Skip to Content
HTTP APIWorkspace

Close a window

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.

Command
curl -X DELETE 'http://127.0.0.1:48180/v1/workspace/windows/1' \
  -H "Authorization: Bearer $SPECTRE_LOCAL_API_TOKEN"
DELETE
/workspace/windows/{id}

The main window cannot be closed through the API.

Authorization

bearerToken workspace:write
headerAuthorizationBearer <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

Path Parameters

id*integer

The id of a window from GET /workspace.

Formatint64
Range0 <= value

Response Body

What the command touched.

application/json
  1. response

What a workspace command opened or touched. The numbers it concerns are filled in. The rest is null or empty.

window_id*|
Formatint64
tab_id*|
Formatint64
stacks*array<>
charts*array<>
Example Request
curl -X DELETE 'http://127.0.0.1:48180/v1/workspace/windows/1' \  -H "Authorization: Bearer $SPECTRE_LOCAL_API_TOKEN"
Example Response
{  "window_id": 2,  "tab_id": null,  "stacks": [],  "charts": []}