Close an organisation
const url = 'https://api.sloose.com/staff/orgs/org_9f3c/close';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"reason":"example","purgeAfterDays":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.sloose.com/staff/orgs/org_9f3c/close \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "reason": "example", "purgeAfterDays": 1 }'Backoffice route: a staff session, or ADMIN_TOKEN. Takes the organisation out of service without deleting anything: every connector’s credential is revoked at its provider, the Stripe subscription is cancelled so nothing is charged again, and every session and API token bound to the organisation answers 403 ORG_CLOSED from this moment. A purge_after clock starts — 30 days by default — and until it runs out POST …/reopen puts the organisation back; the credentials do not come back, because revoking them was not ours to undo. Whatever could not be finished comes back in warnings — a credential Zoho would not revoke, a subscription Stripe would not cancel, a write or a cache of ours that failed — as plain descriptions, never exception text; the close itself always happens. Written down as org.close.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The organisation
Example
org_9f3cThe organisation
Request Bodyrequired
Section titled “Request Bodyrequired”object
Why the organisation is closing. Required — it goes on the record.
Days before the purge may run. Defaults to 30.
Examplegenerated
{ "reason": "example", "purgeAfterDays": 1}Responses
Section titled “Responses”Closed.
object
The earliest the purge will run.
What could not be done on the way out — a credential Zoho would not revoke, a subscription Stripe would not cancel, a cached entitlement that would not clear. Plain descriptions, never exception text. The organisation is closed regardless, so this is the only place a partial offboarding is reported.
Examplegenerated
{ "closedAt": "example", "purgeAfter": "example", "connectorsRevoked": 1, "subscriptionCancelled": true, "warnings": [ "example" ]}The request — its body or its query — 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 organisation, 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 organisation is closed already (code: ALREADY_CLOSED).
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 restore switch is on (code: MAINTENANCE): every route but /health and /robots.txt is refused before anything is read, except the operator’s own POST /staff/people/{id}/delete with the ADMIN_TOKEN. Sloose is down for maintenance. Please try again in a few minutes.
object
Example
{ "code": "MAINTENANCE"}Headers
Section titled “Headers”Seconds until asking again is worth it (300 while the switch is on).