Topolo Docs Topolo Platform
Open workspace

Delete space

Irreversibly remove one space and its database metadata, leaving stored asset and export object bytes.

Outcome

Irreversibly remove one space and its database metadata, leaving stored asset and export object bytes.

Before you start

  • Verify the authenticated identity, exact environment and pinned approved organization context before preparing an action.
  • The published application permission is spaces:admin. 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.spaces.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.
  • Discover the exact spaceId from spaces.list or a retained creation response in this workspace.

Request

DELETE /api/spaces/{spaceId}

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
spaceIdRequiredstringExact space id discovered from spaces.list or a creation response in this granted workspace.; {"minLength":1}

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

Effects

  • Deletes associated asset metadata, jobs, annotations, links, events, invitations, publish attempts and export rows, then the core space record.
  • The deletion spans four databases without one transaction. It does not call R2 delete; retained bytes become untracked and a later organization erasure cannot discover them through removed rows.
  • Removed enabled-link metadata stops normal public resolution. Success returns only ok:true; repeated calls return space_not_found.

Interpret the response

The response does not discover a new resource id. Retain exact input/context identifiers; nullable or absence responses are not canonical identifier discovery.

Save the requested spaceId before execution; success contains no resource id. Read spaces.get and expect space_not_found, and verify the old public URL stops resolving. Do not claim stored bytes or backups were erased. Preserve object/export identifiers from an approved pre-delete export when assessing retention.

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.

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:

{
  "spaceId": "space_9338e6fc-cc93-421e-a783-6c8062088e0c"
}

CLI:

topolo actions validate app_topolo_spaces.spaces.delete --data @payload.json --json
topolo actions plan app_topolo_spaces.spaces.delete --resource-type workspace --resource-id "$SPACES_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_spaces.spaces.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.spaces.delete",
    "input": {
      "spaceId": "space_9338e6fc-cc93-421e-a783-6c8062088e0c"
    },
    "resourceType": "workspace",
    "resourceId": "<identifier returned by granted resource discovery>",
    "confirm": true
  }
}

Captured local response · HTTP 200:

{
  "ok": true
}

HTTP 200. Save the requested spaceId before execution; success contains no resource id. Read spaces.get and expect space_not_found, and verify the old public URL stops resolving. Do not claim stored bytes or backups were erased. Preserve object/export identifiers from an approved pre-delete export when assessing retention.

Refused request · HTTP 404

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:

{
  "spaceId": "space_9338e6fc-cc93-421e-a783-6c8062088e0c"
}

CLI:

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

Captured local response · HTTP 404:

{
  "error": "space_not_found"
}

HTTP 404. 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:

{
  "spaceId": "space_bfe6af37-3588-406b-b103-7675eb527e82"
}

CLI:

topolo actions validate app_topolo_spaces.spaces.delete --data @payload.json --json
topolo actions plan app_topolo_spaces.spaces.delete --resource-type workspace --resource-id "$SPACES_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_spaces.spaces.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.spaces.delete",
    "input": {
      "spaceId": "space_bfe6af37-3588-406b-b103-7675eb527e82"
    },
    "resourceType": "workspace",
    "resourceId": "<identifier returned by granted resource discovery>",
    "confirm": true
  }
}

Captured local response · HTTP 200:

{
  "ok": true
}

HTTP 200. Save the requested spaceId before execution; success contains no resource id. Read spaces.get and expect space_not_found, and verify the old public URL stops resolving. Do not claim stored bytes or backups were erased. Preserve object/export identifiers from an approved pre-delete export when assessing retention.

Refused request · HTTP 404

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:

{
  "spaceId": "space_bfe6af37-3588-406b-b103-7675eb527e82"
}

CLI:

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

Captured local response · HTTP 404:

{
  "error": "space_not_found"
}

HTTP 404. 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:

{
  "spaceId": "space_858bda7b-397a-4784-979e-609961a9a16e"
}

CLI:

topolo actions validate app_topolo_spaces.spaces.delete --data @payload.json --json
topolo actions plan app_topolo_spaces.spaces.delete --resource-type workspace --resource-id "$SPACES_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_spaces.spaces.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.spaces.delete",
    "input": {
      "spaceId": "space_858bda7b-397a-4784-979e-609961a9a16e"
    },
    "resourceType": "workspace",
    "resourceId": "<identifier returned by granted resource discovery>",
    "confirm": true
  }
}

Captured local response · HTTP 200:

{
  "ok": true
}

HTTP 200. Save the requested spaceId before execution; success contains no resource id. Read spaces.get and expect space_not_found, and verify the old public URL stops resolving. Do not claim stored bytes or backups were erased. Preserve object/export identifiers from an approved pre-delete export when assessing retention.

Refused request · HTTP 404

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:

{
  "spaceId": "space_858bda7b-397a-4784-979e-609961a9a16e"
}

CLI:

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

Captured local response · HTTP 404:

{
  "error": "space_not_found"
}

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

Verify the result

  • Save the requested spaceId before execution; success contains no resource id. Read spaces.get and expect space_not_found, and verify the old public URL stops resolving.
  • Do not claim stored bytes or backups were erased. Preserve object/export identifiers from an approved pre-delete export when assessing retention.

Errors and recovery

  • space_not_found (HTTP 404): Rediscover the exact space id in this granted workspace through spaces.list or a saved creation response; deletion or another workspace can make it unavailable.
  • 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.

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

Database metadata has no published restoration action. Export JSON is a metadata snapshot, not an asset-byte backup. Partial deletion and orphan object retention need separately governed investigation.

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.