> For the complete documentation index, see [llms.txt](https://rwaperp-1.gitbook.io/rwaperp-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://rwaperp-1.gitbook.io/rwaperp-docs/rwa-perp-b2b-api/rest-api.md).

# REST API

Request conventions, trading, and withdrawals.

## REST API overview

Use the REST API for market data, account queries, order management, and withdrawals.

### Request and response conventions

Most REST responses use the following JSON envelope. Clients should still inspect the HTTP status and `Content-Type`, because some error responses may be returned as plain text.

**Success**

```json
{"success": true, "data": {}, "timestamp": 1781628474510}
```

Some endpoints use `ts` instead of `timestamp`:

```json
{"success": true, "data": {}, "ts": 1781628475491}
```

**Failure**

```json
{"success": false, "code": -1002, "message": "Error description"}
```

| Field              | Description                              |
| ------------------ | ---------------------------------------- |
| `success`          | Whether the business operation succeeded |
| `data`             | Payload; usually omitted on failure      |
| `code` / `message` | Error code and description on failure    |
| `timestamp` / `ts` | Server time in milliseconds              |

#### Request construction

| Method          | Request                                          | Signed path includes            |
| --------------- | ------------------------------------------------ | ------------------------------- |
| GET / DELETE    | URL **query** (`?symbol=...&status=NEW`)         | The query string                |
| POST / PUT      | **JSON body** (`Content-Type: application/json`) | The body string exactly as sent |
| Path parameters | Substitute `{symbol}`, `{order_id}`, etc.        | The expanded path               |

Private endpoints additionally carry `RWA-*` headers; see Request signing for the rules. **The POST body must be byte-for-byte identical to what was signed.**

#### Response `data` shapes

Common `data` shapes include:

| Shape             | Structure                                                 | Typical endpoints                                                      |
| ----------------- | --------------------------------------------------------- | ---------------------------------------------------------------------- |
| **Single object** | `{ field: value, ... }`                                   | `GET /v1/public/futures/{symbol}`, `GET /v1/client/info`               |
| **List**          | `{ "rows": [ ... ] }`                                     | `GET /v1/public/info`, `GET /v1/positions`                             |
| **Paged list**    | `{ "rows": [ ... ], "meta": { ... } }` or `"next_cursor"` | `GET /v1/orders`, `GET /v1/trades`, order queries under `public/query` |

Use the REST API reference for endpoint-specific parameters, request bodies, response fields, authentication requirements, and rate limits. For the primary trading operations, see the trading workflow.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://rwaperp-1.gitbook.io/rwaperp-docs/rwa-perp-b2b-api/rest-api.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
