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 organization | This endpoint |
|---|---|
OWNER | Allowed |
ADMIN | Allowed |
MEMBER | Refused — 403 |
Path parameters
| Parameter | Type | Description |
|---|---|---|
contactId | string | Required. Identifier of the contact |
topicId | string | Required. 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 issubscribed, including when no refusal existed.400 Bad Request— a path identifier is not a valid UUID;detailsidentifies the field.401 Unauthorized— missing or invalid key, or its owner left the organization.403 Forbidden— the key's owner is amember, not anadmin.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
| Field | Type | Description |
|---|---|---|
success | boolean | Indicates if the operation was successful |
data.contactId | string | Identifier of the contact |
data.topicId | string | Identifier of the topic |
data.status | string | Always 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.