> ## Documentation Index
> Fetch the complete documentation index at: https://docs.roxom.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Connection

> Authenticate and connect to the Roxom WebSocket API using RSA-signed headers and keep-alive pings.

## Overview

The WebSocket API requires authentication for a successful connection. The server authenticates your request before upgrading the connection. To connect, provide these HTTP headers:

* `X-API-Key`: Your Roxom API Key.
* `X-API-Signature`: base64-encoded RSA signature. The payload you should hash is `GET:/ws`, then sign the digest using your private key.

For more authentication examples, see [Authentication](/api-reference/authentication).

## Error codes

Common WebSocket connection and operation errors:

### Authentication errors

* **600010** - Authentication failed (invalid API key or signature)

### Subscription errors

* **60014** - Invalid channel name (unsupported channel type)
* **60015** - Invalid symbol (trading pair not available)
* **60016** - Subscription limit exceeded (too many active subscriptions)

### Protocol errors

* **60017** - Message parsing error (malformed JSON request)
* **60018** - Binary messages not supported (use text messages only)
* **60019** - Internal server error (temporary service issue)

### Error response format

```json theme={null}
{
  "event": "error",
  "code": "600010", 
  "msg": "Authentication failed",
  "connId": "01234567-89ab-7def-8123-456789abcdef"
}
```

## Next steps

After establishing a connection, you can:

* Subscribe to [Market Data](/websockets/market-data) streams for real-time quotes and trades
* Enable [Account Updates](/websockets/account-updates) for order and balance notifications
