Removals API
NOTE
These are the internal routes the workspace window uses. They are not a public API and may change.
These routes sit under /api/workspaces/ in the workspace itself. They are not the /ox-api/ surface in the
REST API. For the person-facing flow, see Removals;
for every refusal and its sentence, see A removal was refused.
Overview
A removal is staged by a Save or an accepted proposal, waits on a list kept with the workspace, and runs only at Deploy. Deploy is bound to a plan hash: the plan you reviewed must still be the plan when you confirm.
Any workspace member can accept a proposal; some changes (access, licenses, connected-app requests) need a management right. The same holds for a Save.
| Who | Needed for |
|---|---|
| A workspace member | Saving, and accepting a proposal |
An owner, or Workspace.Access.Manage | Saving or accepting a change to access records or a connected-app request |
An owner, or Workspace.Archive | Archiving the workspace, reading its archive plan, and the wind-down notices |
Licenses.Manage | Saving or accepting a change to licenses |
Workspace.Deploy | The deploy plan, Deploy, and reading a deploy run |
A workspace's owners hold Licenses.Manage and Workspace.Deploy with no access card. A call is still
capped by the rights its token carries, so an API key scoped without them is refused.
Deploy plan
GET /api/workspaces/commit/deploy-plan
Returns what a Deploy would do now, including every staged removal and a PlanHash.
| Status | Code | When |
|---|---|---|
| 403 | DEPLOY_NOT_ALLOWED | The caller lacks Workspace.Deploy |
| 503 | CHECKS_UNAVAILABLE | The removal checks could not run, so no plan could be built |
Deploy
POST /api/workspaces/commit/deploy
Body: ConfirmedPlanHash, the PlanHash of the plan the person confirmed.
| Status | Code | When |
|---|---|---|
| 403 | DEPLOY_NOT_ALLOWED | The caller lacks Workspace.Deploy |
| 409 | DEPLOY_PLAN_CHANGED | Removals are waiting or records are moving to your private cloud, and the confirmed hash does not match the current plan (an older deletes body is refused the same way). The body carries the fresh Plan. Nothing was torn down |
| 409 | DEPLOY_IN_PROGRESS | Another deploy holds this workspace |
| 409 | MOVE_HELD | A record would move to your private cloud and its kind cannot move yet. Nothing was deployed |
| 503 | CHECKS_UNAVAILABLE | The removal checks could not run, so nothing was deployed |
Deploying a staged removal of a workbench deletes its Container Apps, one for each mode it runs; an app that is
already gone counts as removed. Removing a workbench from its surface stages the same whole-record removal as
removing it from the workspace canvas, so it is a Workbenches/{lookup} entry on the list like any other record.
A proposal cannot remove a workbench (REMOVER_NOT_ALLOWED).
A removal that keeps a copy of its data has the copy taken first, inside the Deploy, into the oi-data-archives
container of the landing zone. A copy that cannot be taken is not refused by status: the removal comes back as an
excluded entry in the response with the copy's code (listed under
Data stores and data archives),
nothing of it is torn down, and it stays on the list.
The body may also send AcceptsRunPoll: true, saying the caller will poll a run. The answer is a 202 with a
runId only when the caller opted in and the work cannot finish inside the request. Today every Deploy answers
inline, because the copy runs inside the request; read its progress from Deploy runs.
Save
POST /api/workspaces/commit
Body: eac (the workspace) and StageDeletes (removals to stage). Restoring a waiting removal is a Save
that clears its entry.
| Status | Code | When |
|---|---|---|
| 400 | RECORD_STAGED_FOR_DELETE | The Save changes a record that is waiting to be removed |
| 400 | STAGE_ON_ACTUATED_SAVE | A removal was added to a setup-window Save that also builds in your cloud |
| 400 | STAGE_DELETES_SHAPE | A removal does not say what it removes |
| 400 | any removal check code | A refusal from the removal checks |
| 409 | TEARDOWN_STARTED | The removal being restored has already started |
| 409 | DEPLOY_IN_PROGRESS | A deploy holds this workspace |
| 503 | CHECKS_UNAVAILABLE | The checks could not load, so nothing was committed |
Removal check
POST /api/workspaces/commit/removal-check
Body: Records, a list of { Kind, Lookup } (at most 50). Answers, for each record, whether a delete
would remove it at once (GoesAway) or leave it waiting for Deploy, with the reason. The canvas asks this
before a delete; the Save decides again on its own.
Accept a proposal
POST /api/workspaces/proposals/{group}/{bundle}/accept
Body: ConfirmDeletes, required when the bundle removes records.
| Status | Code | When |
|---|---|---|
| 400 | DELETE_CONFIRM_REQUIRED | The bundle removes records and ConfirmDeletes was not sent |
| 403 | NOT_A_MEMBER | The caller is not a member of this workspace |
| 403 | ACCESS_MANAGE_REQUIRED | The bundle changes access records and the caller is not an owner and lacks Workspace.Access.Manage |
| 403 | ACCESS_RIGHT_REQUIRED | The bundle changes licenses and the caller lacks Licenses.Manage |
| 400 | FROM_SURFACE_NOT_SUPPORTED | The bundle removes a kind from one surface that is removed only as a whole record |
| 409 | ALREADY_STAGED | The record is already waiting for the next deploy |
| 409 | TARGET_NOT_FOUND | The record is no longer in this workspace |
| 409 | any other removal check code | A refusal from the removal checks |
| 409 | DEPLOY_IN_PROGRESS | A deploy holds this workspace |
| 503 | CHECKS_UNAVAILABLE | The checks could not run, so nothing was accepted |
Accepting stages a removal that waits for Deploy; a record that runs nothing in Azure, or was never built, is removed at accept.
Archive a workspace
DELETE /api/workspaces/archive
| Status | Code | When |
|---|---|---|
| 403 | WORKSPACE_ARCHIVE_REQUIRED | The caller is not an owner and lacks Workspace.Archive (the plan read needs the same) |
| 409 | WORKSPACE_ARCHIVE_BLOCKED | Removals are still waiting for the next deploy |
| 409 | DEPLOY_IN_PROGRESS | A deploy holds this workspace |
| 409 | PROVENANCE_WORM_ACTIVE | The workspace's Provenance is Locked (a person pressed Lock permanently) |
| 409 | ARCHIVE_PLAN_CHANGED | The archive plan changed since it was shown |
| 409 | ARCHIVE_LICENSE_SUBSCRIPTIONS_UNREAD | A license's subscribers could not be read from Stripe, so nothing was torn down. The sentence names the read's reason (for example LICENSE_NOT_CONNECTED), and each such license in Resources carries it as Reason |
| 409 | ARCHIVE_LICENSE_SUBSCRIPTIONS_LIVE | A license gained a subscriber in Stripe while the archive ran, found at the read right before that license is retired, and nothing had been removed yet. The sentence names the license and its live subscriptions; cancel them in Stripe, then archive again. A stop after something was removed is not this refusal: it answers 500 ARCHIVE_STOPPED_PARTWAY and a second press finishes it |
GET /api/workspaces/archive returns the archive plan.
A license that never had Stripe keys (no Stripe settings at all, or every key empty) is skipped: its Stripe step is not read, wound down or retired, and the archive's Resources note it as kept with the code ARCHIVE_LICENSE_NEVER_KEYED. A license with any key set is still read, and if that read fails (including a key reference that cannot be read) it blocks as ARCHIVE_LICENSE_SUBSCRIPTIONS_UNREAD with the real reason. GET /api/workspaces/archive/notices agrees: a skipped license is not in Unread, and UnreadReasons maps each license that is unread to the read's reason in words.
History
GET /api/workspaces/commit/statuses
The last 20 commits, each with the intent it was recorded with. The Deploy window's Deployments and Saves read this.
Deploy runs
GET /api/workspaces/commit/deploy-runs
GET /api/workspaces/commit/deploy-runs/{runId}
The first answers the deploy running now; the second answers one run, running or finished. Both need
Workspace.Deploy and answer the same fields: RunID, State, StartedAt, CompletedAt and Outcome once it
ends, Exclusions (each removal left waiting, with its code), the Plan it ran, SavedDuring and Removals.
| Status | Code | When |
|---|---|---|
| 403 | UNKNOWN_RUN | The caller lacks Workspace.Deploy |
| 404 | UNKNOWN_RUN | Nothing is deploying in this workspace right now (or: This deploy run is not known here. If a deploy is still running, try again shortly.) |
Data archives
The copies kept by removals, read from the oi-data-archives container of the workspace's landing zone. They are
the Removed items list in the workspace (see Removed items and Recover).
There is no MCP tool for them.
List
GET /api/workspaces/data-archives
Needs Workspace.DataStore.Table.Read, as reading a table's documents does. Answers the archives' manifests as a
JSON array, with no envelope: each names its Kind, Lookup, EntryID, Attempt, CreatedAt and Parts. A copy
whose manifest was never written is unfinished and is not listed. A landing zone with no copies answers [].
Download one file
GET /api/workspaces/data-archives/{kind}/{lookup}/{entryId}/parts?name=attempt-0001/part-0001.ndjson
Needs Workspace.DataStore.Table.Read. Streams one stored file of one copy (a part, or its manifest), byte for
byte. name may only name a file directly inside one attempt of that entry.
Recover
POST /api/workspaces/data-archives/{kind}/{lookup}/{entryId}/recover
Body: ConfirmRecover: true. Needs Workspace.Deploy.
Writes the removed record back from the copy's own settings, unprovisioned: nothing is built in Azure until the
next Deploy. A table and an IoT fabric can be recovered. Answers 202 with Recovering, Kind, Lookup and the
queued CommitID; the record is back once that commit completes.
Refusals
| Status | Code | When |
|---|---|---|
| 403 | DATA_STORE_RIGHT_MISSING | List or download: the caller lacks Workspace.DataStore.Table.Read |
| 403 | DEPLOY_NOT_ALLOWED | Recover: You do not have permission to recover records in this workspace. |
| 400 | DATA_ARCHIVE_RECOVER_UNCONFIRMED | Recover writes the removed record back. Confirm it with ConfirmRecover: true. |
| 400 | DATA_ARCHIVE_ADDRESS_INVALID | The lookup and entry id must each be one path segment. |
| 400 | DATA_ARCHIVE_KIND_UNKNOWN | There is no recoverable record at this address. |
| 400 | DATA_ARCHIVE_PART_NAME_INVALID | name must be one file inside one attempt, as 'attempt-0001/part-0001.ndjson'. |
| 404 | DATA_ARCHIVE_ENTRY_NOT_FOUND | There is no data archive for this entry, so nothing was recovered. |
| 404 | DATA_ARCHIVE_RECORD_MISSING | This copy holds no settings, so nothing was recovered. |
| 404 | DATA_ARCHIVE_PART_NOT_FOUND | There is no such file in this archive. |
| 409 | DATA_ARCHIVE_RECORD_EXISTS | This record is in the workspace already, so it was not overwritten. |
| 409 | DATA_ARCHIVE_PARENT_MISSING | This table's database or data store is no longer in the workspace, so it was not recovered. Recover or recreate them first. |
| 409 | DATA_ARCHIVE_PARENT_STAGED | This table's database or data store is staged for removal, so it was not recovered: the next Deploy would remove it again. Restore that removal first. |
| 409 | DATA_ARCHIVE_TABLE_NAME_TAKEN | A table in this database already uses this container name, so it was not recovered. |
| 409 | DEPLOY_IN_PROGRESS | Recover: a Deploy is removing records in this workspace now |
| 409 | CLOUD_NOT_CONNECTED | This workspace has no cloud connection (or its connection is incomplete or unusable), so there are no data archives to read. |
| 409 | ARCHIVE_DESTINATION_MISSING | The workspace landing zone has no storage account recorded on it |
| 422 | DATA_ARCHIVE_RECORD_MALFORMED | This copy's settings could not be read, so nothing was recovered. |
| 500 | DATA_ARCHIVE_RECOVER_CONTEXT_MISSING | Recover could not reach the workspace settings service, so nothing was recovered. |
| 502 | ARCHIVE_DESTINATION_FORBIDDEN | The landing zone refused the read, so nothing was listed, downloaded or recovered |
On fathym.com: OpenX →
On this page
- Removals API
- ╰─▶Overview
- ╰─▶Deploy plan
- ╰─▶Deploy
- ╰─▶Save
- ╰─▶Removal check
- ╰─▶Accept a proposal
- ╰─▶Archive a workspace
- ╰─▶History
- ╰─▶Deploy runs
- ╰─▶Data archives
- ╰─▶List
- ╰─▶Download one file
- ╰─▶Recover
- ╰─▶Refusals