Sendex

Topics

Topics are named content categories within an audience (e.g. "Weekly Newsletter", "Product Updates"). Contacts can be subscribed or unsubscribed per-topic. Each contact gets a unique unsubscribe URL for self-service preference management.

GET/api/v1/audiences/:id/topicsfull access

List topics

Returns all topics for an audience, including subscriber counts.

Response

dataTopic[]

Array of topic objects.

totalnumber

Total number of topics.

data[].idstring

Topic ID.

data[].namestring

Topic name.

data[].descriptionstring

Optional description.

data[].default_subscribed"auto" | "opt-in"

Whether new contacts are auto-subscribed.

data[].subscriber_countnumber

Number of subscribed contacts.

data[].created_atstring

ISO timestamp.

Request (curl)

curl "https://sendexapi.com/api/v1/audiences/66f1a2b3c4d5e6f7a8b9c0e1/topics" \
  -H "Authorization: Bearer sk_live_XXXX"

Response

{
  "data": [
    {
      "id": "66f1a2b3c4d5e6f7a8b9c0a1",
      "name": "Weekly Newsletter",
      "description": "Our weekly digest",
      "default_subscribed": "auto",
      "subscriber_count": 142,
      "created_at": "2025-01-10T00:00:00.000Z"
    }
  ],
  "total": 1
}
GET/api/v1/audiences/:id/contacts/:contactId/topicsfull access

Get contact topic subscriptions

Returns all topics for an audience with the contact's subscription status for each.

Response

dataContactTopic[]

Array of topic subscription objects.

data[].topic_idstring

Topic ID.

data[].namestring

Topic name.

data[].subscribedboolean

Whether the contact is subscribed to this topic.

Request (curl)

curl "https://sendexapi.com/api/v1/audiences/66f1a2b3c4d5e6f7a8b9c0e1/contacts/66f1a2b3c4d5e6f7a8b9c0f1/topics" \
  -H "Authorization: Bearer sk_live_XXXX"

Response

{
  "data": [
    {
      "topic_id": "66f1a2b3c4d5e6f7a8b9c0a1",
      "name": "Weekly Newsletter",
      "subscribed": true
    },
    {
      "topic_id": "66f1a2b3c4d5e6f7a8b9c0a2",
      "name": "Product Updates",
      "subscribed": false
    }
  ]
}
PATCH/api/v1/audiences/:id/contacts/:contactId/topicsfull access

Update contact topic subscription

Subscribe or unsubscribe a contact from a specific topic.

Request Body

topic_idstringrequired

ID of the topic to update.

subscribedbooleanrequired

true to subscribe, false to unsubscribe.

Response

topic_idstring

Topic ID.

subscribedboolean

Updated subscription status.

Request (curl)

curl -X PATCH "https://sendexapi.com/api/v1/audiences/66f1a2b3c4d5e6f7a8b9c0e1/contacts/66f1a2b3c4d5e6f7a8b9c0f1/topics" \
  -H "Authorization: Bearer sk_live_XXXX" \
  -H "Content-Type: application/json" \
  -d '{"topic_id":"66f1a2b3c4d5e6f7a8b9c0a1","subscribed":false}'

Response

{
  "topic_id": "66f1a2b3c4d5e6f7a8b9c0a1",
  "subscribed": false
}