Skip to Content
Developers

Batch

Send up to 1000 messages in one call, with one result per message.

POST/v1/numbers/{phone_number}/messages/send/batchReference →

messages holds 1 to 1000 items. Each item has the same fields as a single send: recipient, message, and optionally client_ref.

curl -X POST "$WAPIU_API/v1/numbers/$WAPIU_NUMBER/messages/send/batch" \  -H "Authorization: Bearer $WAPIU_TOKEN" \  -H "Content-Type: application/json" \  -d '{    "messages": [      {        "recipient": "+393331112222",        "message": {          "message_type": "text",          "text": "Hi Mario!"        },        "client_ref": "order-1234"      },      {        "recipient": "+393334445555",        "message": {          "message_type": "text",          "text": "Hi Lucia!"        },        "client_ref": "order-1235"      }    ]  }'

Response

The call answers 200 even if some messages fail. Every item gets its own result, in request order.

{
  "accepted_count": 1,
  "failed_count": 1,
  "results": [
    { "index": 0, "recipient": "+393331112222", "status": "accepted", "message_uuid": "aaaaaaaa-…", "error": null },
    { "index": 1, "recipient": "+393334445555", "status": "failed", "message_uuid": null,
      "error": { "code": "provider_rate_limited", "message": "provider rate limit", "retry_after_ms": 2000 } }
  ]
}
FieldDescription
indexPosition of the item in messages, from 0.
statusaccepted or failed.
message_uuidSet when accepted.
errorSet when failed: code, message, retry_after_ms. See Errors.

Retry only the failed items with a retryable code (provider_rate_limited, provider_retryable).

The whole call answers 422 only when the batch itself is invalid: empty, more than 1000 items, or a malformed item.

On this page