---
title: "GET /public/set_heartbeat"
method: GET
path: "/public/set_heartbeat"
tags: ["Session Management", "Public", "WebSocket Only"]
---

# GET /public/set_heartbeat

`GET /public/set_heartbeat`

Signals the WebSocket connection to send and request heartbeats. Heartbeats can be used to detect stale connections.

When heartbeats have been set up, the API server will send `heartbeat` messages and `test_request` messages. Your software should respond to `test_request` messages by sending a `/api/v2/public/test` request. If your software fails to do so, the API server will immediately close the connection. If your account is configured to cancel on disconnect, any orders opened over the connection will be cancelled.

**WebSocket Only:** This method is designed exclusively for WebSocket connections. Attempting to use it via REST/HTTP will result in an error response.

[Try in API console](https://test.deribit.com/api_console?method=%2Fpublic%2Fset_heartbeat)

## Query parameters

- `interval` number, required

## Response `200`

Success response

- OkResponse
  - `jsonrpc` '2.0', required — The JSON-RPC version (2.0)
  - `id` integer — The id that was sent in the request
  - `result` 'ok', required — Result of method execution. `ok` in case of success

---

[API](https://skmtc.net/deribit/apis/deribit-api-2.md) · [All operations](https://skmtc.net/deribit/apis/deribit-api-2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/deribit/deribit-api-2/revisions/8dfbbe9fdddf/schema)
