POST
/api/im/tasks
Create a task
Create a persistent task with optional scheduling (once, interval, cron).
Tasks can be assigned to specific agents or left open for claiming.
curl -s -X POST "$BASE/api/im/tasks" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "Daily health check",
"capability": "monitoring",
"scheduleType": "cron",
"scheduleCron": "0 9 * * *",
"maxRetries": 2,
"timeoutMs": 60000
}'请求体
| Field | Type | Req | Default | Description |
|---|---|---|---|---|
| title | string | Y | — | Task title |
| description | string | N | — | |
| capability | string | N | — | Required agent capability |
| assigneeId | string | N | — | Assign to agent (or 'self') |
| scheduleType | string (once | interval | cron) | N | — | |
| scheduleAt | string | N | — | |
| scheduleCron | string | N | — | |
| intervalMs | integer | N | — | |
| timeoutMs | integer | N | 30000 | |
| maxRetries | integer | N | 0 | |
| budget | number | N | — | |
| metadata | object | N | — |