API reference

Element tokens

Mint short-lived, scoped tokens that let embedded admin screens manage roles, review requests and read decisions from the browser.

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#

POST/v1/apps/:app_id/authz/element-tokensApp key
scopesstring[]required
One or more of roles:read, roles:write, requests:review, decisions:read.
usersobjectrequired
Which users it may see: all: true, ids (1 to 1,000 user IDs), or attributes (an exact match on the users' authorization attributes, which only your backend sets). Scoping by meta is refused, since users edit their own meta.
assignable_rolesstring[]
Roles it may grant or approve: app role slugs, or type#role for a role on objects of that type.
actor_idstring
The app user the screen acts for. Their email becomes the label in the audit log.
labelstring
A name for the audit log.
ttl_secondsinteger
60 to 3600. Default 900.
Requestbash
curl -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  }'
Response 201json
{  "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#

DELETE/v1/apps/:app_id/authz/element-tokens/:idApp key

Returns 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.

GET/v1/auth/:app_id/authz/elements/usersElement token
qstring
Query. Searches email and name.
limitinteger
Query. Default 50, at most 100.
offsetinteger
Query. Default 0.
Requestbash
curl "https://api.scute.io/v1/auth/$SCUTE_APP_ID/authz/elements/users?q=alice" \  -H "X-Scute-Element-Token: $ELEMENT_TOKEN"
Response 200json
{  "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.

GET/v1/auth/:app_id/authz/elements/rolesElement token
Response 200json
{  "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.

POST/v1/auth/:app_id/authz/elements/users/:user_id/rolesElement token
rolestringrequired
An assignable role slug.
expires_atstring
ISO 8601 time in the future.
Response 201json
{ "role": "editor", "source": "manual", "expires_at": null }

Revoke a role#

Scope roles:write.

DELETE/v1/auth/:app_id/authz/elements/users/:user_id/roles/:roleElement token

Returns 204.

Statuserror_codeWhen
403role_not_assignableThe role is not in assignable_roles
404user_not_foundThe user is not one the token may see
404not_foundThe user does not hold the role
409managed_by_idpThe role comes from SAML or SCIM

List access requests#

Requests from users the token may see, oldest first, up to 100. Scope requests:review.

GET/v1/auth/:app_id/authz/elements/requestsElement token
statusstring
Query. Default pending.

Returns 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.

POST/v1/auth/:app_id/authz/elements/requests/:id/approveElement token
POST/v1/auth/:app_id/authz/elements/requests/:id/denyElement token

Takes an optional note. Returns the request.

List decisions#

End-user decisions about users the token may see, newest first. Scope decisions:read.

GET/v1/auth/:app_id/authz/elements/decisionsElement token
user_idstring
Query. One user.
decisionstring
Query. One decision value.
limitinteger
Query. Default 50, at most 100.
beforestring
Query. A decision ID. Pass next for the following page.

Returns decisions in the decision log shape and next.