Skip to content

Integration · Developer tools

Broadchat REST API: send WhatsApp messages from your own code

The two developer APIs in Broadchat today, a Graph-compatible proxy per channel and API campaigns, with tokens, request examples, billing behaviour, errors and limits.

By Broadchat teamPublished 6 min read

How it connects

Through the REST API

REST API · Developer tools · website

You will need

  • A connected WhatsApp channel in Broadchat and the account owner login (only the owner can generate channel tokens and account API keys).
  • Approved message templates for anything you send outside the customer's 24-hour window.
  • Enough balance in the channel's messaging wallet: template sends are charged to it before they go to Meta.
  • A server-side environment to call the API from. Never put a Broadchat token in a mobile app or website front end.

Two APIs, two jobs

Broadchat offers two ways to send WhatsApp messages from your own code, and the WhatsApp REST API for developers you pick depends on what you already have. If you have code written for Meta's Cloud API, or want full control of message types, use the channel endpoint: it accepts Meta's request format and forwards it to Meta with your channel's credentials. If you just need "send this template to this number" from a CRM, ERP or backend job, with reporting in the panel, use an API campaign.

Channel endpointAPI campaign
TokenChannel access token (bc_…)Campaign token (bcc_…)
Request formatMeta Cloud APISimple JSON
Message typesAny Cloud API messageApproved templates
Recipients per callOneOne
Reporting in the panelVia channel statusesCampaign report

Example: send a template through the channel endpoint

curl -X POST "https://<your panel domain>/api/meta/v21.0/<PHONE_NUMBER_ID>/messages" \
  -H "Authorization: Bearer bc_xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "messaging_product": "whatsapp",
    "to": "919876543210",
    "type": "template",
    "template": {
      "name": "order_confirmed",
      "language": { "code": "en" },
      "components": [{
        "type": "body",
        "parameters": [
          { "type": "text", "text": "Priya" },
          { "type": "text", "text": "#48213" },
          { "type": "text", "text": "₹2,349" }
        ]
      }]
    }
  }'

Use the API URL and API Version shown in your API Details window; the version above is only an example. Errors come back in Meta's format, { "error": { "message", "type", "code" } }, so your existing error handling keeps working.

Example: send through an API campaign

curl -X POST "https://<your panel domain>/api/v1/campaigns/<CAMPAIGN_ID>/send" \
  -H "Authorization: Bearer bcc_xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "phone": "919876543210",
    "name": "Priya Sharma",
    "template": "order_confirmed",
    "language": "en",
    "variables": ["Priya", "#48213", "₹2,349"],
    "buttons": ["48213"]
  }'

A successful call returns {"success":true,"data":{"recipientId":"…","status":"SENT","messageId":"…"}}. variables can also be an object such as {"1":"Priya","2":"#48213"}; buttons fills URL button variables in order, and headerMedia takes a public URL for image, video or document headers.

Errors you will meet

Status / codeMeaningWhat to do
401Missing or invalid tokenGenerate a new token; check the Bearer prefix
403, code 10Token used for another number, channel disabled or account unavailableUse the token of the right channel; contact your provider
402, code 131042Channel wallet balance too low for a templateRecharge the channel wallet
400, code 100Body is not JSON or misses to / template.nameFix the request body
Meta 131047Free-form message outside the 24-hour windowSend an approved template instead
Meta 131049Marketing template held back by per-user limitsDo not retry for 24 hours

Security checklist

  • Call the API only from your server. Tokens give full sending rights on the channel.
  • Keep one token per integration and revoke unused ones; opening the Access Token window creates a new token every time.
  • Log Meta's message id from each response, so you can match delivery statuses from your webhooks.
  • Respect opt-in: the API does not check consent for you.

For template wording, start from the WhatsApp template library, for example the OTP templates and account alerts. SaaS companies that want to offer WhatsApp messaging inside their own product can do so under their own brand with the white-label platform.

Set it up

  1. Generate a channel access token

    Open Channels → All Channels, open the ⋮ menu on your channel's card and choose Access Token. The API Details window shows the Access Token (starting bc_), the API URL, API Version, WABA ID and Phone Number ID. Copy the token now: it is shown only once, and each time you open the window a new token is created.

  2. Send a test template

    POST to <API URL>/<API Version>/<Phone Number ID>/messages with the header Authorization: Bearer <token> and a Cloud API message body. The response is Meta's own response, including the message id.

  3. Or create an API campaign

    For one-call sends with reporting, open CRM → Bulk Campaign, click Create New Campaign, choose API Campaign and then Create API Campaign. Pick the channel, name it and choose a token validity. The report page shows the Endpoint, the Campaign Token (shown once) and a Sample Request.

  4. Call the campaign endpoint

    POST one recipient per call to /api/v1/campaigns/<campaignId>/send with Authorization: Bearer <campaign token>. Pass phone, template, language and variables. The contact is created or updated with the API as its source, and the send appears in the campaign report.

  5. Handle errors and retries

    Read the HTTP status and Meta's error code. Retry only on network errors and 5xx responses with a back-off; the API does not retry for you. A 402 with code 131042 means the channel wallet needs a recharge.

  6. Revoke tokens you no longer use

    Open the channel and use Revoke Previously Generated Token in its ⋮ menu to invalidate all channel tokens, or Revoke Token on an API campaign's report page.

What you can do

  • Cloud API-compatible endpoint per channel

    Requests use Meta's Graph paths and bodies for your channel's phone number id and WhatsApp Business account id, so existing Cloud API code works by changing the base URL and token.

  • Billing handled for you

    Template sends through the endpoint are charged to the channel wallet at your plan's rates and refunded automatically if Meta rejects the send.

  • API campaigns with reporting

    Each API campaign has its own token, an endpoint that accepts one recipient per call, and the same delivered, read and replied reporting as a normal campaign.

  • Delivery and reply events

    Pair the API with channel webhooks to receive message statuses and customer replies on your server in Meta's format.

Limitations to know

  • A channel token can only reach its own phone number id and WhatsApp Business account id, with GET, POST and DELETE. Business-level and app-level Graph endpoints are not available.
  • Message sends must be JSON. Media uploads (multipart) are not supported through the endpoint; send images, videos and documents by public HTTPS link instead.
  • The API campaign endpoint sends to one recipient per call and is limited to 120 calls per minute per campaign. All API routes also share a limit of 300 requests per minute per IP address.
  • There is no full public reference for the panel's internal /api routes yet. The account API key in Account Settings → API Details acts as your user, but those routes may change without notice; build on the channel endpoint and API campaigns.
  • Opening the Access Token window always creates a new token (up to 20 stay valid). Store the one you use and revoke the rest.

Sources

  1. Cloud API: send messages — Meta for Developers, checked 12 October 2026
  2. Cloud API error codes — Meta for Developers, checked 12 October 2026
  3. Send message templates — Meta for Developers, checked 12 October 2026

Broadchat team · Product and partner success team

The people who build and support Broadchat, the white-label WhatsApp Business API platform. We write from what we see while onboarding partners and their clients on the official WhatsApp Cloud API, and we check every article against Meta's current documentation.

Last updated:

Frequently asked questions

Is the Broadchat API the same as Meta's Cloud API?

The channel endpoint accepts the same paths and request bodies as Meta's Cloud API for your channel's phone number and WhatsApp Business account, and returns Meta's responses. You authenticate with a Broadchat channel token instead of a Meta system user token.

How are messages sent through the API billed?

Template sends are charged to the channel's messaging wallet before they reach Meta and refunded automatically if Meta rejects them. If the balance is too low, the API returns 402 with code 131042.

Can I send bulk messages with one API call?

No. Both APIs send to one recipient per call. Loop over your recipients from your server within the rate limits, or upload the list to a Bulk Campaign in the panel instead.

Where do I find API documentation?

The API Details window and the API campaign report show the base URL, ids and a sample request. Message bodies follow Meta's Cloud API reference, linked under Sources.

Questions about your WhatsApp setup?

Tell us what you are trying to do and we will point you to the right approach, even if it is not Broadchat.