---
title: "Same API, standard envelope"
method: GET
path: "/api/bot/v2/{endpoint}"
tags: ["Paper trading"]
---

# Same API, standard envelope

`GET /api/bot/v2/{endpoint}`

## Request

- Base URL: `https://marginpad.io`
- URL: `https://marginpad.io/api/bot/v2/{endpoint}`
- Auth: API key in header `X-API-Key`

Every /api/bot/v1/* path has a /v2 twin: identical parameters and identical data, wrapped as {ok:true,data,ts} or {ok:false,error:{code,message},ts}. v1 response bodies are frozen and will not change; new work happens on v2. Swap v1 for v2 in the URL. There is also a WebSocket that OpenAPI cannot describe: wss://marginpad.io/api/bot/v2/stream?api_key=... pushes position opened/updated/closed events and mark prices, which replaces polling /positions entirely.

## Path parameters

- `endpoint` string, required

## Response `200`

ok

- Envelope
  - `ok` boolean, required
  - `data` unknown
  - `error` ApiError: code is a stable identifier you can branch on; message is prose and may be reworded.
    - `code` string, required
    - `message` string, required
    - `symbol` string
    - `live` number: On sl_wrong_side / tp_wrong_side: the live price, so a caller can correct and retry.
    - `limit` unknown
    - `max` integer
  - `ts` integer, required: Server unix ms

---

[API](https://skmtc.dev/marginpad/apis/marginpad-free-crypto-api.md) · [All operations](https://skmtc.dev/marginpad/apis/marginpad-free-crypto-api/llms.txt) · [OpenAPI document](https://skmtc.dev/marginpad/apis/marginpad-free-crypto-api/revisions/27d21fcd0bf0?raw)
