Skip to content

Close this org

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

org
required

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

string
Example
org_9f3c

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

Media typeapplication/json
object
confirm
required

The org’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 org 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 org 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 is expired, revoked or no longer resolves to a member.

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, or it was issued for a different org.

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 org, 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 org 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"
}

Report a problem with this page