ConceptsErrors

Concepts

Errors

One error shape for every call, with a code to branch on.

Error shape

Every error has the same shape. message is plain language you can show to a person; branch on code.

ErrorJSON
{
  "error": {
    "code": "conflict",
    "message": "chat is closed"
  }
}

Error codes

HTTP statuscodeMeaning
400validationThe request is malformed or a field is invalid. Unknown fields are refused too.
401unauthorizedNo token, or the token expired or was revoked.
402plan_limitThe organization reached a limit of its plan.
402subscription_lockedThe account is read-only for now.
403forbiddenThis caller may not do this.
404not_foundNot found, or not visible to this caller. A record in another organization is always not found.
409conflictThe state changed or a precondition failed.
413payload_too_largeOver the size limit.
429rate_limitedToo many requests. Wait the number of seconds in the Retry-After header.
500internalSomething failed on our side. Retry with backoff.
503unavailableThe service is briefly unavailable. Retry with backoff.

Retries

Retry 429 after the Retry-After seconds, and 500 or 503 with backoff. Don’t retry other 4xx answers unchanged: fix the request first. Each method’s page lists the errors it can answer.