---
title: "Trigger automation"
method: POST
path: "/v1/automations/{automationId}/trigger"
tags: ["Automations"]
---

# Trigger automation

`POST /v1/automations/{automationId}/trigger`

## Request

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

Start a run now. With an `idempotency_key` (body or `Idempotency-Key` header) the
same key returns the run already started for it (200) rather than a second run
(201). `input` is exposed to steps as `{{trigger.*}}`.

## Path parameters

- `automationId` string, uuid, required

## Request body

- TriggerAutomationRequest
  - `input` object: Exposed to steps as `{{trigger.*}}`.
  - `idempotency_key` string: Same key twice for one automation returns the existing run (200) instead of starting a second (201). `Idempotency-Key` header is equivalent.

## Response `200`

An earlier run with the same idempotency key

- AutomationRunResponse
  - `id` string, uuid, required
  - `automation_id` string, uuid, required
  - `agent_id` string, uuid, required
  - `status` 'running' | 'success' | 'completed_with_skips' | 'failed' | 'timed_out' | 'cancelled' | 'awaiting_approval' | 'waiting' | 'awaiting_callback', required: `awaiting_approval`, `waiting` (a `wait_until` park) and `awaiting_callback` are parked states: the run's clock is stopped and it continues when the approval is decided, the wake time passes, or the callback URL is posted to.
  - `paused_reason` 'approval' | 'wait_until' | 'callback', nullable
  - `paused_at_step` integer, nullable
  - `paused_approval_id` string, uuid, nullable
  - `paused_until` string, date-time, nullable
  - `paused_expires_at` string, date-time, nullable
  - `spec_version` integer, nullable
  - `idempotency_key` string, nullable
  - `parent_run_id` string, uuid, nullable: Set when a `call_automation` step started this run.
  - `step_results` unknown
  - `error` string, nullable
  - `trigger_source` string, nullable
  - `context` object, nullable: JSONB context passed between workflow steps
  - `started_at` string, date-time, required
  - `finished_at` string, date-time, nullable
  - `tokens_used` integer, required
  - `cost_cents` integer, required

## Other responses

- `201`: Run started
- `401`: Authentication required or invalid
- `404`: Resource not found

---

[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/5fa0918f3b41?raw)
