Skip to content

WhatsApp API reference

This page describes the route your system uses to send WhatsApp messages through the number you connected in Replifier. The generated reference of the full contract is in the API section; here you will find how sending behaves.

POST https://api.replifier.com/v1/connections/whatsapp/{conn}/send

{conn} is the identifier of the WhatsApp connection. Each request sends a single message to a single recipient.

What you call with What it needs
API key The whatsapp.send permission, in the Authorization: Bearer rpf_live_… header. A brand key only uses its brand’s numbers.
App session The credentials.manage permission on the number’s brand.

Do not send a session and a key at the same time: the request is rejected with 400 and ambiguous_credentials.

Header Required Description
Authorization With an API key Bearer rpf_live_….
Content-Type Yes application/json.
Idempotency-Key With an API key Text that is unique per message, 1 to 255 characters; a UUID works. Without it, 400 with idempotency_key_required.

A retry with the same key and the same body returns the stored response, with Idempotent-Replayed: true, and does not send another message. The key is remembered for 24 hours. With the same key and a different body, or while the first attempt is still running, the response is 409 with idempotency_conflict. If the server answers with a 5xx error, the key is released so you can retry.

Field Type Description
to text, 1 to 32 characters Recipient number in E.164 format, for example +14155550123.
type text Message type: template, text, image, document, location, buttons or list. If you omit it, it is template.
brandId, contactId, campaignId text, optional Tie the send to a brand, a contact and a campaign. With campaignId, the send adds to that campaign’s statistics.

It can be sent at any time, with no 24-hour window. The template must be approved by Meta.

Field Type Description
templateName text Name of the approved template.
languageCode text, 2 to 10 characters Language of the template, for example en_US.
components list, optional Template parameters, in the format of Meta’s WhatsApp Cloud API (header, body, button).
Field Type Description
text text, 1 to 4096 characters Content of the message.
previewUrl boolean, optional true so WhatsApp shows a preview of the first link. Default false.
Field Type Description
link URL, up to 2048 characters Public address of the file, which WhatsApp downloads.
caption text, optional, up to 1024 Text that goes with the file.
filename text, optional, up to 240 (document only) Name under which the recipient sees the document.
Field Type Description
latitude number, from -90 to 90 Latitude.
longitude number, from -180 to 180 Longitude.
name text, optional, up to 200 Name of the place.
address text, optional, up to 300 Address of the place.
Field Type Description
body text, 1 to 1024 characters Text of the message.
buttons list of 1 to 3 Each button has an id (1 to 256 characters, what you receive when it is tapped) and a title (1 to 20 characters).
Field Type Description
body text, 1 to 1024 characters Text of the message.
buttonText text, 1 to 20 characters Text of the button that opens the list.
sections list of 1 to 10 Each section has a title (optional, up to 24) and rows.
rows list of 1 to 10 per section Each row has an id (up to 200), a title (1 to 24) and a description (optional, up to 72).

WhatsApp only allows messages that are not templates during the 24 hours after the recipient’s last message. If that window is closed, or the recipient never wrote to you, the response is 422 with whatsapp_window_closed. Send an approved template instead; when the recipient replies, the window opens again.

If the recipient opted out of WhatsApp in the brand, the response is 422 with contact_channel_suppressed and nothing is sent.

Limit Value What happens when you pass it
Per API key 120 messages per minute 429 with whatsapp_rate_limited and Retry-After: 60.
Per number The 24-hour limit of the messaging tier Meta assigned to the number (messaging_limit_tier) 429 with whatsapp_daily_limit_reached and Retry-After with the seconds until capacity frees up.

It counts the messages of the last 24 hours that did not fail. Always wait for Retry-After before retrying.

The response is 200 when Replifier processed the request, and the body says whether Meta accepted the message:

Field When it appears Description
ok Always true if Meta accepted the message; false if it rejected it.
providerMessageId With ok: true Identifier of the message in WhatsApp.
providerCode and providerMessage With ok: false The code and text of Meta’s error.

Errors come with the body {"error": {"code", "message", "cause", "fix", "requestId"}}.

Status code When it happens
400 idempotency_key_required The Idempotency-Key header is missing with an API key.
400 validation_failed The body does not match the format of its type, or Idempotency-Key is over 255 characters.
400 ambiguous_credentials The request carries both the session cookie and an API key.
401 unauthorized The API key is missing or not valid.
403 api_key_scope The key does not have the whatsapp.send permission.
404 not_found The connection does not exist or belongs to another brand.
409 idempotency_conflict The key was repeated with another body or the first attempt is still running.
422 whatsapp_window_closed The 24-hour window is closed and the message is not a template.
422 contact_channel_suppressed The recipient opted out of WhatsApp.
429 whatsapp_rate_limited You went over 120 messages per minute with the key.
429 whatsapp_daily_limit_reached The number used up its 24-hour limit.

Each code has its own page in the error catalog.

When you register a webhook with these events, Replifier sends a signed POST to your URL with the notices of the number. They are only sent for numbers tied to a brand, and the signature is verified like that of any other webhook.

A person wrote to your number. from is their number in E.164 format, type is the kind of message (text, image, location, interactive…) and text is its text, or null if it has none. messageId is the identifier in WhatsApp and conversationId the conversation in Replifier. Depending on the type it adds media (id, mimeType, caption and a signed url, or null if it is not available), location (latitude, longitude, name, address) or interactive when the person tapped a button or a list row (kind is button_reply, list_reply or template_button, with id and title).

{
"event": "whatsapp.message.received",
"connectionId": "ccc_…",
"conversationId": "cnv_…",
"messageId": "wamid.…",
"from": "+15555550100",
"type": "text",
"text": "Hello",
"occurredAt": "2026-01-01T00:00:00.000Z"
}

The state of a message you sent advanced. status is sent, delivered, read or failed, and the event is sent only when the state moves forward. messageId is the message in Replifier, providerMessageId the one in WhatsApp, to the recipient, and campaignId and contactId the ones tied to the send, or null. With failed it adds error, with the code and message that Meta reports.

{
"event": "whatsapp.message.status",
"connectionId": "ccc_…",
"messageId": "wam_…",
"providerMessageId": "wamid.…",
"status": "delivered",
"to": "+15555550100",
"campaignId": null,
"contactId": "ctc_…",
"occurredAt": "2026-01-01T00:00:00.000Z"
}

Meta reviewed a template. name and languageCode identify it, and status is its new status, for example APPROVED, PENDING, REJECTED, PAUSED, DISABLED or IN_APPEAL. reason is the reason Meta gives, or null.

{
"event": "whatsapp.template.status",
"connectionId": "ccc_…",
"name": "abandoned_cart",
"languageCode": "es_MX",
"status": "APPROVED",
"reason": null,
"occurredAt": "2026-01-01T00:00:00.000Z"
}

The generic events message.received, message.delivered, message.read, message.replied, link.clicked and conversion.recorded can also report WhatsApp activity; their format is in the webhooks guide.

Your integration sends every message type it needs, treats a 200 with ok: false as a rejection from Meta, respects Retry-After on 429 responses and always sends a different Idempotency-Key per message.