Update a topic
Updates an announcement topic’s name and description. Existing per-contact unsubscriptions from the topic are preserved.
PATCH
/v2/ accounts/ {accountId}/ topics/ {topicId}Path parameters
accountIdstringrequired
The account the request is scoped to.
topicIdstringrequired
Request body
Request body for updating an announcement topic. Both fields are optional - send only what changes.
namestringoptional
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 updated 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.
404
The requested resource does not exist.
See Errors and rate limits for what error responses look like.
curl --location --request PATCH 'https://api.sendstreak.com/v2/accounts/YOUR_ACCOUNT_ID/topics/YOUR_TOPIC_ID' \
--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/YOUR_TOPIC_ID', {
method: 'PATCH',
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.patch(
'https://api.sendstreak.com/v2/accounts/YOUR_ACCOUNT_ID/topics/YOUR_TOPIC_ID',
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"
}