Skip to content
MZSMS

Reference

Error codes

Every error code the API returns, with HTTP status and meaning.

Error format#

{
  "success": false,
  "error": {
    "code": "INSUFFICIENT_BALANCE",
    "message": "Insufficient balance. Add balance to your wallet and try again.",
    "details": { "required": "35.00" }
  },
  "meta": { "requestId": "req_1c9x0b2m4n6v8q7w" }
}

error.code is stable and safe to branch on. error.message is for people and may change. Validation errors include error.details.fields.

All codes#

CodeHTTPMeaning
INVALID_REQUEST400The request is malformed (invalid JSON, body too large, bad header).
VALIDATION_ERROR422One or more fields are invalid. See error.details.fields.
UNAUTHORIZED401Not signed in (dashboard endpoints).
INVALID_API_KEY401The API key is missing, malformed, revoked or expired.
FORBIDDEN403Authenticated but not allowed (IP not allowlisted, account suspended, missing permission).
INSUFFICIENT_SCOPE403The API key does not have the scope this endpoint requires.
ACCOUNT_SUSPENDED403The organization is suspended. Contact support.
EMAIL_NOT_VERIFIED403Verify the account email before using this feature.
NOT_FOUND404The resource does not exist or belongs to another account.
CONFLICT409The request conflicts with the current state (e.g. a duplicate, or a request with the same Idempotency-Key still in progress).
IDEMPOTENCY_CONFLICT409The Idempotency-Key was already used with a different request body.
RATE_LIMITED429Too many requests. Wait for the time in the Retry-After header.
INSUFFICIENT_BALANCE402Wallet balance is lower than the cost of the request.
INVALID_RECIPIENT422The number is not a valid Bangladesh mobile number, or is blocked.
SENDER_ID_NOT_APPROVED422The sender_id is not approved for your account.
CONTENT_BLOCKED422The message matched a content rule or needs review.
MESSAGE_TOO_LONG422The message exceeds the maximum number of segments.
RECIPIENT_SUPPRESSED422The recipient opted out of promotional messages.
QUIET_HOURS422Promotional messages cannot be sent at this time (Asia/Dhaka).
DAILY_LIMIT_EXCEEDED429The request would exceed your daily sending limit.
MONTHLY_LIMIT_EXCEEDED429The request would exceed your monthly sending limit.
PAYMENT_FAILED402A payment could not be completed or verified.
PROVIDER_ERROR502The upstream SMS provider returned an error.
PROVIDER_NOT_CONFIGURED503No SMS provider is configured for this platform.
FEATURE_DISABLED403This feature is not enabled.
SERVICE_UNAVAILABLE503Temporarily busy. Retry after the Retry-After seconds (with the same Idempotency-Key for sends).
INTERNAL_ERROR500Unexpected server error. Safe to retry with the same Idempotency-Key.

Handling errors#

  • 4xx errors other than 409 and 429 will not succeed if retried unchanged. Fix the request.
  • For 429, wait for the Retry-After seconds.
  • For 5xx and network errors, retry with backoff using the same Idempotency-Key.