---
title: "Create a schedule"
method: POST
path: "/agents/{agent_id}/schedules"
tags: ["agents"]
---

# Create a schedule

`POST /agents/{agent_id}/schedules`

## Request

- Base URL: `/api/v1` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/v1/agents/{agent_id}/schedules`
- Auth: API key in header `X-Axilio-Api-Key`
- TypeScript: <https://skmtc.dev/axilioai/apis/axilio-api/docs/agents/:agent_id/schedules/post.ts> (a function with typed inputs; its response is checked against the schema)

Creates a schedule of an agent: each occurrence of cron_expression, read in time_zone, starts a run of the agent with trigger scheduled and the schedule's id, built from run_template as POST /runs builds a saved agent's run. A cron expression or time zone that doesn't parse, an expression that never fires, a revision of another agent, an agent with no revision, or a schedule with no occurrence before its end_at is 400.

## Path parameters

- `agent_id` string, uuid, required: The agent's id.

## Request body

- AgentScheduleCreateRequest: Request body for creating a schedule of an agent.
  - `$schema` string, uri: A URL to the JSON Schema for this object.
  - `cron_expression` string, required: Five-field cron: minute, hour, day of month, month, day of week. For example 0 9 * * 1-5 is 09:00 on weekdays.
  - `end_at` string, date-time: No occurrence at or after this time. Leave out to run until deleted.
  - `name` string: A label for the schedule.
  - `overlap_policy` 'skip' | 'queue': skip (default) drops an occurrence while the previous run is unfinished; queue starts it anyway.
  - `run_template` AgentScheduleRunTemplate: What each run of the schedule starts with. The agent's model, output schema and limits apply, as for POST /runs.
    - `network` 'restricted' | 'internet': The sandbox's network for each run of an instructions agent: restricted (default) reaches the phone only; internet adds the public internet. Code runs always have internet, so a code agent's template takes no network.
    - `revision_id` string, uuid: A revision of the agent to run. Leave out to run the agent's current revision at each occurrence.
    - `targets` RunTarget[], nullable: The device each run drives (at most one). Leave out for a shared phone.
      - `capabilities` RunTargetCapabilities: What a run needs of its device.
        - `accessibility` boolean: Run in accessibility mode, which needs a phone that supports it and your organization's access to accessibility mode.
      - `device_class` 'phone', required: The kind of device.
      - `ownership` 'dedicated' | 'shared': dedicated: one of your organization's phones, the one phone_id names or any free one. shared: a phone from the shared fleet. Defaults to dedicated when phone_id is set, else shared.
      - `phone_id` string: A dedicated phone of your organization to run on. Leave out for any of yours (ownership dedicated) or a shared phone.
      - `platform` 'android': The device's platform (default android).
    - `variables` object: Each run's inputs, bound as variables in the kernel.
  - `start_at` string, date-time: No occurrence before this time. Leave out to start now.
  - `time_zone` string, required: The IANA time zone cron_expression is read in, for example America/Los_Angeles or UTC.

## Response `201`

Created

- AgentSchedule: A schedule: an agent's recurring runs. Each occurrence of cron_expression, read in time_zone, starts a run with trigger scheduled and this schedule_id.
  - `$schema` string, uri: A URL to the JSON Schema for this object.
  - `agent_id` string, uuid, required: The agent the schedule runs.
  - `created_at` string, date-time, required: When the schedule was created.
  - `cron_expression` string, required: Five-field cron: minute, hour, day of month, month, day of week.
  - `end_at` string, date-time: No occurrence at or after this time. Once it passes, the schedule ends and its runs that have not started are cancelled.
  - `id` string, uuid, required: The schedule's id.
  - `last_run_id` string, uuid: The run the schedule last started.
  - `name` string, required: The schedule's label.
  - `next_run_at` string, date-time: When the next occurrence starts a run, or end_at when no occurrence is left before it. Absent unless the schedule is active.
  - `overlap_policy` 'skip' | 'queue', required: skip drops an occurrence while the schedule's previous run is scheduled, queued, running or paused. queue starts it anyway, waiting for a phone like any run.
  - `run_template` AgentScheduleRunTemplate, required: What each run of the schedule starts with. The agent's model, output schema and limits apply, as for POST /runs.
    - `network` 'restricted' | 'internet': The sandbox's network for each run of an instructions agent: restricted (default) reaches the phone only; internet adds the public internet. Code runs always have internet, so a code agent's template takes no network.
    - `revision_id` string, uuid: A revision of the agent to run. Leave out to run the agent's current revision at each occurrence.
    - `targets` RunTarget[], nullable: The device each run drives (at most one). Leave out for a shared phone.
      - `capabilities` RunTargetCapabilities: What a run needs of its device.
        - `accessibility` boolean: Run in accessibility mode, which needs a phone that supports it and your organization's access to accessibility mode.
      - `device_class` 'phone', required: The kind of device.
      - `ownership` 'dedicated' | 'shared': dedicated: one of your organization's phones, the one phone_id names or any free one. shared: a phone from the shared fleet. Defaults to dedicated when phone_id is set, else shared.
      - `phone_id` string: A dedicated phone of your organization to run on. Leave out for any of yours (ownership dedicated) or a shared phone.
      - `platform` 'android': The device's platform (default android).
    - `variables` object: Each run's inputs, bound as variables in the kernel.
  - `start_at` string, date-time: No occurrence before this time.
  - `state` 'active' | 'paused' | 'ended', required: active runs its occurrences. paused runs none until resumed. ended is final: the schedule passed its end_at.
  - `time_zone` string, required: The IANA time zone cron_expression is read in, so local times hold across daylight saving.
  - `updated_at` string, date-time, required: When the schedule was last changed.

## Other responses

- `400`: Bad Request
- `403`: Forbidden
- `404`: Not Found
- `422`: Unprocessable Entity
- `500`: Internal Server Error

## Changes

- **2026-11-01** `80de09d0e643`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/axilioai/apis/axilio-api/changes/agents/:agent_id/schedules/post.md)

---

[API](https://skmtc.dev/axilioai/apis/axilio-api.md) - [All operations](https://skmtc.dev/axilioai/apis/axilio-api/llms.txt) - [OpenAPI document](https://skmtc.dev/axilioai/apis/axilio-api/revisions/80de09d0e643?raw)
