Ricky logorickyDocs

Errors

The shape of error responses and the code catalog.

Every response with a non-2xx status has the same body:

400 Bad Request
{
  "error": {
    "code": "invalid_input",
    "message": "primary_email: Invalid email address",
    "param": "primary_email",
    "request_id": "7c1e9a3b-5d2f-4e8a-b6c0-1f3d5a7b9e2c"
  }
}
FieldDescription
codeStable, machine-readable code. Base your logic on it.
messageExplanation for people. It may change: do not parse it.
paramThe field or parameter that caused the error, when known: phone, template.components.0.parameters.0.text, cursor, Idempotency-Key. It may be absent.
request_idRequest identifier. It also arrives in the X-Request-Id header.

Every response, successful or not, includes X-Request-Id. Keep it in your logs and include it when you contact support.

Codes

The table is generated from the API contract. Each reference page lists the codes that operation can answer.

CodeHTTPMeaning
invalid_input400A parameter or body field is invalid; param names it when known.
invalid_json400The body is not valid JSON.
missing_idempotency_key400A write without an Idempotency-Key header of 8 to 200 characters.
unauthorized401The Authorization header is missing, malformed, expired or revoked.
insufficient_scope403The key lacks the scope this operation requires.
forbidden403The organization does not allow the operation.
not_found404The resource does not exist in this organization.
conflict409The resource changed in a way that prevents the operation.
idempotency_conflict409The Idempotency-Key was used for a different request.
request_processing409A request with this Idempotency-Key is still processing or ended in an unknown state.
body_too_large413The JSON body exceeds 64 KiB.
unsupported_media_type415The body must be application/json.
outside_messaging_window422The channel only allows free-form text inside its reply window; send a template.
rule_violation422The request breaks a business rule; message says which.
rate_limited429More than 120 requests this minute with this key; see Retry-After.
internal_error500Ricky failed. Retry a read. Before retrying a write, read the resource: the same Idempotency-Key answers request_processing.
upstream_error502The messaging provider failed. Retry later.
unavailable503A dependency is temporarily unavailable. Retry later.

Handling them

  • Decide by code. If you receive a code you do not know, decide by the HTTP status.
  • A 4xx means a problem with the request. Do not repeat it unchanged, except 409 request_processing and 429 rate_limited.
  • A 5xx means Ricky or the provider failed. Before repeating a write, read Idempotency, rate limits and retries.
  • Validation stops at the first problem. After you fix one field, another one may fail.

On this page