Topics
Define subscription choices, choose a fixed default and decide which topics appear in the preference center.
A topic records what kind of mail a contact wants. A broadcast can name a topic_id;
only contacts effectively opted in to that topic are eligible. Global unsubscribes and
suppressions still take precedence.
Create a topic
Use POST /topics with a name and a default subscription:
{
"name":"Product news",
"description":"Changes to the product",
"default_subscription":"opt_out",
"visibility":"public"
}default_subscription is opt_in or opt_out. A contact's explicit choice wins;
without one, the topic's default applies. With opt_out, only contacts who opt in receive
a broadcast for the topic. A default is a sending setting, not proof of consent.
The default cannot be changed after creation. PATCH /topics/{id} can change the name,
description and visibility. It can also configure double opt-in.
Public and private topics
visibility: "public" lists the topic in the contact's
preference center. private, the default, hides it from that page;
you manage its choices through the API or dashboard. Both appear in the API.
GET /topics lists topics and GET /topics/{id} reads one. Reading definitions needs
read; changes need audience. API keys need full access.
Record a contact's choices
PATCH /contacts/{id_or_email}/topics takes a JSON list, not an object around the list:
[{"id":"<topic_id>","subscription":"opt_in"}]GET /contacts/{id_or_email}/topics returns each topic with its effective subscription.
Reading or changing these choices needs audience, because they are a person's data.
A new choice appends a consent event and emits contact.updated.
Deleting a topic removes its choices but keeps the contact's consent events until that contact is deleted or erased. Deletion is refused while a dynamic rule or a scheduled or sending broadcast uses the topic.