Skip to main content
POST
/
v1
/
automations
Create Automation
curl --request POST \
  --url https://api.tryreplicas.com/v1/automations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "triggers": [
    {
      "config": {
        "schedule": "0 9 * * 1-5",
        "timezone": "America/New_York"
      }
    }
  ],
  "prompt": "<string>",
  "environment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "description": "<string>",
  "scope": "org",
  "debounce_seconds": 43200,
  "enabled": true,
  "workspace_auto_stop_minutes": 721,
  "workspace_size": "small",
  "config": {
    "capabilities": {
      "pr_followups": true
    },
    "preferences": {
      "keep_open_on_pr_merge": false
    }
  },
  "model": "<string>",
  "plan_mode": true,
  "goal_mode": true,
  "fast_mode": true
}
'
{
  "automation": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "organization_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "name": "<string>",
    "description": "<string>",
    "triggers": [
      {
        "config": {
          "schedule": "0 9 * * 1-5",
          "timezone": "America/New_York"
        }
      }
    ],
    "prompt": "<string>",
    "debounce_seconds": 43200,
    "environment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "enabled": true,
    "webhook_token": "<string>",
    "cron_expression": "<string>",
    "cron_timezone": "<string>",
    "cron_next_fire_at": "2023-11-07T05:31:56Z",
    "user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "created_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "workspace_auto_stop_minutes": 721,
    "config": {
      "capabilities": {
        "pr_followups": true
      },
      "preferences": {
        "keep_open_on_pr_merge": false
      }
    },
    "model": "<string>",
    "plan_mode": true,
    "goal_mode": true,
    "fast_mode": true,
    "created_at": "2023-11-07T05:31:56Z",
    "updated_at": "2023-11-07T05:31:56Z"
  }
}

Authorizations

Authorization
string
header
required

API key authentication. Obtain your API key from the Replicas dashboard under Settings > API Keys.

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 for this automation and the latest payload runs after the automation stops receiving events for this many seconds. Null or 0 disables debouncing.

Required range: 0 <= x <= 86400
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,
delete_when_done,
delete_after_inactivity
workspace_auto_stop_minutes
integer

Inactivity timeout in minutes (requires delete_after_inactivity 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,
null
model
string | null

Model override. Requires agent_provider when set.

thinking_level
enum<string> | null

Thinking/reasoning level override.

Available options:
low,
medium,
high,
max,
null
plan_mode
boolean

Run automation messages in plan mode.

goal_mode
boolean

Set automation messages as Codex goals. Only applies when the resolved agent is Codex.

fast_mode
boolean

Run automation messages in fast mode.

Response

Automation created successfully

Response containing a single automation

automation
object
required

An automation record