Send a WhatsApp reply
curl --request POST \
--url https://backend.botcadence.com/organizations/{organization_id}/projects/{project_id}/whatsapp/messages \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"to": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({to: '<string>'})
};
fetch('https://backend.botcadence.com/organizations/{organization_id}/projects/{project_id}/whatsapp/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://backend.botcadence.com/organizations/{organization_id}/projects/{project_id}/whatsapp/messages"
payload = { "to": "<string>" }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)WhatsApp
Send a WhatsApp reply
Let your own app answer a WhatsApp number: get each message and delivery status by webhook, and reply inside the 24-hour window
POST
/
organizations
/
{organization_id}
/
projects
/
{project_id}
/
whatsapp
/
messages
Send a WhatsApp reply
curl --request POST \
--url https://backend.botcadence.com/organizations/{organization_id}/projects/{project_id}/whatsapp/messages \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"to": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({to: '<string>'})
};
fetch('https://backend.botcadence.com/organizations/{organization_id}/projects/{project_id}/whatsapp/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://backend.botcadence.com/organizations/{organization_id}/projects/{project_id}/whatsapp/messages"
payload = { "to": "<string>" }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)Your own app can answer a WhatsApp number in place of the AI or your team. Botcadence posts each customer message and each delivery status to your app’s webhook, and your app replies with this endpoint while the customer’s 24-hour window is open. Outside that window, send an approved template with Send a WhatsApp template.
Each customer message is posted as JSON:
Each delivery status Meta reports for a message sent from the number, including your app’s replies:
Refuse a post whose signature does not match or whose timestamp is more than a few minutes old.
Required scope:
The reply shows in the conversation in your inbox.
Setup
- In Channels, open the WhatsApp channel. Under Webhooks, add your app’s public HTTPS address (up to 2,048 characters) and a signing secret (up to 256), pick the events, and save. Spaces around both are trimmed. You can add up to 5 webhooks.
- To stop the AI and your team from answering, set Default reply mode to Your app replies. This mode needs a webhook that takes
message.received. In this mode Botcadence does not read images with AI and does not bill them as media; your app gets the signed image link. Webhooks also work with any other reply mode; they only notify. - Create a project API key with the
whatsapp:createscope.
Events
message.received
Each customer message is posted as JSON:
{
"event_id": "4f1c2e…",
"event_type": "message.received",
"schema_version": "2026-12-01.v1",
"occurred_at": "2026-12-01T10:00:00+00:00",
"message": {
"id": "665f1a2b3c4d5e6f7a8b9c0d",
"provider_message_id": "wamid.HBgL…",
"type": "image",
"text": "Front door",
"media": [{ "type": "image", "urls": ["https://…signed…"], "title": null, "content_type": "image/jpeg" }],
"button_payload": null,
"button_id": null,
"reply_to_provider_message_id": null
},
"sender": "14155552671",
"conversation": { "id": "665f1a2b3c4d5e6f7a8b9c0e", "channel_id": "665f1a2b3c4d5e6f7a8b9c0f" }
}
occurred_atis when the customer sent the message, as WhatsApp reports it.conversation.idis the chat; pass it asconversation_idwhen you reply.message.typeistext,image,video,audioordocument. Eachmessage.mediaitem hastype,urls,titleandcontent_type. The links are signed and expire, so download them when the post arrives.button_payloadis set when the customer taps a template quick-reply button. It is the payload Meta sends for that button: Meta’s default unless an automation maps the button’s payload to a variable (for examplebutton_payload_0) in its template settings.button_idis set when the customer taps a reply button or picks a list row; for the reply buttons this API sends, it is the button title.senderis the customer’s WhatsApp number, without+.
message.status
Each delivery status Meta reports for a message sent from the number, including your app’s replies:
{
"event_id": "9b2d…",
"event_type": "message.status",
"schema_version": "2026-12-01.v1",
"occurred_at": "2026-12-01T10:00:05+00:00",
"message": { "id": "665f1a2b3c4d5e6f7a8b9c0d", "provider_message_id": "wamid.HBgL…" },
"status": "delivered",
"error": null,
"recipient": "14155552671"
}
statusissent,delivered,readorfailed;errorexplains a failure.message.idis the inbox message: agent, AI and API replies, and templates sent from the inbox. For your replies it is themessage_idthis API returns. It isnullfor messages that are not in the inbox (broadcasts, automation templates, and messages sent from the WhatsApp Business app); match those onprovider_message_id.- A reply with an image and text goes out as two WhatsApp messages, so each part gets its own statuses: same
message.id, differentprovider_message_id.
Delivery
Answer with any2xx status within 15 seconds. A 5xx, a 429, a timeout, a network error or a failed DNS lookup is retried with the same event_id, also sent as the Idempotency-Key header, so ignore an event_id you have already handled. Retries back off, waiting up to 50 minutes between tries, for about 2 hours in total.
Other statuses are not retried. Redirects are not followed, and a 3xx is not retried. An address that resolves to a private network is refused and not retried.
Events can arrive out of order, so order them by occurred_at. When a delivery gives up, the webhook in the channel settings shows Last delivery failed with the time and the error.
Verify the signature
Each post carriesX-Botcadence-Timestamp (Unix seconds) and X-Botcadence-Signature: sha256=<hex>. The signature is the HMAC-SHA256, keyed with your signing secret, of the timestamp, a ., and the raw request body:
import hashlib, hmac
def is_signed(secret: str, timestamp: str, body: bytes, signature: str) -> bool:
digest = hmac.new(secret.encode(), f"{timestamp}.".encode() + body, hashlib.sha256)
return hmac.compare_digest(f"sha256={digest.hexdigest()}", signature)
Authentication
Send the project API key as a Bearer token. See API authentication.Authorization: Bearer bot_live_YOUR_KEY
whatsapp:create
Request body
The customer’s number in international format, for example
+14155552671. It must have a live WhatsApp chat in the project.The chat to reply in:
conversation.id from the message.received event. It must be a live WhatsApp chat in this project with the to number. Without it, the reply goes to the latest live chat with that number.Up to 4,096 characters. Required unless
image_url is set, and always required with quick_replies, as 1 to 1,024 characters.Up to three different button titles of 1 to 20 characters after trimming spaces, sent as reply buttons on the text. A tap arrives as an inbound message with
button_id set to the title.Example
curl -X POST \
"https://backend.botcadence.com/organizations/ORG_ID/projects/PROJECT_ID/whatsapp/messages" \
-H "Authorization: Bearer $BOTCADENCE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "+14155552671",
"conversation_id": "665f1a2b3c4d5e6f7a8b9c0e",
"text": "Someone is at the front door.",
"image_url": "https://cdn.example.com/front-door.jpg",
"quick_replies": ["Sound siren", "Seen"]
}'
Response
{
"status": "success",
"message": "Message sent",
"data": {
"message_id": "665f1a2b3c4d5e6f7a8b9c0d",
"conversation_id": "665f1a2b3c4d5e6f7a8b9c0e"
},
"status_code": 200
}
Idempotent retries
Send anIdempotency-Key header (1 to 255 characters) to retry safely. A repeated key with the same body returns the first response without sending again.
- A failure before the reply is stored frees the key for another try.
- A failure after the reply is stored keeps the key as
outcome_unknown, because the reply may have reached the customer. A replay with that key answers409; check the conversation before you send again with a new key.
Idempotency-Key: alert-1042
Errors
| Status | Meaning |
|---|---|
400 | Invalid organization or project id, an Idempotency-Key that is not 1 to 255 characters, the WhatsApp channel is off or cannot send, or WhatsApp refused the message. |
401 | API key is missing, invalid, or revoked. |
403 | API key belongs to another organization/project or lacks whatsapp:create. |
404 | No live WhatsApp chat with this number, or conversation_id is not a live WhatsApp chat in this project with this number. |
409 | The customer’s 24-hour window has closed (send a template instead); this customer opted out; or the idempotency key was used with a different body, is still being sent, or its outcome is unknown. |
422 | Invalid body: missing text and image, a non-public image address, or invalid quick replies. |
500 | Something failed on our side. If you sent an Idempotency-Key, the reply may have reached the customer; see Idempotent retries. |

