Skip to content

Errors

Every error uses one envelope:

json
{
  "error": {
    "code": "INSUFFICIENT_CREDITS",
    "message": "This batch costs US$0.0400 and your balance is US$0.0100. Load at least US$0.0300 more.",
    "docs_url": "https://docs.sms.xash.network/errors#insufficient_credits",
    "required": "0.0400",
    "balance": "0.0100",
    "shortfall": "0.0300"
  }
}

code is stable and machine-readable. message is for humans and may change. Extra context fields depend on the code.

Codes

CodeHTTPMeaningWhat to do
INSUFFICIENT_CREDITS402The batch costs more than your balance. The response includes the shortfall.Top up, then retry.
MESSAGE_REJECTED422The body failed the content rules. Includes category and reason.Rewrite as a service message, or contact support if it is one.
MODERATION_UNAVAILABLE503A new template could not be checked.Retryable. Wait a moment and resend.
UNSUPPORTED_DESTINATIONper-recipientThe number is outside +263 / +27. Appears in rejected, not billed.Remove the number.
INVALID_RECIPIENT422 / per-recipientThe number does not parse.Send E.164, e.g. +263771234567.
CHANNEL_NOT_AVAILABLE400The channel is reserved but not live (telegram, whatsapp).Use sms.
ACCOUNT_SUSPENDED403Your account is suspended. The dashboard shows the reason.Contact support.
RATE_LIMITED429Over 60 requests per minute.Back off and retry. Batch recipients instead of looping single sends.
IDEMPOTENCY_CONFLICT409The Idempotency-Key was used with a different payload, or the original request is still running.Use a fresh key, or wait and retry the identical request.
TOO_MANY_RECIPIENTS422More than 1,000 numbers in one call.Split the batch.
VALIDATION_FAILED422A field is missing or malformed. The message names it.Fix the request.
NOT_FOUND404No batch or message with that id on your account.Check the id.

Partial rejection is not an error: a batch with some valid and some invalid numbers sends to the valid ones and lists the rest in rejected, unbilled.