DELETE /v1/organizations/:orgId
Offboard a customer — archive the child org and revoke its keys atomically.
DELETE
/v1/organizations/:orgIdPhase 1stableidempotent
- Auth
- Bearer
- Scope
- org:admin
Offboard a customer in one call. Archiving a child org is terminal: its status moves to archived, all of its API keys are revoked, and it can never be restored. This is the clean cut the flat model can't give you — no lingering OAuth tokens, no entangled credit history.
Archival is irreversible by design. If the same customer returns, create a fresh child org. An archived org cannot be resumed or re-activated.
Path
orgIdstringrequiredThe child org id (`org_`-prefixed or bare UUID).
Headers
Idempotency-Keystring (UUID)optionalOptional. Archiving an already-archived org is itself idempotent and returns its terminal state.
Example request
curl -X DELETE https://api.layers.com/v1/organizations/org_d4e5f6a7-8b9c-4d0e-9f2a-3b4c5d6e7f80 \
-H "Authorization: Bearer $PARENT_KEY"const result = await fetch(
"https://api.layers.com/v1/organizations/org_d4e5f6a7-8b9c-4d0e-9f2a-3b4c5d6e7f80",
{ method: "DELETE", headers: { "Authorization": `Bearer ${process.env.PARENT_KEY}` } },
).then((r) => r.json());import os, requests
result = requests.delete(
"https://api.layers.com/v1/organizations/org_d4e5f6a7-8b9c-4d0e-9f2a-3b4c5d6e7f80",
headers={"Authorization": f"Bearer {os.environ['PARENT_KEY']}"},
).json()Response
200OK
{
"id": "org_d4e5f6a7-8b9c-4d0e-9f2a-3b4c5d6e7f80",
"status": "archived",
"archivedAt": "2026-06-02T13:00:00.000000+00:00",
"reclaimedCredits": 3200,
"revokedApiKeys": 2
}Field notes
revokedApiKeysis the number of the child's active keys that were revoked by this call.reclaimedCreditsis the child's unspent non-reserved balance, swept back to the parent wallet as part of this call. Credits reserved for in-flight generations are not reclaimed. It's0only when the child had nothing reclaimable (never funded, or fully spent). See allocate for the funding side.
Errors
| Status | Code | When |
|---|---|---|
| 404 | NOT_FOUND | No such org, or it isn't a direct child of your org. |
| 422 | VALIDATION | The :orgId is not a valid organization id (malformed UUID). |
| 401 | UNAUTHENTICATED | Missing or invalid key. |
| 403 | FORBIDDEN_SCOPE | Key lacks org:admin. |
See also
POST /v1/organizations/:orgId/suspend— a reversible pause, if you're not ready to offboard.- Organizations concept — the lifecycle diagram.