Open a stack
Build your request
Change the values and the command follows. The token is never typed here: the command reads it from the SPECTRE_LOCAL_API_TOKEN environment variable. Run it in your own terminal.
curl -X POST 'http://127.0.0.1:48180/v1/workspace/stacks' \
-H "Authorization: Bearer $SPECTRE_LOCAL_API_TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"instrument": "binance:futures:BTCUSDT",
"connection_id": 25,
"chart": true,
"target": "new_tab",
"window_id": 1,
"activate": true
}'Opens the stack of an instrument in a new tab or a new window. The tab is named after the symbol of the instrument. The side and the share of the chart come from the multiview settings, but with "No charts" there the chart still opens on top.
bearerToken workspace:writeAuthorizationBearer <token>The Local API token: spt_ and 64 hex characters. Copy it from Settings App → General → Local API. It is accepted only in the Authorization header. The names listed with an operation are the scopes it requires. The token of the terminal carries all of them.
Scope: workspace:write
application/json- body
instrument*stringAn instrument from the catalogue.
connection_id?integerWithout it the terminal uses the trading connection of the exchange and market, or the read-only one if there is none.
int64chart?booleanAlso open a chart of the same instrument.
falsetarget?WorkspaceTargetnew_tab opens a tab in the window window_id, or in the focused window without it. new_window opens a new window.
"new_tab""new_tab""new_window"window_id?integerThe window for the new tab. Not used with new_window.
int640 <= valueactivate?booleanfalse opens the tab in the background. A new window always takes the focus.
trueWhere the stack opened. stacks and charts are the widgets of the new tab.
application/json- response
What a workspace command opened or touched. The numbers it concerns are filled in. The rest is null or empty.
window_id*|int64tab_id*|int64stacks*array<>charts*array<>curl -X POST 'http://127.0.0.1:48180/v1/workspace/stacks' \ -H "Authorization: Bearer $SPECTRE_LOCAL_API_TOKEN" \ -H 'Content-Type: application/json' \ -d '{ "instrument": "binance:futures:BTCUSDT", "connection_id": 25, "chart": true, "target": "new_tab", "window_id": 1, "activate": true}'{ "window_id": 1, "tab_id": 2, "stacks": [ 14 ], "charts": [ 15 ]}Open a tab of instruments POST
Opens a tab with one column for each element of `items`, in the order of the list. Without `name` the tab takes the symbol of the first instrument, plus the number of the others if there are any: `BTCUSDT +1`. The side and the share of a chart come from the multiview settings.
Change the instrument of a stack PATCH
Changes the instrument of the stack and of the charts of its group. A tab that is not active becomes active for the time of the command.