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

# Errors

Every response uses the same envelope. On success `data` carries the result; on
failure it is absent and `message` explains why.

```json theme={null}
{ "code": 400, "message": "invalid chain id" }
```

## Status codes

| Status | Meaning | What to do |
| - | - | - |
| `200` | Success | Check `data` is not `null` before using it |
| `400` | The request was rejected | Fix the request, do not retry unchanged |
| `429` | Rate limited | Back off and retry |
| `500` | The service failed | Retry with backoff |

## Request validation

A quote request missing fields returns every problem at once, semicolon separated,
rather than failing on the first one:

```sh theme={null}
curl -X POST https://api.uatu.dev/quotes/routes \
  -H "Authorization: Bearer ${UATU_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{"originChainId":1,"destinationChainId":1}'
```

```json theme={null}
{
  "code": 400,
  "message": "amount: is required; recipientAddress: is required; tokenIn: is required; tokenOut: is required"
}
```

`POST /quotes/routes` requires matching `originChainId` and `destinationChainId`.
Its API reference documents a `400` response for invalid requests or when no
acceptable same-chain quote is available.

## A 200 can still carry nothing

<Warning>
  An unknown `chainId` on `/blockchains/pools` returns **`200` with `data: null`**,
  not a `404`. Null-check every `data` before iterating, or you will crash on a
  request that technically succeeded.
</Warning>

```sh theme={null}
curl "https://api.uatu.dev/blockchains/pools?chainId=999999"
```

```json theme={null}
{ "code": 200, "message": "Pools fetched successfully", "data": null }
```

Omitting `chainId` entirely is a different case and does fail properly:

```json theme={null}
{ "code": 400, "message": "invalid chain id" }
```

## Failures that are not HTTP errors

* **The swap reverts.** `amountOutMinimum` is enforced on-chain, so a market that
  moved between quoting and broadcasting reverts the transaction rather than filling
  at a worse price. Re-quote and retry.


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