Skip to content
LogoLogo

unsubscribe

Endpoint

WebSocket /ws

Selector: method: "unsubscribe"

Purpose

Removes the matching subscription from the connection. The subscription object identifies the same type, target and optional fields used to create it.

Authorization

Owner or approved reader for subscription.user. The SDK signs requests. Current permissions are checked before delivery; expiry or revocation stops access.

Request fields

FieldTypeRequiredMeaning
methodStringYes"unsubscribe".
authObjectYesRequest proof with timestamp, nonce and signature; see authorization.
subscriptionObjectYesA supported subscription object matching the subscription being removed.

The supported subscription types and their fields are listed in subscribe.

Request example

Test fixture. Generate a fresh proof before use. Fixture inputs.

{
  "method": "unsubscribe",
  "subscription": {
    "type": "openOrders",
    "user": "0x7E5F4552091A69125d5DfCb7b8C2659029395Bdf"
  },
  "auth": {
    "timestamp": 1796250000000,
    "nonce": "0x0505050505050505050505050505050505050505050505050505050505050505",
    "signature": "0x6aad99f28372d23a9895b95b69e6589dd82cd8500dd5821efa5ef02afd773500428fbaf5c6e381a1e61b58d27ab4244944b4db79f443e81c9e3ec00ed9f34a8b1c"
  }
}

Response fields

FieldMeaning
channel"subscriptionResponse".
dataAcknowledgement object containing the logical request.
data.method"unsubscribe".
data.subscriptionEchoed subscription object identifying the removed subscription.

Response example

{
  "channel": "subscriptionResponse",
  "data": {
    "method": "unsubscribe",
    "subscription": {
      "type": "openOrders",
      "user": "0x7E5F4552091A69125d5DfCb7b8C2659029395Bdf"
    }
  }
}

Constraints

  • A valid authorized request receives the acknowledgement even if that exact subscription is no longer active.
  • Unsubscribing does not close the connection or remove other subscriptions.
  • Requests still require a supported subscription shape and current permission for the target account.

subscribe starts a subscription. WebSocket overview covers limits and connection lifecycle.