Archive an empty Campaigns workspace
Checks app-local emptiness, requests canonical Auth archival, then deletes the local identity mirror. The source does not permanently delete canonical workspace identity.
Outcome and boundaries
Checks app-local emptiness, requests canonical Auth archival, then deletes the local identity mirror. The source does not permanently delete canonical workspace identity.
Success is HTTP 204 with no JSON body. Active or archived campaign-domain rows still count as content; merely archiving campaigns does not make the workspace empty. Auth decides canonical refusal, including any default-workspace rule.
Before you start
- Confirm the intended environment and current credential organization using whoami; discover the exact application/action before any call.
- Required application permission: app_topolo_campaigns.workspace:delete. Catalog discoverability is not permission to execute.
- Discover an authorized canonical workspace and bind resourceType workspace/resourceId separately from action input.
- All worked cases in this guide are hypothetical source-reviewed illustrations; no business action, live fixture, customer data or provider request was executed.
- Canonical workspace minimum access is admin in addition to the application permission. After grant verification, the first request may create an app-local identity/recipient mirror even before the later app-permission check; this is not campaign-domain completion.
Discover the intended identifiers
- Discover the workspace from the granted canonical Campaigns workspace list; workspaceId must equal the verified selected resource.
Action: app_topolo_campaigns.workspaces.delete · DELETE /api/workspaces/{workspaceId}.
Input fields
| Field | Required | Meaning and validation |
|---|---|---|
workspaceId | Yes | Discovered canonical workspace id, also selected as workspace resource context. Canonical grant level admin and application workspace:delete are both needed. string; minLength=1 |
Safe call sequence
Write the reviewed input to payload.json; fixture identifiers below are unusable examples. Validate before planning, bind the discovered resource separately, and execute only within actual authority.
topolo actions validate app_topolo_campaigns.workspaces.delete --data @payload.json --json
topolo actions plan app_topolo_campaigns.workspaces.delete --resource-type workspace --resource-id "$CAMPAIGNS_WORKSPACE_ID" --data @payload.json --json
The published action requires confirmation. Only after the exact mutation is authorized, use that same payload/context with --confirm on plan/call; no operation in this guide has been executed.
Worked cases
Every response below is synthetic and source-reviewed, not captured. HTTP status and body are explained independently; a structurally valid body alone never proves successful execution. Middleware may add a different error envelope.
Empty workspace archived · HTTP 204
Input:
{
"workspaceId": "workspace_example"
}
Illustrative HTTP 204 has no response body. Do not parse a JSON object.
There is no JSON response. null below is only the documentation representation of an absent body.
Stored content blocks archival · HTTP 409
Input:
{
"workspaceId": "workspace_example"
}
Illustrative response:
{
"error": "workspace_not_empty"
}
Canonical Auth refuses · HTTP 409
Input:
{
"workspaceId": "workspace_example"
}
Illustrative response:
{
"error": "workspace_archive_refused",
"code": "workspace_archive_refused"
}
The error message may come from Auth; code identifies this boundary.
Verify the outcome
- Treat 204 as no-content; then re-read the canonical workspace list under authorized access. Reconcile a platform-archived/local-cleanup failure through the owners instead of guessing a rollback.
Refusals and recovery
- HTTP 403
workspace_forbidden: The canonical workspace grant refused the selected resource. Resolve it with the access owner, not a guessed workspace. - HTTP 404
workspace_not_found: Correct the named input or retain the authoritative refusal in the same context. - HTTP 409
workspace_not_empty: Correct the named input or retain the authoritative refusal in the same context. - HTTP 409
workspace_archive_refused: Correct the named input or retain the authoritative refusal in the same context. - HTTP 502
workspace_archive_refused: Auth archival returned a non-409 refusal. Preserve its status, code and request id; reconcile canonical workspace state and app-local cleanup with the lifecycle owner before any separately authorized retry. Do not recreate identity or delete content to force emptiness. - HTTP 403
forbidden: Raw handler permission refusal. SDKs can normalize it to permission_denied. Keep the same intended resource; do not widen access.
No Campaigns restore action is published. Do not recreate the same identifier or delete retained content to bypass emptiness. Canonical restoration, if available, belongs to its published Auth lifecycle and owner.
Source and catalog limits
The catalog describes deletion and a non-default check; source asks Auth to archive and does not implement its own default test. The declared object output schema cannot describe the actual 204/no-body success.
Exact schemas and provenance
Input schema:
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"workspaceId": {
"type": "string",
"minLength": 1
}
},
"required": [
"workspaceId"
],
"additionalProperties": false
}
Output schema:
{
"type": "object",
"title": "Delete workspace response",
"description": "Operation result returned by workspaces.delete.",
"properties": {
"success": {
"type": "boolean"
},
"id": {
"type": "string"
},
"data": {
"anyOf": [
{
"type": "object",
"title": "workspace record",
"properties": {
"id": {
"type": "string",
"description": "Stable identifier when the workspace exposes one."
}
},
"additionalProperties": true
},
{
"type": "object",
"additionalProperties": true
}
]
},
"result": {
"type": "object",
"additionalProperties": true
},
"message": {
"type": "string"
}
},
"additionalProperties": true,
"x-topolo-contract-source": "derived-action-metadata",
"x-topolo-contract-precision": "structural"
}
Reviewed immutable source: TopoloCampaigns@cacbb8b12b4e19a662cf82d03a927aef3c3a35e8, apps/api/src/campaigns-store.ts. Fresh production catalog was read on 2026-10-20. Its publication metadata is not proof that this source is loaded. Output examples are not widened or rewritten to force schema success; the accompanying validation record classifies exact success, refusal, no-body and structural-schema limits.
Local input rejection example
This deliberately invalid input belongs to a pure schema check; it is never a planned or executed request. The closed action input schema must reject the extra field. It has no HTTP status or server response.
{
"workspaceId": "workspace_example",
"__unsupported_field": true
}
The hidden companion labels this as ILLUSTRATIVE_LOCAL_SCHEMA_CHECK; its validation representation is not an action output.
Published output validation limits
Current published output qualification: the output schema accepts an empty object, a partial success marker, a partial data object and a refusal body. It therefore establishes only broad structure. Require the documented HTTP/domain result and source-shaped fields; missing fields or a schema-valid error are not success. The reviewed success is HTTP 204 with no body; its documentation null represents absence and is not a JSON success matching the declared object schema.
These observations come from pure checks of the exact published schema; they are not server responses or production captures.