Skip to main content
POST
Create an automation

Headers

idempotency-key
string
required

Idempotency-Key header. Required: resending the request with the same key returns the automation the first request created, so a lost response never leaves a second schedule running

Required string length: 1 - 128
Pattern: ^\S[\s\S]*\S$|^\S$|^$

Body

application/json
name
string
required

Human-readable automation name

Required string length: 1 - 256
agent
required

Agent to run in each session. Pass an ID to pin the latest version, or pass an object with type "agent", id, and version to pin a specific version.

Required string length: 1 - 256
environment_id
string
required

Environment ID each run's session uses

Required string length: 1 - 256
initial_events
object[]
required

Initial events sent when each run creates a session. Supply one text user.message event of up to 16384 UTF-16 code units after its text blocks are joined with newlines.

Required array length: 1 element
description
string | null

What the automation is for, up to 2048 characters

Maximum string length: 2048
schedule
object | null

When the automation fires: a cron expression that names a single minute, so it fires at most once per clock hour, read in an IANA time zone name such as America/New_York. Omit it or send null to run this automation only on demand or from incoming integrations.

resources
object[]

Repositories, memory stores, artifacts, skills and files to mount in each run's session. An automation stores no secrets, so a repository here cannot carry authorization_token. An artifact or skill without a version mounts the version that is current when the run starts.

Maximum array length: 72
vault_ids
string[]

Vaults whose credentials each run's session may use. Credentials are matched to the agent's MCP servers when each run starts, so a rotated or added credential applies to the next run.

Maximum array length: 20
Minimum string length: 1
mcp_server_credentials
object[]

Explicit credentials for named servers. An explicit binding wins over vault matching.

Maximum array length: 40
machine_credentials
object[]

Credentials from the automation's vaults for each run's machine, as on session create. Each is checked when a run starts, so an archived credential refuses the run.

Maximum array length: 16
custom_tools
enum<string>

What a run's session does when the agent calls a custom tool. refuse (default) tells the agent nobody will answer. wait pauses the session with stop_reason requires_action until your application sends user.custom_tool_result, as in a session you start yourself. Tools that need a person's approval are refused either way.

Available options:
refuse,
wait

Response

Success

id
string
required
Required string length: 1 - 128
type
enum<string>
required
Available options:
automation
name
string
required
Required string length: 1 - 256
description
string | null
required
Maximum string length: 2048
environment_id
string
required
Required string length: 1 - 256
schedule
object | null
required
status
enum<string>
required
Available options:
active,
paused,
archived
pause_reason
string | null
required
revision
integer
required
Required range: 1 <= x <= 9007199254740991
last_run_at
string | null
required
created_at
string
required
updated_at
string
required
archived_at
string | null
required
agent
object
required
initial_events
object[]
required
Required array length: 1 element
resources
object[]
required
Maximum array length: 72
vault_ids
string[]
required
Maximum array length: 20
Minimum string length: 1
mcp_server_credentials
object[]
required
Maximum array length: 40
machine_credentials
object[]
required
Maximum array length: 16
custom_tools
enum<string>
required
Available options:
refuse,
wait
run_count
integer
required
Required range: -9007199254740991 <= x <= 9007199254740991
upcoming_runs_at
string[]
required