## WebSocket Connection To connect to the WebSocket API, you will need to use the appropriate URL for your environment: - Test: `wss://ws.test.figmarkets.com` - Production: `wss://ws.figmarkets.com` ### Authentication See the [Authentication Guide](/guides/authentication#websocket-authentication) for more information on how to authenticate. ### Subscribing and Unsubscribing To subscribe to channels, send a JSON-RPC message in the following format: ```json { "jsonrpc": "2.0", "id": "", "method": "v1/subscribe", "params": { "channels": ["channel1", "channel2"] } } ``` This will respond with: ```json { "jsonrpc": "2.0", "id": "", "method": "v1/subscribe", "result": { "status": "subscribed", "channels": ["channel1", "channel2"] } } ``` To unsubscribe from channels, send a JSON-RPC message in the following format: ```json { "jsonrpc": "2.0", "id": "", "method": "v1/unsubscribe", "params": { "channels": ["channel1", "channel2"] } } ``` This will respond with: ```json { "jsonrpc": "2.0", "id": "", "method": "v1/unsubscribe", "result": { "status": "unsubscribed", "channels": ["channel1", "channel2"] } } ``` ### WebSocket Channels Below are the available WebSocket channels - [rfq.maker](/websockets/rfq.maker) - This channel is used to receive updates for RFQs you are able to quote against. - [rfq.taker](/websockets/rfq.taker) - This channel is used to receive updates for RFQs where you are the `taker`. - [rfq_quote.maker](/websockets/rfq_quote.maker) - This channel is used to receive notifications on quotes created by you as the `maker`. - [rfq_quote.taker](/websockets/rfq_quote.taker) - This channel is used to receive notifications on quotes received for RFQs where you are the `taker`.