Topics API

A topic is a kind of email you send: a newsletter, product updates, a giveaway. A segment says who a broadcast is for; a topic says which of them asked for it. Label a broadcast with a topic and only the contacts subscribed to it get the broadcast. Its unsubscribe link removes that topic only, and opens a page where the contact chooses the rest, so someone who is tired of one kind of email does not have to leave your list. Topics work like Resend's, with the same fields.

Scope

#

Reading needs contact:read. Creating, changing and deleting topics, and changing a contact's topics, need contact:write. Topics belong to a team.

Who is subscribed

#

Each topic has a default_subscription: the subscription of a contact that never chose.

  • opt_in: every contact gets the topic's broadcasts unless they opt out. Use it for email most of your list expects, such as product updates.
  • opt_out: nobody gets them unless they opt in, for example through a signup form with this topic. Use it for a giveaway, a beta list or an event.

The default is fixed when the topic is created. A contact's own choice always wins over the default, and a contact who unsubscribed from everything, or a suppressed address, gets no topic broadcast whatever their topics say. Transactional email ignores topics. A broadcast without a topic goes to every subscribed contact in its audience, as before.

Creating an opt_out topic with subscribe_existing_contacts: true (not in Resend) opts in every contact who is subscribed and not suppressed at that moment. That is how you move an existing newsletter list onto a topic, so that people who later join only a giveaway do not get the newsletter. The dashboard ticks it for a team's first topic and shows how many contacts it would add.

The unsubscribe link and the preference page

#

In a broadcast with a topic, {{unsubscribe_url}} and the one-click List-Unsubscribe header remove that topic only. The link opens a page hosted by SMTPfast with the contact's topics as checkboxes and an "Unsubscribe from all" button, which works like the unsubscribe link of a broadcast without a topic. The page lists public topics, and private ones the contact is opted in to. It needs no login: the link is signed for one contact in your team and shows nothing about anyone else.

A topic unsubscribe fires email.unsubscribed with a topic_id field, so your own systems can tell it apart from an unsubscribe from everything. The post-unsubscribe redirect in your settings is not used for topic links, since the page is where the other topics are chosen.

Signup forms

#

A form with a topic_id subscribes each signup to that topic. Existing contacts can sign up too: they join the topic and nothing else about them changes. Every address gets the same answer, so the form never shows who is already on your list. With double opt-in, confirming subscribes that topic only. A contact who unsubscribed from everything stays unsubscribed. consent_text is shown under the form and stored with each opt-in, with the form and the time.

GET/v1/topics

List the team's topics, oldest first.

Response

json
{
  "object": "list",
  "has_more": false,
  "data": [
    {
      "id": "clx_topic123",
      "name": "Product updates",
      "description": "New features, about once a month",
      "default_subscription": "opt_in",
      "visibility": "public",
      "created_at": "2026-11-24T09:00:00.000Z",
      "updated_at": "2026-11-24T09:00:00.000Z"
    }
  ],
  "total": 1,
  "topic_limit": 50,
  "subscribed_contacts": 1200
}
POST/v1/topics

Create a topic.

Parameters

ParameterTypeDescription
namerequiredstringUp to 50 characters. Contacts see it on the preference page.
default_subscriptionrequiredstringopt_in or opt_out. Cannot be changed later.
descriptionstringUp to 200 characters.
visibilitystringpublic or private (the default).
subscribe_existing_contactsbooleanopt_out topics only: opt in every contact who is subscribed now. Not in Resend.

Response

json
{
  "object": "topic",
  "id": "clx_topic123",
  "name": "Product updates",
  "description": "New features, about once a month",
  "default_subscription": "opt_in",
  "visibility": "public",
  "created_at": "2026-11-24T09:00:00.000Z",
  "updated_at": "2026-11-24T09:00:00.000Z"
}
GET/v1/topics/{id}

Retrieve one topic.

Response

json
{
  "object": "topic",
  "id": "clx_topic123",
  "name": "Product updates",
  "description": "New features, about once a month",
  "default_subscription": "opt_in",
  "visibility": "public",
  "created_at": "2026-11-24T09:00:00.000Z",
  "updated_at": "2026-11-24T09:00:00.000Z"
}
PATCH/v1/topics/{id}

Change the name, description or visibility. The default subscription cannot be changed.

DELETE/v1/topics/{id}

Delete a topic and every contact's choice about it. Returns 409 while a form signs people up to it or a broadcast that has not been sent belongs to it.

GET/v1/contacts/{id}/topics

Every topic of the team with this contact's subscription. source and updated_at are null when the contact never chose and the default applies. The contact can be named by id or email address.

Response

json
{
  "object": "list",
  "has_more": false,
  "data": [
    {
      "id": "clx_topic123",
      "name": "Product updates",
      "description": "New features, about once a month",
      "subscription": "opt_out",
      "default_subscription": "opt_in",
      "visibility": "public",
      "source": "unsubscribe_link",
      "updated_at": "2026-11-25T14:02:11.000Z"
    }
  ],
  "total": 1
}
PATCH/v1/contacts/{id}/topics

Opt the contact in to or out of topics: { "topics": [{ "id", "subscription" }] }, or the bare array. Topics not named keep what they had.

Examples

#
# a topic everyone gets unless they opt out
curl -X POST https://smtpfa.st/api/v1/topics \
  -H "Authorization: Bearer $SMTPFAST_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Product updates", "default_subscription": "opt_in", "visibility": "public" }'

# a topic nobody gets unless they sign up for it
curl -X POST https://smtpfa.st/api/v1/topics \
  -H "Authorization: Bearer $SMTPFAST_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Giveaway", "default_subscription": "opt_out" }'

# a form that signs people up to it
curl -X PATCH https://smtpfa.st/api/v1/forms/clx_form123 \
  -H "Authorization: Bearer $SMTPFAST_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "topic_id": "clx_topic456", "consent_text": "Email me about the giveaway." }'

# a broadcast that goes only to the topic's subscribers
curl -X POST https://smtpfa.st/api/v1/broadcasts \
  -H "Authorization: Bearer $SMTPFAST_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Winners", "topic_id": "clx_topic456", "from": "[email protected]",
        "subject": "The winners", "markdown": "Hi! ... [Unsubscribe]({{unsubscribe_url}})" }'

# one contact's choices
curl -X PATCH https://smtpfa.st/api/v1/contacts/[email protected]/topics \
  -H "Authorization: Bearer $SMTPFAST_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "topics": [{ "id": "clx_topic123", "subscription": "opt_out" }] }'

Differences from Resend

#
  • GET /v1/contacts?topic_id= lists a topic's subscribers; Resend has no such filter.
  • subscribe_existing_contacts on create is ours.
  • Each contact's choice records where it was made, and for a form the form and its consent text.
  • topic_id on single emails (POST /v1/emails) is not supported yet; use it on broadcasts and forms.
  • The preference page uses SMTPfast's own design; per-team branding is not available yet.
  • A contact's topic choices are deleted with the contact. An unsubscribe from everything is kept as a suppression and still applies if the address is added again.