Send WhatsApp
POST /v1/whatsappValidates and queues one WhatsApp message for asynchronous delivery from a number connected to your organization. Retransmit normalizes the recipient number and detects its destination country. Poll Get WhatsApp or subscribe to Webhooks for the outcome.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
from | string | No | Connected number to send from, in E.164 format. Required only when your organization has more than one number. |
to | string | Yes | One recipient in international E.164 format. |
type | string | No | text (default), template, image, or document. |
text | string | For text | Message body, from 1 to 4,096 characters. Also used as the caption for media when the media object has none. |
preview_url | boolean | No | Render a preview for the first link in a text message. Defaults to false. |
template | object | For template | { name, language, components? }. components is passed to WhatsApp verbatim. |
image | object | For image | { link, caption? }. The link must be a public HTTPS URL. |
document | object | For document | { link, caption?, filename? }. |
Example
Node.js
const { data, error } = await retransmit.whatsapp.send({
to: "+237670000000",
text: "Your verification code is 482913",
});Template example
Node.js
const { data, error } = await retransmit.whatsapp.send({
to: "+237670000000",
type: "template",
template: {
name: "verification_code",
language: "en_US",
components: [
{ type: "body", parameters: [{ type: "text", text: "482913" }] },
],
},
});Response
202 Accepted
{
"id": "wa_xxxxxxxxxxxx",
"status": "queued",
"type": "text",
"from": "+237650000000",
"country": "CM",
"created_at": "2026-09-01T12:00:00.000Z"
}country is the detected ISO 3166-1 alpha-2 destination.
Errors
| Status | Code | Meaning |
|---|---|---|
400 | invalid_json | The request body is not valid JSON. |
401 | unauthorized | The API key is missing, invalid, or revoked. |
422 | validation_error | A field is invalid, the phone number is malformed, the object required by type is missing, or from is needed to choose between several numbers. |
422 | no_whatsapp_account | No connected WhatsApp number matches. Connect one in the dashboard. |
500 | internal_error | The message could not be created. |
Last updated on