Skip to content

Close this organisation

POST
/orgs/{org}/close
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.

org
required

The organisation id the session was issued for. A token for one organisation can never read another.

string
Example
org_9f3c

The organisation id the session was issued for. A token for one organisation can never read another.

Media typeapplication/json
object
confirm
required

The organisation’s own name, typed out. Anything else is refused.

string
reason

Why you are leaving. Optional, and kept with the record.

string
<= 500 characters
Examplegenerated
{
"confirm": "example",
"reason": "example"
}

Closed. This session no longer works.

Media typeapplication/json
object
closedAt
required
string
purgeAfter
required

After this, the organisation and its data are deleted for good.

string
connectorsRevoked
required
integer
subscriptionCancelled
required
boolean
warnings
required

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.

Array<string>
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.

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
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).

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
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.

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
Examplegenerated
{
"error": "example",
"code": "example"
}

No such organisation, or it is not visible to this session.

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
Examplegenerated
{
"error": "example",
"code": "example"
}

The organisation is closed already (code: ALREADY_CLOSED).

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
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.

Media typeapplication/json
object
error
required
string
code
required
string
Allowed value: MAINTENANCE
Example
{
"code": "MAINTENANCE"
}
Retry-After
integer

Seconds until asking again is worth it (300 while the switch is on).

Report a problem with this page

sloose.com