Outcome
Check that the selected Bytes workspace is empty, then ask Auth to archive it. The path workspaceId must match the verified workspace resource.
Before you start
- Verify identity, pin environment and organization, and discover a granted Bytes workspace before choosing file keys.
- The action requires workspace:delete. Select a verified workspace resource separately from action input; a body field cannot supply a workspace grant.
- Scope org uses the verified workspace shared root; private uses the caller’s private subtree. The accepted legacy all value resolves to org and does not grant cross-organization browsing. The bucket input cannot switch the configured R2 binding.
- Authorize the described effect or private-data export before passing CLI --confirm or MCP confirm:true. GET listing/search can persist derived data; HTTP method alone does not establish a read-only action.
Discover the target
topolo whoami --json
topolo actions get app_topolo_bytes.workspaces.delete --detail --json
topolo resources topolo-bytes --json
topolo workspaces list topolo-bytes --json
- File keys are paths returned by files.list/search in the selected workspace and scope. Discover the granted workspace id; do not derive access from fixture ids.
- The path workspaceId must equal the verified workspace resourceId. Workspace inventory exports contain metadata, not file bytes.
Request
DELETE /api/workspaces/{workspaceId}
Save action input as payload.json. The reviewed plan separates path identifiers, query fields and the HTTP body. Set BYTES_WORKSPACE_ID from granted resource discovery.
Inspect and test this action in the signed action console. A test response still requires the verification below.
Input fields
| Field | Required | Type | Constraints |
|---|---|---|---|
workspaceId | Required | string | {"minLength":1} |
Exact input schema:
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"workspaceId": {
"type": "string",
"minLength": 1
}
},
"required": [
"workspaceId"
],
"additionalProperties": false
}
Effects
- Requests platform archival after local emptiness checks. It is archival, not permanent identity deletion; platform refusal leaves it active.
Interpret the response
The response identifier path is $.workspaceId for workspace. An empty list does not discover a target.
Confirm archived:true and workspaceId, then verify the workspace state through the credential-scoped platform workspace surface.
The schema describes supported success fields; optional metadata and integration-dependent values may vary. Errors have the exact shapes shown in refused examples.
Success schema:
{
"type": "object",
"required": [
"archived",
"workspaceId"
],
"properties": {
"archived": {
"type": "boolean"
},
"workspaceId": {
"type": "string"
}
}
}
Worked examples
Actual exported Worker handlers with local Miniflare R2/KV. Auth, workspace grants, R2 multipart, notification, usage and semantic integrations are simulated at their configured test boundaries. Synthetic ids, timestamps and signed URLs confer no live access. No deployed provider outcome, external delivery or live grant is established. Upload-session credential values are explicitly redacted; binary responses use the tested SDK transport envelope. Replace synthetic identifiers through credential-scoped discovery. Refused scenarios document failure boundaries; they are not successful workflows.
Successful request
Actual worker response with local Miniflare R2/KV and simulated Auth, workspace grants and outbound integration boundaries. No authorization header is captured.
Input · payload.json:
{
"workspaceId": "workspace_acme"
}
CLI:
topolo actions validate app_topolo_bytes.workspaces.delete --data @payload.json --json
topolo actions plan app_topolo_bytes.workspaces.delete --resource-type workspace --resource-id "$BYTES_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_bytes.workspaces.delete --resource-type workspace --resource-id "$BYTES_WORKSPACE_ID" --data @payload.json --confirm --json
MCP tool and arguments:
{
"tool": "topolo_call_action",
"arguments": {
"actionId": "app_topolo_bytes.workspaces.delete",
"input": {
"workspaceId": "workspace_acme"
},
"resourceType": "workspace",
"resourceId": "<identifier returned by granted resource discovery>",
"confirm": true
}
}
Captured local response · HTTP 200:
{
"archived": true,
"workspaceId": "workspace_acme"
}
HTTP 200. Confirm archived:true and workspaceId, then verify the workspace state through the credential-scoped platform workspace surface.
Refused request · HTTP 409
Actual worker response with local Miniflare R2/KV and simulated Auth, workspace grants and outbound integration boundaries. No authorization header is captured.
Input · payload.json:
{
"workspaceId": "workspace_acme"
}
CLI:
topolo actions validate app_topolo_bytes.workspaces.delete --data @payload.json --json
topolo actions plan app_topolo_bytes.workspaces.delete --resource-type workspace --resource-id "$BYTES_WORKSPACE_ID" --data @payload.json --json
Captured local response · HTTP 409:
{
"error": "workspace_not_empty"
}
HTTP 409. This request was refused; preserve the exact response and correct its cause before retrying.
Refused request · HTTP 409
Actual worker response with local Miniflare R2/KV and simulated Auth, workspace grants and outbound integration boundaries. No authorization header is captured.
Input · payload.json:
{
"workspaceId": "workspace_acme"
}
CLI:
topolo actions validate app_topolo_bytes.workspaces.delete --data @payload.json --json
topolo actions plan app_topolo_bytes.workspaces.delete --resource-type workspace --resource-id "$BYTES_WORKSPACE_ID" --data @payload.json --json
Captured local response · HTTP 409:
{
"error": "workspace is the organization default",
"code": "workspace_archive_refused"
}
HTTP 409. This request was refused; preserve the exact response and correct its cause before retrying.
Refused request · HTTP 403
Actual worker response with local Miniflare R2/KV and simulated Auth, workspace grants and outbound integration boundaries. No authorization header is captured.
Input · payload.json:
{
"workspaceId": "workspace_acme"
}
CLI:
topolo actions validate app_topolo_bytes.workspaces.delete --data @payload.json --json
topolo actions plan app_topolo_bytes.workspaces.delete --resource-type workspace --resource-id "$BYTES_WORKSPACE_ID" --data @payload.json --json
Captured local response · HTTP 403:
{
"error": "Forbidden"
}
HTTP 403. This request was refused; preserve the exact response and correct its cause before retrying.
Verify the result
- Confirm archived:true and workspaceId, then verify the workspace state through the credential-scoped platform workspace surface.
Errors and recovery
workspace_not_empty(HTTP 409): Inspect the existing target and workspace state. Resolve the documented conflict before resubmitting; do not erase content to bypass an emptiness or destination check.workspace is the organization default(HTTP 409): Inspect the existing target and workspace state. Resolve the documented conflict before resubmitting; do not erase content to bypass an emptiness or destination check.Forbidden(HTTP 403): Verify the pinned organization, granted workspace resource and required application permission. Inspect the exact refusal before requesting narrower access; never switch scope to bypass the denial.
Authentication, the action-input validator or resource middleware can refuse a request before this handler. Preserve the exact request id, error and selected credential context. The fixtures establish no live credentials or configured provider.
Recovery boundary
The Bytes action provides no unarchive operation. Inspect the published platform workspace lifecycle before choosing a recovery operation.
Related actions
- Export workspace inventory: Export every paginated object’s metadata and redacted sharing records for one verified workspace. This is an inventory, not a backup of file content.
Evidence
Actual exported Worker handlers with local Miniflare R2/KV. Auth, workspace grants, R2 multipart, notification, usage and semantic integrations are simulated at their configured test boundaries. Synthetic ids, timestamps and signed URLs confer no live access. No deployed provider outcome, external delivery or live grant is established. Upload-session credential values are explicitly redacted; binary responses use the tested SDK transport envelope. Capture digests and test scenarios are retained in the source fixture records.