Your backend can ask the person an agent will act for before the task exists. The person agrees to all or some of the actions, or declines. Once they agree, your backend polls for the task token. The task allows exactly what the person agreed to.
The flow follows OpenID CIBA (client-initiated backchannel authentication) in poll mode. It is for an app's own agents; MCP clients have their own consent screen in MCP sign-in.
Ask#
/v1/apps/:app_id/authz/agents/:slug/bc-authorizeApp keycurl -X POST https://api.scute.io/v1/apps/$SCUTE_APP_ID/authz/agents/billing-assistant/bc-authorize \ -H "Authorization: Bearer $SCUTE_APP_SECRET" \ -H "Content-Type: application/json" \ -d '{ "login_hint": "sam@example.com", "actions": ["invoice:read", "invoice:refund"], "binding_message": "Refund for order 1182", "delivery": "sms" }'{ "auth_req_id": "cib_...", "expires_in": 300, "interval": 5 }Keep auth_req_id on your server. A person can have at most 3 requests waiting at once.
Poll for the token#
/v1/apps/:app_id/authz/consents/tokenApp keycurl -X POST https://api.scute.io/v1/apps/$SCUTE_APP_ID/authz/consents/token \ -H "Authorization: Bearer $SCUTE_APP_SECRET" \ -H "Content-Type: application/json" \ -d '{ "grant_type": "urn:openid:params:grant-type:ciba", "auth_req_id": "cib_..." }'Until the person answers, the answer is an error with CIBA's codes. Poll no faster than every 5 seconds. Once they agree:
{ "access_token": "sct_...", "token_type": "Bearer", "expires_in": 1800, "task_id": "TASK_ID", "authorization_details": [{ "type": "scute_agent_task", "actions": ["invoice:read"] }]}access_token is the task token, issued once. Its actions are the ones the person agreed to.
| error | Meaning |
|---|---|
| authorization_pending | The person has not answered yet |
| slow_down | Polled within 5 seconds of the last poll |
| access_denied | The person declined, the agent is suspended, or the person is banned or suspended |
| expired_token | The person did not answer in time |
| invalid_grant | Unknown auth_req_id, or the token was already issued |
| unsupported_grant_type | grant_type is not the CIBA grant |
Show the request in your app#
With delivery: "app", your frontend reads the signed-in person's pending requests and sends their answer, with their session token in X-Authorization.
/v1/auth/:app_id/authz/me/consentsSession token{ "consents": [ { "id": "CONSENT_ID", "status": "pending", "expires_at": "2026-11-19T10:05:00Z", "agent": { "name": "Billing assistant", "description": "Answers billing questions and issues refunds." }, "binding_message": "Refund for order 1182", "task_minutes": 30, "actions": [ { "permission": "invoice:read", "sentence": "read invoices" }, { "permission": "invoice:refund", "sentence": "refund invoices", "needs_verification": true } ] } ]}/v1/auth/:app_id/authz/me/consents/:id/decisionSession tokenOnly the first answer counts. A second answer, or an answer after expiry, is 409 with request_closed.
The one-time link#
With delivery: "sms" or "email", Scute sends the person a link to the hosted consent page on your app's hosted site (/agent-consent?token=cil_...). The page uses these endpoints, where the link's token is the proof:
/v1/auth/:app_id/agent-consents/:tokenLink token/v1/auth/:app_id/agent-consents/:token/decisionLink tokenThey take and return the same shapes as the signed-in endpoints.
Errors on the ask#
| Status | error | When |
|---|---|---|
| 409 | access_denied | The agent is suspended |
| 403 | access_denied | The person is banned or suspended |
| 404 | unknown_user_id | No user of this app matches login_hint |
| 400 | invalid_scope | An action none of the agent's roles grant |
| 400 | invalid_request | Bad action count, delivery, TTL or expiry, or no phone or email for the chosen delivery |
| 429 | slow_down | The person already has 3 requests waiting |