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.
/v1/apps/:app_id/authz/requestsApp keycurl "https://api.scute.io/v1/apps/$SCUTE_APP_ID/authz/requests?status=pending" \ -H "Authorization: Bearer $SCUTE_APP_SECRET"{ "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#
/v1/apps/:app_id/authz/requestsApp keycurl -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#
/v1/apps/:app_id/authz/requests/:id/approveApp key/v1/apps/:app_id/authz/requests/:id/denyApp keycurl -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#
| Status | error_code | When |
|---|---|---|
| 404 | not_found | No request with that ID, or no such role |
| 404 | user_not_found | No such user or reviewer |
| 403 | self_review | The reviewer filed the request |
| 403 | not_a_reviewer | The reviewer lacks access_requests.review |
| 409 | already_held | The user already holds the role |
| 409 | closed | The request is no longer pending |
| 409 | managed_by_idp | The identity provider manages that role |
| 422 | not_needed | The operation does not need approval |
| 422 | not_permitted | No role allows the operation, so there is nothing to approve |
| 422 | invalid | Neither 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#
/v1/auth/:app_id/authz/me/requestsAccess tokenTakes role, resource, duration and reason, or action, resource and reason. Returns 201 with the request.
List the user's requests#
/v1/auth/:app_id/authz/me/requestsAccess tokenTakes an optional status. Returns up to 100 requests, newest first.
Cancel a request#
/v1/auth/:app_id/authz/me/requests/:idAccess tokenOnly the requester can cancel, while the request is pending. Returns the request.
List requests to review#
/v1/auth/:app_id/authz/me/reviewsAccess tokenPending 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#
/v1/auth/:app_id/authz/me/reviews/:id/approveAccess token/v1/auth/:app_id/authz/me/reviews/:id/denyAccess tokenTakes an optional note. Returns the request.
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" }'