Skip to main content
POST
Create Automation

Authorizations

Authorization
string
header
required

API key authentication. Obtain your API key from the Replicas dashboard under Organization → Settings → API Keys. User-session JWTs are not accepted by /v1/replica endpoints.

Body

application/json

Request body for creating a new automation. The automation runs in a single environment specified by environment_id.

name
string
required

Human-readable name for the automation

triggers
object[]
required

One or more triggers. Duplicates are not allowed: at most one cron trigger, and at most one event-based trigger per event (e.g. two triggers for pull_request.opened is rejected, but pull_request.opened + merge_request.opened is fine).

Minimum array length: 1
prompt
string
required

The instruction sent to the coding agent when the automation fires

environment_id
string<uuid>
required

ID of the environment this automation runs in. Required. The environment supplies the repository (or repository set) and resolved env vars / MCPs / skills.

description
string

Optional description

scope
enum<string>
default:org

Automation scope. org (default) creates an org-owned automation visible to all members. user creates a personal automation scoped to the authenticated user.

Available options:
org,
user
debounce_seconds
integer | null

Optional per-automation debounce window in seconds. When greater than 0, bursty trigger events update one pending run and the latest payload runs after matching events stop for this many seconds. GitHub and GitLab events keep separate pending runs per repository and pull or merge request. Null or 0 disables debouncing.

Required range: 0 <= x <= 86400
github_check_names
string[]

Optional GitHub check names this automation reports its verdict on. Requires a pull_request.opened or pull_request.synchronize trigger. Each name is created as an in-progress check run on the head commit of every matching pull request before the run is dispatched, so a required check cannot pass until the agent reports a result. Defaults to an empty array.

Maximum array length: 10
Maximum string length: 100
enabled
boolean
default:true

Whether the automation should be active (defaults to true)

workspace_lifecycle_policy
enum<string>

Lifecycle policy for workspaces created by this automation

Available options:
default,
archive_when_done,
sleep_when_done
workspace_auto_stop_minutes
integer

Inactivity timeout in minutes for the default keep-alive policy

Required range: 3 <= x <= 1440
workspace_size
enum<string>
default:small

Compute size for every workspace this automation fires off. small (2 vCPU, 8 GB memory, 20 GB disk) bills at $0.008/min; large (4 vCPU, 16 GB memory, 32 GB disk) bills at $0.016/min. Defaults to small.

Available options:
small,
large
config
object

Workspace behavior configuration. Missing capabilities and preferences default to disabled.

agent_provider
enum<string> | null

Coding agent override. Null inherits the organization default.

Available options:
claude,
codex,
cursor,
opencode,
pi,
null
model
string | null

Model override. Requires agent_provider when set.

thinking_level
enum<string> | null

Thinking/reasoning level override. ultra is Codex-only; ultracode is Claude Code-only.

Available options:
low,
medium,
high,
xhigh,
max,
ultra,
ultracode,
null
plan_mode
boolean

Run automation messages in plan mode.

goal_mode
boolean | null

Set automation messages as Codex goals. Null inherits the resolved agent default; false explicitly disables it. Only applies when the resolved agent is Codex.

fast_mode
boolean | null

Run automation messages in fast mode. Null inherits the resolved agent default; false explicitly disables it.

Response

Automation created successfully

Response containing a single automation

automation
object
required

An automation record