Delete organization
/organization/{id}
**Schedules permanent deletion 30 days out — it does not erase the organization today.** What happens IMMEDIATELY and cannot be undone: every connection is severed and its vault credential deleted (a restore returns the organization but NOT the connections — each must be re-authorized by hand), every SCIM token and MCP OAuth grant is revoked, and the Stripe subscription is canceled (immediately, not at period end). Everything else — members, roles, teams, toolboxes, templates, restrictions, conversations, audit history, the logo, API tokens — survives and returns on a restore. For the next 30 days the organization is READ-ONLY: every GET still works (the paginated read APIs are the export path, and existing API tokens keep reading through them, so an export script needs no new credential), and every other method answers `403 organization_pending_deletion` except `POST /organization/{id}/restore` and the billing checkout/portal routes. MCP, tool execution and new connections are refused outright. On day 30 a daily cron runs the full teardown. Calling this twice is idempotent — the second call returns the same `purge_after` with an all-zero summary. Requires the `org:delete` permission, which **only the Org Owner role holds** — an Org Admin is refused with 403 `permission_required`. Requires an interactive session and step-up reauthentication: without a valid `X-Step-Up-Token` the call answers `428 step_up_required` (see the step-up flow). `confirm_slug` must equal the organization’s own `slug` and is re-checked server-side, so a client that skips its confirmation prompt does not skip the check. The platform root organization can never be deleted: `403 root_organization_cannot_be_deleted`. Unlike every other mutation here this does NOT require an active subscription — a locked or expired organization must still be able to leave. On `200` the `summary` describes only what THIS call severed; `api_tokens_revoked`, `conversations_purged` and `logo_objects_deleted` are absent and `residue` stays empty because this phase touches none of them (the day-30 purge reports those). A non-empty `failures` means a credential this call promised to revoke may still be live at the provider, and a client should say so rather than repeat the promise.
Path Parameters
Organization id (org_…).
Request Body
Must equal this organization’s slug. Re-checked server-side.
Optional note, recorded on the audit entry this deletion writes before it runs.
Response Body
true
Always true here: this route only schedules. The organization is read-only until purge_after and can be brought back with POST /organization/{id}/restore.
true
When the daily cron will run the full teardown, 30 days out. The restore window closes at this instant. A repeat call on an already-scheduled organization returns the deadline already set, never a later one.
Only what THIS call severed. Counts are of items successfully removed. The purge-only counts (api_tokens_revoked, conversations_purged, logo_objects_deleted) are absent here, not zero: they appear only on the day-30 purge and on a staff immediate delete.
Steps that did not come off cleanly on this run, one entry per step. Empty on a clean run; a retry of the same delete may clear them. Bounded by the fixed number of teardown steps, never by organization size — a step that walks a collection reports a count and a few sample ids in its single entry rather than one entry per row.
2 properties
Stores a deletion cannot reach at all. Empty on this route, because scheduling touches none of them; the day-30 purge (and a staff immediate delete) reports them, and that list is never a sign that anything went wrong. It is the list an erasure request is answered with.
2 properties
curl -X DELETE 'https://api.elaichi.ai/organization/<id>' \
-H 'Authorization: Bearer $ELAICHI_API_TOKEN' \
-H 'Content-Type: application/json'const response = await fetch('https://api.elaichi.ai/organization/<id>', {
method: 'DELETE',
headers: {
'Authorization': 'Bearer ' + process.env.ELAICHI_API_TOKEN,
'Content-Type': 'application/json',
},
});
const data = await response.json();
console.log(data);import os
import requests
url = "https://api.elaichi.ai/organization/<id>"
headers = {
"Authorization": f"Bearer {os.environ['ELAICHI_API_TOKEN']}",
"Content-Type": "application/json",
}
response = requests.delete(url, headers=headers)
print(response.json())