Docs API v1.4
Dashboard

Errors

Docs API uses conventional HTTP status codes to indicate the outcome of a request. Codes in the 2xx range mean success, 4xx codes signal a problem with the request, and 5xx codes indicate a rare error on our side.

The error object #

Every failed request returns a JSON body with an error object. The type field groups errors into broad categories, while code identifies the specific problem.

400 · JSON
{
  "error": {
    "type": "invalid_request_error",
    "code": "parameter_missing",
    "message": "Missing required parameter: name.",
    "param": "name",
    "request_id": "req_Hd92kLpQ7m"
  }
}

HTTP status codes #

StatusMeaning
200OK — the request succeeded.
201Created — a new object was created.
400Bad Request — the request was malformed or missing a parameter.
401Unauthorized — no valid API key was provided.
403Forbidden — the key lacks permission for this resource.
404Not Found — the requested resource does not exist.
409Conflict — the request conflicts with the current state.
429Too Many Requests — you have hit the rate limit.
500Server Error — something went wrong on our end.

Error codes #

CodeTypeDescription
parameter_missinginvalid_request_errorA required parameter was not supplied.
parameter_invalidinvalid_request_errorA parameter had the wrong type or value.
resource_missinginvalid_request_errorNo object exists with the given ID.
authentication_failedauthentication_errorThe API key is missing, malformed, or revoked.
permission_deniedpermission_errorThe key is valid but lacks the required scope.
idempotency_conflictidempotency_errorAn idempotency key was reused with a different body.
rate_limit_exceededrate_limit_errorToo many requests in a short window.
api_errorapi_errorAn unexpected error occurred on our side.

Handling errors #

Inspect the status code first, then branch on error.code for specific handling. The official libraries raise typed exceptions you can catch directly.

try {
  await client.resources.create({ name: "" });
} catch (err) {
  if (err.code === "parameter_missing") {
    console.error(`Missing: ${err.param}`);
  }
}
from Docs API import InvalidRequestError

try:
    client.resources.create(name="")
except InvalidRequestError as err:
    if err.code == "parameter_missing":
        print(f"Missing: {err.param}")

Rate limits & retries #

The API allows up to 100 requests per second per key. When you exceed it, you receive a 429 with a Retry-After header. Retry 429 and 5xx responses with exponential backoff, and attach an Idempotency-Key to writes so retries never duplicate work.

Never retry a 4xx error other than 429 without changing the request — the result will be the same. Log the request_id from the error body so support can trace any issue quickly.