Routines
A routine belongs to one bot and one person: the caller. Paths are relative to
/api/workspaces/{workspaceId}/agents/{agentId}.
| Method | Path | Does |
|---|---|---|
GET |
/routines/ |
Your routines on this bot |
POST |
/routines/ |
Create one |
GET |
/routines/{routineId} |
Read one |
PATCH |
/routines/{routineId} |
Update |
DELETE |
/routines/{routineId} |
Delete |
GET |
/routines/{routineId}/runs |
Run history |
POST |
/routines/{routineId}/runs |
Run it now |
Create a routine
Section titled “Create a routine”curl -X POST https://<host>/api/workspaces/{workspaceId}/agents/{agentId}/routines/ \ -H "Authorization: Bearer $KATA_API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "Morning tickets", "instruction": "Summarise new support tickets since yesterday.", "triggers": [{ "kind": "schedule", "spec": { "cron": "0 9 * * MON-FRI" } }] }'| Field | Required | Notes |
|---|---|---|
name |
yes | |
instruction |
no | What the bot does each run |
active |
no | Pause with false |
triggers |
no | Schedules: { "kind": "schedule", "spec": { "cron": "…" } } |
Cron expressions are validated (0 25 * * * is rejected; @daily and MON-FRI work)
and evaluated in the workspace’s timezone.
Run it now
Section titled “Run it now”POST /routines/{routineId}/runs runs the routine through the same path the scheduler
uses. Add ?dryRun (or { "dryRun": true }) to go through it without acting. The run
is returned, with status 500 if it failed.