Erase a closed org, for good
const url = 'https://api.sloose.com/staff/orgs/org_9f3c';const options = { method: 'DELETE', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"reason":"example","force":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request DELETE \ --url https://api.sloose.com/staff/orgs/org_9f3c \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "reason": "example", "force": true }'Backoffice route: a staff session, or ADMIN_TOKEN. This cannot be undone. Deletes every row the org owns — runs, projects, the registry, AI transcripts, billing history, tokens, invitations, memberships — then the org, then anybody whose last membership it was; its ledger is emptied too. The org must be closed first and its purge_after clock must have run out, unless force is set, which is the answer to an erasure request that will not wait. The backoffice’s own audit survives: staff_actions rows keep what they said and carry the org’s id and name into their detail. Written down as org.purge.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The org
Example
org_9f3cThe org
Request Bodyrequired
Section titled “Request Bodyrequired”object
Why. Required.
Purge before the clock runs out. For an erasure request that will not wait; still audited.
Examplegenerated
{ "reason": "example", "force": true}Responses
Section titled “Responses”Erased.
object
Rows deleted, by table.
object
Examplegenerated
{ "counts": { "additionalProperty": 1 }, "usersDeleted": 1, "ledgerErased": true}The request body did not match the schema. issues carries the Zod issue list.
The error envelope every non-2xx answer uses.
object
Human-readable explanation.
Machine-readable reason. Absent on a few legacy 400s.
Examplegenerated
{ "error": "example", "code": "example"}A bearer that is neither the token nor a live session (code: AUTH_REQUIRED).
The error envelope every non-2xx answer uses.
object
Human-readable explanation.
Machine-readable reason. Absent on a few legacy 400s.
Examplegenerated
{ "error": "example", "code": "example"}A customer’s session, an API token, or no bearer at all — not staff, and not the ADMIN_TOKEN (code: ADMIN_REQUIRED).
The error envelope every non-2xx answer uses.
object
Human-readable explanation.
Machine-readable reason. Absent on a few legacy 400s.
Examplegenerated
{ "error": "example", "code": "example"}No such org, or it is not visible to this session.
The error envelope every non-2xx answer uses.
object
Human-readable explanation.
Machine-readable reason. Absent on a few legacy 400s.
Examplegenerated
{ "error": "example", "code": "example"}The org is not closed (code: NOT_CLOSED), or its clock has not run out and force was not set (code: TOO_SOON).
The error envelope every non-2xx answer uses.
object
Human-readable explanation.
Machine-readable reason. Absent on a few legacy 400s.
Examplegenerated
{ "error": "example", "code": "example"}