Skip to content

Erase a closed org, for good

DELETE
/staff/orgs/{orgId}
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.

orgId
required

The org

string
Example
org_9f3c

The org

Media typeapplication/json
object
reason
required

Why. Required.

string
>= 1 characters <= 500 characters
force

Purge before the clock runs out. For an erasure request that will not wait; still audited.

boolean
Examplegenerated
{
"reason": "example",
"force": true
}

Erased.

Media typeapplication/json
object
counts
required

Rows deleted, by table.

object
key
additional properties
number
usersDeleted
required
integer
ledgerErased
required
boolean
Examplegenerated
{
"counts": {
"additionalProperty": 1
},
"usersDeleted": 1,
"ledgerErased": true
}

The request body did not match the schema. issues carries the Zod issue list.

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
Examplegenerated
{
"error": "example",
"code": "example"
}

A bearer that is neither the token nor a live session (code: AUTH_REQUIRED).

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
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).

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
Examplegenerated
{
"error": "example",
"code": "example"
}

No such org, or it is not visible to this session.

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
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).

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
Examplegenerated
{
"error": "example",
"code": "example"
}