---
title: "Error handling"
description: "Read the error format and HTTP status codes of the custom integration API, with troubleshooting steps and the limits that apply."
---

# Error handling

> Read the error format and HTTP status codes of the custom integration API, with troubleshooting steps and the limits that apply.

All error responses follow this format:

```json
{
  "error_code": "string",
  "error_message": "string"
}
```

| HTTP status | Error code               | Description                                                                       |
| ----------- | ------------------------ | --------------------------------------------------------------------------------- |
| 400         | `invalid-payload`        | Invalid JSON, missing required fields, or a value outside the accepted set.        |
| 401         | `invalid-api-key`        | Missing or invalid API key.                                                       |
| 401         | `unauthorized`           | IP not in allowlist.                                                              |
| 404         | `session-not-found`      | Session does not exist, has expired, or does not belong to this integration.      |
| 410         | `integration-not-found`  | The integration has been deleted. Stop retrying and remove the stored credentials. |
| 500         | `internal-server-error`  | Server error.                                                                     |

`error_message` carries the specific reason for a `400`, for example `"channel_type" must be one of: chat, email, voice` or `A session cannot have more than 25 tags`.

---

## Troubleshooting

<details>
<summary>Webhook not receiving events</summary>

- Verify your `webhook_url` is publicly accessible over HTTPS.
- Check that your server returns a 2xx status code within a few seconds.
- Confirm `subscribed_events` includes the event types you expect, or leave it empty to receive all events.

</details>

<details>
<summary>401 Unauthorized on inbound API</summary>

- Verify the API key in your `Authorization` header matches the one generated in the Moveo dashboard.
- Use the format `Authorization: apikey YOUR_API_KEY` (note the `apikey` prefix).
- If you configured an IP allowlist, confirm your server's IP address is included.

</details>

<details>
<summary>404 Session not found</summary>

- Confirm the `session_id` matches the value returned from the [create session](https://docs.moveo.ai/api/custom-integration/custom-integration-sessions.md#create-session) endpoint.
- The session may have expired (default timeout: 24 hours). If so, [create a new session](https://docs.moveo.ai/api/custom-integration/custom-integration-sessions.md#create-session) and retry the request with the new `session_id`.
- Check that the session belongs to the same `integration_id` used in the request.

</details>

<details>
<summary>410 Integration not found</summary>

- The integration has been deleted in the Moveo dashboard. This is permanent, and a retry does not succeed.
- Stop the retry loop, discard the stored API key, and create a new integration if you still need the connection.

</details>

<details>
<summary>400 Invalid payload</summary>

- Verify the request body is valid JSON.
- For send message requests, ensure either `text` or `attachments` is provided.
- Check that required fields (like `filename` and `content_type` for file uploads) are present.
- For create session, `channel_type` must be `chat`, `email`, or `voice` if you send it at all.
- For the tag endpoints, `tags` must contain at least one non-empty value, and the session must not end up with more than 25 tags.

</details>

---

## Limitations

- **Session timeout**: sessions expire after the configured timeout (default: 24 hours).
- **Webhook timeout**: your webhook endpoint must respond within 8 seconds.
- **Webhook retries**: a delivery is attempted at most 3 times in total, unless all 3 attempts get a `429`. Only 408, 429, 500, 502, 503, and 504 responses are retried; timeouts are not. Backoff runs from 250 ms to 2 seconds, except for a `429` carrying a `Retry-After`, which Moveo honors up to 60 seconds. When all 3 attempts get a `429`, Moveo keeps retrying for up to 5 minutes. See [retry timing](https://docs.moveo.ai/api/custom-integration/custom-integration-webhook-security.md#retry-timing).
- **Message content**: messages must contain either text or attachments. Empty messages are rejected.
- **Text length**: Moveo keeps the first 1,500 characters of `input.text` and drops the rest. The
  API does not return an error for a longer text.
- **Messages per session**: while the AI agent handles a session, Moveo accepts up to 200 user
  messages. After that, the API returns `202 Accepted` but Moveo drops the message. The limit does
  not apply after a handover.
- **Request body**: a request to `/v1/custom/*` can be 10 MiB at most. A larger request gets
  `413 Request Entity Too Large`.
- **Context**: the context has no size limit of its own. It holds at most 25 tags and 250
  variables in each `channels` object, and a variable name has at most 128 characters. See
  [context object](https://docs.moveo.ai/api/custom-integration/custom-integration-sessions.md#context-object).
- **Handover**: after a handover, the AI agent stays silent until you give the session back with
  the Moveo REST API. See [after a handover](https://docs.moveo.ai/api/custom-integration/custom-integration-sessions.md#after-a-handover).
- **Tags**: a session carries at most 25 tags, each up to 48 characters after [normalization](https://docs.moveo.ai/api/custom-integration/custom-integration-sessions.md#tag-normalization).
