# eth_unsubscribe

> For the complete documentation index, see [llms.txt](/docs/llms.txt).

POST https://pharos-mainnet.g.alchemy.com/v2/{apiKey}

Cancels an active subscription given its subscription ID.

⚠️ **WARNING: WebSocket-Only Method** ⚠️

> This method REQUIRES a WebSocket connection using `wss://` protocol. It will NOT work with standard HTTP/HTTPS requests or `curl`.
> See the [WebSocket documentation](https://alchemy.com/docs/reference/subscription-api) for examples.


Reference: https://www.alchemy.com/docs/chains/pharos/pharos-api-endpoints/eth-unsubscribe

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| Subscription ID | string | No | The identifier of the subscription to cancel. |

## Result

**Unsubscribe Result** (boolean): A boolean indicating whether the subscription was successfully canceled.

## Example

### Request

```json
{
  "jsonrpc": "2.0",
  "method": "eth_unsubscribe",
  "params": [
    "0x9c7c3f3c3c63b1b89ac0c1e0b0d3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8090a1b"
  ],
  "id": 1
}
```

### Response

```json
{
  "jsonrpc": "2.0",
  "result": true,
  "id": 1
}
```

## OpenRPC Method Specification

```yaml
name: eth_unsubscribe
summary: Cancel a WebSocket subscription (WSS required)
description: |
  Cancels an active subscription given its subscription ID.

  ⚠️ **WARNING: WebSocket-Only Method** ⚠️

  > This method REQUIRES a WebSocket connection using `wss://` protocol. It will NOT work with standard HTTP/HTTPS requests or `curl`.
  > See the [WebSocket documentation](https://alchemy.com/docs/reference/subscription-api) for examples.
x-api-explorer: false
params:
  - name: Subscription ID
    description: The identifier of the subscription to cancel.
    schema:
      title: 32 byte hex value
      type: string
      pattern: ^0x[0-9a-f]{64}$
result:
  name: Unsubscribe Result
  description: A boolean indicating whether the subscription was successfully canceled.
  schema:
    type: boolean
examples:
  - name: Unsubscribe example
    params:
      - name: Subscription ID
        value: '0x9c7c3f3c3c63b1b89ac0c1e0b0d3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8090a1b'
    result:
      name: Unsubscribe Result
      value: true
```
