SSoftLinkSMSDocs

Errors

One error shape everywhere, a stable code for every case, and what to do about each.

Every error, from any endpoint, has the same shape:

{
  "error": {
    "code": "insufficient_balance",
    "message": "Insufficient balance: have 120, need 600 (cents)",
    "details": null
  }
}

Prop

Type

The HTTP status tells you the category; code tells you exactly what happened.

Validation errors

A request that fails validation returns 400. details maps each problem field to its messages, and code is the code of the first problem:

{
  "error": {
    "code": "required",
    "message": "This field is required.",
    "details": {
      "body": ["This field is required."],
      "recipients": ["Ensure this field has no more than 1000 elements."]
    }
  }
}

Problems that aren't tied to one field, such as invalid phone numbers or suppressed email addresses, appear under details.non_field_errors.

All codes

StatuscodeMeaningWhat to do
400required, blank, null, invalid, invalid_choice, max_length, min_length, max_value, min_valueA field is missing or invalid. See details.Fix the request. Don't retry as-is.
400message_too_longThe SMS needs more than 3 segments.Shorten it; see segments.
400invalid_idempotency_keyIdempotency-Key is empty or longer than 255 characters.Use a UUID.
400invalid_webhook_urlThe webhook URL isn't public https:// on port 443.Fix the URL.
400invalid_event_typeUnknown webhook event type.See Events.
401not_authenticatedNo API key was sent.Send X-Api-Key.
401authentication_failedThe key is malformed, unknown, revoked, or its account is inactive.Check the key.
402insufficient_balanceThe wallet can't cover the whole send. Nothing was sent.Top up, then retry.
403insufficient_scopeThe key lacks the scope this endpoint needs.Use a key with that scope.
403traffic_class_not_permittedThe account isn't approved for this traffic class. details.status says where the access request stands.See Sending access.
403permission_deniedNot allowed for another reason.Contact support.
404not_foundNo such resource on your account.Check the id.
405method_not_allowedWrong HTTP method for this path.Check the API reference.
409idempotency_in_progressA request with this Idempotency-Key is still running.Retry after a second.
422idempotency_key_reusedThis Idempotency-Key was used with a different body.Use a new key for a new request.
429throttledToo many requests.Wait Retry-After seconds. See Rate limits.
503pricing_unavailableWe can't price this destination right now. Nothing was charged.Retry later, or contact support.
5xx–Something went wrong on our side. The body may not be JSON.Retry with the same Idempotency-Key.

Which errors to retry

Retry

409, 429 (after Retry-After), 503, other 5xx, and timeouts or connection errors. Always send an Idempotency-Key so a retry can't send twice.

Don't retry

400, 401, 402, 403, 404, 422. The same request will fail the same way until you change something.

On this page