# Broker WebSocket Streams API

> This is version `1.0.0` of this API documentation. Last update on Nov 19, 2026.
> Real-time WebSocket streams for order updates and market data.
> 
> Authentication:
> - Keyed BLAKE2b-256 signature via HTTP headers during WebSocket Upgrade:
> * PRE-ACCESS-KEY — broker access key identifier (unique API key)
> * PRE-ACCESS-TIMESTAMP — RFC3339 timestamp with milliseconds (e.g., 2025-10-30T06:00:34.075Z)
> * PRE-ACCESS-SIGNATURE — Keyed BLAKE2b-256 hex lowercase (64 chars)
> - Signature computed over (each line ends with \n):
> 1. "GET\n"
> 2. path + query string + "\n"
> 3. timestamp + "\n"
> 4. "" (empty idempotency_key for WebSocket) + "\n"
> 5. broker_id + "\n"
> 6. access_key + "\n"
> 7. body_digest (BLAKE2b-256 of empty body = hash of "")
> - Keyed BLAKE2b-256 is computed using secret_key associated with the access_key
> - The function returns 32 bytes, encoded as hex lowercase (64 chars) for PRE-ACCESS-SIGNATURE.
> - Timestamp must be within clock_skew_tolerance (default 5m)
> - Invalid signature or timestamp → HTTP 401 or WS close 4401
> - All authz 403 responses, including upgrade refusal, use the public
> Error {error_code, message} with Content-Type: application/json;
> see private-api-broker-openapi.yaml#/components/schemas/Error.
> - CIDR is checked first (HTTP 403, ip_not_allowed); disabled brokers are
> denied before upgrade (HTTP 403, broker_disabled).
> - Missing brokers and unknown/revoked access keys return HTTP 401.
> - Suspended brokers may open streams subject to permissions; suspension
> and CIDR changes keep existing sockets.
> - Policy close 1008 reasons are broker_disabled, access_key_revoked
> (key-bound sockets), and broker_not_found.
> - Restrictions apply after local registry updates; propagation lag
> remains. Clients reconnect themselves after restrictions are lifted;
> no separate notification is sent.
> 
> General Principles:
> - All data frames include monotonic sequence numbers for ordering and resume; sequence numbers are not guaranteed to be contiguous
> - Heartbeat frames do not advance sequence numbers
> - Resume capability via 'since' parameter where applicable ('since' must be >0; value 0 is treated as absent)
> - Historical replay is available for up to one hour; messages older than one hour cannot be replayed
> - Idempotent frame delivery (clients drop frames with seq <= last_applied)

[Documentation](https://bump.sh/tie-tech/hub/b2b-api/doc/broker-asyncapi.md)

AsyncAPI file: https://bump.sh/tie-tech/hub/b2b-api/doc/broker-asyncapi.yaml

## MCP server

Connect AI agents to this documentation with the broker-asyncapi MCP server (Model Context Protocol, no authentication, Streamable HTTP transport):

- URL: `https://bump.sh/tie-tech/hub/b2b-api/doc/broker-asyncapi/mcp`

## [Servers](https://bump.sh/tie-tech/hub/b2b-api/doc/broker-asyncapi/servers.md)
- production: wss://api.example.com/v1/stream (Production WebSocket endpoint)

- sandbox: wss://sandbox.api.example.com/v1/stream (Sandbox WebSocket endpoint)


## Topics


## Channels

### [Accounting](https://bump.sh/tie-tech/hub/b2b-api/doc/broker-asyncapi/group/channel-accounting.md)

- [Receive real-time accounting and ledger updates](https://bump.sh/tie-tech/hub/b2b-api/doc/broker-asyncapi/operation/operation-subscribe-accounting.md)


### [Events](https://bump.sh/tie-tech/hub/b2b-api/doc/broker-asyncapi/group/channel-events.md)

- [Receive real-time event/market lifecycle updates](https://bump.sh/tie-tech/hub/b2b-api/doc/broker-asyncapi/operation/operation-subscribe-events.md)


### [Market data](https://bump.sh/tie-tech/hub/b2b-api/doc/broker-asyncapi/group/channel-market-data.md)

- [Receive real-time market data](https://bump.sh/tie-tech/hub/b2b-api/doc/broker-asyncapi/operation/operation-subscribe-market-data.md)

- [Send subscription control messages](https://bump.sh/tie-tech/hub/b2b-api/doc/broker-asyncapi/operation/operation-publish-market-data.md)


### [Orders](https://bump.sh/tie-tech/hub/b2b-api/doc/broker-asyncapi/group/channel-orders.md)

- [Receive real-time order updates](https://bump.sh/tie-tech/hub/b2b-api/doc/broker-asyncapi/operation/operation-subscribe-orders.md)




## Changelog

- [Changelog](https://bump.sh/tie-tech/hub/b2b-api/doc/broker-asyncapi/changes.md)
- [Changelog index (llms.txt)](https://bump.sh/tie-tech/hub/b2b-api/doc/broker-asyncapi/changes/llms.txt)

[Powered by Bump.sh](https://bump.sh)
