API
REST Conventions
Envelopes, casing, pagination and error codes for the Trade Wzrd REST API.
Two things about the current API surface matter more than anything else: two response envelopes and two casing conventions coexist. They are documented here so your client handles reality, not wishful thinking - normalizing them is a /api/v2 change.
Envelopes
// Most routes - "message" envelope{ "success": true, "data": {}, "message": null } // Keys, events, SSE - "timestamp" envelope{ "success": true, "data": {}, "message": null, "timestamp": "2026-12-02T10:04:06.287890" }Never assume message or timestamp is present: read success, then data.
Casing
| Group | Casing | Example field |
|---|---|---|
/api/v1/keys* | camelCase | keyId, rateLimitRpm |
/api/v1/trades | camelCase (raw trade documents) | accountId, openPrice, tickets |
/api/v1/accounts*, /rooms*, /automations*, /webhooks* | snake_case | account_name, room_name, webhook_name |
/api/v1/analytics/* | snake_case | has_data, equity_curve |
Other conventions
- Timestamps: epoch milliseconds in documents (
createdAt: 1764500000123); ISO-8601 strings where a model serializes a datetime ("2026-09-10T16:59:43.871771+00:00"). - Ids: MongoDB ObjectId hex strings. Malformed ids are a 404, never a 500.
- Pagination:
limit(1-200, default 50) +offset(0 or more). Counts are approximate where noted. - Errors: every documented error carries an
X-Api-Error-Codeheader.
Error codes
| HTTP | Code | Meaning |
|---|---|---|
| 400 | - | Malformed body / unknown scope |
| 401 | invalid_api_key | Unknown key, bad secret, malformed |
| 401 | api_key_revoked | Key revoked |
| 401 | api_key_expired | Past expiresAt |
| 402 | api_not_included | Plan does not include API access |
| 402 | key_limit_reached | Plan key cap reached |
| 403 | api_disabled | Plan API access turned off |
| 403 | insufficient_scope | Key lacks the scope for this route |
| 403 | scope_not_in_plan | Plan forbids the scope at key creation |
| 403 | trade_scope_not_in_plan | Plan forbids trading |
| 403 | ip_not_allowed | Request IP outside the key's allowlist |
| 429 | rate_limited | Per-key window exhausted |
| 503 | - | Dependency unavailable |
Rate-limited responses carry Retry-After plus X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset (seconds until the window resets). Pace at rpm/60 requests per second - there is no burst allowance.
Session-only routes
These exist but are not callable with an API key (you get 401):
- Broker linking:
POST /api/v1/accounts,/search-servers*,/ctrader/*,/ntvate/*,/tradovate/*- link in the app, then operate the account by key. - Notifications inbox, billing surfaces, admin, affiliates, partners.
The API entitlement for your plan is always readable via POST /api/v1/keys/self-test.







