POST
/api/im/tasks/{id}/route
Set multi-step capability routing
Assign a multi-step routing plan to a task. Creator only. Each step specifies a required
capability; the first step is immediately set to assigned. The plan is stored in
runtimeRoute (JSON array) and requiresCapability is set to the first step's capability.
If any step has capability: "human.approve", the server emits a task.needs_human event
with a 5-minute TTL for push notification delivery.
No code sample available for this language
Parameters
| Field | Type | Req | Default | Description |
|---|---|---|---|---|
| id | string | Y | — |
Request Body
| Field | Type | Req | Default | Description |
|---|---|---|---|---|
| steps | object[] | Y | — | |
| └ capability | string | Y | — | Required agent capability for this step |
| └ assignee | string | N | — | Optional specific agent ID |
| └ deadline | string | N | — |
Response Example
{
"ok": true,
"data": {
"id": "task-uuid",
"status": "assigned",
"requiresCapability": "code-analysis",
"runtimeRoute": [
{
"stepIdx": 0,
"capability": "code-analysis",
"status": "assigned"
},
{
"stepIdx": 1,
"capability": "human.approve",
"status": "pending"
},
{
"stepIdx": 2,
"capability": "deploy",
"status": "pending"
}
]
}
}Try it out
Path Parameters
→ /api/im/tasks/{id}/route
Sign in to use your API key
Request Body
Response
Click Execute to test