Set a contact's topic preference

Set a contact's topic preference

POST/api/v1/contacts/{id}/topics

POST /contacts/{id}/topics
curl -X POST 'https://www.unitpost.com/api/v1/contacts/con_123/topics' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0' \
  -H 'Content-Type: application/json' \
  -d '{
    "topic_id": "top_123",
    "subscribed": false
  }'
Response · 201
{
  "object": "contact_topic",
  "topic_id": "topic_123",
  "subscribed": false,
  "status": "subscribed",
  "source": "user"
}

Subscribe or unsubscribe a contact for one topic. This records an explicit preference that overrides the topic's default_opt_in, and it's idempotent — setting the same preference twice succeeds. PUT behaves identically. Read the contact's current state with List a contact's topic subscriptions. Requires the topics:write capability.

Parameters1 field
FieldTypeDescription
idrequiredstring · path—
Request body3 fields
FieldTypeDescription
topic_idstring—
topicstring—
subscribedrequiredboolean—
Response · 201 fields5 fields
FieldTypeDescription
objectrequiredstring—
topic_idrequiredstring—
subscribedrequiredboolean—
statusrequiredenumsubscribed | unsubscribed—
sourcerequiredenumuser | manual | import | api—
201401404422

Search docs and guides

Search the docs and product guides.