Errors

The error body, what retryable means, and every code

A refused request gets a 4xx or 5xx status and the same JSON body every time. Usually nothing was sent; details.messageId and details.sentParts say when something was.

The error body

403 Forbidden
{
  "error": {
    "code": "recipient_not_allowed",
    "message": "This person opted out of your messages.",
    "details": { "reason": "opted_out" },
    "requestId": "0192c4e1-…",
    "docUrl": "https://docs.mapier.ai/convo/api/errors#recipient_not_allowed.opted_out",
    "retryable": false
  }
}
FieldMeans
codeWhat went wrong, the value to switch on
details.reasonWhich case of that code, from a fixed list per code
details on a 422A list: each field at fault, with path, message and sometimes reason
details.retryAfterSeconds to wait, when known
details.messageIdA message that may have gone out: read its result, don't resend
details.sentPartsParts of a split message already sent
Other details fieldsSome codes add their own, listed on the code's page
messageA sentence for people, never for parsing
requestIdGive this to support
docUrlThis code's row on this page, at the reason when there is one
retryabletrue when the same request can succeed later

When retryable is true

Only six cases are retryable. Every other refusal needs a fix first.

  • 429 rate_limited, and 503 service_busy.
  • 503 line_unavailable with reason transport_down: the line's connection to the channel is down for now.
  • 503 upstream_unavailable when nothing reached the channel.
  • 409 conflict with reason idempotency_key_in_flight, and with reason card_update_in_flight once the card's last send has finished.

Retries says which Idempotency-Key to send in each case.

Every code

This table lists every code, and whether retryable can be true.

StatusCodeMeansretryable
400bad_requestThe request could not be read, or a header it needs is missingNo
401invalid_credentialsThe key or token is missing, unknown, revoked or expiredNo
403channel_not_entitledThis channel is not turned on for your projectNo
403forbiddenThe key or token may not make this call hereNo
403insufficient_scopeThe key or token lacks the scope for this callNo
403line_not_allowedThe line does not belong to this projectNo
403recipient_not_allowedYou may not send this to this person nowNo
404not_foundNothing exists at that idNo
404unsupported_commandThis channel or line cannot do that, or the name is retiredNo
409conflictThe request clashes with an earlier one, or with the current stateOnly idempotency_key_in_flight and card_update_in_flight
409conversation_closedYour line can no longer send into this groupNo
409limit_reachedA test line's daily cap, your paid lines, or another count is reachedNo
409project_archivedThe project is archivedNo
413payload_too_largeThe request body is over 64 KiBNo
422validation_failedA field is missing or wrongNo
429rate_limitedToo many requestsYes
500internal_errorMapier failed on its sideNo
503capacity_exhaustedEvery line is full for new peopleNo
503line_unavailableThe line cannot send right nowOnly transport_down
503no_lineYour project has no active line on that channelNo
503service_busyMapier is busy and did nothingYes
503upstream_unavailableThe channel did not answerOnly before anything was sent

Older API versions use other words for some codes and reasons: see Older versions.

Next