An element token lets a browser call a limited admin API without the app key. Your backend mints it with the app key and passes it to the page. The page sends it in X-Scute-Element-Token. Every call is limited to the token's scopes, the users it may see and the roles it may grant.
Only a digest is stored. The token (sce_...) is in the create response only.
Mint and revoke#
Create an element token#
/v1/apps/:app_id/authz/element-tokensApp keycurl -X POST https://api.scute.io/v1/apps/$SCUTE_APP_ID/authz/element-tokens \ -H "Authorization: Bearer $SCUTE_APP_SECRET" \ -H "Content-Type: application/json" \ -d '{ "scopes": ["roles:read", "roles:write", "requests:review"], "users": { "attributes": { "tenant_id": "acme" } }, "assignable_roles": ["viewer", "editor"], "actor_id": "0193f900-aaaa-bbbb-cccc-eeeeeeeeeeee", "ttl_seconds": 900 }'{ "id": "0193f9c0-1111-7222-8333-444444444444", "token": "sce_Q2h4bW9rLXRva2VuLWV4YW1wbGUtdmFsdWUtMTIzNA", "expires_at": "2026-11-19T14:15:00.000Z", "scopes": ["roles:read", "roles:write", "requests:review"]}Returns 404 user_not_found for an unknown actor_id, and 422 invalid for an unknown scope, no scopes, or an invalid users value.
Revoke an element token#
/v1/apps/:app_id/authz/element-tokens/:idApp keyReturns 204, or 404 not_found.
Calls an element token can make#
All of these take X-Scute-Element-Token: sce_.... A missing, expired or revoked token returns 401 invalid_element_token. A call outside the token's scopes returns 403 scope_missing.
List users#
Users the token may see, with their app roles. Scope roles:read.
/v1/auth/:app_id/authz/elements/usersElement tokencurl "https://api.scute.io/v1/auth/$SCUTE_APP_ID/authz/elements/users?q=alice" \ -H "X-Scute-Element-Token: $ELEMENT_TOKEN"{ "total": 1, "users": [ { "id": "0193f900-aaaa-bbbb-cccc-eeeeeeeeeeee", "email": "alice@example.com", "name": "Alice", "roles": [{ "role": "viewer", "source": "manual", "expires_at": null, "active": true }] } ]}List roles#
The app's roles, and which ones the token may grant. Scope roles:read.
/v1/auth/:app_id/authz/elements/rolesElement token{ "roles": [ { "slug": "viewer", "name": "Viewer", "description": null }, { "slug": "editor", "name": "Editor", "description": null } ], "assignable": ["viewer", "editor"]}Assign a role#
Scope roles:write. The role must be in assignable_roles and the user in the token's users.
/v1/auth/:app_id/authz/elements/users/:user_id/rolesElement token{ "role": "editor", "source": "manual", "expires_at": null }Revoke a role#
Scope roles:write.
/v1/auth/:app_id/authz/elements/users/:user_id/roles/:roleElement tokenReturns 204.
| Status | error_code | When |
|---|---|---|
| 403 | role_not_assignable | The role is not in assignable_roles |
| 404 | user_not_found | The user is not one the token may see |
| 404 | not_found | The user does not hold the role |
| 409 | managed_by_idp | The role comes from SAML or SCIM |
List access requests#
Requests from users the token may see, oldest first, up to 100. Scope requests:review.
/v1/auth/:app_id/authz/elements/requestsElement tokenReturns requests in the access request shape.
Approve or deny a request#
Scope requests:review. Approving a role request needs the role in assignable_roles; denying does not.
/v1/auth/:app_id/authz/elements/requests/:id/approveElement token/v1/auth/:app_id/authz/elements/requests/:id/denyElement tokenTakes an optional note. Returns the request.
List decisions#
End-user decisions about users the token may see, newest first. Scope decisions:read.
/v1/auth/:app_id/authz/elements/decisionsElement tokenReturns decisions in the decision log shape and next.