Refresh a session
const url = 'https://api.sloose.com/auth/session/refresh';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/auth/session/refresh \ --header 'Authorization: Bearer <token>'Confirms the session is still good and returns it with the member’s current role and expiry. A session is a row, not a claim: the role is re-read on every request and the expiry slides with use, so there is no new token to hand out — this answers what the bearer is now. A staff member’s read-only view of the org answers with impersonation set and an expiry that does not slide.
Session only. An API token is refused with 403 SESSION_REQUIRED.
Authorizations
Section titled “Authorizations”Responses
Section titled “Responses”The session as it stands.
object
The session token. Send it as Authorization: Bearer.
The org’s Zoho data centre.
Expiry, seconds since the epoch.
Present when this session is a staff member’s view of the org as one of its members. Read-only unless write is true, in which case it acts as the member for real. The widget shows it as a banner, coloured differently for the two.
object
The staff member looking, by name.
When the view ends, seconds since the epoch.
Whether this view may write. When true it acts as the member for real, and the widget says so.
Example
{ "role": "owner"}The session is unknown, expired, signed out, or you are no longer a member of its org (code: AUTH_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"}An API token was used (code: SESSION_REQUIRED), or an administrator has revoked your access to the org (code: ACCESS_REVOKED).
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"}