Auto
EN
POST/api/v2/messages/bulk

Queue a bulk send

Stores an array of messages. Each item is one recipient and uses the same fields as POST /api/v2/messages/send. The response is 202 with status validating. Sending starts only after every row passes. messagesPerSecond is an integer from 1 to 50 and a ceiling shared by the account's jobs in creation order. Each job is capped at 10,000 messages (HTTP 413, code BULK_TOO_LARGE). Split larger audiences into multiple jobs. Idempotency-Key is required and limited to 200 characters. The same key and the same name, messagesPerSecond, and messages return the current job even if JSON key order differs. The same key with a different body returns 409. Fields outside those three are ignored. scheduleAt is later rejected for the whole job. Duplicate recipients are allowed. One invalid row rejects the job and nothing is sent. An inactive subscription rejects the request before a job is created.

When to use it. Tens or thousands of different messages without waiting for delivery inside the request. For one message, or up to 100 recipients with the same text, use POST /api/v2/messages/send.

Code example

Correct: Correct: two messages

curl --request POST 'https://raselsms.com/api/v2/messages/bulk' \--header 'X-API-Key: YOUR_API_KEY' \--header 'Content-Type: application/json' \--header 'Idempotency-Key: bulk-example-001' \--data '{"name":"Morning notices","messagesPerSecond":10,"messages":[{"to":"+963912345678","channel":"local_sms","messageType":"free_text","content":{"text":"Example notice from Rasel."}},{"to":"+963987654321","channel":"local_sms","messageType":"free_text","content":{"text":"Example notice from Rasel."}}]}'

The key is present, the rate is inside the ceiling, and the array is not empty.

Response example

202 — Correct: two messages

{  "success": true,  "id": "64b0c0ff0000000000000001",  "name": "Morning notices",  "status": "validating",  "messagesPerSecond": 10,  "pauseReason": null,  "total": 2,  "validatedCount": 0,  "counts": {    "pending": 0,    "sent": 0,    "failed": 0,    "cancelled": 0  },  "errorCode": null,  "errorMessage": null,  "createdAt": "2026-09-24T12:00:00.000Z"}

The key is present, the rate is inside the ceiling, and the array is not empty.

HTTP request

POST /api/v2/messages/bulk

Request Headers

HeaderTypeDescription
X-API-KeystringYour Rasel API key. Send it on every documented request except inbound webhooks. *
Idempotency-KeystringOptional unique key for safe retries. Takes precedence over a body idempotencyKey. Successful and failed responses can be replayed for 24 hours when send idempotency is enabled. *

Request body

FieldTypeDescriptionExample
namestringDisplay name or lowercase template identifier, depending on the endpoint.
messagesPerSecondintegerInteger from 1 to 50. Zero, fractions, and values above 50 reject the request. *
messagesjsonNon-empty array. Each item is one recipient object: to, channel, messageType, content, sender, template, and attachment under the single-send rules. Do not put an array in to, and do not send scheduleAt. *

Status Codes

StatusDescription
202Accepted and queued.
400Invalid request, validation error, or the resource cannot be used in this state.
401Missing or invalid API key.
403Phone not verified, missing permission, or the account cannot perform this action.
409Conflict, such as an idempotency key reuse with a different body, or a session that is not ready.
413Request body exceeds the size limit.
429Rate limit exceeded, or the maximum number of verification attempts was reached.

Cases to handle

  • accepting: storage is not finished and nothing is sent. If storage stops, the job becomes rejected with INTAKE_INCOMPLETE.
  • validating: every row is checked. validatedCount shows progress. Nothing is sent in this state.
  • rejected: nothing was sent. errorCode is VALIDATION_FAILED, INSUFFICIENT_BALANCE, or INTAKE_INCOMPLETE.
  • queued: accepted and waiting for a send slot. running: sending is in progress.
  • paused: sending stopped. pauseReason is insufficient_balance, provider_rate_limit, or user.
  • completed: the job finished even when some rows failed. Counts stay separate.
  • cancelled: rows that were not sent became cancelled. The current window may finish a few sends after pause or cancel is requested.

Try it

Parameters

Optional unique key for safe retries. Takes precedence over a body idempotencyKey. Successful and failed responses can be replayed for 24 hours when send idempotency is enabled.

Display name or lowercase template identifier, depending on the endpoint.

Integer from 1 to 50. Zero, fractions, and values above 50 reject the request.

Non-empty array. Each item is one recipient object: to, channel, messageType, content, sender, template, and attachment under the single-send rules. Do not put an array in to, and do not send scheduleAt.

Request

{  "name": "Morning notices",  "messagesPerSecond": 10,  "messages": [    {      "to": "+963912345678",      "channel": "local_sms",      "messageType": "free_text",      "content": {        "text": "Example notice from Rasel."      }    },    {      "to": "+963987654321",      "channel": "local_sms",      "messageType": "free_text",      "content": {        "text": "Example notice from Rasel."      }    }  ]}

Response

Example response

{  "success": true,  "id": "64b0c0ff0000000000000001",  "name": "Morning notices",  "status": "validating",  "messagesPerSecond": 10,  "pauseReason": null,  "total": 2,  "validatedCount": 0,  "counts": {    "pending": 0,    "sent": 0,    "failed": 0,    "cancelled": 0  },  "errorCode": null,  "errorMessage": null,  "createdAt": "2026-09-24T12:00:00.000Z"}