Resubscribe a contact to a topic

POST /api/v1/contacts/{contactId}/topics/{topicId}/resubscribe Re-enables messages assigned to one topic for a contact. It does not globally resubscribe an unsubscribed contact, and it leaves every other topic unchanged.

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. Identifier of the contact
topicIdstringRequired. Identifier of the topic to re-enable

Example

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

Response

  • 200 OK — the topic preference is subscribed, including when no refusal existed.
  • 400 Bad Request — a path identifier is not a valid UUID; details identifies the field.
  • 401 Unauthorized — missing or invalid key, or its owner left the organization.
  • 403 Forbidden — the key's owner is a member, not an admin.
  • 404 Not Found — the contact or topic is missing, belongs to another organization, or the two resources do not belong to the same organization.
  • 429 Too Many Requests — over 120 requests in a minute for this key.

Response fields

FieldTypeDescription
successbooleanIndicates if the operation was successful
data.contactIdstringIdentifier of the contact
data.topicIdstringIdentifier of the topic
data.statusstringAlways subscribed

Example response

json
{
  "success": true,
  "data": {
    "contactId": "4d19c0a2-8f20-4fb8-9d55-39a88f86d778",
    "topicId": "a338c425-3115-4890-a01c-f2f6f012db93",
    "status": "subscribed"
  }
}

Notes

  • The call is idempotent. If the contact never opted out of the topic, no preference row needs to be created.
  • A previous opt-out remains in the preference history; re-enabling the topic records the return instead of deleting that history.
  • This call never changes the contact's global subscription status.