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": [
    {
      "type": "cron",
      "config": {
        "schedule": "0 9 * * 1-5",
        "timezone": "America/New_York"
      }
    }
  ],
  "prompt": "<string>",
  "environment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "description": "<string>",
  "enabled": true,
  "workspace_lifecycle_policy": "default",
  "workspace_auto_stop_minutes": 721
}
'
{
  "automation": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "organization_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "name": "<string>",
    "description": "<string>",
    "triggers": [
      {
        "type": "cron",
        "config": {
          "schedule": "0 9 * * 1-5",
          "timezone": "America/New_York"
        }
      }
    ],
    "prompt": "<string>",
    "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",
    "created_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "workspace_lifecycle_policy": "default",
    "workspace_auto_stop_minutes": 721,
    "created_at": "2023-11-07T05:31:56Z",
    "updated_at": "2023-11-07T05:31:56Z"
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.replicas.dev/llms.txt

Use this file to discover all available pages before exploring further.

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 GitHub or Sentry trigger per event (e.g. two triggers for pull_request.opened is rejected, but pull_request.opened + pull_request.synchronize 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

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

Response

Automation created successfully

Response containing a single automation

automation
object
required

An automation record