A task is one job an agent runs. Its token (sct_...) is all the agent holds: who it works for, which actions it may take, on which objects, and until when. Scute stores only a digest of the token, so it is returned once, when the task is created.
Your backend creates tasks with the app key. The agent uses the token as its bearer: Authorization: Bearer sct_.... Never send a task token to a browser.
Create a task#
/v1/apps/:app_id/authz/agents/:slug/tasksApp keycurl -X POST https://api.scute.io/v1/apps/$SCUTE_APP_ID/authz/agents/billing-assistant/tasks \ -H "Authorization: Bearer $SCUTE_APP_SECRET" \ -H "Content-Type: application/json" \ -d '{ "acts_for": "APP_USER_ID", "actions": ["invoice:read", "invoice:refund"], "resources": ["invoice:42"], "ttl_seconds": 900, "ref": "ticket-8812" }'Scute answers 201:
{ "id": "4f1e...", "agent": "billing-assistant", "agent_name": "Billing assistant", "status": "open", "acts_for": "APP_USER_ID", "acts_for_person": { "id": "APP_USER_ID", "email": "sam@example.com", "name": "Sam Lee" }, "actions": ["invoice:read", "invoice:refund"], "resources": ["invoice:42"], "ref": "ticket-8812", "chain": ["billing-assistant"], "expires_at": "2026-11-19T10:15:00Z", "created_at": "2026-11-19T10:00:00Z", "token": "sct_..."}Action slugs are lowercased and both lists are sorted and de-duplicated. token appears only in this answer.
Errors#
| Status | error_code | When |
|---|---|---|
| 404 | not_found | No such agent, or parent_task_id is not a task of this app |
| 404 | user_not_found | acts_for is not a user of this app, or acts_for_operator is not a member of the workspace |
| 403 | user_banned, user_suspended | The person is banned or suspended. No task can act for them. |
| 409 | agent_suspended | The agent is suspended |
| 422 | invalid | ttl_seconds is not a whole number, the person is deactivated, or a child task reaches outside its parent |
Status#
A task is in one of four states. status is computed on every read.
| Status | Meaning |
|---|---|
| open | Usable |
| completed | Your backend marked it done |
| revoked | Revoked, or its agent was suspended, or its parent task ended |
| expired | Past expires_at |
A token works only while the task is open, the agent is active, every parent task is open, and the person it acts for is not banned or suspended. A ban or suspension of that person ends their open tasks, with a revoke_note saying why.
What the agent can read#
/v1/auth/:app_id/agent/whoamiTask tokenWhat this task may do right now: the agent's ceiling roles intersected with the person's permissions and the task's lists.
curl https://api.scute.io/v1/auth/$SCUTE_APP_ID/agent/whoami \ -H "Authorization: Bearer $TASK_TOKEN"{ "agent": "billing-assistant", "task": "4f1e...", "acts_for": "APP_USER_ID", "chain": ["billing-assistant"], "agent_roles": ["billing_agent"], "permissions": ["invoice:read", "invoice:refund"], "ceiling": ["invoice:read", "invoice:refund"], "conditional": [], "step_up": ["invoice:refund"], "approval": [], "actions": ["invoice:read", "invoice:refund"], "resources": ["invoice:42"], "expires_at": "2026-11-19T10:15:00Z", "expires_in": 840, "warnings": []}| Field | Meaning |
|---|---|
| permissions | What the task may do now |
| ceiling | The most it could ever do: enabled permissions its roles grant, within the task's actions. Use it to hide tools. |
| conditional | Permissions the person holds only under conditions |
| step_up | Allowed permissions that need the person to verify first |
| approval | Allowed permissions that need a reviewer's approval |
| warnings | expires_soon when under 5 minutes are left |
An invalid, expired or revoked token answers 401 with invalid_task_token.
List tasks#
/v1/apps/:app_id/authz/agents/:slug/tasksApp keyOne agent's tasks, newest first, up to 200. ?status=open for open tasks only.
/v1/apps/:app_id/authz/tasksApp keyEvery agent's tasks in the app, newest first, paged. Query: status (open, completed, revoked, expired), agent (a slug), limit (default 50, at most 200) and before (the next of the previous page).
/v1/workspaces/:workspace_id/authz/tasksWorkspace memberThe same list across every app of a workspace. Adds app_id to pick one app. Each task has an app field.
Complete a task#
/v1/apps/:app_id/authz/agents/:slug/tasks/:id/completeApp keyMarks an open task done. Its token stops working. A task that is not open answers 409 with task_closed.
Revoke a task#
/v1/apps/:app_id/authz/agents/:slug/tasks/:id/revokeApp keyEvery open task inside it (its sub-agents' tasks, at any depth) ends with it. They come back in also_revoked. The task records who revoked it in revoked_by.
curl -X POST https://api.scute.io/v1/apps/$SCUTE_APP_ID/authz/agents/billing-assistant/tasks/TASK_ID/revoke \ -H "Authorization: Bearer $SCUTE_APP_SECRET" \ -H "Content-Type: application/json" \ -d '{ "revoke_note": "Customer closed the ticket" }'| Status | error_code | When |
|---|---|---|
| 404 | not_found | No such task for this agent |
| 409 | task_closed | Already completed, revoked or expired |
| 422 | invalid | revoke_note is not text |
The task as a JWT#
For systems that want a signed JWT instead of the opaque token, Scute signs the delegation with the app's key. See Delegation.