menu
Create a topic
Creates an announcement topic. Assign it to announcements so contacts can unsubscribe from that category without leaving your whole list.
Endpoint
POST https://api.sendstreak.com/v2/accounts/{accountId}/topics
All v2 endpoints require a bearer token - see Authentication.
Path parameters
| Parameter | Type | Description |
|---|---|---|
accountId | string | The account the request is scoped to. |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
_id | string | no | |
name | string | yes | Topic name; contacts see it on the unsubscribe page when choosing what to keep receiving. |
description | string | no | Optional explanation of what this category of email covers. |
Response
The created topic.
{
"_id": "665f0a2b1c9d440012ab34cd",
"name": "Example name",
"description": "Product news and announcements"
}
Errors
| Status | Description |
|---|---|
400 | The request body or parameters failed validation. |
401 | Missing or invalid token, or the token is not authorized for this account/user. |
See Errors and rate limits for what error responses look like.
Curl example
curl --location --request POST 'https://api.sendstreak.com/v2/accounts/YOUR_ACCOUNT_ID/topics' \
--header 'Authorization: Bearer YOUR_API_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
"_id": "665f0a2b1c9d440012ab34cd",
"name": "Example name",
"description": "Product news and announcements"
}'