Create a topic
Creates an announcement topic. Assign it to announcements so contacts can unsubscribe from that category without leaving your whole list.
POST
/v2/ accounts/ {accountId}/ topicsPath parameters
accountIdstringrequired
The account the request is scoped to.
Request body
Request body for creating an announcement topic.
namestringrequired
Topic name; contacts see it on the unsubscribe page when choosing what to keep receiving.
descriptionstringoptional
Optional explanation of what this category of email covers.
Response
The created topic.
Errors
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 --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 '{
"name": "Example name",
"description": "Product news and announcements"
}'
const res = await fetch('https://api.sendstreak.com/v2/accounts/YOUR_ACCOUNT_ID/topics', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SENDSTREAK_TOKEN}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
"name": "Example name",
"description": "Product news and announcements"
})
});
import os, requests
res = requests.post(
'https://api.sendstreak.com/v2/accounts/YOUR_ACCOUNT_ID/topics',
headers={'Authorization': f"Bearer {os.environ['SENDSTREAK_TOKEN']}"},
json={
"name": "Example name",
"description": "Product news and announcements"
},
)
{
"_id": "665f0a2b1c9d440012ab34cd",
"name": "Example name",
"description": "Product news and announcements"
}