Unsubscribe request

Remove the specified symbols from the session's subscriptions for a schema.

The symbols don't need to match an earlier subscription request: any subset of the subscribed symbols can be removed, and ALL_SYMBOLS removes every symbol for the schema. An unsubscribe request can be sent before or after the session is started.

The gateway acknowledges the request with a system message with code=UNSUBSCRIBE_ACK. Symbols that aren't subscribed, or that can't be removed with the given stype_in, are left in place and reported in an ErrorMsg. If there's no subscription for the schema or stype_in isn't supported, the gateway sends an ErrorMsg with code=InvalidSubscription. None of these errors end the session.

The unsubscribe's stype_in must be compatible with the subscription's stype_in.

Subscribed with
Can unsubscribe with
raw_symbol, instrument_id, or continuous
raw_symbol or instrument_id
parent
parent

To remove a continuous symbol, unsubscribe the raw symbol or instrument ID that it resolved to at subscription time.

As with subscription requests, the symbols can be split across multiple control messages. All but the last message should include is_last=0.

Fields

Field
Required
Type
Description
unsubscribe
required
Identifies the message as an unsubscribe request. Must be the first field. A value can be given, such as unsubscribe=0, but it's ignored.
schema
required
string
The data record schema to unsubscribe from.
stype_in
required
string
The symbology type of input symbols. Must be one of raw_symbol, parent, or instrument_id.
symbols
required
string
A comma-separated list of symbols to unsubscribe from. Setting this value to ALL_SYMBOLS will remove every symbol for the schema.
is_last
optional
int8_t
0 indicates more requests will be sent with the same parameters other than symbols and the gateway should wait to process the request. is_last=1 is the default and instructs the gateway to process the request immediately.
Example message
1
unsubscribe|schema=trades|stype_in=raw_symbol|symbols=SPY,QQQ\n