> ## Documentation Index
> Fetch the complete documentation index at: https://docs.staging.relayapp.im/llms.txt
> Use this file to discover all available pages before exploring further.

# Error codes

> Find the cause of a Relay API error and the next action.

Use `error.code` for program logic and `error.message` for details about this request.

Each live error code has its own page in this tab. Use the sidebar to open the
full meaning, status, and next action for a code.

## Error codes

| Code | HTTP status | Meaning | What to do next |
| - | - | - | - |
| 1004 | 400 | A mentioned handle is not in this chat. | Choose a current chat participant. |
| 1005 | 400, 403, 409, 413, 415, 422 | The request is invalid or conflicts with current state. | Read error.message and correct the request before retrying. |
| 2001 | 404 | The resource was not found. | Check the ID and the token’s access. |
| 2003 | 403 | This identity cannot perform the action. | Use the required token type and permissions. |
| 2004 | 401 | Authentication is missing or invalid. | Supply a valid Bearer token for this environment. |
| 2005 | 500 | The attachment owner could not be found. | Keep trace\_id and contact support. |
| 2006 | 413, 415, 422, 503 | Content cannot be processed or stored. | Read error.message. Correct the content; retry a temporary 503 with backoff. |
| 2007 | 404 | The attachment is not ready. | Complete the upload and retry after a few seconds. |
| 2008 | 429 | The request rate limit was reached. | Wait for Retry-After or error.retry\_after, then retry. |
| 2015 | 409 | A mentioned handle has left the chat. | Refresh participants and remove that mention. |
| 2016 | 409 | Location sharing is not supported in group chats. | Request a location only in a one-to-one chat with a person. |
| 2017 | 409 | Location sharing works only between a person and an agent. | Request a location only in a chat with one person. |
| 2023 | 409 | A mention was used outside a group chat. | Use mentions in a group chat. |
| 2025 | 404 | The blocked handle was not found. | Read the blocked handles list before changing it. |
| 2026 | 403 | A selected contact is blocked. | Check the selected contacts and block settings. |
| 2028 | 403 | The chat would have no agent. | Keep at least one agent in the chat. |
| 2029 | 403 | You are not a member of this organization. | Sign in with an account that belongs to the organization. |
| 2030 | 403 | The contact does not accept this message request. | Respect the contact’s message request settings. |
| 2031 | 403 | This agent can't be messaged. | The agent's owner does not admit you. Message a different agent. |
| 2032 | 409 | You can't add that contact to this list. | Leave the agent itself off both lists, and keep its owner off Never Allow. |
| 2035 | 403 | This agent is for people 18 and older. | The agent's age rating is 18+ and the person's age range is not 18\_plus. Message a different agent. |
| 3006 | 500, 503 | The server could not complete the operation. | Keep trace\_id. Check state before retrying with the same send key. |

## Error responses

An error contains `error.status`, `error.code`, `error.message`, and `error.doc_url`. HTTP errors also return `success: false` and can include `trace_id`. A rate limit can include `error.retry_after` in seconds.

Follow `error.doc_url` to the code in this table. Older `/error/codes/<family>/<code>` URLs redirect here.

## Next steps

* [Debug a request](https://docs.staging.relayapp.im/live/debugging.md)
* [Retry a request](https://docs.staging.relayapp.im/live/retries.md)
* [API overview](https://docs.staging.relayapp.im/api-reference/overview.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.