---
title: "GET /private/enable_cancel_on_disconnect"
method: GET
path: "/private/enable_cancel_on_disconnect"
tags: ["Session Management", "Private"]
---

# GET /private/enable_cancel_on_disconnect

`GET /private/enable_cancel_on_disconnect`

Enable Cancel On Disconnect for the connection. After enabling, all orders created via this connection will be automatically cancelled when the connection is closed.

Cancel is triggered in the following cases: when the TCP connection is properly terminated, when the connection is closed due to 10 minutes of inactivity, or when a heartbeat detects a disconnection. To reduce the inactivity timeout, consider using [public/set_heartbeat](https://docs.deribit.com/api-reference/session-management/public-set_heartbeat).

**Note:** If the connection is gracefully closed using [private/logout](https://docs.deribit.com/api-reference/authentication/private-logout), cancel-on-disconnect will **not** be triggered.

**Notice:** Cancel-on-Disconnect does not affect orders created by other connections - they will remain active! When change is applied on the `account` scope, then every newly opened connection will start with **active** Cancel on Disconnect.

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

**Scope:** `account:read_write`

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

## Query parameters

- `scope` 'connection' | 'account'

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