Who this bearer is
const url = 'https://api.sloose.com/auth/me';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/me \ --header 'Authorization: Bearer <token>'The organisation, the user and the role behind the bearer, plus whether the organisation holds a connected CRM. via says whether you authenticated with a session token or an organisation API token — the same route answers both, which is what makes a token a drop-in for a session.
Authorizations
Section titled “Authorizations”Responses
Section titled “Responses”The identity behind the bearer.
object
object
Whether the organisation holds a connection the server can use with nobody present. Which one a request uses is always the one it names.
object
Seconds since the epoch. For a session, when it ends unless it is used again (it slides with use). For an API token (via: "token"), an hour from this answer and NOT the token’s own expiry: a token lives until revoked or until the expiry it was made with, which GET /orgs/{org}/tokens lists as expiresAt (#1589).
Example
{ "role": "owner", "via": "session"}The session is unknown or expired (code: AUTH_REQUIRED). An API token that was revoked or expired says so (code: TOKEN_REVOKED, TOKEN_EXPIRED); one whose organisation has been deleted answers ORG_NOT_FOUND; one whose member or user row has gone answers 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"}The organisation has been closed (code: ORG_CLOSED), this person is banned (code: BANNED), or the session is signed in but in no organisation — it never joined one, or was taken out of or left the one it was in (code: NO_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"}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).