Contract
- shape
- entity
- authority
- act
- evidence
- none
- subscription
- false
- permission
- any one of: staff.ops (the staff role staff_ops held in the Internal org, tradehq_role.staff_role); a deactivated caller is refused first
- idempotency
- natural
- emits
- org.purge_approved, org.purged
- MCP tool
- purge_org
- decision_set
- approve, reject, escalate
- REST
- POST https://api.containertradehq.com/v1/cap/purge_org
Through MCP this call returns an approval request first; see Approvals.
Idempotency: keyed by the contract's own inputs: the same inputs replay the first call's result
Inputs
| name | type | required | validation |
|---|---|---|---|
| org_id | org_id | required | tradehq-org-id; 1 to 20 characters The org to purge. |
| dry_run_id | text | required | 1 to 20 characters The dry run approved: the org's current one, as get_purge_readiness names it, once it has counted. |
Response
org_id· string · The org.state· string · deletion_scheduled: the purge is the job's, and a purged org is no target.purge_after· stringnull · When the countdown ended.dry_run_id· string · The dry run approved.approvals· integer · How many staff have approved this dry run.queued· boolean · The approvals are a quorum and the purge job may run.
Full JSON Schema
{
"type": "object",
"properties": {
"org_id": {
"type": "string",
"minLength": 1,
"maxLength": 20,
"pattern": "^[A-Za-z0-9_-]{1,20}$",
"format": "tradehq-org-id",
"description": "The org.",
"x-data-class": "operational"
},
"state": {
"type": "string",
"enum": [
"deletion_scheduled"
],
"description": "deletion_scheduled: the purge is the job's, and a purged org is no target.",
"x-data-class": "operational"
},
"purge_after": {
"type": [
"string",
"null"
],
"format": "date-time",
"description": "When the countdown ended.",
"x-data-class": "operational"
},
"dry_run_id": {
"type": "string",
"description": "The dry run approved.",
"x-data-class": "operational"
},
"approvals": {
"type": "integer",
"description": "How many staff have approved this dry run.",
"x-data-class": "operational"
},
"queued": {
"type": "boolean",
"description": "The approvals are a quorum and the purge job may run.",
"x-data-class": "operational"
}
},
"required": [
"org_id",
"state",
"purge_after",
"dry_run_id",
"approvals",
"queued"
],
"additionalProperties": false
} Refusals
countdown_running· 422 · the 30 day deletion countdown has not endedorg_not_scheduled· 422 · the org has no deletion scheduledpurge_dry_run_required· 422 · no finished dry run by that id for the org's current deletion; run one and approve it once it has countedpurge_dry_run_superseded· 409 · a newer dry run replaced the one named; its approvals no longer count, so approve the current onepurge_counts_changed· 409 · the purge stopped on the dry run named because the counts changed, and deleted nothing; run a new dry run and approve againorg_has_no_lifecycle· 422 · the org has no lifecycle row: a ported org nothing has typed yetorg_has_no_type· 422 · the org has a lifecycle row and no type row; a person repairs itorg_is_twin· 422 · a test twin follows its live orgorg_declared· 422 · the org is declared in db/tradehq/orgs.json and leaves by a reviewed changeorg_purged· 422 · the org is purged; only its tombstone is left
The platform refusals apply to every call: version, authentication, authority, validation and rate limits, each in the same envelope.
Surfaces
- Mobile: degraded: authority
- MCP: approval required
- Voice: degraded: authority
- OneBox: no document originates a purge
- Outbound: crosses to no counterparty
Events
org.purge_approvedaudit_onlyorg.purgedaudit_only
Related
None.