Create a topic

Create a kind of email your contacts can choose to get, like "Product updates".

POSThttps://app.usenotix.dev/api/v1/topics

Needs 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.

json
{
  "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:

defaultSubscriptionA contact who never chose
OPT_INgets it, until they opt out
OPT_OUTdoes 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

namestringrequired

At most 100 characters.

descriptionstring

At most 500 characters. Can be null.

defaultSubscriptionstring

Default OPT_IN. Fixed once the topic exists.

One of OPT_IN, OPT_OUT.

visibilitystring

Default PUBLIC.

One of PUBLIC, PRIVATE.

Headers

Authorizationstringrequired

Bearer followed by your API key.

Errors

400

The body is not valid.

403

The team already has 50 topics, or the key may not write.

409

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"
}'
Response201
{
  "id": "cm1x8f3k20001qz7v5b9d2e4a",
  "name": "Acme",
  "description": "string",
  "defaultSubscription": "OPT_IN",
  "visibility": "PUBLIC",
  "optedIn": 1,
  "optedOut": 1,
  "createdAt": "string",
  "updatedAt": "string"
}
Open in ClaudeOpen in ChatGPT