Skip to Content
SendlySendly
API ReferenceTopics

Update a topic

PATCH
/api/v1/topics/{id}

Rename it, re-describe it, flip default_opt_in, or archive it.

key is absent from the body on purpose. Every stored preference and every integration refers to a topic by its key, so changing one would orphan them silently. There is no DELETE for the same reason — archived: true removes the topic from the preference centre and from new sends while every opt-out recorded against it survives.

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.

id*string

Resource id.

Formatuuid
application/json
  1. body

key is deliberately absent. It is the name every stored preference and every integration refers to, so changing it would silently orphan them.

name?string
Length1 <= length <= 200
description?|
Lengthlength <= 1000
default_opt_in?boolean
archived?boolean

Response Body

The updated 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 PATCH 'https://api.sendly.now/api/v1/topics/497f6eca-6276-4993-bfeb-53cbbbba6f08' \  -H 'Content-Type: application/json' \  -d '{}'
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"}