> For the complete documentation index, see [llms.txt](https://docs.distro.so/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.distro.so/developers/errors.md).

# API errors and safe retries

Inspect the HTTP status and error body before retrying a request.

| Status | Meaning and next step                                                                            |
| ------ | ------------------------------------------------------------------------------------------------ |
| 200    | Successful read or supported replay. Inspect the returned state.                                 |
| 201    | A new event, booking, link or artifact was accepted/created.                                     |
| 401    | Missing, expired or invalid authentication. Check the token.                                     |
| 403    | Missing scope or permission. Check the member, resource and workspace.                           |
| 404    | Resource unavailable, wrong workspace or feature unavailable. Do not silently switch workspaces. |
| 409    | Conflicting idempotency data. Compare the event/request with the original.                       |
| 422    | Invalid inputs, unsupported operation or state. Read the error before changing fields.           |
| 429    | Rate limit. Back off and inspect any retry guidance returned.                                    |
| 5xx    | Server or dependency failure. Preserve request identity and inspect state before a retry.        |

Error shapes vary between APIs. Workflow and scheduling-link APIs generally provide `error.code` and `error.message`; booking management can return `success: false`, `error`, `errors` or a supported management URL.

## Preserve request identity

Use the workflow Idempotency-Key header or the scheduling operation's body `idempotency_key`, as documented for that endpoint. Reuse it only for the same operation and unchanged data.

After a timeout, check the saved run, booking or destination record before creating a new request identity. An external write may have succeeded before the response was lost.

## Distinguish accepted from finished

A workflow accepted response is not a completed workflow. A scheduler offered is not a booked meeting. A successful enrollment is not email delivery.

Record the run/booking ID and timestamp so an admin can inspect the corresponding evidence in Distro Logs.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.distro.so/developers/errors.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `build a script that syncs our docs to a CMS` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
