Topolo Docs Topolo Platform
Open workspace

Delete workspace

Archive an empty Brand workspace through the platform workspace authority.

Outcome

Archive an empty Brand workspace through the platform workspace authority.

Before you start

  • Verify whoami and the pinned credential context, then inspect the exact discovered action before preparing input.
  • Discover a granted Brand workspace. Pass its resourceType/workspace identifier separately from input; a copied fixture identifier grants no access.
  • The declared permission is workspace:delete. The active credential, application scope, resource binding and runtime authority must all authorize the request.
  • Review the exact mutation and recovery, including destructive scope, and execute only after the intended effect is authorized.

Discover the target

topolo whoami --json
topolo actions get app_topolo_brand.workspaces.delete --detail --json
topolo resources topolo-brand --json
topolo workspaces list topolo-brand --json

Request

DELETE /api/workspaces/{workspaceId}

Resource context is the selected Brand workspace. CLI/SDK action input includes path identifiers; direct HTTP JSON bodies exclude path parameters. Read the reviewed plan for the exact request.

Input fields

FieldRequiredMeaning
workspaceIdYesCanonical workspace identifier granted to the caller. Workspace archival requires this to match the selected request workspace.

Exact published input schema:

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "workspaceId": {
      "type": "string",
      "minLength": 1,
      "description": "Canonical workspace identifier granted to the caller. Workspace archival requires this to match the selected request workspace."
    }
  },
  "required": [
    "workspaceId"
  ],
  "additionalProperties": false
}

Effects

Requires the path workspace to match the verified selected workspace and an existing empty local mirror. Requests archival from Auth, then removes the mirror only after Auth accepts.

Interpret the response

Success is HTTP 204 with no body. The released CLI SDK represents that body as an empty string. No deleted:true object is returned. The Brand handler does not independently reject a default workspace; Auth may refuse its archival.

Response identifier contract:

{
  "kind": "workspaces_delete",
  "identifierSource": "none",
  "explanation": "Success is HTTP 204 with no body. The released CLI SDK represents that body as an empty string. No deleted:true object is returned. The Brand handler does not independently reject a default workspace; Auth may refuse its archival."
}

Worked examples

These complete synthetic responses were captured from the local worker over canonical SQL migrations. Auth and R2 dependencies are simulated; notification delivery is not exercised. Set BRAND_WORKSPACE_ID from granted workspace discovery. Save reviewed input as payload.json, validate and inspect the unchanged plan. The final mutation command and MCP confirm flag assume the intended effect has already been authorized.

Minimal example

Input · payload.json:

{
  "workspaceId": "ws_brand_documentation_fixture"
}

CLI:

topolo actions validate app_topolo_brand.workspaces.delete --data @payload.json --json
topolo actions plan app_topolo_brand.workspaces.delete --resource-type workspace --resource-id "$BRAND_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_brand.workspaces.delete --resource-type workspace --resource-id "$BRAND_WORKSPACE_ID" --data @payload.json --confirm --json

MCP tool and arguments:

{
  "tool": "topolo_call_action",
  "arguments": {
    "actionId": "app_topolo_brand.workspaces.delete",
    "input": {
      "workspaceId": "ws_brand_documentation_fixture"
    },
    "resourceType": "workspace",
    "resourceId": "<identifier returned by resource discovery>",
    "confirm": true
  }
}

Captured handler outcome · HTTP 204 with no body. Released SDK value:

Success is HTTP 204 with no body. The released CLI SDK represents that body as an empty string. No deleted:true object is returned. The Brand handler does not independently reject a default workspace; Auth may refuse its archival.

Workflow example

Input · payload.json:

{
  "workspaceId": "ws_brand_documentation_fixture"
}

CLI:

topolo actions validate app_topolo_brand.workspaces.delete --data @payload.json --json
topolo actions plan app_topolo_brand.workspaces.delete --resource-type workspace --resource-id "$BRAND_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_brand.workspaces.delete --resource-type workspace --resource-id "$BRAND_WORKSPACE_ID" --data @payload.json --confirm --json

MCP tool and arguments:

{
  "tool": "topolo_call_action",
  "arguments": {
    "actionId": "app_topolo_brand.workspaces.delete",
    "input": {
      "workspaceId": "ws_brand_documentation_fixture"
    },
    "resourceType": "workspace",
    "resourceId": "<identifier returned by resource discovery>",
    "confirm": true
  }
}

Captured handler outcome · HTTP 204 with no body. Released SDK value:

Success is HTTP 204 with no body. The released CLI SDK represents that body as an empty string. No deleted:true object is returned. The Brand handler does not independently reject a default workspace; Auth may refuse its archival.

Verify the result

Refresh granted workspaces through platform discovery and confirm the archived identifier is absent. Preserve an Auth refusal; it does not establish successful archival.

Errors and recovery

  • auth_error (HTTP 401): CLI/SDK authentication classification when Auth returns a non-code message: restore the authorized credential, then verify whoami and context. Preserve the exact service message.

  • permission_denied (HTTP 403): Use the exact permission and granted resource required by the reviewed action; organization membership alone is insufficient.

  • workspace_required (HTTP 400): Discover and select a granted Brand workspace before preparing the request.

  • brand_storage_unavailable (HTTP 503): The Brand storage bindings are unavailable. Preserve the request identifier and report the service fault; do not retry an unverified mutation.

Recovery boundary

There is no restore action in this Brand action set. Preserve necessary exports and do not infer a new workspace has the same identity.

  • app_topolo_brand.privacy.export: Export records and asset download paths belonging to the selected Brand workspace.

Evidence

Four real local SQLite stores use all canonical migrations; Auth identity/grants and archival plus R2 object storage are explicitly simulated. Notifications are disabled in fixtures. No notification delivery, live mutation, gateway credential parity or deployed environment proof is claimed. Fixture identifiers and timestamps are synthetic and must be replaced by exact authorized resource discovery.