Close this org
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 org. Every session and API token in the org — 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 org.
You cannot undo this yourself. Reopening needs Sloose staff, and only until the purge clock runs out; after that the org and everything in it is deleted. So confirm must be the org’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 org it belongs to. A staff impersonation session is refused too, however capable — closing an org 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 org id the session was issued for. A token for one org can never read another.
Example
org_9f3cThe org id the session was issued for. A token for one org can never read another.
Request Bodyrequired
Section titled “Request Bodyrequired”object
The org’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 org 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 org 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 is expired, revoked or no longer resolves to a member.
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, or it was issued for a different org.
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 org, 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 org 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"}