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

# Errors

> The error object every failed call answers with, its five types and every error code.

Every answer that is not a 2xx carries the same JSON object. `error.type` follows from the HTTP status. `error.code` is stable and meant for your code. `error.message` is for people and can change. `error.param` names the parameter when the error is about one, and is `null` otherwise. `error.doc_url` opens the code on this page. Quote `request_id` (also the `X-Request-ID` header) when you ask us about a request.

```json theme={null}
{
  "error": {
    "type": "invalid_request_error",
    "code": "parameter_invalid",
    "message": "limit must be an integer between 1 and 200",
    "param": "limit",
    "doc_url": "https://insightchain.ai/docs/errors#parameter_invalid"
  },
  "request_id": "9f3c2b1e-..."
}
```

## Types

| Type | Status | Meaning |
| - | - | - |
| `invalid_request_error` | 400, 404, 405, 409, 413, 415, 422 | The request cannot be carried out as sent. Change it before sending it again. |
| `authentication_error` | 401 | The API key is missing or was not accepted. |
| `permission_error` | 403 | The key, or the organization, may not do this. |
| `rate_limit_error` | 429 | A limit is used up. `Retry-After` says when to send the request again. |
| `api_error` | 500, 502, 503, 504 | Something failed on our side, or in a service the route depends on. |

## Codes any route can answer

By type, with the HTTP status of each.

### Invalid request

#### request\_invalid

Status `400`. The request is not valid; the message says why.

#### parameter\_invalid

Status `400`. A parameter has a value the route does not accept; `param` names it.

#### parameter\_missing

Status `400`. A required parameter is absent; `param` names it.

#### parameter\_unknown

Status `400`. The route does not take this query parameter; `param` names it.

#### body\_invalid

Status `400`. The body is not the JSON object the route expects.

#### cursor\_invalid

Status `400`. The cursor is malformed, or was issued for another route or other filters.

#### idempotency\_key\_invalid

Status `400`. `Idempotency-Key` must be 1 to 128 visible ASCII characters.

#### not\_found

Status `404`. No such resource in your organization.

#### route\_not\_found

Status `404`. No such route.

#### method\_not\_allowed

Status `405`. The route does not take this method; `Allow` lists the ones it takes.

#### conflict

Status `409`. The request conflicts with the resource's current state.

#### idempotency\_key\_in\_use

Status `409`. A request with this `Idempotency-Key` is still running; retry after `Retry-After`.

#### payload\_too\_large

Status `413`. The body, or the data the request would read, is larger than the route allows.

#### unsupported\_media\_type

Status `415`. The `Content-Type` is not one the route reads.

#### unprocessable

Status `422`. The request is well formed but cannot be carried out as sent.

#### idempotency\_key\_reused

Status `422`. This `Idempotency-Key` was already used with a different request.

### Authentication

#### credentials\_missing

Status `401`. No `Authorization` header. Send `Authorization: Bearer <key>`.

#### api\_key\_invalid

Status `401`. The API key is unknown or inactive.

#### api\_key\_expired

Status `401`. The API key is past its `expires_at`. Mint or rotate a key.

#### unauthenticated

Status `401`. The credentials were not accepted.

### Permission

#### scope\_missing

Status `403`. The API key lacks the scope this route needs.

#### module\_not\_enabled

Status `403`. The organization does not have the module this route belongs to.

#### org\_suspended

Status `403`. The organization is suspended.

#### forbidden

Status `403`. The caller may not do this.

### Limits

#### rate\_limit\_exceeded

Status `429`. Too many requests in the current window; retry after `Retry-After`.

#### daily\_quota\_exceeded

Status `429`. The API key's daily quota is used up; it resets at 00:00 UTC (`Retry-After`).

#### model\_budget\_exceeded

Status `429`. The organization's daily budget for routes that use AI is used up; it resets at 00:00 UTC.

### Our side

#### internal\_error

Status `500`. Something failed on our side. Quote `request_id`.

#### upstream\_error

Status `502`. A service this route depends on failed.

#### service\_unavailable

Status `503`. The route is not available right now.

#### timeout

Status `504`. The route did not finish in time.

## Codes of one area

A route answers one of these for a failure only it has. The HTTP status and `error.type` still say what kind of failure it is.

### Orders and approvals

#### compliance\_blocked

The current compliance verdict blocks this cross-border order.

#### compliance\_unknown

There is no usable compliance verdict for this order, and your organization holds back an order whose verdict is unknown.

#### compliance\_withheld

Status `409`. The movement was not proposed: the compliance check every proposed movement passes held it back. The answer's `compliance` field says why.

#### key\_without\_creator

The API key has no creator on record, so it cannot act as a person. Key management, starting a sync and decisions on orders answer this (403).

#### key\_creator\_left

The API key's creator is no longer a member of the organization.

#### not\_org\_admin

The caller (for a key, its creator) must be an organization admin.

#### above\_maximum

The quantity is above the most the recommendation allows.

#### below\_minimum\_order

The quantity is below the supplier's minimum order.

#### not\_a\_multiple

The quantity is not a multiple of the order's pack size.

#### invalid\_quantity

The quantity must be above 0, with at most three decimals.

#### invalid\_reason

A changed quantity needs a reason of 3 to 500 characters.

#### not\_editable

The quantity of this kind of recommendation or order cannot be changed.

### Connections

#### sync\_in\_progress

A sync of this connection is already running.

#### pull\_not\_enabled

This connection does not pull from the source system.

#### disconnected

The connection is disconnected.

#### rate\_limited

Too many of this action in the current window. Starting a sync of a connection answers this (429), with `Retry-After`. The per-minute limit of every route is [`rate_limit_exceeded`](#rate_limit_exceeded).

### Compliance and recalls

#### attribute\_not\_found

Status `404`. The item has no such attribute to confirm.

#### certificate\_not\_found

Status `404`. No such certificate in your organization.

#### invalid\_stored\_value

Status `409`. The stored value is not valid; set it again.

#### value\_changed

Status `409`. The stored value differs from the one you sent; read it again.

#### concurrent\_change

Status `409`. The record changed while the request ran; read it again.

#### too\_many\_certificates

Status `409`. The item already holds the most active certificates it can.

#### duplicate\_certificate

Status `409`. The item already has an active certificate of this kind and number.

#### too\_many\_entries

Status `400`. The request holds more entries than one call may carry.

#### body\_too\_large

The body is larger than the route allows. Compliance checks answer this (413). Other routes answer [`payload_too_large`](#payload_too_large).

#### key\_has\_no\_creator

Status `403`. The API key has no creator on record, so it cannot change data as a person.

#### no\_person

Status `403`. The change needs a signed-in user or an API key with a creator.

#### not\_a\_member

Status `403`. The caller (for a key, its creator) is not a member of the organization.

#### bad\_request

Status `400`. The body is not what the route expects.

#### not\_configured

Status `503`. The feature is not available.

#### daily\_cap

Status `429`. The organization has used today's allowance of this action; it resets at 00:00 UTC. `Retry-After` says when the allowance resets.

#### model\_timeout

Status `502`. The answer did not arrive in time; nothing was stored.

#### model\_failed

Status `502`. No answer could be produced; nothing was stored.

#### invalid\_output

Status `502`. The answer did not fit the expected form; nothing was stored.

#### item\_not\_found

No item with this external id in your organization.

#### withheld\_not\_found

Status `404`. No such withheld movement.

#### match\_not\_found

Not an HTTP status: the code inside a failed tool result. No such recall match. Over HTTP a recall match that does not exist answers [`not_found`](#not_found).

#### match\_decided

Status `409`. The recall match already has a decision: a second opinion is given only while a match waits for one.

#### not\_offered

Status `409`. A second opinion is not offered for this match.

#### duplicate\_entry

Not an HTTP status: the code of one rejected entry inside a `200` answer. The same item and attribute appear twice in the request. Only the first of the two is applied.

### Forecast checks

A forecast check answers 200 and judges each row on its own: a row it could not check carries one of the first four codes in its own `error.code`.

#### unknown\_item

No item with this external id.

#### unknown\_location

No location with this external id.

#### period\_in\_past

The period starts before today.

#### period\_beyond\_horizon

The period ends beyond the forecast horizon.

#### read\_limit

The request would read more rows than the route allows.

### Inventory actions

#### location\_not\_found

Status `404`. No location with this external id.

#### to\_location\_not\_found

Status `404`. No destination location with this external id.

### Keys, sandbox and webhooks

#### scope\_not\_held

A key cannot put a scope on a key, or rotate a key that holds one, unless it holds that scope itself.

#### not\_an\_api\_key

This is an app connection, not an API key: it has no secret to rotate and its permissions change by reconnecting.

#### environment\_mismatch

A test key manages test keys and a live key live keys.

#### sandbox\_missing

The organization has no sandbox yet.

#### sandbox\_exists

The organization already has a sandbox.

#### sandbox\_of\_sandbox

A sandbox cannot have a sandbox of its own.

#### session\_required

This route needs a signed-in person, not an API key.

#### delivery\_pending

The delivery is still being retried on its schedule.

#### delivery\_cancelled

The delivery was cancelled before it was sent; it cannot be redelivered.

#### endpoint\_inactive

The webhook endpoint is switched off.

### Other

#### invalid\_input

The input is not valid; the message says why.

#### org\_too\_large

The organization holds more rows than this route reads on request.

#### recommendation\_not\_found

Not an HTTP status: the code inside a failed tool result. No such recommendation. Over HTTP a recommendation that does not exist answers [`not_found`](#not_found).

#### target\_not\_found

Status `404`. No target with this id in your organization.

### MCP tool results

These are not HTTP answers: they appear as the error object inside a failed tool result of the [MCP server](/docs/agents.md).

#### unknown\_tool

No such tool.

#### not\_entitled

The organization does not have the module this tool belongs to. Over HTTP the same refusal is [`module_not_enabled`](#module_not_enabled).

#### insufficient\_scope

The API key lacks the scope this tool needs. Over HTTP the same refusal is [`scope_missing`](#scope_missing).

#### tool\_failed

The tool failed on our side. Quote the request id.


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