Skip to content

Batch Send Messages

The batch endpoint lets you send 1 to 100 messages from one sender number (phone_number_id) in a single HTTP request. Each item in the messages array is an object { "idempotency_key"?: "<=256 chars", "message": { ... } }, where message uses the exact same request body format as a single send (POST /v1/{phone_number_id}/messages).

POST /v1/{phone_number_id}/messages/batch
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
POST /v1/YOUR_PHONE_NUMBER_ID/messages/batch
{
"messages": [
{
"idempotency_key": "order-1001-confirm",
"message": {
"messaging_product": "whatsapp",
"to": "6281234567890",
"type": "template",
"template": {
"name": "order_confirmation",
"language": { "code": "id" },
"components": [
{
"type": "body",
"parameters": [
{ "type": "text", "text": "Budi" },
{ "type": "text", "text": "INV-1001" }
]
}
]
}
}
},
{
"message": {
"messaging_product": "whatsapp",
"to": "6289876543210",
"type": "template",
"template": {
"name": "order_confirmation",
"language": { "code": "id" },
"components": [
{
"type": "body",
"parameters": [
{ "type": "text", "text": "Siti" },
{ "type": "text", "text": "INV-1002" }
]
}
]
}
}
}
]
}

The server returns 202 Accepted whenever the batch envelope is valid (1–100 items), even if some or all individual items are rejected.

202 Accepted
{
"messaging_product": "whatsapp",
"accepted": 1,
"rejected": 1,
"results": [
{
"index": 0,
"to": "6281234567890",
"status": "accepted",
"id": "msg_01933c8a-7f2b-7d10-8a31-91b2c3d4e5f6",
"idempotent_replayed": false
},
{
"index": 1,
"to": "6289876543210",
"status": "rejected",
"idempotent_replayed": false,
"error": {
"code": 400,
"error": "validation_error",
"message": "Template 'order_confirmation' is not approved"
}
}
]
}
FieldTypeDescription
messaging_productstringAlways "whatsapp"
acceptednumberNumber of items accepted and queued for delivery
rejectednumberNumber of items that failed validation or were rejected
results[]arrayPer-item results in the same order as the request array
results[].indexnumber0-based index in the request messages array
results[].tostringRecipient phone number for that item
results[].statusstring"accepted" or "rejected"
results[].idstringMessage ID (msg_<uuid>), present only when status is "accepted"
results[].idempotent_replayedbooleanAlways present. true if the item’s idempotency_key matched a previous send, otherwise false (also on rejected items)
results[].errorobject{ code, error, message }, present only when status is "rejected" (code is the HTTP status number, error is the snake_case error slug such as "validation_error" or "payment_required", and message is the public error message)
  • Batch size: Minimum 1 item and maximum 100 items per request. An empty batch ([]) or more than 100 items returns 400 Bad Request.
  • JSON parsing: A request body that is not valid JSON or has a structurally invalid item is rejected as a whole with 400 Bad Request (per-item results cover checks after parsing).
  • Payload size: Keep the HTTP request body under 2 MB.
  • Independent items: Each item is evaluated independently. If item 3 fails validation or lacks balance, the remaining valid items are still accepted and queued.
  • Per-item idempotency: Pass idempotency_key (up to 256 characters) on the item wrapper object (messages[i].idempotency_key) to safely retry without duplicate sends.
  • Billing, queueing, and send limits: Every accepted item reserves balance, enters the outbound queue, respects the Meta daily recipient limit and frequency cap, and emits per-message status webhooks (message.status.sent, delivered, read, failed) identically to single sends.
Use CaseUse Batch APIUse Portal Campaigns
Transactional triggers from your backend / ERP / CRMYesNo
Scheduled broadcasts or large audiences (thousands–millions of contacts)NoYes
Per-message idempotency and immediate msg_<uuid> responsesYesNo
CSV contact lists and campaign progress tracking in app.mahadata.ioNoYes