Skip to main content
POST
Send a WhatsApp message
Send one WhatsApp message to one recipient and record it under an existing broadcast. The request does not start the broadcast or send to its saved contact list. API recipients appear in that broadcast’s recipient history with their delivery status.

End-to-end setup

  1. In Botcadence, connect a WhatsApp number to the project.
  2. Create a WhatsApp broadcast and select its sender. Save the broadcast. It can stay in draft; this API call does not launch it.
  3. For template sends, attach an approved WhatsApp template to the broadcast. The template’s named variables are the keys you pass in data.
  4. Create a project API key with the whatsapp:create scope. Keep the key on your server.
  5. Open the broadcast in the dashboard and copy its ID from the URL. Copy the organization and project IDs into the request below as well.
The broadcast supplies the WhatsApp channel and sender. The API key must belong to the organization and project in the URL.

Authentication

Send the project API key as a Bearer token. See API authentication.
Required scope: whatsapp:create

Path parameters

string
required
Organization that owns the project and API key.
string
required
Project containing the broadcast and connected WhatsApp number.
string
required
Existing broadcast used to track this send. The broadcast’s contact list is not sent.

Request body

Use one of two request shapes:
  • Broadcast template: omit type and pass the recipient in to. Pass named template variables in data. You cannot choose another template in the request.
  • Typed message: pass type and a matching payload. Do not include data in a typed message request.
string
required
Recipient phone number in international format, such as +14155552671. Spaces, parentheses, periods, and hyphens are removed.
object
Named values for variables in the broadcast’s attached template. The keys must match the template’s variables exactly. Media headers use header_media_url; location headers use header_location with latitude and longitude. Omit this field when the template has no variables.
string
Typed message: text, image, video, audio, voice, document, sticker, location, contacts, interactive, reaction, product, product_list, or catalog.
object
Fields for the selected message type. Media uses a publicly reachable HTTPS URL; this API does not upload files.

Example 1: send the broadcast’s approved template

Suppose the approved template attached to the broadcast has the named variables first_name and order_id. Send those values in data; the API gets the template name, language, channel, and sender from the broadcast settings.
If the attached template has no variables, send only to, or pass an empty data object. A template send can be used when the free-form messaging window is closed, provided the template is approved and the account is eligible to send it.

Example 2: send a text message

Free-form messages such as text require an open WhatsApp messaging window for the recipient.
preview_url is optional and defaults to true.

Example 3: send an image or document from a URL

The URL must use HTTPS and Meta must be able to fetch it without signing in. For a document, filename and caption are optional.
Use either link or url; both are accepted. The API forwards the URL to WhatsApp and does not store a copy of the file.

Other message types

All typed messages use the same endpoint. payload contains the fields for the selected type. For example, send a location with:

Idempotent retries

You can send an Idempotency-Key header of 1–255 characters. If the original request included the header, retry a timeout with the same key and request body. For 24 hours, repeating the same key and request returns the saved result instead of sending again. Reusing a key with a different request returns 409 Conflict. If the provider outcome is still being resolved, the API returns 202 Accepted while it waits for a delivery status update. Without an idempotency key on the original request, a timeout retry may send a duplicate.

Response

When Meta accepts the request, the API returns the internal message ID, recipient, send status, and Meta’s message ID when available. Acceptance does not mean the recipient has received or read the message; delivery updates arrive later and appear in the broadcast recipient history.

Limits and errors

An active plan, available WhatsApp send quota, a connected sender, and messaging eligibility are required. A successful Meta acceptance consumes one WhatsApp send. If Meta definitely rejects the request, the API marks it failed and releases the reserved send. If the provider outcome is uncertain and the original request included Idempotency-Key, retry with the same key while the API resolves the status webhook. Otherwise, check the broadcast history before deciding whether to retry.