Skip to Content
SendlySendly
API ReferenceTopics

Create a topic

POST
/api/v1/topics

key is the stable, project-unique name every preference form and integration refers to, so it survives a rename of name and cannot be edited afterwards.

default_opt_in is the field worth thinking about: it decides what SILENCE means for every contact who never answers. Leave it true for a topic introduced over a list you already have — those contacts consented to hear from you, and inventing an opt-out they never asked for would mute mail they expect. Set it false for anything a person has to ask for, and absence then means not asked rather than no.

Requires the topics:write scope — Create and edit topics, and change what your contacts are subscribed to — this decides who your campaigns reach.

headerAuthorizationBearer <API Key>

API key authentication. Use a sk_* (FULL) or pk_* (SENDING_ONLY) key as the bearer token. Public keys (pk_*) are restricted to the email-send endpoints and the self-serve list subscribe/unsubscribe pair; every other endpoint — event tracking included — answers 403 for them. In scope terms (used by /api/v1/* operations): FULL keys hold every scope; SENDING_ONLY keys hold only emails:send.

application/json
  1. body
key*string

Stable, URL-safe, unique within the project. This is what a preference form and an API caller name the topic by, so it must survive a rename of name — which is the whole reason it exists beside one.

Match^[a-z0-9][a-z0-9_-]*$
Length1 <= length <= 64
name*string
Length1 <= length <= 200
description?|
Lengthlength <= 1000
default_opt_in?boolean

Response Body

The created topic

application/json
  1. response

One subject this project mails about.

id*string
key*string

Stable, URL-safe, unique within the project. This is what a preference form and an API caller name the topic by, so it must survive a rename of name — which is the whole reason it exists beside one.

Match^[a-z0-9][a-z0-9_-]*$
Length1 <= length <= 64
name*string
description*string|null
default_opt_in*boolean

What a contact with NO answer counts as. True is the honest default for a topic added after a list already exists: those contacts consented to hear from you, and inventing an opt-out they never asked for would silence mail they expect. False means the topic must be opted INTO, and absence means not asked rather than no.

archived*boolean

Hidden from the preference centre and from new sends, WITHOUT discarding the opt-outs recorded against it. There is no delete for the same reason: deleting a topic would delete the choices people made about it.

subscribed_count*integer

Contacts who explicitly said yes. Excludes those covered only by default_opt_in.

unsubscribed_count*integer
created_at*string
Formatdate-time
Example Request
curl -X POST 'https://api.sendly.now/api/v1/topics' \  -H 'Content-Type: application/json' \  -d '{  "key": "string",  "name": "string"}'
Example Response
{  "id": "string",  "key": "string",  "name": "string",  "description": "string",  "default_opt_in": true,  "archived": true,  "subscribed_count": 0,  "unsubscribed_count": 0,  "created_at": "2019-08-24T14:15:22Z"}