> ## Documentation Index
> Fetch the complete documentation index at: https://docs.runtm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Scheduled Agent

> Create a cron-driven agent

Creates a scheduled agent. When `enabled` is true the scheduler job is created atomically with the row: if the schedule cannot be created, nothing is persisted.

The recommended order is to create with `"enabled": false`, prove the configuration with [Run Now](https://docs.runtm.com/cloud-api/scheduled-agents/run.md), then enable. A run-now executes the identical code path the cron tick takes, so a bad template or missing Slack target fails in front of you instead of silently at the scheduled hour.

**Required scope:** `sessions:write` and an admin or owner role.

## Request Body

**name** `string` *required*

Display name (1 to 128 characters).

**cron** `string` *required*

5-field cron expression, evaluated in UTC. There is no per-agent time zone: 11am Pacific is `0 18 * * *` during daylight time and `0 19 * * *` in winter.

**prompt** `string` *required*

The prompt run on every tick. Runs are unattended (autopilot), so say exactly what to produce and in what shape.

**org\_template\_id** `string`

Org template the session launches from.

**agent** `string` (default: claude-code)

Coding agent harness.

**model** `string`

Model override for the launched session. Defaults to the model set on the linked agent's triggers. For Claude Code and Codex an unknown model is a 422 that lists the valid ones.

**agent\_id** `string`

Roster agent the schedule runs as. Each run uses the agent's template, harness and instructions, and `org_template_id` is ignored. The model is the schedule's `model` if set, else the one set on the agent's triggers.

**enabled** `boolean` (default: true)

Whether the schedule is live immediately.

**slack\_integration\_id** `string`

Slack integration posting each run's result. Must be set together with `slack_channel_id`.

**slack\_channel\_id** `string`

Channel each run's result is posted to. Must be set together with `slack_integration_id`.

## Response

The created [scheduled agent object](https://docs.runtm.com/cloud-api/scheduled-agents/overview.md#the-scheduled-agent-object) with status `201`.

## Errors

| Status | Cause |
| - | - |
| `400` | Slack integration and channel not set together |
| `403` | Caller is not an org admin or owner |
| `422` | `cron` is not a 5-field expression |
| `503` | Cloud Scheduler is not configured in this environment; create with `"enabled": false` and drive with run-now |

```bash cURL theme={null}
curl -X POST "https://app.runtm.com/api/cloud/v1/scheduled-agents" \
  -H "Authorization: Bearer runtm_xxx" \
  -H "X-Organization-Id: org_abc123" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "weekly-outbound",
    "cron": "0 18 * * 1",
    "prompt": "Build this week'"'"'s outbound lists and post them for approval",
    "org_template_id": "tmpl_abc123",
    "enabled": false
  }'
```

```bash CLI theme={null}
runtm-api scheduled-agents create --name weekly-outbound --disabled \
  --cron '0 18 * * 1' --template tmpl_abc123 \
  --prompt 'Build this weeks outbound lists and post them for approval'
```

```json 201 theme={null}
{
  "id": "sa_9f3c1a",
  "name": "weekly-outbound",
  "cron": "0 18 * * 1",
  "prompt": "Build this week's outbound lists and post them for approval",
  "org_template_id": "tmpl_abc123",
  "template_name": "GTM Machine",
  "agent": "claude-code",
  "model": null,
  "enabled": false,
  "slack_integration_id": null,
  "slack_integration_name": null,
  "slack_channel_id": null,
  "last_run_at": null,
  "last_session_id": null,
  "next_run_at": null,
  "created_at": "2026-07-28T19:00:00Z",
  "updated_at": null
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.