Messages

Estimate message cost

Shows how many segments a message will use and what it will cost, without sending it.

POST
/v1/messages/estimate

Shows how many segments a message will use and what it will cost, without sending it.

Authorization

bearer
headerAuthorizationBearer <JWT>

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

Request Body

application/json
  1. body
text*string

The message text to price, up to 480 characters including spaces.

Lengthlength <= 480
recipients?number

Number of recipients to price for. Defaults to 1.

Range1 <= value <= 10000

Response Body

The estimate.

application/json
Example Request
curl -X POST 'https://api.appstractone.com/v1/messages/estimate' \
  -H 'Content-Type: application/json' \
  -d '{
  "text": "Your order #1042 is on its way."
}'
Example Response
{
  "encoding": "GSM-7",
  "characters": 31,
  "segments": 1,
  "recipients": 250,
  "costPerMessage": {
    "amount": "0.04",
    "currency": "GHS"
  },
  "totalCost": {
    "amount": "10.00",
    "currency": "GHS"
  }
}