---
title: "Create automation"
method: POST
path: "/v1/automations"
tags: ["Automations"]
---

# Create automation

`POST /v1/automations`

## Request

- Base URL: `https://api.1claw.co`
- URL: `https://api.1claw.co/v1/automations`
- Auth: HTTP bearer

## Request body

- CreateAutomationRequest: Create an automation. `workflow_spec` is required and must be either a JSON array of steps or `{ "steps": [...] }`. Dashboard `schedule` trigger_type is accepted and normalized to `cron`. For cron triggers, `cron_expr` is required.
  - `name` string, required
  - `agent_id` string, uuid, required
  - `trigger_type` 'cron' | 'event' | 'webhook' | 'manual' | 'schedule', required: cron | event | webhook | manual (alias schedule → cron)
  - `cron_expr` string: Required when trigger_type is cron (or schedule)
  - `timezone` string
  - `event_filter` object, nullable
  - `workflow_spec` union, required: Workflow steps. Accepts a bare array `[...]` or `{ "steps": [...] }` (dashboard / preset shape). Supported step types: get_secret, put_secret, http_request, rotate_secret, notify_human, ai_generate, memory_get, memory_put, memory_search, notify, approval_request, condition, execute_binding.
    - object[]
    - object

## Response `201`

Automation created (includes one-time webhook credentials when trigger_type is webhook)

- AutomationCreatedResponse
  - `id` string, uuid, required
  - `agent_id` string, uuid, required
  - `name` string, required
  - `trigger_type` 'cron' | 'event' | 'webhook' | 'manual', required
  - `cron_expr` string, nullable
  - `timezone` string, required
  - `event_filter` object, nullable
  - `workflow_spec` union, required
    - object[]
    - object
  - `is_active` boolean, required
  - `last_run_at` string, date-time, nullable
  - `next_run_at` string, date-time, nullable
  - `last_run_status` string, nullable: Status of the most recent run (enriched list field)
  - `total_runs` integer, nullable: Total runs in the last 30 days (enriched list field)
  - `success_rate` number, nullable: Success rate percentage (enriched list field)
  - `agent_name` string, nullable: Resolved agent display name (enriched list field)
  - `created_by_type` 'user' | 'agent': Whether the automation was created by a human or agent (chat-native create)
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required
  - `spec_version` integer: Current `automation_versions` version.
  - `webhook_signature_scheme` string, nullable: Inbound signature scheme name, never the secret.
  - `webhook_url` string: Full POST URL including token (one-time on create)
  - `webhook_token` string: whk_ token segment (one-time on create)

## Other responses

- `400`: Invalid request
- `401`: Authentication required or invalid

---

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