Who is signed in, and their organisations
const url = 'https://api.sloose.com/auth/orgs';const options = {method: 'GET', 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 GET \ --url https://api.sloose.com/auth/orgs \ --header 'Authorization: Bearer <token>'The person behind the session and every organisation they belong to, whichever one the session is working in. This works for somebody who belongs to no organisation yet — the account app’s first question after a magic-link sign-in.
Session only.
Authorizations
Section titled “Authorizations”Responses
Section titled “Responses”The person and their organisations.
object
object
The person’s own choice, in every organisation: false when they turned support diagnostics off for themselves. An organisation that blocks them overrides it (orgs[].diagnostics).
object
The organisation has been closed; nothing in it can be worked on.
When it was closed; null for an open organisation.
For a closed organisation, when it is erased: until then support can reopen it. Null for an open organisation.
One of the organisation’s own connections holds a grant the server can use unattended — the connection list’s connected, by the same rule. That is reading, not importing: a grant that cannot reach records is connected and counted in needsReconnecting all the same. False for an organisation that has only been made, and for one whose every connection’s grant was refused, is gone, or was disconnected.
How many of the organisation’s own connections stopped working without anybody choosing it — a grant refused or gone, one that cannot reach records, or one Zoho refused the query permission — and need reconnecting on Connections. Never a person’s own, which the organisation cannot reconnect, nor one disconnected on purpose.
How many connections the organisation holds, counted as its Connections list counts the plan’s: the organisation’s own, not disconnected — one needing reconnecting included. Never a person’s own, which is theirs and not the organisation’s.
When the person joined the organisation.
The person owns the organisation and nobody else does: they cannot leave it, nor delete their account while it is open, until someone else is an owner or it is closed.
Whether the organisation lets its members send support diagnostics — the page’s console, network log and session replay — with a support request: default, each member’s own choice (on unless they opt out); blocked, off for everybody in the organisation.
Whether a support request this person sends while working in this organisation carries diagnostics: the organisation is default and the person has not opted out (user.sendDiagnostics).
Whether this person may open the backoffice.
Whether the next organisation this person makes starts a trial (#2381): true until they have had their one trial, in any organisation they made or started one in, open, closed or erased. What a page says before POST /orgs; that route decides again as it makes the organisation.
When this session ends unless it is used again, in seconds since the epoch, as this request left it: thirty days from its last use, eight hours for a Sloose staff member.
Example
{ "orgs": [ { "role": "owner", "supportDiagnostics": "default" } ]}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 (code: SESSION_REQUIRED).
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).