Change the instrument of 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 PATCH 'http://127.0.0.1:48180/v1/workspace/stacks/12' \
-H "Authorization: Bearer $SPECTRE_LOCAL_API_TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"instrument": "binance:futures:ETHUSDT"
}'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.
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
widget_id*integerThe widget_id of a stack from GET /workspace. A chart is refused with invalid_request.
int640 <= valueapplication/json- body
instrument*stringAn instrument from the catalogue.
connection_id?integerint64What the command touched.
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 PATCH 'http://127.0.0.1:48180/v1/workspace/stacks/12' \ -H "Authorization: Bearer $SPECTRE_LOCAL_API_TOKEN" \ -H 'Content-Type: application/json' \ -d '{ "instrument": "binance:futures:ETHUSDT"}'{ "window_id": 1, "tab_id": 1, "stacks": [ 12 ], "charts": []}Open a stack POST
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.
Close a stack DELETE
Works like the close button of the stack.