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

# Unsubscribe

This request removes one or more streams from the current WebSocket connection.

#### Request

```json theme={null}
{
  "message": "unsubscribe",
  "content": {
    "clientRequestId": "b21f0f58-8780-4cf2-b3d3-6439fed37304",
    "subscriptions": ["publicOrderBook"]
  }
}
```

| Field                     | Type   | Required | Description                           |
| ------------------------- | ------ | -------- | ------------------------------------- |
| `message`                 | string | Yes      | `unsubscribe`                         |
| `content.clientRequestId` | string | No       | Client-generated UUID for correlation |
| `content.subscriptions`   | array  | Yes      | One or more subscriptions to remove   |

#### Response

```json theme={null}
{
  "resultType": "unsubscribed",
  "data": {
    "activeSubscriptions": ["orders", "optionsPositions", "optionsOpenOrders"],
    "requestedUnsubscriptions": ["publicOrderBook"],
    "clientRequestId": "b21f0f58-8780-4cf2-b3d3-6439fed37304",
    "statusCode": 200
  }
}
```

| Field                           | Type   | Required | Description                                            |
| ------------------------------- | ------ | -------- | ------------------------------------------------------ |
| `resultType`                    | string | Yes      | `unsubscribed`                                         |
| `data.activeSubscriptions`      | array  | Yes      | All currently active subscriptions after the operation |
| `data.requestedUnsubscriptions` | array  | Yes      | The subscriptions requested to be removed              |
| `data.clientRequestId`          | string | No       | Client-generated UUID for correlation                  |
| `data.statusCode`               | number | Yes      | `200`                                                  |

#### Behavior

* Only active subscriptions are removed
* Removing a non-active subscription is a no-op
* Other subscriptions remain unaffected
* Changes apply immediately
* Safe to call repeatedly (idempotent)
* Does not affect other connections
* Does not require reconnecting
