smartchat

Get opt-in status

Returns how many contacts are confirmed, pending, never asked or unsubscribed. Counts only, no personal data. Read-only.

GET /v1/optin-status

Permissioncontacts:read (all permissions)
RiskRead
Idempotency-KeyNot needed (how it works)
Safe to repeatSafe: the call only reads.
Rate limit classread (120 requests per minute per key)
ConfirmationNone
MCP toolNot available in MCP
Since version2026-10-25

#What it does

  • Only reads data. It changes nothing and sends nothing.

#Examples

curl "https://api.smartchat.marketing/v1/optin-status" \
  -H "Authorization: Bearer $SMARTCHAT_API_KEY"
import os
import requests

response = requests.get(
    "https://api.smartchat.marketing/v1/optin-status",
    headers={"Authorization": "Bearer " + os.environ["SMARTCHAT_API_KEY"]},
)
response.raise_for_status()
print(response.json())
const response = await fetch("https://api.smartchat.marketing/v1/optin-status", {
  method: "GET",
  headers: {
    Authorization: `Bearer ${process.env.SMARTCHAT_API_KEY}`,
  },
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.json());

Response (200):

{
  "object": "optin_status",
  "total": 340,
  "confirmed": 250,
  "pending": 10,
  "none": 70,
  "opted_out": 10,
  "confirmation_messages_waiting": 0
}

#Response

Status 200. Every response has the headers Request-Id, SmartChat-Version and X-RateLimit-*.

NameTypeDescription
objectstringAlways "optin_status". always optin_status
totalintegerAll contacts. 0 to 1000000000
confirmedintegerContacts with a confirmed WhatsApp opt-in. 0 to 1000000000
pendingintegerContacts who were asked to confirm and have not answered. 0 to 1000000000
noneintegerContacts who were never asked to confirm. 0 to 1000000000
opted_outintegerContacts who unsubscribed. 0 to 1000000000
confirmation_messages_waitingintegerConfirmation messages that wait until sending is possible again. 0 to 1000000000

#Errors

CodeStatusWhen
api_key_expired401This API key has expired.
api_key_invalid401This API key is not valid.
api_key_revoked401This API key was revoked.
authentication_required401No API key was sent. Send 'Authorization: Bearer <key>'.
account_blocked403This account is blocked.
insufficient_scope403This key lacks a required permission.
ip_not_allowed403This IP address is not allowed for this key.
rate_limited429Too many requests. Wait and try again.
internal_error500Something went wrong on our side.
service_unavailable503The service is temporarily unavailable.

All errors use one format.