Delete a workspace
Deletes the workspace and destroys every execution of it. Uncommitted work is lost. The workspace is unattachable from the moment the call starts; an execution that cannot be destroyed yet (its host is not answering, or an operation on it is still settling) is listed in executionsPendingCleanup and destroyed automatically once it can be. Needs sandbox.environment.delete, which every role holding sandbox.destroy holds. An API key holds it only when its own scopes name it: an unscoped key and every key template lack it, and are refused with 403. API keys reach these operations only where key access to environments is enabled for this deployment, and then only their principal's own workspaces; until then every API key is refused with 403.
Authorization
bearerAuth A RemoteHost API key (rh_sk_...) or a user session token.
In: header
Path Parameters
uuidQuery Parameters
For a workspace with a work volume: true keeps the volume, unbound from the workspace, once the workspace can no longer be restored; false, the default, deletes it then. Any other value is refused with 400. A workspace with no work volume ignores it.
falseResponse Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X DELETE "https://example.com/orgs/string/projects/string/workspaces/497f6eca-6276-4993-bfeb-53cbbbba6f08"{ "deleted": true, "workspaceId": "ef0efa32-d1c1-43d4-a5e2-fe7b4f00403c", "executionsPendingCleanup": [ { "sandboxId": "5b4b1d3f-21e4-43f6-8ac1-b460b150f885", "message": "string" } ], "recoverableUntil": "2019-08-24T14:15:22Z", "workVolume": { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "fate": "keep" }}Rename or reconfigure a workspace PATCH
A rename does not move the workspace's git branch. Moving it to another environment pushes that environment's network rules to its running execution as it is saved; one the push cannot reach is stopped so it cannot keep the old rules, and the response's egressPropagation says which.
Attach a workspace POST
Returns a running sandbox for the workspace: the one already running, the sleeping one woken, or a new one. One execution at a time: while another is starting or stopping the call answers 409 workspace_leased. When the host running it has stopped answering, the call answers 409 lease_expired; retrying with takeover: true moves the workspace to a new execution restored from its last saved snapshot, reports what was lost in `recovery`, and never happens while the old execution's host still lists it. A takeover needs sandbox.destroy as well as sandbox.create, is refused with restore_unavailable when the last snapshot never left the unreachable host, and immediately cuts the old execution off: its keys are revoked, and its open terminals, tunnels and preview sockets are closed.