Messages

Send a batch

Sends up to 10,000 messages from one sender ID in a single request. Each recipient can have its own text. Invalid recipients are reported in errors and are not charged.

POST
/v1/messages/batch

Sends up to 10,000 messages from one sender ID in a single request. Each recipient can have its own text. Invalid recipients are reported in errors and are not charged.

Authorization

bearer
headerAuthorizationBearer <JWT>

Your secret API key: sk_live_… for live traffic or sk_test_… for testing.

Header Parameters

idempotency-key*string
Idempotency-Key?string

Request Body

application/json
  1. body
from*string

An approved sender ID on your account, 3 to 11 letters or digits.

text?string

Text sent to every recipient that has no text of its own. Up to 480 characters including spaces.

Lengthlength <= 480
reference?string

Your own reference for the whole batch.

Lengthlength <= 100
recipients*array<>

Between 1 and 10,000 recipients.

Items1 <= items <= 10000

Response Body

The batch was accepted.

application/json
Example Request
curl -X POST 'https://api.appstractone.com/v1/messages/batch' \
  -H 'idempotency-key: string' \
  -H 'Content-Type: application/json' \
  -d '{
  "from": "MYSHOP",
  "recipients": [
    {
      "to": "+233241234567"
    }
  ]
}'
Example Response
{
  "batchId": "bat_01M6MJSBW6TNFXDJ48HMRQXBPJ",
  "status": "completed",
  "test": true,
  "accepted": 2,
  "rejected": 0,
  "segments": 2,
  "cost": {
    "amount": "0.08",
    "currency": "GHS"
  },
  "messages": [
    {
      "id": "msg_01M6MJSBW6TNFXDJ48HMRQXBPK",
      "to": "+233241234567",
      "status": "delivered",
      "encoding": "GSM-7",
      "segments": 1,
      "cost": {
        "amount": "0.04",
        "currency": "GHS"
      },
      "reference": null,
      "test": true
    },
    {
      "id": "msg_01M6MJSBW6TNFXDJ48HMRQXBPM",
      "to": "+233201234567",
      "status": "delivered",
      "encoding": "GSM-7",
      "segments": 1,
      "cost": {
        "amount": "0.04",
        "currency": "GHS"
      },
      "reference": null,
      "test": true
    }
  ],
  "errors": []
}