Reference

Errors

Every code the API and MCP server return, what it means, and how to fix it. Only three are worth retrying.

400 Bad request

401 Unauthenticated

402 Plan

403 Not allowed

404 Not found

409 Conflict

410 Gone

412 Changed

413 Too large

422 Not ready

429 Slow down

503 Unavailable

The error body

Errors from the REST API come back in this shape. The status comes from the code, so a code always carries the same status.

403 Forbidden
{
  "error": {
    "code": "permission_denied",
    "message": "This credential cannot perform that action.",
    "request_id": "req_8Kd2x91",
    "retryable": false,
    "details": {}
  }
}
  • Branch on code, not message. The code is a stable value; the message is written for a person reading a log.
  • Quote request_id, or the x-request-id response header, when you ask about one request.
  • retryable can be true only for rate_limited, provider_unavailable and temporarily_unavailable. Anything else needs something to change first: the request, the account or the resource.
  • details adds context on some codes, such as fields on invalid_request and reason_codes on policy_denied. It is an empty object when there is none.

Over MCP

The MCP server sits behind OAuth. A request without a valid access token is refused by the OAuth layer with a 401 and WWW-Authenticate; an unknown or expired token also gets an invalid_token body. Past that, the server answers with the body above when it refuses a call itself, such as a rate limit or a tool the connection can’t use. When a tool runs and fails, its result is marked isError: true and carries only a message, as text.

Codes with no page

The contract declares three more codes that nothing returns: daily_limit_exceeded, source_unavailable and send_already_submitting. The daily recipient limit is real; it answers policy_denied.

View as Markdown

Search docs