Skip to main content
The Stabyl WebSocket API streams real time exchange data and account specific trading updates. Use REST to discover markets and fetch durable baseline state, then use WebSocket subscriptions for low latency updates.

Endpoints

Authentication

Market data topics can be used without account authentication. Private topics and order commands require an API key:
Because the API key is carried in the WebSocket URL, connect from server side automation only. Do not open API-key WebSocket connections from browser, mobile, desktop, or user controlled code, and do not log full WebSocket URLs.

Pair and Topic Naming

REST endpoints use the pair identifier returned by GET /partner/exchange/markets, such as USD/NGN. WebSocket topic names use a topic-safe pair key where / becomes _: Today, USD/NGN is the supported exchange pair. When more pairs are added, discover them from GET /partner/exchange/markets and derive the topic key by replacing / with _. Use the REST pair ID in command payloads, such as "pair_id": "USD/NGN". Use the topic key only inside topic names, such as trades.USD_NGN.

Message Model

All client and server messages are JSON objects with a type field. Client messages: Server messages:

Basic Session

Connect From A Server

Reliability Model

Every data message includes: Store the latest {epoch, seq} per exact topic. On reconnect, send those values in resume. Resume is best-effort; if the server cannot replay from your sequence, rebuild state from REST and continue with fresh WebSocket updates. Use exact topics when you need reliable resume. Wildcard topics are useful for broad monitoring, but exact topics give cleaner recovery behavior.

Operational Limits

Keep each connection focused on the streams it needs: If a connection receives rate_limited, slow down, reduce the subscription set if needed, and reconnect only after a backoff delay.