Resubscribe a contact

POST /api/v1/contacts/{contactId}/resubscribe Resubscribes the contact — an explicit act, never a side effect of an import or an upsert. Idempotent as well. A contact in bounced state is refused with 400: a hard bounce is final and cannot be undone through the API.

Authorization

Role in the organizationThis endpoint
OWNERAllowed
ADMINAllowed
MEMBERRefused — 403
A key carries the role its creator holds in this organization — never a role on AgentsMail itself. See API keys.

Path parameters

ParameterTypeDescription
contactIdstringRequired. The contact to put back

Example

bash
curl -X POST -H "x-api-key: $AGENTMAIL_API_KEY" \
  "https://www.agentsmail.io/api/v1/contacts/$CONTACT_ID/resubscribe"

Response

  • 200 OK — the call succeeded.
  • 401 Unauthorized — missing or invalid key, or its owner left the organization.
  • 403 Forbidden — the key's owner is a member of the organization, not an admin.
  • 404 Not Found — no such resource, or it belongs to another organization. The API never confirms that an id exists to a caller who has no right to it.
  • 429 Too Many Requests — over 120 requests in a minute for this key.

Response fields

The contact, now subscribed. A bounced address is refused: a hard bounce is final.
FieldTypeDescription
successbooleanIndicates if the operation was successful
data.idstringIdentifier of the contact
data.emailstringIts address — unique inside its list
data.firstName / lastNamestring \null
data.statusstringpending, subscribed, unsubscribed, bounced, complained
data.listIdstringThe list it belongs to — a contact belongs to exactly one
data.listobject{id, name} of that list
data.tagsarray{id, name} of every tag carried
data.createdAt / updatedAtstringISO dates

Example response

json
{
  "success": true,
  "data": {
    "id": "4d19c0a2",
    "email": "ada@example.com",
    "firstName` / `lastName": "value",
    "status": "subscribed",
    "listId": "0b7c51e8",
    "list": {
      "id": "0b7c51e8",
      "name": "Newsletter"
    },
    "tags": [
      {
        "id": "7c2ef4b1",
        "name": "vip"
      }
    ],
    "createdAt` / `updatedAt": "value"
  }
}