Remotehost Docs
API ReferenceWorkspaces

Delete a workspace

DELETE
/orgs/{orgId}/projects/{projectId}/workspaces/{workspaceId}

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
AuthorizationBearer <token>

A RemoteHost API key (rh_sk_...) or a user session token.

In: header

Path Parameters

orgId*string
projectId*string
workspaceId*string
Formatuuid

Query Parameters

keepWorkVolume?boolean

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.

Defaultfalse

Response 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"  }}