Skip to main content

Errors

Every error uses the same JSON shape, with an HTTP status code to match:

{
"error": {
"code": "invalid_phone_number",
"message": "Invalid phone number(s): 12345. Use E.164 format, e.g. +254712345678.",
"status": 400
}
}
  • code is stable — use it in your code.
  • message is for humans and may change wording.

Error codes​

StatusCodeMeaningWhat to do
400invalid_requestBody is not JSON, a field is missing or has the wrong type, or a value is out of rangeFix the request; the message names the field
400invalid_phone_numberOne or more numbers are not validSend E.164 (+2547…) or a valid Kenyan format; the message lists up to 10 bad numbers
401invalid_api_keyKey missing, unknown, expired, revoked, or the organisation is disabledCheck the Authorization: Bearer … header and the key's status in Developer API
402insufficient_unitsNot enough SMS units for the whole requestBuy units in the app; nothing was sent
403scope_deniedThe key lacks the permission for this endpointUse a key with the right scope
403invalid_sender_idThe sender_id is not approved for your organisation, or you have noneUse an approved sender ID, or apply for one in the app
403sms_not_configuredSMS is not set up for your organisation yet (live keys)Buy SMS units in the app first
403module_unavailableSMS is not enabled for your accountContact your CloudMetis administrator
403forbiddenAccess deniedContact support if unexpected
404not_foundUnknown URL, or the message/batch doesn't exist in your organisationCheck the ID and URL
405method_not_allowedWrong HTTP method (e.g. GET on /send)Use the documented method
409idempotency_conflictIdempotency-Key reused with a different body, or the first request is still processingSee Idempotency
422all_recipients_opted_outEvery number has opted out of your messagesNothing to send
429rate_limit_exceededToo many requests for this keyWait for Retry-After seconds; see Rate limits
500server_errorSomething went wrong on our sideRetry with backoff; contact support if it persists
502send_failedThe SMS network or gateway rejected the requestRetry later; the message explains the cause

Retrying safely​

  • Don't retry 400, 401, 402, 403, 404, 405 or 422 without changing something — the same request will fail again.
  • Retry with backoff on 429, 500, 502 and network timeouts.
  • Send an Idempotency-Key with every POST /v1/sms/send, so a retry can never send the same SMS twice.