Errors

Stable customer-facing codes and HTTP status mapping.

Error responses are JSON. Validation failures typically use 400. Auth failures use 401. Business rules such as wallet balance use dedicated codes.

Response shape

{
  "code": "INSUFFICIENT_BALANCE",
  "message": "Insufficient wallet balance. Need 25 TZS, have 0"
}

HTTP status

StatusMeaning
400Invalid request, missing Sender ID, missing wallet, or bad input
401Missing or invalid Bearer token / API key
402Insufficient prepaid balance
404Resource not found (e.g. message id)
202SMS accepted and queued (success for send)

Application codes

CodeWhen
MISSING_SENDER_IDNo senderId provided and no org/platform default available
WALLET_MISSINGOrganisation wallet could not be found
INSUFFICIENT_BALANCEWallet balance lower than the send charge
NOT_FOUNDMessage or resource id does not exist
MESSAGE_PROVIDER_ERRORCustomer-safe stand-in when delivery fails for provider/infrastructure reasons
Provider noise is strippedFailed messages expose Netnaunse codes and messages only. Upstream provider payloads are never returned on customer APIs.

Related: SMS API · Webhooks