> ## 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":"245867a5-0de9-4542-a9da-724577ab4102",
    "subscriptions":[
      "trades",
      "publicTrades",
      "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"
        ],
        "clientRequestId": "245867a5-0de9-4542-a9da-724577ab4102",
        "requestedUnsubscriptions": [
            "trades",
            "publicTrades",
            "publicOrderBook"
        ]
    }
}
```

| Field                           | Type   | Required | Description                                                  |
| ------------------------------- | ------ | -------- | ------------------------------------------------------------ |
| `resultType`                    | string | Yes      | `unsubscribed`                                               |
| `data.activeSubscriptions`      | array  | Yes      | Remaining active subscriptions after the operation           |
| `data.clientRequestId`          | string | No       | Client-generated UUID for correlation                        |
| `data.requestedUnsubscriptions` | array  | Yes      | The specific subscriptions that were requested to be removed |

#### 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
