Skip to Content
Messages

Send a batch

POST
/v1/numbers/{phone_number}/messages/send/batch

Send 1 to 1000 messages. Answers 200 with one result per message, even if some fail.

Authorization

HTTPBearer
headerAuthorizationBearer <token>

Path Parameters

phone_number*string

Your WhatsApp number, digits only, e.g. 393401234567.

Request Body

application/json
  1. body
messages*array<>

1 to 1000 messages, each with the fields of a single send.

Items1 <= items <= 1000

Response Body

OK

application/json
  1. response
accepted_count*integer

Messages accepted.

failed_count*integer

Messages rejected.

results*array<>

One result per message, in request order.

Example Request
curl -X POST 'https://api.wapiu.ai/v1/numbers/393401234567/messages/send/batch' \  -H 'Content-Type: application/json' \  -d '{  "messages": [    {      "recipient": "+393331112222",      "message": {        "message_type": "text",        "text": "Hello from WhaPiù!"      },      "client_ref": "order-1234"    },    {      "recipient": "+393334445555",      "message": {        "message_type": "text",        "text": "Hello from WhaPiù!"      },      "client_ref": "order-1235"    }  ]}'
Example Response
{  "accepted_count": 1,  "failed_count": 1,  "results": [    {      "index": 0,      "recipient": "+393331112222",      "status": "accepted",      "message_uuid": "3f2b8c1e-7a4d-4e9b-9c2a-5d6e7f8a9b0c",      "error": null    },    {      "index": 1,      "recipient": "+393334445555",      "status": "failed",      "message_uuid": null,      "error": {        "code": "provider_rate_limited",        "message": "provider rate limit",        "retry_after_ms": 2000      }    }  ]}