Version 2.5
Schedules

Schedules

A schedule creates Work Items for a Worker agent on a cron cadence — the API equivalent of the schedule picker in the application. Use this API to create and manage schedules for your worker agents.

All paths are relative to the base URL and require an Authorization: Bearer YOUR_API_KEY header.

Schedules only exist for Worker agents. Calling these endpoints for a conversational agent returns 400 ("Schedules can only be created for worker agents"). Check an agent's mode with GET /agents/{agent_id}.

The Schedule object

PublicSchedule is returned by all endpoints here.

FieldTypeDescription
idstringSchedule ID.
agent_idstringThe Worker agent the schedule belongs to.
cron_expressionstringStandard 5-field cron expression (e.g. 0 9 * * 1-5).
timezonestringIANA timezone the cron expression is evaluated in.
enabledbooleanWhether the schedule fires. Read-only — pause and resume in the application.
catch_upbooleanOn a missed occurrence (e.g. downtime), run once and advance to the next occurrence.
work_item_namestring | nullName given to the Work Items this schedule creates.
messagestringMessage included in each created Work Item.
payloadobjectPayload included in each created Work Item.
metadataobjectFree-form metadata (the application stores its picker UI state here).
last_run_atstring | nullWhen the schedule last fired (null if never).
next_run_atstring | nullNext planned run (null while paused).
created_at / updated_atstringTimestamps.

List schedules

GET /agents/{agent_id}/schedules

Returns a PaginatedResponse whose data is a list of schedules. The endpoint takes no paging parameters — the agent's schedules are returned in one page.

curl 'https://{your-deployment-host}/api/v2/agents/{agent_id}/schedules' \
  -H 'Authorization: Bearer YOUR_API_KEY'

Create a schedule

POST /agents/{agent_id}/schedules

Body

FieldTypeRequiredDescription
cron_expressionstringYesStandard 5-field cron expression (e.g. 0 9 * * 1-5).
timezonestringNoIANA timezone (e.g. America/New_York). Defaults to UTC.
catch_upbooleanNoRun once on a missed occurrence, then advance. Defaults to true.
work_item_namestringNoName for the Work Items this schedule creates.
messagestringNoMessage to include in each Work Item (max 10,000 chars).
payloadobjectNoPayload to include in each Work Item.
metadataobjectNoFree-form metadata.
curl -X POST 'https://{your-deployment-host}/api/v2/agents/{agent_id}/schedules' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "cron_expression": "0 9 * * 1-5",
    "timezone": "America/New_York",
    "work_item_name": "Daily invoice batch",
    "message": "Process the overnight invoice queue",
    "payload": { "source": "email-inbox", "batch_size": 50 }
  }'

Returns the created Schedule, enabled and with next_run_at set to the first occurrence.

An invalid cron expression or timezone returns 400. Two advanced settings cap schedules: MAX_SCHEDULES_PER_AGENT (default 20) and MAX_WORK_ITEM_PAYLOAD_SIZE_IN_KB (default 100) — exceeding either returns 400.

Get a schedule

GET /agents/{agent_id}/schedules/{schedule_id}

Returns a Schedule. The schedule must belong to the given agent — otherwise 404.

Update a schedule

PUT /agents/{agent_id}/schedules/{schedule_id}

Takes the same body as create and replaces the schedule's definition with it — omitted optional fields are reset to their defaults, not left untouched. Send the full definition every time.

curl -X PUT 'https://{your-deployment-host}/api/v2/agents/{agent_id}/schedules/{schedule_id}' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "cron_expression": "30 8 * * 1-5",
    "timezone": "Europe/Helsinki",
    "work_item_name": "Daily invoice batch",
    "message": "Process the overnight invoice queue",
    "payload": { "source": "email-inbox", "batch_size": 50 }
  }'

Returns the updated Schedule with next_run_at recomputed. The enabled state is preserved: updating a paused schedule keeps it paused, and next_run_at stays unset until it's resumed in the application.

Delete a schedule

DELETE /agents/{agent_id}/schedules/{schedule_id}

Deletes the schedule. Returns 204 No Content. Work Items already created by the schedule are not affected.