# Error codes

### Pacifica API Response Codes (REST API)

| 400 | Bad Request                             |
| --- | --------------------------------------- |
| 403 | Forbidden: restricted region            |
| 404 | Not Found                               |
| 409 | Conflict                                |
| 422 | Business Logic Error - See below        |
| 429 | Too Many Requests - Rate limit exceeded |
| 500 | Internal Server Error                   |
| 503 | Service Unavailable                     |
| 504 | Gateway Timeout                         |

### Business Logic Errors (Code 422)

| 0  | UNKNOWN                         |
| -- | ------------------------------- |
| 1  | ACCOUNT\_NOT\_FOUND             |
| 2  | BOOK\_NOT\_FOUND                |
| 3  | INVALID\_TICK\_LEVEL            |
| 4  | INSUFFICIENT\_BALANCE           |
| 5  | ORDER\_NOT\_FOUND               |
| 6  | OVER\_WITHDRAWAL                |
| 7  | INVALID\_LEVERAGE               |
| 8  | CANNOT\_UPDATE\_MARGIN          |
| 9  | POSITION\_NOT\_FOUND            |
| 10 | POSITION\_TPSL\_LIMIT\_EXCEEDED |

### WebSocket Error Codes

| 200 | SUCCESS\_CODE               |
| --- | --------------------------- |
| 400 | INVALID\_REQUEST\_CODE      |
| 401 | INVALID\_SIGNATURE\_CODE    |
| 402 | INVALID\_SIGNER\_CODE       |
| 403 | UNAUTHORIZED\_REQUEST\_CODE |
| 420 | ENGINE\_ERROR\_CODE         |
| 429 | RATE\_LIMIT\_EXCEEDED\_CODE |
| 500 | UNKNOWN\_ERROR\_CODE        |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://pacifica.gitbook.io/docs/api-documentation/api/error-codes.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
