Close this organisation
const url = 'https://api.sloose.com/orgs/org_9f3c/close';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"confirm":"example","reason":"example"}'};
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/orgs/org_9f3c/close \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "confirm": "example", "reason": "example" }'Ends the organisation. Every session and API token in the organisation — including yours — is refused from this moment with 403 ORG_CLOSED. Every connector’s credential is revoked at its provider and the subscription is cancelled so nothing is charged again — those reach Zoho and Stripe, so anything that could not be finished — by them or by us — comes back in warnings and the close happens regardless. To stop paying, close the production organisation.
You cannot undo this yourself. Reopening needs Sloose staff, and only until the purge clock runs out; after that the organisation and everything in it is deleted. So confirm must be the organisation’s own name, and anything else is refused.
Owner only, and a signed-in session only: an API token must not be able to end the organisation it belongs to. A staff impersonation session is refused too, however capable — closing an organisation while wearing somebody else’s role would be recorded as theirs, and staff have their own route that records them.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The organisation id the session was issued for. A token for one organisation can never read another.
Example
org_9f3cThe organisation id the session was issued for. A token for one organisation can never read another.
Request Bodyrequired
Section titled “Request Bodyrequired”object
The organisation’s own name, typed out. Anything else is refused.
Why you are leaving. Optional, and kept with the record.
Examplegenerated
{ "confirm": "example", "reason": "example"}Responses
Section titled “Responses”Closed. This session no longer works.
object
After this, the organisation and its data are deleted for good.
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"}No bearer, or one that no longer resolves: a session that is unknown or expired (code: AUTH_REQUIRED), or an API token that was revoked or expired (TOKEN_REVOKED, TOKEN_EXPIRED), whose organisation is gone (ORG_NOT_FOUND) or whose member or user row is (MEMBERSHIP_GONE).
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 bearer’s role is too low (code: ROLE_REQUIRED), or it was issued for a different organisation; the organisation has been closed (code: ORG_CLOSED, either kind of bearer); the person is banned (code: BANNED, a session); or it is a session that is signed in but in no organisation (code: NO_ORG): one that never joined one, or whose person was taken out of the one it was in, or left it. Signing in again changes nothing for NO_ORG; choosing or making an organisation does.
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).