API reference

Access requests

File, list, approve and deny requests for a role or for approval of one operation.

An access request asks for one of two things:

  • A role (kind role): an app role, or a role on one instance. Approving it assigns the role, for duration_seconds when the request set one.
  • Approval of one operation (kind operation): for a permission with requires_approval. The approved request's id goes in approval on the next check, and is spent by that check.

A request stays pending for 72 hours. status is one of pending, approved, denied, cancelled, expired, used.

Your backend manages requests with the app key, whether or not the app lets users file requests themselves. Users file and review their own with their access token when the app has access_requests on in policy settings.

Requests from your backend#

List requests#

Newest first.

GET/v1/apps/:app_id/authz/requestsApp key
statusstring
Query. One status.
user_idstring
Query. One user.
agentstring
Query. One agent's slug: requests its tasks filed.
limitinteger
Query. Default and maximum 200.
beforestring
Query. A request ID. Pass next for the following page.
Requestbash
curl "https://api.scute.io/v1/apps/$SCUTE_APP_ID/authz/requests?status=pending" \  -H "Authorization: Bearer $SCUTE_APP_SECRET"
Response 200json
{  "requests": [    {      "id": "0193f9b0-1111-7222-8333-444444444444",      "kind": "role",      "user_id": "0193f900-aaaa-bbbb-cccc-eeeeeeeeeeee",      "status": "pending",      "role": "billing_admin",      "reason": "Month-end close",      "duration_seconds": 86400,      "expires_at": "2026-11-22T14:00:00.000Z",      "created_at": "2026-11-19T14:00:00.000Z",      "user": { "id": "0193f900-aaaa-bbbb-cccc-eeeeeeeeeeee", "email": "alice@example.com", "name": "Alice" }    }  ]}

Fields that are empty are left out. A decided request adds decided_at, decided_by and decision_note; a spent operation approval adds used_at. An operation request has permission and resource instead of role.

File a request for a user#

POST/v1/apps/:app_id/authz/requestsApp key
user_idstringrequired
The user's ID in the app.
rolestring
An app role slug, or a resource role with resource set to the instance.
actionstring
For an operation request instead of a role: the action needing approval.
resourcestring
type:key.
durationinteger
Seconds the role lasts once approved. Role requests only.
reasonstring
Why. Shown to reviewers.
Requestbash
curl -X POST https://api.scute.io/v1/apps/$SCUTE_APP_ID/authz/requests \  -H "Authorization: Bearer $SCUTE_APP_SECRET" \  -H "Content-Type: application/json" \  -d '{    "user_id": "0193f900-aaaa-bbbb-cccc-eeeeeeeeeeee",    "role": "billing_admin",    "duration": 86400,    "reason": "Month-end close"  }'

Returns 201 with the request. When the same user already has the same request open, that request is returned instead of a new one. A role on an instance Scute does not know yet is kept as a resource reference, and the instance is created on approval.

Approve or deny a request#

POST/v1/apps/:app_id/authz/requests/:id/approveApp key
POST/v1/apps/:app_id/authz/requests/:id/denyApp key
notestring
Kept as decision_note.
reviewer_idstring
An app user deciding through your UI. Scute checks they may review (they hold access_requests.review) and are not the requester. Without it the decision is your backend's.
Requestbash
curl -X POST https://api.scute.io/v1/apps/$SCUTE_APP_ID/authz/requests/0193f9b0-1111-7222-8333-444444444444/approve \  -H "Authorization: Bearer $SCUTE_APP_SECRET" \  -H "Content-Type: application/json" \  -d '{ "note": "Approved for close" }'

Returns 200 with the request.

Errors#

Statuserror_codeWhen
404not_foundNo request with that ID, or no such role
404user_not_foundNo such user or reviewer
403self_reviewThe reviewer filed the request
403not_a_reviewerThe reviewer lacks access_requests.review
409already_heldThe user already holds the role
409closedThe request is no longer pending
409managed_by_idpThe identity provider manages that role
422not_neededThe operation does not need approval
422not_permittedNo role allows the operation, so there is nothing to approve
422invalidNeither role nor action was sent, or duration is not a whole number

The signed-in user's requests#

These take the user's access token in X-Authorization. They return 403 access_requests_disabled unless the app has access_requests on.

File a request as the user#

POST/v1/auth/:app_id/authz/me/requestsAccess token

Takes role, resource, duration and reason, or action, resource and reason. Returns 201 with the request.

List the user's requests#

GET/v1/auth/:app_id/authz/me/requestsAccess token

Takes an optional status. Returns up to 100 requests, newest first.

Cancel a request#

DELETE/v1/auth/:app_id/authz/me/requests/:idAccess token

Only the requester can cancel, while the request is pending. Returns the request.

List requests to review#

GET/v1/auth/:app_id/authz/me/reviewsAccess token

Pending requests the user may review, never their own, up to 100. Empty for a user without access_requests.review.

Approve or deny as the user#

POST/v1/auth/:app_id/authz/me/reviews/:id/approveAccess token
POST/v1/auth/:app_id/authz/me/reviews/:id/denyAccess token

Takes an optional note. Returns the request.

Requestbash
curl -X POST https://api.scute.io/v1/auth/$SCUTE_APP_ID/authz/me/reviews/0193f9b0-1111-7222-8333-444444444444/deny \  -H "X-Authorization: Bearer $ACCESS_TOKEN" \  -H "Content-Type: application/json" \  -d '{ "note": "Not this month" }'