---
title: "Create Routine"
method: POST
path: "/api/platform/v1/routines"
tags: ["workflows"]
---

# Create Routine

`POST /api/platform/v1/routines`

## Request

- Base URL: `https://docs.amdahl.ai`
- URL: `https://docs.amdahl.ai/api/platform/v1/routines`
- Auth: one of:
  - API key in header `X-API-Key`
  - HTTP bearer

Create a Routine: a cron that fires a Chat each occurrence, running one Master agent turn in a fresh named Chat. Use when the user asks for a standing refresh or a recurring investigation. Provide name, prompt, and cron (plus optional timezone and per-fire config like depth or an agents roster); the fire never pauses on a human and each occurrence opens a new Chat.

## Request body

- object
  - `name` string, required: Human label. Each fired Chat is named "{name} — {date}".
  - `prompt` string, required: The Chat input every fire starts the Master turn with.
  - `cron` string, required: Cron expression (e.g. "0 9 * * 1"). Validated before the row is stored.
  - `timezone` string: IANA timezone the cron evaluates in. Defaults to UTC.
  - `agent` string: LEGACY single-agent pin the Master turn runs as (library slug/uuid or workspace agent id/slug). Prefer config.agents; passing both rejects.
  - `config` object: Per-fire Chat config. on_question is always none (headless); agents picks the roster ("all", one pin, or a delegate allowlist).
    - `depth` 'quick' | 'standard' | 'deep'
    - `agents` union: Agents the routine employs: "all" for unrestricted delegation, one ref to run AS that agent (pin), or several refs to restrict delegation to that roster.
      - 'all'
      - string[]
    - `actions_allowed` string[]: Outbound actions each fired run may invoke. Absent = ALL cataloged actions (default ON); pass a list to narrow, [] to disable.
    - `external_search` boolean: Allow market fan-outs (external_search.execute in the kit). Default false.
    - `include_divergence` boolean: Fuse the divergence map on external_search.execute (else evidence-only). Default false.
  - `enabled` boolean: Whether the routine fires. Defaults to true.

## Response `201`

Created

- object
  - `data` unknown

## Other responses

- `400`: Invalid input - failed schema validation
- `401`: Authentication required
- `403`: Forbidden - missing scope or role
- `500`: Internal server error

---

[API](https://skmtc.dev/amdahl/apis/amdahl-platform-api.md) · [All operations](https://skmtc.dev/amdahl/apis/amdahl-platform-api/llms.txt) · [OpenAPI document](https://skmtc.dev/amdahl/apis/amdahl-platform-api/revisions/d4eee33e2472?raw)
