Safravo Logosafravo.com
SMS API

Errors and retries

Understand SMS API errors and build reliable retry handling.

The SMS API returns structured errors when a request cannot be accepted.

Authentication error

{
  "statusCode": 401,
  "error": "ProviderAuthenticationError",
  "code": "SMS_PROVIDER_AUTHENTICATION_FAILED",
  "message": "The messaging account credentials were rejected by the provider.",
  "providerCode": 1006
}

Check the API key and partner ID. Do not retry unchanged credentials indefinitely.

Common provider codes

CodeMeaningAction
200Successful requestContinue processing
1001Invalid sender IDUse an approved sender ID
1002Network not allowedCheck destination/network permissions
1003Invalid mobile numberValidate the recipient number
1004Insufficient creditsRecharge before retrying
1005Provider system errorRetry with backoff
1006Invalid credentialsCorrect credentials before retrying
1008No delivery reportTry again later or reconcile asynchronously
4090Internal provider errorRetry after five minutes
4091Partner ID missingSupply a valid partner ID
4092API key missingSupply a valid API key
4093Account details not foundVerify the account configuration

Retry policy

  • Retry transient 502, 503, and provider system errors with exponential backoff.
  • Do not automatically retry 401, invalid number, invalid sender, or insufficient-credit errors.
  • Use an application idempotency key or client reference to reconcile retries.
  • For bulk requests, retry only failed items rather than the entire batch.

Never log API keys, message contents containing sensitive information, or full provider payloads in production logs.

On this page