MisarMisar Docs
MisarMailMisar.BlogMisarReachMisarPostMisar.DevMisarSEOMisar PlatformMisar SSO
API Reference

Channels API

Check channel connection status and connect WhatsApp Business / Twilio SMS credentials — api.misar.io/reach/api/channels.

Reach sends across email (delegated to MisarMail — connect a mailbox at mail.misar.io/email-accounts), WhatsApp Business Cloud API, and SMS (Twilio, bring-your-own-account). This page covers checking connection status and connecting WhatsApp/SMS credentials from the Channels page in the app.

Base URL: https://api.misar.io/reach

Get channel status

GET/api/channels/status

Returns enabled/verified state and lightweight send stats for each channel. email.verified reflects whether a MisarMail mailbox is connected — this is the authoritative "is email connected" signal (email.enabled is always true and does not mean connected).

Response fields

data.email.verifiedboolean

true once the user has at least one connected MisarMail mailbox.

data.whatsapp.verifiedboolean

true once WhatsApp Business Cloud API credentials are saved (see Connect WhatsApp).

data.sms.verifiedboolean

true once a Twilio account is connected (see Connect SMS) — sourced from twilio_configs, not a generic channel config row.

curl "https://api.misar.io/reach/api/channels/status" \
  -H "Authorization: Bearer msr_your_key_here"
{
  "success": true,
  "data": {
    "email": { "enabled": true, "verified": true, "connected_email": "you@company.com", "accounts": 1, "stats": { "sent": 120, "delivered": 0, "failed": 0, "delivery_rate": 0 } },
    "whatsapp": { "enabled": true, "verified": false, "stats": { "sent": 0, "delivered": 0, "failed": 0, "delivery_rate": 0 } },
    "sms": { "enabled": false, "verified": false, "number": null, "provider": "Twilio", "stats": { "sent": 0, "delivered": 0, "failed": 0, "delivery_rate": 0 } }
  }
}

Toggle a channel

PATCH/api/channels/status

Enables or disables a channel without touching its saved credentials.

Body parameters

channelstringrequired

One of "whatsapp" | "sms" | "push".

enabledbooleanrequired
curl -X PATCH "https://api.misar.io/reach/api/channels/status" \
  -H "Authorization: Bearer msr_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{ "channel": "whatsapp", "enabled": true }'

Connect WhatsApp

POST/api/channels/whatsapp/connect

Saves WhatsApp Business Cloud API (Meta Graph API) credentials for the authenticated user and enables the channel. The access token is encrypted at rest (AES-256-GCM).

Body parameters

phone_number_idstringrequired

Meta WhatsApp phone number ID.

business_idstringrequired

Meta WhatsApp Business Account ID.

access_tokenstringrequired

Permanent or long-lived system-user access token.

display_namestring

Optional label shown on the Channels page.

curl -X POST "https://api.misar.io/reach/api/channels/whatsapp/connect" \
  -H "Authorization: Bearer msr_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{ "phone_number_id": "109876543210123", "business_id": "987654321098765", "access_token": "EAAG..." }'
{ "success": true }

Connect SMS (Twilio)

POST/api/channels/sms/connect

Saves bring-your-own-Twilio (BYOT) credentials and enables the SMS channel. The auth token is encrypted at rest. This writes to twilio_configs — the table the send pipeline actually reads at dispatch time — and enables the corresponding channel_configs row so the toggle on the Channels page reflects it.

Body parameters

account_sidstringrequired

Twilio Account SID.

auth_tokenstringrequired

Twilio Auth Token.

phone_numberstringrequired

E.164 SMS sending number, e.g. +14155551234.

whatsapp_numberstring

Optional E.164 Twilio WhatsApp-enabled number.

curl -X POST "https://api.misar.io/reach/api/channels/sms/connect" \
  -H "Authorization: Bearer msr_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{ "account_sid": "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "auth_token": "...", "phone_number": "+14155551234" }'
{ "success": true }