Deriv API
Documentation

Forget all

SubscriptionNo Auth

Unsubscribe from all streams of a given type. Simplified with fewer options.

Quick comparison

AspectLegacy APINew APIAction
Endpointforget_allforget_allNone
Auth RequiredNoNoNone
Stream TypesEnum (14 types)Any stringNone
Response FieldOptionalRequiredUpdate response handling

Breaking changes

1. Stream type enum validation removed

Legacy restricted stream types to a specific enum of 14 values. New accepts any string value, providing more flexibility.

2. Response field now required

In Legacy, the forget_all array in the response was optional. In New, this field is always present and required.

3. Response array items now typed

Legacy defined forget_all as an array without specifying item types. New explicitly types array items as strings.

Request structure

Legacy APIrequest example
{
  "forget_all": "ticks"
  // Must be one of 14 enum values
}

// Or multiple types:
{
  "forget_all": ["ticks", "proposal"]
}
New APIrequest example
{
  "forget_all": "ticks"
  // Any string value accepted
}

// Or multiple types:
{
  "forget_all": ["ticks", "proposal"]
}

Response structure

Legacy APIresponse example
{
  "forget_all": ["sub-id-1", "sub-id-2"],
  // ⚠️ forget_all is optional
  "msg_type": "forget_all"
}
New APIresponse example
{
  "forget_all": ["sub-id-1", "sub-id-2"],
  // ✓ forget_all is always present
  "msg_type": "forget_all"
}

Code examples

async function forgetAllTicks() {
  const request = {
    forget_all: "ticks"
  };

  ws.send(JSON.stringify(request));

  ws.onmessage = (event) => {
    const response = JSON.parse(event.data);
    if (response.msg_type === 'forget_all') {
      if (response.forget_all) {
        console.log('Unsubscribed from:', response.forget_all.length);
      }
    }
  };
}

Any other questions? Get in touch

Click to open live chat support. Get instant help from our support team.