Make a topic the default
Makes this the default category of messages in its namespace. Existing explicit subscription statuses remain unchanged.
POST
Makes this the default category of messages in its namespace. Existing explicit subscription statuses remain unchanged.
apiKeyheader
x-api-key<token>id*stringMatch
^tpc_[0-9a-hjkmnp-tv-z]{16,24}$Topic
application/json- response
id*TopicIdMatch
^tpc_[0-9a-hjkmnp-tv-z]{16,24}$namespaceId*|nullname*stringdescription*string|nulldefault*stringValue in
"opt_out""opt_in"isDefault*booleandefaultSenderId*|nullreplyMailboxId*|nulltemplateId*|nullsubscriptions*createdAt*stringupdatedAt*stringimport { createClient } from "samva";
const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });
const result = await samva.topics.setDefault({
"id": "example"
});Example Response
{
"id": "string",
"namespaceId": "string",
"name": "string",
"description": "string",
"default": "opt_out",
"isDefault": true,
"defaultSenderId": "string",
"replyMailboxId": "string",
"templateId": "string",
"subscriptions": {
"sms": {
"subscribed": 0,
"unsubscribed": 0
},
"whatsapp": {
"subscribed": 0,
"unsubscribed": 0
},
"email": {
"subscribed": 0,
"unsubscribed": 0
}
},
"createdAt": "string",
"updatedAt": "string"
}