SMS API
SMS API
  • SMS API

    • SMS API Documentation
    • Authentication
    • IP Whitelisting
    • Send SMS
    • Idempotency
    • Rate Limits
    • Responses
    • Errors
    • Delivery Reports

Responses

The SMS API returns JSON responses for both successful and failed requests.

Response format

Successful response

A successful request returns HTTP 200.

{
  "success": true,
  "message": "SMS queued successfully.",
  "error": null,
  "data": {
    "batch_id": "20bc680b-974d-4f33-affa-273414ebb77f",
    "sms_count": 1,
    "total_recipients": 2,
    "cost_cents": 200,
    "status": "queued"
  }
}

Success fields

FieldDescription
successIndicates whether the request was successful.
messageDescription of the result.
errornull for successful requests.
data.batch_idUnique ID for the SMS request.
data.sms_countNumber of SMS parts in the message.
data.total_recipientsNumber of recipients.
data.cost_centsTotal cost of the request in cents.
data.statusCurrent request status.

The batch_id identifies the original request and is also used to associate delivery reports with the request.

Error response

Failed requests use the following structure:

{
  "success": false,
  "message": "Error description",
  "error": "ERROR_CODE",
  "data": null
}

Error fields

FieldDescription
successAlways false for an error response.
messageHuman-readable description of the error.
errorMachine-readable error code.
datanull for error responses.

HTTP status codes

The API uses standard HTTP status codes to indicate the result of a request.

StatusMeaning
200Request accepted and SMS queued.
402Insufficient account balance.
403Sender name is not allowed for the account.
404Account or required resource was not found.
422Request validation failed.
429Rate limit exceeded.
500Internal server error.

Error codes

Common error codes include:

Error codeHTTP statusDescription
INVALID_REQUEST422The request is invalid.
INVALID_RECIPIENT_COUNT422No recipients were provided.
MAX_RECIPIENTS_EXCEEDED422More than 100 recipients were provided.
INVALID_MOBILE422One or more mobile numbers are invalid.
INVALID_MESSAGE422The message is invalid.
SMS_PARTS_EXCEEDED422The message exceeds 6 SMS parts.
IP_NOT_ALLOWED403The request came from an address this application is not allowed to use.
SENDER_NOT_FOUND422The sender name does not exist on the account.
SENDER_NOT_ALLOWED403The sender name is not allowed for the account.
ACCOUNT_NOT_FOUND404The account could not be found.
WALLET_NOT_FOUND500The account wallet could not be found.
INSUFFICIENT_BALANCE402The account does not have enough balance.
RATE_LIMIT_EXCEEDED429The request rate limit has been exceeded.
INTERNAL_SERVER_ERROR500An unexpected server error occurred.

See Errors for more information about handling individual errors.

Last Updated: 11/5/26, 3:48 PM
Contributors: harrykerry
Prev
Rate Limits
Next
Errors