Skip to Content

Check topic subscriptions

Name exactly one contactId, email, or phone and a channel.

GET
/v1/topics/check

Name exactly one contactId, email, or phone and a channel. Returns effective status, using the topic default when no explicit subscription exists. topicIds is an optional comma-separated list. Addresses resolve within the requested namespace; an unknown address returns contactId null and the effective defaults.

Authorization

apiKey
headerx-api-key<token>

Query Parameters

contactId?string
Match^contact_[0-9a-hjkmnp-tv-z]{16,24}$
email?string
phone?string
namespaceId?string
Match^ns_[0-9a-hjkmnp-tv-z]{16,24}$
channel*string
Value in"sms""whatsapp""email"
topicIds?string

Response Body

TopicSubscriptionCheck

application/json
  1. response
contactId*|null
channel*string
Value in"sms""whatsapp""email"
topics*array<>
Example Request
import { createClient } from "samva";

const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });

const result = await samva.topics.checkSubscription({
  "channel": "sms"
});
Example Response
{
  "contactId": "string",
  "channel": "sms",
  "topics": [
    {
      "topicId": "string",
      "topicName": "string",
      "status": "subscribed"
    }
  ]
}

Related documentation