# Subscribing & Unsubscribing

### Subscribing

Subscribing to checkpoints enables you to listen to current state events for accounts, transactions (such as payments) and token activity.&#x20;

To subscribe to a stream with the name `stream` send a text frame over the websocket connection with the following JSON payload:

```
{
  "id": 1,
  "method": "SUBSCRIBE",
  "stream": 
      {
          "name": "CHECKPOINTS",
          "full": true
      }
}
```

confirmation will be received as below:

```
{
  "id": 1,
  "result": "11223344556677889900"
}
```

{% hint style="success" %}
Have a try with below command in your terminal:

```json
{"id": 1,"method": "SUBSCRIBE","stream": {"name": "CHECKPOINTS","full": true}}
```

or with below:

<pre class="language-json"><code class="lang-json"><strong>{"id": 1,"method": "SUBSCRIBE","stream": {"name": "CHECKPOINTS","full": false}}
</strong></code></pre>

{% endhint %}

### Unsubscribing

Similarly, to unsubscribe from a stream with the name `stream`:

```
{
  "id", 1,
  "method": "UNSUBSCRIBE",
  "stream": "CHECKPOINTS"
}
```

confirmation will be received as below:

```
{
  "id": 1,
  "result": true
}
```

{% hint style="success" %}
When subscribed, try with below command in your terminal:

```json
{"id": 1,"method": "UNSUBSCRIBE","stream": "CHECKPOINTS"}
```

{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.1moneynetwork.com/integrations/websocket/subscribing-and-unsubscribing.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
