API reference

Sign in as a user

Start, list and end support sessions in which your staff act as one of an app's users.

Support staff can sign in as a user of the app to see what the user sees. The app has to allow it: it is off until the app's authorization settings turn on impersonation. Each session is short, cannot be refreshed, and its access token carries imp: true and an act claim naming who is really acting. Starting and ending one are recorded as app.user.impersonation.started and app.user.impersonation.ended events.

These routes take the app key (or a workspace key above the app).

Start a session as a user#

POST/v1/apps/:app_id/users/:user_id/impersonateApp key

Name who is acting in one of two ways:

  • actor: your backend names its support person, and Scute takes its word.
  • actor_user_id: a user of this app who holds the user:impersonate permission on the target. The permission can ask for a verification or an approval, passed in challenge or approval.
reasonstringrequired
Why. Kept with the session, up to 500 characters.
minutesinteger
How long the session lasts. Default and ceiling: the app's impersonation_max_minutes (60 unless set, at most 240).
actorobject
email, name and id of your support person. email or name is required when actor_user_id is not sent.
actor_user_idstring
Id of the acting user in this app.
challengestring
A completed verification, when the acting user's permission asks for one.
approvalstring
An approval, when the acting user's permission asks for one.
handoffboolean
true returns a single-use code and a link into the app instead of tokens. Default false.
cURLbash
curl -X POST https://api.scute.io/v1/apps/$SCUTE_APP_ID/users/$USER_ID/impersonate \  -H "Authorization: Bearer $SCUTE_APP_SECRET" \  -H "Content-Type: application/json" \  -d '{    "reason": "Ticket 4821: user cannot see their invoices",    "minutes": 15,    "actor": { "email": "support@acme.com", "name": "Sam Support" }  }'
Response 201json
{  "access": "eyJhbGciOiJSUzI1NiIs...",  "access_expires_at": "2026-11-19T10:15:00Z",  "csrf": "kZ3e...",  "key_id": "c1b2...",  "user_id": "0193f900-aaaa-bbbb-cccc-eeeeeeeeeeee",  "session_id": "0193f990-aaaa-7bbb-8ccc-000000000003",  "impersonation": {    "actor": { "email": "support@acme.com", "name": "Sam Support", "kind": "backend" },    "reason": "Ticket 4821: user cannot see their invoices",    "started_at": "2026-11-19T10:00:00Z",    "expires_at": "2026-11-19T10:15:00Z"  }}

There is no refresh token. When the access token expires, the session is over.

With handoff: true the response has no tokens. It has session_id, impersonation and:

handoffjson
{  "handoff": {    "code": "q8Zt...",    "url": "https://app.acme.com/?sct_imp=q8Zt...",    "expires_at": "2026-11-19T10:02:00Z"  }}

The code lasts 2 minutes and works once. The app's SDK reads sct_imp from the URL and exchanges it for the session. url is null when the app has no address.

StatusErrorWhen
403impersonation_disabledThe app does not allow signing in as users.
403protected_userThe user has one of the app's protected roles, or the no_impersonation attribute.
403user_banned, user_suspendedThe user is banned or suspended.
403actor_banned, actor_suspendedThe acting user is banned or suspended.
403not_permittedThe acting user does not hold user:impersonate on this user. The body has the decision.
404user_not_foundNo user with that id.
422reason_requiredNo reason.
422user_inactiveThe user is not active.
422actor_requiredNeither actor.email, actor.name nor actor_user_id was sent.
422actor_not_foundNo user with the id in actor_user_id.
422selfactor_user_id is the target user.

List active sessions as a user#

GET/v1/apps/:app_id/users/:user_id/impersonationsApp key
cURLbash
curl https://api.scute.io/v1/apps/$SCUTE_APP_ID/users/$USER_ID/impersonations \  -H "Authorization: Bearer $SCUTE_APP_SECRET"
Response 200json
{  "impersonations": [    {      "session_id": "0193f990-aaaa-7bbb-8ccc-000000000003",      "actor": { "email": "support@acme.com", "name": "Sam Support", "kind": "backend" },      "reason": "Ticket 4821: user cannot see their invoices",      "started_at": "2026-11-19T10:00:00Z",      "expires_at": "2026-11-19T10:15:00Z"    }  ]}

End sessions as a user#

DELETE/v1/apps/:app_id/users/:user_id/impersonateApp key

Ends every active session as the user, or one when session_id is given.

session_idstring
Query parameter. End this session only.
cURLbash
curl -X DELETE "https://api.scute.io/v1/apps/$SCUTE_APP_ID/users/$USER_ID/impersonate?session_id=$SESSION_ID" \  -H "Authorization: Bearer $SCUTE_APP_SECRET"
Response 200json
{ "ended": 1 }