Messages

Estimate a batch

Prices a batch without sending it and checks it against your balance.

POST
/v1/messages/batch/estimate

Prices a batch without sending it and checks it against your balance.

Authorization

bearer
headerAuthorizationBearer <JWT>

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

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 estimate.

application/json
Example Request
curl -X POST 'https://api.appstractone.com/v1/messages/batch/estimate' \  -H 'Content-Type: application/json' \  -d '{  "from": "MYSHOP",  "recipients": [    {      "to": "+233241234567"    }  ]}'
Example Response
{  "accepted": 2,  "rejected": 0,  "segments": 2,  "totalCost": {    "amount": "0.08",    "currency": "GHS"  },  "balance": {    "amount": "19.96",    "currency": "GHS"  },  "sufficient": true,  "errors": []}