# HTTP Status Codes

HTTP-layer codes complement the application `code` inside the response envelope.

| Status | Meaning                                                                                                           |
| :----: | ----------------------------------------------------------------------------------------------------------------- |
|  `200` | Success. Check `code == "0"` in the envelope to confirm.                                                          |
|  `400` | Bad request — malformed parameters.                                                                               |
|  `404` | Resource not found.                                                                                               |
|  `409` | State conflict — e.g. the order has already filled or been canceled.                                              |
|  `422` | Business-rule rejection — e.g. insufficient margin, price out of band, leverage outside the bracket.              |
|  `429` | Rate limit exceeded (read endpoints; see [Rate Limits](broken://pages/49c2131114d7a6e2d5a7b134fd41559c8ec4c7ce)). |
|  `500` | Internal server error. Safe to retry with exponential backoff.                                                    |

## Worked Example

A `POST /v1/trade/orders` that fails margin check returns HTTP `422` and an envelope like:

```http
HTTP/1.1 422 Unprocessable Entity
Content-Type: application/json
X-RateLimit-Limit: 50
X-RateLimit-Remaining: 47
X-RateLimit-Reset: 1719500060000

{
  "code": "20003",
  "msg": "Insufficient margin",
  "data": null,
  "trace_code": "bb-12345-abcde"
}
```

> The HTTP status tells you the **category** (business-rule failure); the envelope `code` tells you the **specific reason** (look up `20003` in [Error Codes](file:///1548985/reference/error-code-index.md)).


---

# 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://docs.lynxtrade.world/conventions/http-status-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.
