Skip to main content
POST
/
v1
/
automations
Create Automation
curl --request POST \
  --url https://api.replicas.dev/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>",
  "description": "<string>",
  "repository_ids": [
    "3c90c3cc-0d44-4b50-8888-8dd25736052a"
  ],
  "repository_set_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "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>",
    "repository_ids": [
      "3c90c3cc-0d44-4b50-8888-8dd25736052a"
    ],
    "repository_set_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "enabled": true,
    "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"
  }
}

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. Provide either repository_ids or repository_set_id (mutually exclusive).

name
string
required

Human-readable name for the automation

triggers
object[]
required

One or more triggers. At most one cron trigger is allowed.

Minimum array length: 1
prompt
string
required

The instruction sent to the coding agent when the automation fires

description
string

Optional description

repository_ids
string<uuid>[]

Target repository IDs. Mutually exclusive with repository_set_id.

repository_set_id
string<uuid>

Target repository set ID. Mutually exclusive with repository_ids.

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