SendSMSby ZEXTELDocumentation
EN
Cabinet
Open MarkdownOpen in ChatGPTOpen in Claude
⋯ Page actions
Open MarkdownOpen in ChatGPTOpen in ClaudeOpen in CursorOpen in PerplexityOpen in Gemini (question is copied)Open in Microsoft CopilotOpen in IBM Bob (question is copied)

Reference

Error codes

An API refusal is an HTTP status plus the error field of the JSON body. The table below says what each code means and what to do. Look at the HTTP status first; error refines it.

37 codes

CodeHTTPMeaningWhat to do
api_key_missing401No X-API-Key header.Send the key in the X-API-Key header.
api_key_invalid401The key is wrong, revoked or expired.Check the key; issue a new one in the cabinet if needed.
text_or_template_required400Neither text nor templateId.Send a text or a template — exactly one of them.
sender_required400No from, no default Sender ID, and not exactly one approved name (the number is in approvedSenders).Send from, or choose a «Default Sender ID» in the cabinet: «API and integrations».
traffic_class_required400No trafficClass, and neither the template nor the setting gives one.Send trafficClass (otp, transactional, promotional) or choose a «Default traffic class» in the cabinet.
traffic_class_not_allowed400The class is not available to a SendSMS client (allowed ones are in allowed).Use otp, transactional or promotional.
invalid_dry_run400The X-Dry-Run header is not true.Send X-Dry-Run: true or remove the header.
dry_run_required403A changing request from the documentation page without X-Dry-Run: true.From the documentation page only trial requests are possible; send real ones from your server.
ip_not_allowed403The request came from an address that is not on the key’s allowlist. clientIp in the answer is the address we see.Add that address to the key in the cabinet (“Change addresses”).
wrong_api_host403The key works on another API address (the apiBaseUrl field).Send requests to https://api.sendsms.to.
(no permission)403The key lacks the permission the method needs (see “Required permission” on the method page).Issue a key with that permission.
sender_not_approved403The name in from is not approved for your account, is suspended or expired.Take an approved name from GET /v1/senders or request a new one.
billing_suspended403Accepting new messages is suspended for now.Try later; if it lasts, contact support.
invalid_number400The recipient number is invalid.Pass the number in international format: country code and number, digits only (a + is allowed).
text_and_template_conflict400Both text and templateId were sent.Keep one of them.
invalid_template_id400templateId is not a UUID.Pass a template identifier from GET /v1/templates.
invalid_idempotency_key400The Idempotency-Key value is not accepted, or the header was sent empty.Pass your own key (a UUID or a short string without spaces), or do not send the header.
invalid_batch400The batch failed the check: more than 25 items, repeated keys or a wrong item.Fix the batch; give every item its own idempotencyKey.
invalid_balance_query400An unknown or repeated balance query parameter.Check include, limit, after against the reference.
insufficient_balance402Not enough funds or SMS credits to send.Top up in the cabinet, then send with a new Idempotency-Key.
insufficient_credit402Not enough available credit on a postpaid account.Ask for a higher limit; then use a new Idempotency-Key.
message_not_found404No message with this id in your account.Check the messageId from the 202 answer.
template_not_found404The template is not in your account.Take the id from GET /v1/templates.
sender_not_found404No sender name with this id in your account.Take the id from GET /v1/senders.
event_not_found404No scenario event with this id in your account.Check the eventId from the event answer.
idempotency_conflict409This Idempotency-Key was already used with another request body.A new send needs a new key; a repeat needs the same body.
idempotency_in_progress409The first request with this key is still being processed.Repeat after Retry-After with the same key and body.
payment_mode_changed409The account’s payment mode changed during the request; no message was created.Repeat the same request with the same key.
scenario_not_active409The scenario is paused.Switch the scenario on in the cabinet.
template_variables_missing422Template or scenario variables are not filled (the list is in missing).Pass every required variable in variables.
idempotency_key_reused422The event key was already used for another event.Use a new key for a new event.
pricing_unavailable422Sending is not set up for this destination.Contact support with the recipient’s country and operator.
balance_rate_limit429The balance is requested more often than once per 10 seconds.Wait Retry-After (10 s).
rate_limit_exceeded429The per-account requests-per-second limit is exceeded (or the batch does not fit into this second’s limit).Wait a second (Retry-After when present) and repeat.
balance_unavailable503The balance is temporarily unavailable.Repeat after Retry-After (10 s).
service_unavailable503A short maintenance window: the request was not accepted.Repeat the same request after Retry-After.

#Reading an error answer

  • Check the HTTP status and Content-Type before parsing JSON: an intermediate network node may return text or HTML.
  • error is a stable code where there is one; message is an explanation for people and its wording may change. Do not build logic on message text.
  • In 401 answers and the general 429 limit error keeps its former text (for compatibility); the machine code is in the code field: api_key_missing, api_key_invalid, rate_limit_exceeded.
  • On 429 and 503 wait (the Retry-After header, when present) and repeat the same request with the same Idempotency-Key.

Type to search