Topolo Docs Topolo Platform
Open workspace

Archive Spaces workspace

Archive a granted empty canonical workspace through Auth, then remove its Spaces identity mirror.

Outcome

Archive a granted empty canonical workspace through Auth, then remove its Spaces identity mirror.

Before you start

  • Verify the authenticated identity, exact environment and pinned approved organization context before preparing an action.
  • The published application permission is workspace:delete. Discover a granted Spaces workspace and bind that exact resource. Supplied identifiers do not grant access.
  • Authorize the documented storage, publication, invitation, notification, metering, privacy or archival effects before CLI --confirm or MCP confirm:true.

Discover the target

topolo whoami --json
topolo actions get app_topolo_spaces.workspaces.delete --detail --json
topolo resources topolo-spaces --json
topolo workspaces list topolo-spaces --json
  • Select the exact granted workspace id as SPACES_WORKSPACE_ID. Fixture ids authorize no live operation.

Request

DELETE /api/spaces/workspaces/{workspaceId}

Save action input as payload.json. Inspect the plan for the exact path, query and body. Set SPACES_WORKSPACE_ID from granted resource discovery.

Inspect and test this action in the signed action console, then perform the verification below.

Input fields

FieldRequiredTypeConstraints
workspaceIdRequiredstringExact active granted canonical workspace id; the path id and resource context must agree.; {"minLength":1}

View the complete input schema in the action console. The same schema is available through CLI and MCP action discovery.

Effects

  • The path workspaceId must match the exact workspace granted for this request and have a local mirror. Spaces refuses when any space remains.
  • Auth owns canonical archival and default-workspace protection. A successful Auth call precedes mirror deletion without a cross-service transaction.
  • The local emptiness check counts spaces only, not orphan object bytes or every other store. This action is not organization erasure and has no published app-local unarchive action.

Interpret the response

Use response path $.workspaceId for workspace. An empty list does not discover a target.

Confirm ok:true and the returned workspaceId equals the discovered target; reread canonical workspaces and grants. Do not interpret mirror removal as object erasure. On an uncertain cross-service result inspect canonical status before retrying.

The success schema was checked against captured handler responses. Delegated Auth identity and canonical widget context fields can vary; exact Spaces envelopes and all thirteen SQL export table sets are source-reviewed against the migrated local schema. Error responses can be plain text; the original refusal body is retained. Error examples retain their actual refusal shapes.

View the complete success schema in the action console. The worked examples below retain complete raw captured Worker responses. CLI responses have a transport envelope and can be bounded unless --detail is requested; action discovery supplies the exact schema.

Worked examples

Real isolated local D1/R2 and source handlers with synthetic Auth/workspace discovery, queue transport, notification delivery and metering. Arbitrary fixture SOG bytes demonstrate handler state only, not valid Gaussian data, renderer quality, deployed processing or live effects. Annotation rows are seeded directly into isolated fixture storage because no annotation mutation is published. Refused examples demonstrate boundaries and must not be executed as successful workflows.

Refused request · HTTP 409

Actual local Worker response; all four migrated D1 databases and R2 are real. Auth identity/workspace discovery, queue transport, notification delivery and metering are simulated or disabled. Captured scenario: minimal.

Input · payload.json:

{
  "workspaceId": "ws_spaces_minimal"
}

CLI:

topolo actions validate app_topolo_spaces.workspaces.delete --data @payload.json --json
topolo actions plan app_topolo_spaces.workspaces.delete --resource-type workspace --resource-id "$SPACES_WORKSPACE_ID" --data @payload.json --json

Captured local response · HTTP 409:

{
  "error": "workspace_not_empty"
}

HTTP 409. The handler refused this request. Resolve its exact cause before retrying; input validation can reject an invalid fixture before it reaches the handler.

Successful request

Actual local Worker response; all four migrated D1 databases and R2 are real. Auth identity/workspace discovery, queue transport, notification delivery and metering are simulated or disabled. Captured scenario: minimal.

Input · payload.json:

{
  "workspaceId": "ws_spaces_minimal"
}

CLI:

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

MCP tool and arguments:

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

Captured local response · HTTP 200:

{
  "ok": true,
  "workspaceId": "ws_spaces_minimal"
}

HTTP 200. Confirm ok:true and the returned workspaceId equals the discovered target; reread canonical workspaces and grants. Do not interpret mirror removal as object erasure. On an uncertain cross-service result inspect canonical status before retrying.

Refused request · HTTP 409

Actual local Worker response; all four migrated D1 databases and R2 are real. Auth identity/workspace discovery, queue transport, notification delivery and metering are simulated or disabled. Captured scenario: workflow.

Input · payload.json:

{
  "workspaceId": "ws_spaces_workflow"
}

CLI:

topolo actions validate app_topolo_spaces.workspaces.delete --data @payload.json --json
topolo actions plan app_topolo_spaces.workspaces.delete --resource-type workspace --resource-id "$SPACES_WORKSPACE_ID" --data @payload.json --json

Captured local response · HTTP 409:

{
  "error": "workspace_not_empty"
}

HTTP 409. The handler refused this request. Resolve its exact cause before retrying; input validation can reject an invalid fixture before it reaches the handler.

Another supported request

Actual local Worker response; all four migrated D1 databases and R2 are real. Auth identity/workspace discovery, queue transport, notification delivery and metering are simulated or disabled. Captured scenario: workflow.

Input · payload.json:

{
  "workspaceId": "ws_spaces_workflow"
}

CLI:

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

MCP tool and arguments:

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

Captured local response · HTTP 200:

{
  "ok": true,
  "workspaceId": "ws_spaces_workflow"
}

HTTP 200. Confirm ok:true and the returned workspaceId equals the discovered target; reread canonical workspaces and grants. Do not interpret mirror removal as object erasure. On an uncertain cross-service result inspect canonical status before retrying.

Refused request · HTTP 409

Actual local Worker response; all four migrated D1 databases and R2 are real. Auth identity/workspace discovery, queue transport, notification delivery and metering are simulated or disabled. Captured scenario: privacy.

Input · payload.json:

{
  "workspaceId": "ws_spaces_privacy"
}

CLI:

topolo actions validate app_topolo_spaces.workspaces.delete --data @payload.json --json
topolo actions plan app_topolo_spaces.workspaces.delete --resource-type workspace --resource-id "$SPACES_WORKSPACE_ID" --data @payload.json --json

Captured local response · HTTP 409:

{
  "error": "workspace_not_empty"
}

HTTP 409. The handler refused this request. Resolve its exact cause before retrying; input validation can reject an invalid fixture before it reaches the handler.

Another supported request

Actual local Worker response; all four migrated D1 databases and R2 are real. Auth identity/workspace discovery, queue transport, notification delivery and metering are simulated or disabled. Captured scenario: privacy.

Input · payload.json:

{
  "workspaceId": "ws_spaces_privacy"
}

CLI:

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

MCP tool and arguments:

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

Captured local response · HTTP 200:

{
  "ok": true,
  "workspaceId": "ws_spaces_privacy"
}

HTTP 200. Confirm ok:true and the returned workspaceId equals the discovered target; reread canonical workspaces and grants. Do not interpret mirror removal as object erasure. On an uncertain cross-service result inspect canonical status before retrying.

Verify the result

  • Confirm ok:true and the returned workspaceId equals the discovered target; reread canonical workspaces and grants.
  • Do not interpret mirror removal as object erasure. On an uncertain cross-service result inspect canonical status before retrying.

Errors and recovery

  • workspace_not_empty (HTTP 409): Inspect spaces.list for retained captures. Do not delete them automatically to clear the archival gate; obtain authorization for their documented destructive metadata and retained-byte effects.
  • organization_context_required (HTTP 403): Stop and authenticate into the approved owning organization. Preserve the actual denial; a resource id does not grant organization access.
  • workspace_required (HTTP 400): Discover the exact granted canonical workspace through resource/workspace discovery; bootstrap does not return a workspace record.
  • workspace_forbidden (HTTP 403): The path id must equal the exact granted resource id. Do not widen the credential to bypass a refusal.
  • workspace_not_found (HTTP 404): The Spaces identity mirror is absent; inspect canonical Auth state before retrying archival.
  • workspace_archive_refused (HTTP 409): Canonical Auth refused archival, including default-workspace protection. Inspect canonical workspace status; the local mirror remains.
  • workspace_archive_refused (HTTP 502): The canonical Auth archive call failed outside the conflict response. Inspect its exact error and canonical state before retrying.

A plain-text server refusal is surfaced by CLI/MCP as http_error with its HTTP status and requestId; its text is not a structured service error.code. Auth, action-input validation and platform resource resolution can refuse a request before its handler. Retain the exact error, request id and context; requesting another context is not a legitimate way to bypass a refusal.

Recovery boundary

Archival has no reversal action in the Spaces catalog. Resolve canonical workspace status with Auth and obtain separate authorization for any supported restoration.

Evidence

Real isolated local D1/R2 and source handlers with synthetic Auth/workspace discovery, queue transport, notification delivery and metering. Arbitrary fixture SOG bytes demonstrate handler state only, not valid Gaussian data, renderer quality, deployed processing or live effects. Annotation rows are seeded directly into isolated fixture storage because no annotation mutation is published. Capture digests and test scenarios are retained in the source fixture records.