Create a topic
Create a kind of email your contacts can choose to get, like "Product updates".
https://app.usenotix.dev/api/v1/topicsNeeds a full access key. Sending access keys cannot call this. Key permissions lists the extra rules some calls have.
Create a kind of email your contacts can choose to get, like "Product updates". Target it from a campaign with topicId, and your contacts can switch it on or off on the page their unsubscribe link opens.
{
"name": "Product updates",
"description": "New features, about once a month.",
"defaultSubscription": "OPT_IN",
"visibility": "PUBLIC"
}
A team can have up to 50 topics; names are unique in the team.
Who gets a topic
A contact gets a topic when they chose it, or, when they never chose, by the topic's defaultSubscription:
defaultSubscription | A contact who never chose |
|---|---|
OPT_IN | gets it, until they opt out |
OPT_OUT | does not get it, until they opt in |
The default is fixed once the topic exists: changing it would change what everyone who never chose receives. A contact who unsubscribed from everything gets no campaign, whatever their topics say.
A choice is the person's, not one contact row's: it applies to every contact of the team with the same address. A choice the contact made on their preference page is kept as theirs, and no key or team member can turn that topic back on for them.
Needs a full access key. Topics carry no domain, so a key limited to one domain may use them too. Read only, send-only and live AI keys answer 403 SCOPE_DENIED.
Body parameters
At most 100 characters.
At most 500 characters. Can be null.
Default OPT_IN. Fixed once the topic exists.
One of OPT_IN, OPT_OUT.
Default PUBLIC.
One of PUBLIC, PRIVATE.
Headers
Bearer followed by your API key.
Errors
The body is not valid.
The team already has 50 topics, or the key may not write.
A topic with this name already exists, or a deleted topic had it with a different default.
Every error has the same shape. See all error codes.
curl -X POST "https://app.usenotix.dev/api/v1/topics" \
-H "Authorization: Bearer $NOTIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Product updates"
}'
{
"id": "cm1x8f3k20001qz7v5b9d2e4a",
"name": "Acme",
"description": "string",
"defaultSubscription": "OPT_IN",
"visibility": "PUBLIC",
"optedIn": 1,
"optedOut": 1,
"createdAt": "string",
"updatedAt": "string"
}