MisarMisar Docs
MisarMailMisarBlogMisarReachMisarPostMisarDevMisarCoderMisarSEOMisar 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. LinkedIn is also supported as an off-by-default automation channel.

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.

Request
curl "https://api.misar.io/reach/api/channels/status" \
  -H "Authorization: Bearer mrk_your_key_here"
200 — OK
{
  "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
Request
curl -X PATCH "https://api.misar.io/reach/api/channels/status" \
  -H "Authorization: Bearer mrk_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.

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

LinkedIn outreach

LinkedIn is a supported outreach channel, but it is off by default and there is no public REST endpoint that sends a LinkedIn DM directly — messages are dispatched only through a campaign step whose channel is linkedin, and only after an operator has explicitly enabled automation.

LinkedIn automation violates the LinkedIn User Agreement §8.2 and can get the underlying account permanently restricted. The channel is disabled unless an operator sets LINKEDIN_AUTOMATION_ENABLED=true and accepts that risk. When the flag is absent, queued LinkedIn sends stay queued — they are never claimed, so nothing is lost — and the worker no-ops. Flipping the flag on later dispatches the backlog cleanly.

  • Consent-gated. LinkedIn is a CONSENT channel (see Consent & Opt-in). Every send is gated on a proof-of-consent record keyed by the prospect's profile URL — the same address the worker sends to. Without a recorded consent the send is blocked (skipped), fail-closed.
  • Session security. Automation runs against a stored LinkedIn session; session cookies are encrypted at rest (AES-256-GCM). The worker enforces per-account daily send limits and human-like pacing.

How a campaign dispatches a LinkedIn DM

Queue a LinkedIn step

A campaign step with channel: "linkedin" produces a queued reach_campaign_sends row whose metadata carries the lead's LinkedIn profile URL.

Dispatch tick claims it

POST /api/campaigns/run (the cron dispatcher) claims due sends. LinkedIn is added to the claimable set only when LINKEDIN_AUTOMATION_ENABLED=true; otherwise the row is left queued.

The shared channel-policy gate asserts a consent record for the profile URL. No record → the row is marked skipped with a reason, and nothing is sent.

Hand off to the worker

The runner inserts a linkedin_outreach_queue row and enqueues a BullMQ job on the linkedin-outreach queue (jobId = the queue-row id, so a re-enqueue is de-duplicated). A successful hand-off marks the send sent.

Worker sends the DM

The standalone Playwright worker (run separately: pnpm worker:linkedin:start) consumes the job and sends the DM asynchronously — rate-limited, minutes later — and owns the terminal outcome in linkedin_outreach_queue.

Email is the only channel dispatched from the cron runner with no extra setup. SMS, WhatsApp, the reply-window social channels, and LinkedIn each carry their own consent/automation gate before a queued step is sent.

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.

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