Leave an organisation
const url = 'https://api.sloose.com/orgs/org_9f3c/leave';const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
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/leave \ --header 'Authorization: Bearer <token>'Takes you out of the organisation, as an administrator removing you would: any session of yours working in it is left in no organisation, and the way back in is another invitation. The imports and templates you made stay with the organisation. The organisation’s history says you left. Any organisation you are in, not only the one this session is working in: Your account lists them all.
The organisation’s only owner cannot leave it (LAST_OWNER): make someone else an owner on People, or close the organisation. A closed organisation cannot be left (ORG_CLOSED).
Session only, and not a staff member’s view, which does not act as the person outside the organisation it was opened on (STAFF_VIEW).
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”An organisation you are in: any of them, not only the one this session is working in.
Example
org_9f3cAn organisation you are in: any of them, not only the one this session is working in.
Responses
Section titled “Responses”Left.
object
Example
{ "ok": true}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"}An API token was used (SESSION_REQUIRED), the person is banned (BANNED), the session is a staff member’s view (STAFF_VIEW), or the organisation is closed (ORG_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"}You are not in this organisation (MEMBER_NOT_FOUND).
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"}You are the organisation’s only owner (LAST_OWNER), or your role changed as you asked (MEMBER_CHANGED) — read it again and decide afresh.
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).