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
| Field | Type | Description |
|---|---|---|
idrequired | string · path | — |
Request body3 fields
| Field | Type | Description |
|---|---|---|
topic_id | string | — |
topic | string | — |
subscribedrequired | boolean | — |
Response · 201 fields5 fields
| Field | Type | Description |
|---|---|---|
objectrequired | string | — |
topic_idrequired | string | — |
subscribedrequired | boolean | — |
statusrequired | enumsubscribed | unsubscribed | — |
sourcerequired | enumuser | manual | import | api | — |
201401404422