# CrossTrade API — Complete Reference for AI Agents
Generated from the live OpenAPI spec. This file describes the
CrossTrade REST API surface as published at app.crosstrade.io.

---

## Base URL

All endpoints are rooted at `https://app.crosstrade.io`.

Note: the path prefix is `/v1/api/...` — there is **no** `/api/...` route.
Guesses like `/api/order` or `/api/orders` are not handled by this app and will produce an unrelated response from the marketing site (e.g. a redirect). Always use the `/v1/api/...` prefix; if you guess wrong under `/v1/api/...` you will get a structured 404 with `did_you_mean`.

## MCP server

**Subscription:** open beta access is enabled for authenticated users, including trial accounts. If open beta is later disabled, MCP access returns to the Elite tier. The REST API and SDKs remain available on the Pro tier.

AI clients should prefer the Model Context Protocol endpoint over REST when the user has MCP access:

- Endpoint: `https://app.crosstrade.io/v1/api/mcp` (Streamable HTTP transport)
- Server card: https://app.crosstrade.io/.well-known/mcp/server-card.json
- OAuth metadata: https://app.crosstrade.io/.well-known/oauth-protected-resource
- Auth server metadata: https://app.crosstrade.io/.well-known/oauth-authorization-server
- Manage tokens / view consent grants: https://app.crosstrade.io/user/my-account?tab=ai-clients

The MCP surface is a **superset** of the REST surface below. Every REST endpoint is exposed as an MCP tool of the same name (PascalCase). Additionally, MCP clients have access to NinjaScript compile/deploy, backtest, replay, indicator queries, drawings, workspaces, and alerts — none of which are reachable via REST or WebSocket.

Two scopes are issued: `mcp:read` (read-only data) and `mcp:trade` (full trading). MCP clients support OAuth 2.1 with PKCE and dynamic client registration (RFC 7591), so a one-line config like:

```
{
  "mcpServers": {
    "crosstrade": {
      "url": "https://app.crosstrade.io/v1/api/mcp"
    }
  }
}
```

…is enough for Claude Desktop, Claude Code, Cursor, etc. to discover the auth metadata, register, prompt the user for consent, and start calling tools.

## Authentication

Every request must carry a Bearer token:

```
Authorization: Bearer <token>
```

Tokens are issued from https://app.crosstrade.io/user/my-account
and require an active Pro subscription.

## Rate limits

- 180 requests / minute per user, shared across HTTP and WebSocket.
- 20-request burst allowance on top of that.
- Per-endpoint egress caps apply to bulk endpoints (bars, executions).

## Response shape

Every successful response carries `"success": true`. Errors carry
`"success": false` plus an `"error"` string (machine-readable code) and
an optional `"detail"` (human-readable). Some endpoints add `"warning"`
for non-fatal edge cases (e.g. flatten with no positions).

```json
{"success": true, "data": ...}
{"success": false, "error": "invalid_account", "detail": "Account Sim999 not found"}
```

## Instrument format

Wherever an `instrument` parameter is accepted, all of these resolve:

- `"ES 03-26"` — full dated form (always works)
- `"ES"` — root symbol, resolves to current front month
- `"ES1!"` — TradingView continuous format
- `"ESH26"` — CME code format

## Common gotchas

- Endpoints are **PascalCase RPC names** mapped to **REST paths**: `PlaceOrder` → `POST /v1/api/accounts/{account}/orders/place`. Don't invent /api/orders.
- Path parameters live in the URL; everything else for POST/PUT goes in a JSON body. No form-encoding.
- The user must have NinjaTrader running with the CrossTrade add-on connected — otherwise calls return `{"success": false, "error": "..."}` with HTTP 408.
- `account` values are case-insensitive on input but echoed in canonical case.

---

## Endpoints

### Accounts

#### `GET /v1/api/accounts`

Get Accounts

**Example:**

```bash
curl -H "Authorization: Bearer $XTRADE_TOKEN" "https://app.crosstrade.io/v1/api/accounts"
```

---

#### `GET /v1/api/accounts/snapshot`

Get Accounts Summary

**Example:**

```bash
curl -H "Authorization: Bearer $XTRADE_TOKEN" "https://app.crosstrade.io/v1/api/accounts/snapshot"
```

---

#### `GET /v1/api/accounts/{account}`

Get Account

**Path parameters:**

- `account` (required) — Account name (e.g., "Sim101")

**Example:**

```bash
curl -H "Authorization: Bearer $XTRADE_TOKEN" "https://app.crosstrade.io/v1/api/accounts/Sim101"
```

---

#### `GET /v1/api/accounts/{account}/position`

Get Position by Account + Instrument (instrument URL-encoded)

**Path parameters:**

- `account` (required) — Account name (e.g., "Sim101")

**Query parameters:**

- `instrument` (required)

**Example:**

```bash
curl -H "Authorization: Bearer $XTRADE_TOKEN" "https://app.crosstrade.io/v1/api/accounts/Sim101/position"
```

---

#### `GET /v1/api/accounts/{account}/quote`

Get Quote

**Query parameters:**

- `instrument` (required)
- `root` (required)
- `showRollover` (optional)

**Example:**

```bash
curl -H "Authorization: Bearer $XTRADE_TOKEN" "https://app.crosstrade.io/v1/api/accounts/{account}/quote"
```

---

#### `GET /v1/api/accounts/{account}/watermarks`

Get Watermarks (per-account high/low water marks)

**Path parameters:**

- `account` (required) — Account name (e.g., "Sim101")

**Example:**

```bash
curl -H "Authorization: Bearer $XTRADE_TOKEN" "https://app.crosstrade.io/v1/api/accounts/Sim101/watermarks"
```

---

### Executions

#### `GET /v1/api/accounts/{account}/executions`

Get Executions by Account

**Path parameters:**

- `account` (required) — Account name (e.g., "Sim101")

**Query parameters:**

- `lookbackTime` (optional)

**Example:**

```bash
curl -H "Authorization: Bearer $XTRADE_TOKEN" "https://app.crosstrade.io/v1/api/accounts/Sim101/executions"
```

---

#### `GET /v1/api/accounts/{account}/executions/{id}`

Get Execution by ID

**Path parameters:**

- `account` (required) — Account name (e.g., "Sim101")
- `id` (required) — Resource ID

**Example:**

```bash
curl -H "Authorization: Bearer $XTRADE_TOKEN" "https://app.crosstrade.io/v1/api/accounts/Sim101/executions/Sim101"
```

---

#### `GET /v1/api/executions/order/{orderId}`

Get Executions by Order ID (matches both current and original/initial order ID)

**Path parameters:**

- `orderId` (required) — Order ID

**Example:**

```bash
curl -H "Authorization: Bearer $XTRADE_TOKEN" "https://app.crosstrade.io/v1/api/executions/order/Sim101"
```

---

### General

#### `GET /v1/api/atm-templates`

Get All ATM Templates

**Example:**

```bash
curl -H "Authorization: Bearer $XTRADE_TOKEN" "https://app.crosstrade.io/v1/api/atm-templates"
```

---

### Market Data

#### `POST /v1/api/market/bars`

Get historical bars

**Request body:**

```json
{
  "daysBack": 1,
  "dividendAdjust": true,
  "from": "",
  "instrument": "ES 03-26",
  "limit": 1,
  "mergePolicy": "",
  "period": 1,
  "periodType": "",
  "splitAdjust": true,
  "to": ""
}
```

**Body fields:**

- `daysBack` (integer, (optional))
- `dividendAdjust` (boolean, (optional))
- `from` (string, (optional))
- `instrument` (string, (required))
- `limit` (integer, (optional))
- `mergePolicy` (string, (optional))
- `period` (integer, (optional))
- `periodType` (string, (optional))
- `splitAdjust` (boolean, (optional))
- `to` (string, (optional))

**Example:**

```bash
curl -X POST -H "Authorization: Bearer $XTRADE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"daysBack": 1, "dividendAdjust": true, "from": "", "instrument": "ES 03-26", "limit": 1, "mergePolicy": "", "period": 1, "periodType": "", "splitAdjust": true, "to": ""}' \
  "https://app.crosstrade.io/v1/api/market/bars"
```

---

#### `GET /v1/api/market/info`

Get Market Info

**Query parameters:**

- `instrument` (required)
- `root` (required)

**Example:**

```bash
curl -H "Authorization: Bearer $XTRADE_TOKEN" "https://app.crosstrade.io/v1/api/market/info"
```

---

#### `GET /v1/api/market/quote`

Get Quote

**Query parameters:**

- `instrument` (required)
- `root` (required)
- `showRollover` (optional)

**Example:**

```bash
curl -H "Authorization: Bearer $XTRADE_TOKEN" "https://app.crosstrade.io/v1/api/market/quote"
```

---

### Orders

#### `GET /v1/api/accounts/{account}/orders`

List Active/Orders in Account

**Path parameters:**

- `account` (required) — Account name (e.g., "Sim101")

**Query parameters:**

- `activeOnly` (optional)

**Example:**

```bash
curl -H "Authorization: Bearer $XTRADE_TOKEN" "https://app.crosstrade.io/v1/api/accounts/Sim101/orders"
```

---

#### `POST /v1/api/accounts/{account}/orders/cancel`

Cancel Orders by Account + Instrument

**Path parameters:**

- `account` (required) — Account name (e.g., "Sim101")

**Request body:**

```json
{
  "force": true,
  "instrument": "ES 03-26",
  "strategyTag": ""
}
```

**Body fields:**

- `force` (boolean, (optional))
- `instrument` (string, (optional))
- `strategyTag` (string, (optional))

**Example:**

```bash
curl -X POST -H "Authorization: Bearer $XTRADE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"force": true, "instrument": "ES 03-26", "strategyTag": ""}' \
  "https://app.crosstrade.io/v1/api/accounts/Sim101/orders/cancel"
```

---

#### `POST /v1/api/accounts/{account}/orders/cancel_and_bracket`

Cancel existing orders and immediately place new OCO Bracket (TP/SL)

**Path parameters:**

- `account` (required) — Account name (e.g., "Sim101")

**Request body:**

```json
{
  "action": "Buy",
  "delayMs": 1,
  "force": true,
  "instrument": "ES 03-26",
  "ocoId": "",
  "quantity": 1,
  "stopLoss": 0,
  "strategyTag": "",
  "takeProfit": 0
}
```

**Body fields:**

- `action` (string, (required))
- `delayMs` (integer, (optional))
- `force` (boolean, (optional))
- `instrument` (string, (required))
- `ocoId` (string, (optional))
- `quantity` (integer, (required))
- `stopLoss` (number, (optional))
- `strategyTag` (string, (optional))
- `takeProfit` (number, (optional))

**Example:**

```bash
curl -X POST -H "Authorization: Bearer $XTRADE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"action": "Buy", "delayMs": 1, "force": true, "instrument": "ES 03-26", "ocoId": "", "quantity": 1, "stopLoss": 0, "strategyTag": "", "takeProfit": 0}' \
  "https://app.crosstrade.io/v1/api/accounts/Sim101/orders/cancel_and_bracket"
```

---

#### `POST /v1/api/accounts/{account}/orders/flatplace`

Flat Place Order

**Path parameters:**

- `account` (required) — Account name (e.g., "Sim101")

**Request body:**

```json
{
  "action": "Buy",
  "force": true,
  "instrument": "ES 03-26",
  "limitPrice": 0,
  "quantity": 1,
  "stopPrice": 0,
  "strategyTag": ""
}
```

**Body fields:**

- `action` (string, (optional))
- `force` (boolean, (optional))
- `instrument` (string, (optional))
- `limitPrice` (number, (optional))
- `quantity` (integer, (optional))
- `stopPrice` (number, (optional))
- `strategyTag` (string, (optional))

**Example:**

```bash
curl -X POST -H "Authorization: Bearer $XTRADE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"action": "Buy", "force": true, "instrument": "ES 03-26", "limitPrice": 0, "quantity": 1, "stopPrice": 0, "strategyTag": ""}' \
  "https://app.crosstrade.io/v1/api/accounts/Sim101/orders/flatplace"
```

---

#### `POST /v1/api/accounts/{account}/orders/place`

Place Order

**Path parameters:**

- `account` (required) — Account name (e.g., "Sim101")

**Request body:**

```json
{
  "action": "Buy",
  "force": true,
  "instrument": "ES 03-26",
  "limitPrice": 0,
  "maxPositions": 1,
  "ocoId": "",
  "orderId": "",
  "orderType": "",
  "quantity": 1,
  "requireMarketPosition": "",
  "smartOptions": {},
  "stopPrice": 0,
  "strategy": "",
  "strategyTag": "",
  "targetQuantity": 1,
  "timeInForce": ""
}
```

**Body fields:**

- `action` (string, (optional))
- `force` (boolean, (optional))
- `instrument` (string, (optional))
- `limitPrice` (number, (optional))
- `maxPositions` (integer, (optional))
- `ocoId` (string, (optional))
- `orderId` (string, (optional))
- `orderType` (string, (optional))
- `quantity` (integer, (optional))
- `requireMarketPosition` (string, (optional))
- `smartOptions` (object, (optional))
- `stopPrice` (number, (optional))
- `strategy` (string, (optional))
- `strategyTag` (string, (optional))
- `targetQuantity` (integer, (optional))
- `timeInForce` (string, (required))

**Example:**

```bash
curl -X POST -H "Authorization: Bearer $XTRADE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"action": "Buy", "force": true, "instrument": "ES 03-26", "limitPrice": 0, "maxPositions": 1, "ocoId": "", "orderId": "", "orderType": "", "quantity": 1, "requireMarketPosition": "", "smartOptions": {}, "stopPrice": 0, "strategy": "", "strategyTag": "", "targetQuantity": 1, "timeInForce": ""}' \
  "https://app.crosstrade.io/v1/api/accounts/Sim101/orders/place"
```

---

#### `GET /v1/api/accounts/{account}/orders/{id}`

Get Order by ID

**Path parameters:**

- `account` (required) — Account name (e.g., "Sim101")
- `id` (required) — Resource ID

**Example:**

```bash
curl -H "Authorization: Bearer $XTRADE_TOKEN" "https://app.crosstrade.io/v1/api/accounts/Sim101/orders/Sim101"
```

---

#### `POST /v1/api/accounts/{account}/orders/{id}/cancel`

Cancel Order by ID

**Path parameters:**

- `account` (required) — Account name (e.g., "Sim101")
- `id` (required) — Resource ID

**Example:**

```bash
curl -X POST -H "Authorization: Bearer $XTRADE_TOKEN" \
  -H "Content-Type: application/json" \
  "https://app.crosstrade.io/v1/api/accounts/Sim101/orders/Sim101/cancel"
```

---

#### `PUT /v1/api/accounts/{account}/orders/{id}/change`

Change Order

**Path parameters:**

- `account` (required) — Account name (e.g., "Sim101")
- `id` (required) — Resource ID

**Request body:**

```json
{
  "force": true,
  "limitPrice": 0,
  "orderId": "",
  "quantity": 1,
  "stopPrice": 0,
  "strategyId": "",
  "strategyTag": ""
}
```

**Body fields:**

- `force` (boolean, (optional))
- `limitPrice` (number, (optional))
- `orderId` (string, (required))
- `quantity` (integer, (optional))
- `stopPrice` (number, (optional))
- `strategyId` (string, (optional))
- `strategyTag` (string, (optional))

**Example:**

```bash
curl -X PUT -H "Authorization: Bearer $XTRADE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"force": true, "limitPrice": 0, "orderId": "", "quantity": 1, "stopPrice": 0, "strategyId": "", "strategyTag": ""}' \
  "https://app.crosstrade.io/v1/api/accounts/Sim101/orders/Sim101/change"
```

---

#### `GET /v1/api/accounts/{account}/orders/{id}/lifecycle`

Get Order Lifecycle (v1.13.2)

**Path parameters:**

- `account` (required) — Account name (e.g., "Sim101")
- `id` (required) — Resource ID

**Example:**

```bash
curl -H "Authorization: Bearer $XTRADE_TOKEN" "https://app.crosstrade.io/v1/api/accounts/Sim101/orders/Sim101/lifecycle"
```

---

#### `POST /v1/api/accounts/{account}/orders/{id}/replace`

Cancel Replace Order

**Path parameters:**

- `account` (required) — Account name (e.g., "Sim101")
- `id` (required) — Resource ID

**Request body:**

```json
{
  "action": "Buy",
  "force": true,
  "instrument": "ES 03-26",
  "limitPrice": 0,
  "orderId": "",
  "orderType": "",
  "quantity": 1,
  "stopPrice": 0,
  "strategyTag": "",
  "timeInForce": ""
}
```

**Body fields:**

- `action` (string, (required))
- `force` (boolean, (optional))
- `instrument` (string, (required))
- `limitPrice` (number, (optional))
- `orderId` (string, (required))
- `orderType` (string, (required))
- `quantity` (integer, (optional))
- `stopPrice` (number, (optional))
- `strategyTag` (string, (optional))
- `timeInForce` (string, (required))

**Example:**

```bash
curl -X POST -H "Authorization: Bearer $XTRADE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"action": "Buy", "force": true, "instrument": "ES 03-26", "limitPrice": 0, "orderId": "", "orderType": "", "quantity": 1, "stopPrice": 0, "strategyTag": "", "timeInForce": ""}' \
  "https://app.crosstrade.io/v1/api/accounts/Sim101/orders/Sim101/replace"
```

---

#### `GET /v1/api/accounts/{account}/orders/{id}/status`

Get Order Status by ID

**Path parameters:**

- `account` (required) — Account name (e.g., "Sim101")
- `id` (required) — Resource ID

**Example:**

```bash
curl -H "Authorization: Bearer $XTRADE_TOKEN" "https://app.crosstrade.io/v1/api/accounts/Sim101/orders/Sim101/status"
```

---

#### `GET /v1/api/orders`

Get All Orders (Across all accounts)

**Query parameters:**

- `activeOnly` (optional)
- `lookbackTime` (required)

**Example:**

```bash
curl -H "Authorization: Bearer $XTRADE_TOKEN" "https://app.crosstrade.io/v1/api/orders"
```

---

#### `POST /v1/api/orders/cancelall`

Cancel All Orders in All Accounts

**Example:**

```bash
curl -X POST -H "Authorization: Bearer $XTRADE_TOKEN" \
  -H "Content-Type: application/json" \
  "https://app.crosstrade.io/v1/api/orders/cancelall"
```

---

### Positions

#### `GET /v1/api/accounts/{account}/positions`

List Active Positions in Account

**Path parameters:**

- `account` (required) — Account name (e.g., "Sim101")

**Example:**

```bash
curl -H "Authorization: Bearer $XTRADE_TOKEN" "https://app.crosstrade.io/v1/api/accounts/Sim101/positions"
```

---

#### `POST /v1/api/accounts/{account}/positions/close`

Close Position (account, instrument)

**Path parameters:**

- `account` (required) — Account name (e.g., "Sim101")

**Request body:**

```json
{
  "force": true,
  "instrument": "ES 03-26",
  "percent": 0,
  "quantity": 1,
  "strategyTag": ""
}
```

**Body fields:**

- `force` (boolean, (optional))
- `instrument` (string, (required))
- `percent` (number, (optional))
- `quantity` (integer, (optional))
- `strategyTag` (string, (optional))

**Example:**

```bash
curl -X POST -H "Authorization: Bearer $XTRADE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"force": true, "instrument": "ES 03-26", "percent": 0, "quantity": 1, "strategyTag": ""}' \
  "https://app.crosstrade.io/v1/api/accounts/Sim101/positions/close"
```

---

#### `POST /v1/api/accounts/{account}/positions/flatten`

Flatten Positions in 1 account (account, instrument)

**Path parameters:**

- `account` (required) — Account name (e.g., "Sim101")

**Request body:**

```json
{
  "cancelOrders": true,
  "force": true,
  "instrument": "ES 03-26",
  "strategyTag": "",
  "strategyTagMode": ""
}
```

**Body fields:**

- `cancelOrders` (boolean, (optional))
- `force` (boolean, (optional))
- `instrument` (string, (optional))
- `strategyTag` (string, (optional))
- `strategyTagMode` (string, (optional))

**Example:**

```bash
curl -X POST -H "Authorization: Bearer $XTRADE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"cancelOrders": true, "force": true, "instrument": "ES 03-26", "strategyTag": "", "strategyTagMode": ""}' \
  "https://app.crosstrade.io/v1/api/accounts/Sim101/positions/flatten"
```

---

#### `POST /v1/api/accounts/{account}/positions/reverse`

Reverse

**Path parameters:**

- `account` (required) — Account name (e.g., "Sim101")

**Request body:**

```json
{
  "force": true,
  "instrument": "ES 03-26",
  "strategyTag": ""
}
```

**Body fields:**

- `force` (boolean, (optional))
- `instrument` (string, (required))
- `strategyTag` (string, (optional))

**Example:**

```bash
curl -X POST -H "Authorization: Bearer $XTRADE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"force": true, "instrument": "ES 03-26", "strategyTag": ""}' \
  "https://app.crosstrade.io/v1/api/accounts/Sim101/positions/reverse"
```

---

#### `POST /v1/api/accounts/{account}/positions/reverseposition`

Reverse Position (account, instrument, action, orderType, quantity, timeInForce, limitPrice, stopPrice, ocoId, strategy)

**Path parameters:**

- `account` (required) — Account name (e.g., "Sim101")

**Request body:**

```json
{
  "action": "Buy",
  "force": true,
  "instrument": "ES 03-26",
  "quantity": 1,
  "strategyTag": ""
}
```

**Body fields:**

- `action` (string, (optional))
- `force` (boolean, (optional))
- `instrument` (string, (optional))
- `quantity` (integer, (optional))
- `strategyTag` (string, (optional))

**Example:**

```bash
curl -X POST -H "Authorization: Bearer $XTRADE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"action": "Buy", "force": true, "instrument": "ES 03-26", "quantity": 1, "strategyTag": ""}' \
  "https://app.crosstrade.io/v1/api/accounts/Sim101/positions/reverseposition"
```

---

#### `GET /v1/api/positions`

Get All Open Positions (Across all accounts)

**Query parameters:**

- `includeFlat` (optional)

**Example:**

```bash
curl -H "Authorization: Bearer $XTRADE_TOKEN" "https://app.crosstrade.io/v1/api/positions"
```

---

#### `POST /v1/api/positions/flatten`

Flatten All Positions in All Accounts

**Request body:**

```json
{
  "account": "Sim101",
  "cancelOrders": true,
  "force": true,
  "instrument": "ES 03-26",
  "strategyTag": "",
  "strategyTagMode": ""
}
```

**Body fields:**

- `account` (string, (optional))
- `cancelOrders` (boolean, (optional))
- `force` (boolean, (optional))
- `instrument` (string, (optional))
- `strategyTag` (string, (optional))
- `strategyTagMode` (string, (optional))

**Example:**

```bash
curl -X POST -H "Authorization: Bearer $XTRADE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"account": "Sim101", "cancelOrders": true, "force": true, "instrument": "ES 03-26", "strategyTag": "", "strategyTagMode": ""}' \
  "https://app.crosstrade.io/v1/api/positions/flatten"
```

---

### Strategies

#### `GET /v1/api/accounts/{account}/strategies`

List Strategies

**Path parameters:**

- `account` (required) — Account name (e.g., "Sim101")

**Query parameters:**

- `includeTerminal` (optional)

**Example:**

```bash
curl -H "Authorization: Bearer $XTRADE_TOKEN" "https://app.crosstrade.io/v1/api/accounts/Sim101/strategies"
```

---

#### `POST /v1/api/accounts/{account}/strategies/start`

Starts a NinjaScript Strategy

**Path parameters:**

- `account` (required) — Account name (e.g., "Sim101")

**Request body:**

```json
{
  "instrument": "ES 03-26",
  "mode": "",
  "parameters": {},
  "period": 1,
  "periodType": "",
  "period_type": "",
  "strategyClass": "",
  "strategy_class": ""
}
```

**Body fields:**

- `instrument` (string, (optional))
- `mode` (string, (optional))
- `parameters` (object, (optional))
- `period` (integer, (optional))
- `periodType` (string, (optional))
- `period_type` (string, (optional))
- `strategyClass` (string, (optional))
- `strategy_class` (string, (optional))

**Example:**

```bash
curl -X POST -H "Authorization: Bearer $XTRADE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"instrument": "ES 03-26", "mode": "", "parameters": {}, "period": 1, "periodType": "", "period_type": "", "strategyClass": "", "strategy_class": ""}' \
  "https://app.crosstrade.io/v1/api/accounts/Sim101/strategies/start"
```

---

#### `GET /v1/api/accounts/{account}/strategies/{id}`

Get Strategy

**Path parameters:**

- `account` (required) — Account name (e.g., "Sim101")
- `id` (required) — Resource ID

**Example:**

```bash
curl -H "Authorization: Bearer $XTRADE_TOKEN" "https://app.crosstrade.io/v1/api/accounts/Sim101/strategies/Sim101"
```

---

#### `POST /v1/api/accounts/{account}/strategies/{id}/close`

Close Strategy

**Path parameters:**

- `account` (required) — Account name (e.g., "Sim101")
- `id` (required) — Resource ID

**Example:**

```bash
curl -X POST -H "Authorization: Bearer $XTRADE_TOKEN" \
  -H "Content-Type: application/json" \
  "https://app.crosstrade.io/v1/api/accounts/Sim101/strategies/Sim101/close"
```

---

#### `POST /v1/api/accounts/{account}/strategies/{id}/disable`

Disable Strategy

**Path parameters:**

- `account` (required) — Account name (e.g., "Sim101")
- `id` (required) — Resource ID

**Example:**

```bash
curl -X POST -H "Authorization: Bearer $XTRADE_TOKEN" \
  -H "Content-Type: application/json" \
  "https://app.crosstrade.io/v1/api/accounts/Sim101/strategies/Sim101/disable"
```

---

#### `POST /v1/api/accounts/{account}/strategies/{id}/enable`

Enable Strategy

**Path parameters:**

- `account` (required) — Account name (e.g., "Sim101")
- `id` (required) — Resource ID

**Example:**

```bash
curl -X POST -H "Authorization: Bearer $XTRADE_TOKEN" \
  -H "Content-Type: application/json" \
  "https://app.crosstrade.io/v1/api/accounts/Sim101/strategies/Sim101/enable"
```

---

#### `GET /v1/api/strategies`

List All Strategies

**Query parameters:**

- `includeTerminal` (optional)

**Example:**

```bash
curl -H "Authorization: Bearer $XTRADE_TOKEN" "https://app.crosstrade.io/v1/api/strategies"
```

---

## More resources

- OpenAPI 3.1 spec: https://app.crosstrade.io/v1/api/openapi.json
- Endpoint catalog (lighter): https://app.crosstrade.io/v1/api/_endpoints
- Human docs: https://crosstrade.io/docs/api/overview
- AI-assisted dev guide: https://crosstrade.io/docs/api/ai-assisted-development
