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

# Errors

> The error body, and every error code: when it happens and how to fix it.

Every error response has this body. [Handling errors](/guides/errors) explains how to use it.

```json theme={"system"}
{
  "error": {
    "type": "invalid_request",
    "code": "order_below_minimum",
    "message": "A value of $10.00 buys 0.00011 BTC after rounding down to BTC's 0.00001 size step, which is worth $9.29 at the price limit of $84,430. The minimum is $10.00.",
    "param": "value",
    "hint": "Send a value of at least $10.14.",
    "details": { "value": "10.00", "value_after_rounding": "9.29", "min_value": "10.00", "smallest_passing_value": "10.14" },
    "errors": [],
    "retryable": false,
    "doc_url": "https://docs.tradingapi.dev/api-reference/errors#order_below_minimum"
  }
}
```

<ResponseField name="type" type="string" required>
  The kind of error, which sets the HTTP status: `invalid_request` (400), `authentication` (401), `permission` (403), `not_found` (404), `conflict` (409), `unprocessable` (422), `rate_limited` (429), `internal` (500), `unavailable` (503).
</ResponseField>

<ResponseField name="code" type="string" required>
  A stable identifier for the error, listed below. Branch on this. New codes may be added.
</ResponseField>

<ResponseField name="message" type="string" required>
  What was wrong, with the values involved.
</ResponseField>

<ResponseField name="param" type="string | null" required>
  The request field at fault, as a JSON path such as `metadata.reason`, or `null`.
</ResponseField>

<ResponseField name="hint" type="string | null" required>
  One concrete way to fix the request.
</ResponseField>

<ResponseField name="details" type="object" required>
  The values the message quotes, as fields. Each code below lists its fields.
</ResponseField>

<ResponseField name="errors" type="object[]" required>
  Every field error, each a full error object, when `code` is `invalid_fields`. Otherwise empty.
</ResponseField>

<ResponseField name="retryable" type="boolean" required>
  Whether the same request can succeed later, unchanged.
</ResponseField>

<ResponseField name="retry_after" type="string">
  When a retry can succeed, if known. Present only then.
</ResponseField>

<ResponseField name="doc_url" type="string" required>
  This code's entry on this page.
</ResponseField>

An error means nothing was recorded, except after `500` and `503`, where an order may have been recorded just before the failure. Retrying with the same `client_order_id` is safe in every case.

## Invalid request (400)

### invalid\_json

The body is not valid JSON, or not a JSON object. `details.position` is the byte offset of the problem, when known. Send a JSON object.

### invalid\_fields

More than one field is invalid. `errors` holds one error for each, with its own `code`, `param` and `hint`. Fix them all and send the request again.

### missing\_field

A required field is missing. `param` names it, and `hint` shows an example value.

### unknown\_field

The request has a field this endpoint doesn't take. When the name is close to a real field, `hint` suggests it: `amount`, `qty` and `quantity` suggest `value`; `symbol` suggests `market`. Remove the field or rename it.

### invalid\_value

A field's value is not allowed: the wrong type, format or enum value, a decimal with too many places, or a number out of range. `message` says what the field accepts. For example, `side` is `"buy"` or `"sell"`; `"long"` and `"short"` describe positions, not orders.

### not\_applicable

A field was sent that doesn't apply to this kind of request, such as `price` on a `market` order. Remove it, or change `type`.

### conflicting\_fields

Two fields were sent that can't be used together, such as both `value` and `percent` on a close. `details.fields` lists them. Send one.

### order\_below\_minimum

After rounding down to the market's size step, the order would be worth less than the \$10 minimum.

`details`: `value` (what you sent; `null` for a close by `percent`), `value_after_rounding`, `min_value`, and `smallest_passing_value`, the smallest `value` that would pass at the current price (absent for a close by `percent`). For a partial close, `hint` suggests closing the whole position, which is exempt.

### order\_above\_maximum

The order would be worth more than the market's `max_value`. `details`: `value`, `max_value`. Send a smaller `value`, or split the order.

### invalid\_expand

`expand[]` names something that can't be expanded here. `details.valid` lists what can.

### invalid\_cursor

`cursor` is not one this API returned for this list. Start again without `cursor`.

## Authentication (401)

### missing\_api\_key

No `Authorization` header, or not in the form `Bearer tapi_…`.

### invalid\_api\_key

The key is unknown or has been revoked. Create a new key on the account page.

## Permission (403)

These are the calling key's limits, set by the account owner on the account page. The API can't change them.

### key\_limits\_not\_set

The key was created before keys had limits, so it can't trade. Set its limits on the account page.

### key\_market\_not\_allowed

The key may not trade this market, and that includes closing positions in it. `details`: `market`, `allowed_markets`.

### key\_order\_limit\_exceeded

The order is larger than the key's maximum order. `details`: `value`, `max_order_value`. Send a smaller `value`.

### key\_daily\_limit\_exceeded

The order doesn't fit in what remains of the key's 24-hour limit. `details`: `limit`, `used`, `remaining`, and `next_release` (`at`, `value`), when the oldest order in the window leaves it and how much that frees.

`retryable` is `true`, and `retry_after` is set, when waiting would make room for this order. Reduce-only orders and closes don't count against this limit, so the key can always get out of positions.

## Not found (404)

### market\_not\_found

No market has this symbol. `details.suggestions` lists the closest matches (`symbol`, `name`), and `hint` names the best one. Orders need the exact symbol. Search with `GET /v1/markets?q=`.

### order\_not\_found

You have no order with this ID. From `GET /v1/orders/by-client-id/{client_order_id}`, it means no order was recorded under that `client_order_id`, so nothing traded, and sending the original request again is safe.

### position\_not\_found

You have no position in this market.

### route\_not\_found

No endpoint has this method and path. Check the path in this reference.

## Conflict (409)

### client\_order\_id\_reused

The `client_order_id` already names a different order. `details`: `order_id` (the existing order), `differs` (the fields that differ). If you are retrying, send the original body unchanged. If this is a new order, use a new `client_order_id`.

### account\_not\_active

Trading has not been activated for this account. Activate it on the account page.

### trading\_approval\_expired

The account's trading activation has ended. Renew it on the account page. `GET /v1/account` shows when it ends, in `trading.valid_until`.

## Unprocessable (422)

The request is valid, but can't be carried out given your account or the market right now.

### insufficient\_balance

Your available balance doesn't cover the order and its estimated fee. `details`: `required`, `available`, and `max_value`, the largest `value` that fits. Send a smaller `value`, or deposit more.

### no\_position

The order is `reduce_only`, or a close, and you have no position in this market.

### reduce\_only\_would\_increase

The order is `reduce_only`, but it is in the same direction as your position, so it would increase it. To reduce a long, sell; to reduce a short, buy.

### market\_reduce\_only

The market accepts only orders that reduce a position right now. Set `reduce_only: true`, or close the position.

### market\_halted

The market is not accepting orders right now. `GET /v1/markets/{symbol}` shows its `status`.

## Rate limited (429)

### rate\_limited

The key made too many requests at once. Each key may make 10 requests at once, then 5 a second. `retryable` is `true`, and `retry_after` says when to try again (the `Retry-After` header says the same, in seconds).

## Server (500, 503)

### unavailable

A service we depend on, such as the exchange, failed or didn't answer in time. `retryable` is `true`. Retry the same request with the same `client_order_id`, after a short wait. An order may already have been recorded, and the retry returns it rather than placing another.

### internal\_error

Something failed on our side. Retry the same request with the same `client_order_id`, after a short wait.

## Order status reasons

When an order is recorded but doesn't fill, it isn't an error. The order comes back with `status: "canceled"` or `"rejected"`, and a `status_reason` with its own codes. See [Why an order was canceled or rejected](/concepts/orders#why-an-order-was-canceled-or-rejected).
