---
title: "Create an agent schedule"
method: POST
path: "/api/v2/agent/createCronSchedule"
tags: ["Agent"]
---

# Create an agent schedule

`POST /api/v2/agent/createCronSchedule`

## Request

- Base URL: `https://zeropath.com`
- URL: `https://zeropath.com/api/v2/agent/createCronSchedule`
- Auth: API key in header `X-ZeroPath-API-Token-Id` and API key in header `X-ZeroPath-API-Token-Secret`

Create a recurring assistant schedule. Agent cron schedules run prompts on a recurring time cadence. Use them for polling-style checks, time-window summaries, timeout-rate monitoring, and requests phrased as "every N hours/days" or "on a schedule". For example, create a cron schedule to monitor PR scan timeout rates; do not create a LONG_RUNNING_SCAN event trigger for that recurring workflow. Requires agent management permission. New schedules default to untrusted execution. Repository- or tag-scoped runs always use restricted execution, including when the schedule trusted setting is true.

## Request body

- AgentCreateCronScheduleRequest
  - `organizationId` string: Organization ID (injected by MCP server)
  - `name` string, required: Unique schedule name.
  - `cronExpression` string, required: Standard 5-field cron expression evaluated in UTC. Agent cron schedules run prompts on a recurring time cadence. Use them for polling-style checks, time-window summaries, timeout-rate monitoring, and requests phrased as "every N hours/days" or "on a schedule". For example, create a cron schedule to monitor PR scan timeout rates; do not create a LONG_RUNNING_SCAN event trigger for that recurring workflow.
  - `prompt` string, required: The prompt to run each time the schedule fires.
  - `trusted` boolean: Whether organization-wide jobs run with trusted tool access. Defaults to false. Repository- or tag-scoped jobs always use restricted execution.
  - `modelStrength` 'LOW' | 'HIGH': Model strength copied onto jobs created by this schedule. Omit to use LOW.
  - `repositoryIds` string[]: Include these repository IDs. Combined with selected tags; omitting both selections creates an organization-wide schedule.
  - `tagIds` string[]: Include repositories currently carrying any of these tags at each dispatch. An empty resolved selection is rejected.

## Response `200`

Schedule created

- AgentCronScheduleMutationResponse
  - `schedule` object, required
    - `id` string, uuid, required
    - `name` string, required
    - `cronExpression` string, required
    - `prompt` string, required
    - `enabled` boolean, required
    - `trusted` boolean, required: Saved Trusted setting.
    - `effectiveTrusted` boolean, required: Actual execution mode. Always false for SELECTED scope.
    - `configurationError` string, nullable, required: Cadence validation error, or null when the schedule can run.
    - `scopeMode` 'ALL' | 'SELECTED', required
    - `modelStrength` 'LOW' | 'HIGH', required
    - `lastRunAt` string, date-time, nullable, required
    - `nextRunAt` string, date-time, nullable, required
    - `createdAt` string, date-time, required
    - `updatedAt` string, date-time, required

## Other responses

- `400`: Error Response
- `401`: Error Response
- `403`: Error Response
- `404`: Error Response
- `409`: Error Response

---

[API](https://skmtc.dev/zeropath/apis/zeropath-api.md) - [All operations](https://skmtc.dev/zeropath/apis/zeropath-api/llms.txt) - [OpenAPI document](https://skmtc.dev/zeropath/apis/zeropath-api/revisions/126e9c80ba0d?raw)
