Agents

Schedule an agent

A scheduled task runs one agent with one prompt on a schedule. Each run is saved as a chat of the task's owner, the key owner with a workspace key.

Endpoints

Every route needs X-Space-Slug. On a deployment without scheduling every route returns 404.

MethodURLDoesAuth
POST/api/v1/scheduled-tasks/preview/The next run times for a schedule: {next_runs, expires_at}, in UTCKey or bearer
POST/api/v1/scheduled-tasks/Create; 201 with id, next_run_at, expires_at, enabledKey or bearer
GET/api/v1/scheduled-tasks/The caller's tasks in the workspace, each with last_runKey or bearer
PATCH/api/v1/scheduled-tasks/{task_id}/Change any create field, or {"enabled": false} to pause and true to resumeKey or bearer
GET/api/v1/scheduled-tasks/{task_id}/runs/?limit=50&offset=0Runs, newest first: scheduled_for, status, thread_id, error, skipped_connectionsKey or bearer
DELETE/api/v1/scheduled-tasks/{task_id}/Delete; 204Key or bearer
POST/api/v1/scheduled-tasks/{task_id}/run-now/Run once nowBearer only

Tasks are private to their owner: another member's GET /api/v1/scheduled-tasks/ does not list them.

Fields

FieldRule
nameRequired, 1–50 characters
promptRequired; the user message each run sends
agent_idRequired; an id from GET /api/v1/agents-v2/agents/
model_config_idOptional; omitted, the agent's model
scheduleRequired; below
timezoneRequired; an IANA name such as Europe/Rome. WAT and other abbreviations return 422
expires_atOptional. Omitted: 7 days for daily, 1 month for weekly, 3 months for monthly; null never expires
schedule.frequencyNeedstime
daily—HH:MM, on a 5-minute step, in timezone
weeklyweekdays: MO TU WE TH FR SA SUsame
monthlymonth_day: 1–31; a month without that day is skippedsame
oncedate: YYYY-MM-DDsame

A field that the frequency does not use returns 422, such as weekly schedules take no month_day.

Create a weekly task

  1. Check the run times:

    curl -X POST "$CENTRAL_HUB_URL/api/v1/scheduled-tasks/preview/" \
      -H "X-API-Key: $ALO_API_KEY" \
      -H "X-Space-Slug: $WORKSPACE_SLUG" \
      -H "Content-Type: application/json" \
      -d '{"schedule": {"frequency": "weekly", "time": "09:00", "weekdays": ["MO", "TH"]}, "timezone": "Europe/Rome"}'
    {"next_runs": ["2026-10-22T07:00:00Z", "2026-10-26T08:00:00Z", "2026-10-29T08:00:00Z"], "expires_at": "2026-11-20T14:08:19.816892Z"}
  2. Create the task:

    curl -X POST "$CENTRAL_HUB_URL/api/v1/scheduled-tasks/" \
      -H "X-API-Key: $ALO_API_KEY" \
      -H "X-Space-Slug: $WORKSPACE_SLUG" \
      -H "Content-Type: application/json" \
      -d '{
        "name": "Weekly contract digest",
        "prompt": "Summarize contracts that expire in the next 30 days.",
        "agent_id": 36,
        "schedule": {"frequency": "weekly", "time": "09:00", "weekdays": ["MO"]},
        "timezone": "Europe/Rome"
      }'

    The response is 201 with "next_run_at": "2026-10-26T08:00:00Z" and "enabled": true.

  3. Follow the runs with GET /api/v1/scheduled-tasks/{task_id}/runs/. Each run's thread_id is the chat it wrote; read it signed in, as in Read and share chats, or with a key that has the lab scope through Lab.

Run status

statusMeaning
queued, runningWaiting · in progress
doneFinished
failedCould not start or ended with an error; see error
ended_without_resultInterrupted
cancelledStopped by the owner
quotaThe owner's credits ran out
missedStarted too late and skipped; missed runs are never replayed

After several failed runs in a row the task pauses itself: enabled becomes false and paused_reason failures. Resume with {"enabled": true}.

On this page