API reference

Tokens

Refresh an access token, check a token, and rotate tokens from your server with the app key.

A session has an access token and a refresh token, both JWTs signed with the workspace's RSA key. The access token goes in X-Authorization on calls; the refresh token is swapped for a new access token before the access token expires. See Token set for the fields and default lifetimes.

Session rules#

  • Idle timeout. A session not used (no call with its access token) and not refreshed for longer than the app's session timeout (604800 seconds by default) ends at its next refresh, which returns 401 session_idle.
  • Overlapping refreshes. After a refresh, the previous access token keeps working for 60 seconds, so requests already in flight do not fail.
  • IP rules. Every refresh is checked against the workspace's IP rules. On a refresh from your server, pass the person's address in X-Scute-Client-IP. A refused refresh keeps the session; it refreshes again from an allowed address.
  • Bans and suspensions. A refresh for a person who was banned, suspended or deactivated ends the session and returns 401 with user_banned, user_suspended or account_deactivated.
  • Support sessions. A session opened as a person from the dashboard (impersonation) is never refreshed.

Refresh the access token#

POST/v1/auth/:app_id/tokens/refreshRefresh token
cURLbash
curl -X POST https://api.scute.io/v1/auth/$SCUTE_APP_ID/tokens/refresh \  -H "X-Refresh-Token: $REFRESH_TOKEN"
Response 200json
{  "csrf": "kZQ3x0Qb7V1o2y8wL4mN9pR6sT0uV3wX5yZ7aB9cD1eF",  "access": "eyJhbGciOiJSUzI1NiIsImtpZCI6Ii4uLiJ9...",  "access_expires_at": "2026-11-19T16:04:05.000+00:00"}

The refresh token stays the same. When the refresh token is sent in the sc-refresh-token cookie instead of the header, X-CSRF-Token must carry the session's csrf.

Statuserror_codeWhen
401session_revokedThe session was revoked, or its person deleted. Sign in again.
401session_idleThe session was idle longer than the app's session timeout. Sign in again.
401Invalid or expired refresh token.
403ip_blocked, country_blockedThe workspace's IP rules refuse the address.

Check an access token#

POST/v1/auth/:app_id/tokens/access/verifyAccess token

Checks that the access token is valid and its session is live.

cURLbash
curl -X POST https://api.scute.io/v1/auth/$SCUTE_APP_ID/tokens/access/verify \  -H "X-Authorization: Bearer $ACCESS_TOKEN"
Response 200json
{ "message": "verified", "verified": true }

An invalid, expired or revoked token returns 401. To check tokens without a call per request, verify them offline with the JWKS.

Check a refresh token#

POST/v1/auth/:app_id/tokens/refresh/verifyRefresh token
cURLbash
curl -X POST https://api.scute.io/v1/auth/$SCUTE_APP_ID/tokens/refresh/verify \  -H "X-Refresh-Token: $REFRESH_TOKEN"
Response 200json
{ "message": "verified", "verified": true }

An invalid or expired token returns 401.

Server-side rotation#

These two routes are for a server that keeps the tokens in HTTP-only cookies and refreshes them for the browser. They need the app key in Authorization. The key must belong to the app in the URL, or be a workspace key of a workspace above it; another key returns 403 api_key_not_authorized.

Rotate with the access token#

POST/v1/auth/:app_id/tokens/rotate_accessApp key

Takes the current access token and returns a new access token plus the session's refresh token.

cURLbash
curl -X POST https://api.scute.io/v1/auth/$SCUTE_APP_ID/tokens/rotate_access \  -H "Authorization: Bearer $SCUTE_APP_SECRET" \  -H "X-Authorization: Bearer $ACCESS_TOKEN" \  -H "X-Scute-Client-IP: 203.0.113.24"
Response 200json
{  "csrf": "kZQ3x0Qb7V1o2y8wL4mN9pR6sT0uV3wX5yZ7aB9cD1eF",  "access": "eyJhbGciOiJSUzI1NiIsImtpZCI6Ii4uLiJ9...",  "access_expires_at": "2026-11-19T16:04:05.000+00:00",  "refresh": "eyJhbGciOiJSUzI1NiIsImtpZCI6Ii4uLiJ9..."}
Statuserror_codeWhen
401Invalid app key, or invalid access token or session.
401session_idleThe session was idle longer than the app's session timeout.
403api_key_not_authorizedThe key does not own the app.
404app_not_foundNo app with that ID.

Rotate with the refresh token#

POST/v1/auth/:app_id/tokens/force_refreshApp key

Takes the refresh token and returns a new access token. The refresh token is not returned.

cURLbash
curl -X POST https://api.scute.io/v1/auth/$SCUTE_APP_ID/tokens/force_refresh \  -H "Authorization: Bearer $SCUTE_APP_SECRET" \  -H "X-Refresh-Token: $REFRESH_TOKEN" \  -H "X-Scute-Client-IP: 203.0.113.24"
Response 200json
{  "csrf": "kZQ3x0Qb7V1o2y8wL4mN9pR6sT0uV3wX5yZ7aB9cD1eF",  "access": "eyJhbGciOiJSUzI1NiIsImtpZCI6Ii4uLiJ9...",  "access_expires_at": "2026-11-19T16:04:05.000+00:00"}
Statuserror_codeWhen
401session_revokedThe session was revoked, or its person deleted.
401session_idleThe session was idle longer than the app's session timeout.
403api_key_not_authorizedThe key does not own the app.

Sign out#

To end the current session, call Sign out. To end another of the person's sessions, see Sessions and devices.