Search documentation

Search every page of the Trade Wzrd docs

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

json
// 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

GroupCasingExample field
/api/v1/keys*camelCasekeyId, rateLimitRpm
/api/v1/tradescamelCase (raw trade documents)accountId, openPrice, tickets
/api/v1/accounts*, /rooms*, /automations*, /webhooks*snake_caseaccount_name, room_name, webhook_name
/api/v1/analytics/*snake_casehas_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-Code header.

Error codes

HTTPCodeMeaning
400-Malformed body / unknown scope
401invalid_api_keyUnknown key, bad secret, malformed
401api_key_revokedKey revoked
401api_key_expiredPast expiresAt
402api_not_includedPlan does not include API access
402key_limit_reachedPlan key cap reached
403api_disabledPlan API access turned off
403insufficient_scopeKey lacks the scope for this route
403scope_not_in_planPlan forbids the scope at key creation
403trade_scope_not_in_planPlan forbids trading
403ip_not_allowedRequest IP outside the key's allowlist
429rate_limitedPer-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.

Related