Outcome
Require the exact granted workspace and existing local mirror, refuse all local content including archived items, failed imports and settings, then request canonical Auth archival and remove the mirror. HTTP 204 has no body.
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 Inventory workspace and bind that exact resource. Supplied identifiers do not grant access.
- Authorize the documented inventory, review, import, notification, metering, privacy or archival effects before CLI --confirm or MCP confirm:true.
Discover the target
topolo whoami --json
topolo actions get app_topolo_inventory.workspaces.delete --detail --json
topolo resources topolo-inventory --json
topolo workspaces list topolo-inventory --json
- Select the exact granted workspace id as INVENTORY_WORKSPACE_ID. Fixture ids authorize no live operation.
Request
DELETE /api/workspaces/{workspaceId}
Save action input as payload.json. Inspect the plan for the exact path, query and body. Set INVENTORY_WORKSPACE_ID from granted resource discovery.
Inspect and test this action in the signed action console, then perform the verification below.
Input fields
| Field | Required | Type | Constraints |
|---|---|---|---|
workspaceId | Required | string | Exact id from authorized canonical workspace discovery, matching the separate resource binding.; {"minLength":1} |
View the complete input schema in the action console. The same schema is available through CLI and MCP action discovery.
Effects
- Counts items, locations, import jobs, settings and movements by organization/workspace. Any record, including archived/history/settings rows, prevents archive.
- After Auth accepts canonical archival, removes the local mirror. The cross-service operations are sequential with no atomic rollback guarantee.
Interpret the response
HTTP 204 returns no identifier. Use the previously authorized input.workspaceId and canonical workspace discovery for verification.
Expect HTTP 204/SDK empty string; no workspaceId can be extracted from this response. Verify canonical status through topolo workspaces list topolo-inventory. A missing local mirror alone does not prove canonical archival succeeded.
The success schema was checked against captured handler responses. Delegated Auth profile and canonical widget context fields can vary; exact Inventory projections and all six raw SQL export stores are source-reviewed. Error examples retain their actual refusal shapes.
View the complete success schema in the action console. The worked examples below retain complete captured responses; action discovery supplies the exact schema.
Worked examples
Captured exported Worker responses use both real local SQLite D1 databases with all six committed migrations, synthetic Auth/workspace grants and simulated Notify/Nexus/archive transport. They prove local handler shapes and scoped behavior, not live authorization, notification delivery, metering acceptance or environment deployment. Large 100-row list/capped-dashboard captures are retained in local evidence; committed tests verify those limits while worked guides use smaller complete responses. Refused examples demonstrate boundaries and must not be executed as successful workflows.
Successful request
Actual exported Worker response with both local SQLite D1 databases and all committed migrations; synthetic Auth/grants and simulated Notify/Nexus/archive transport. No live delivery, billing or environment deployment proof. Captured scenario: empty archive returns no HTTP body.
Input · payload.json:
{
"workspaceId": "ws_inventory_fixture"
}
CLI:
topolo actions validate app_topolo_inventory.workspaces.delete --data @payload.json --json
topolo actions plan app_topolo_inventory.workspaces.delete --resource-type workspace --resource-id "$INVENTORY_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_inventory.workspaces.delete --resource-type workspace --resource-id "$INVENTORY_WORKSPACE_ID" --data @payload.json --confirm --json
MCP tool and arguments:
{
"tool": "topolo_call_action",
"arguments": {
"actionId": "app_topolo_inventory.workspaces.delete",
"input": {
"workspaceId": "ws_inventory_fixture"
},
"resourceType": "workspace",
"resourceId": "<identifier returned by granted resource discovery>",
"confirm": true
}
}
Captured local response · HTTP 204:
HTTP 204. Expect HTTP 204/SDK empty string; no workspaceId can be extracted from this response. Verify canonical status through topolo workspaces list topolo-inventory. A missing local mirror alone does not prove canonical archival succeeded.
Refused request · HTTP 409
Actual exported Worker response with both local SQLite D1 databases and all committed migrations; synthetic Auth/grants and simulated Notify/Nexus/archive transport. No live delivery, billing or environment deployment proof. Captured scenario: canonical Auth archive refused.
Input · payload.json:
{
"workspaceId": "ws_inventory_fixture"
}
CLI:
topolo actions validate app_topolo_inventory.workspaces.delete --data @payload.json --json
topolo actions plan app_topolo_inventory.workspaces.delete --resource-type workspace --resource-id "$INVENTORY_WORKSPACE_ID" --data @payload.json --json
Captured local response · HTTP 409:
{
"error": "workspace_archive_refused"
}
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.
Refused request · HTTP 403
Actual exported Worker response with both local SQLite D1 databases and all committed migrations; synthetic Auth/grants and simulated Notify/Nexus/archive transport. No live delivery, billing or environment deployment proof. Captured scenario: input differs from verified workspace.
Input · payload.json:
{
"workspaceId": "ws_foreign"
}
CLI:
topolo actions validate app_topolo_inventory.workspaces.delete --data @payload.json --json
topolo actions plan app_topolo_inventory.workspaces.delete --resource-type workspace --resource-id "$INVENTORY_WORKSPACE_ID" --data @payload.json --json
Captured local response · HTTP 403:
{
"error": "workspace_forbidden"
}
HTTP 403. The handler refused this request. Resolve its exact cause before retrying; input validation can reject an invalid fixture before it reaches the handler.
Refused request · HTTP 409
Actual exported Worker response with both local SQLite D1 databases and all committed migrations; synthetic Auth/grants and simulated Notify/Nexus/archive transport. No live delivery, billing or environment deployment proof. Captured scenario: item prevents archive.
Input · payload.json:
{
"workspaceId": "ws_inventory_fixture"
}
CLI:
topolo actions validate app_topolo_inventory.workspaces.delete --data @payload.json --json
topolo actions plan app_topolo_inventory.workspaces.delete --resource-type workspace --resource-id "$INVENTORY_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.
Refused request · HTTP 404
Actual exported Worker response with both local SQLite D1 databases and all committed migrations; synthetic Auth/grants and simulated Notify/Nexus/archive transport. No live delivery, billing or environment deployment proof. Captured scenario: missing local mirror.
Input · payload.json:
{
"workspaceId": "ws_inventory_fixture"
}
CLI:
topolo actions validate app_topolo_inventory.workspaces.delete --data @payload.json --json
topolo actions plan app_topolo_inventory.workspaces.delete --resource-type workspace --resource-id "$INVENTORY_WORKSPACE_ID" --data @payload.json --json
Captured local response · HTTP 404:
{
"error": "workspace_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
- Expect HTTP 204/SDK empty string; no workspaceId can be extracted from this response.
- Verify canonical status through topolo workspaces list topolo-inventory. A missing local mirror alone does not prove canonical archival succeeded.
Errors and recovery
invalid_action_input(HTTP 400): Correct only the exact fields reported by the published schema validator. An invalid input can be refused before its handler.action_permission_required(HTTP 403): Stop when the verified credential lacks the published action permission. Resource identifiers and organization ownership do not grant that permission.organization_required(HTTP 403): Use the specifically authorized organization context; personal scope cannot act on organization-owned Inventory data.workspace_required(HTTP 400): Discover an authorized Inventory workspace and pass its exact separate resource binding; bootstrap does not select a workspace.workspaces_unavailable(HTTP 503): Retain the request id and report unavailable canonical workspace discovery; do not invent a default workspace.workspace_forbidden(HTTP 403): input.workspaceId must match the independently verified workspace binding.workspace_not_found(HTTP 404): No scoped local mirror exists. Check canonical workspace state; this is not an archival success acknowledgement.workspace_not_empty(HTTP 409): Every counted table must be empty. Archived items, failed import jobs and settings still block archive; organization erasure is not a routine archive prerequisite.workspace_archive_refused(HTTP 409): Auth refused archival; retain request id and inspect canonical policy. No local mirror was removed by this refusal.workspace_archive_refused(HTTP 502): Auth archival request failed. Verify canonical state before replay; keep the exact error and environment.
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
No published Inventory unarchive or mirror-only repair action exists. Verify canonical state after an ambiguous failure and request authorized operator recovery; do not invent workspace identity.
Evidence
Captured exported Worker responses use both real local SQLite D1 databases with all six committed migrations, synthetic Auth/workspace grants and simulated Notify/Nexus/archive transport. They prove local handler shapes and scoped behavior, not live authorization, notification delivery, metering acceptance or environment deployment. Large 100-row list/capped-dashboard captures are retained in local evidence; committed tests verify those limits while worked guides use smaller complete responses. Capture digests and test scenarios are retained in the source fixture records.