Integrations / API, webhooks and schedules

Start a coding agent from an API call, a webhook or a schedule.

Not every task starts with a person typing a message. Call the Replicas REST API from your own code, point another tool at a webhook URL, or set a schedule. Replicas starts Claude Code, Codex, Cursor or OpenCode in an isolated cloud VM with your repos, and the agent can open a pull request when it is done.

Updated

How it works

From a request to a reviewed pull request.

  1. REST API

    POST /v1/replica

    Your code sends an environment, a message and the agent to use. The call returns at once.

  2. Isolated cloud VM

    Your agent works on your repos

    Claude Code, Codex, Cursor or OpenCode runs in its own VM with your environment, and can run tests.

  3. Result

    A pull request, and a callback to your URL

    Review the changes with your team before merging.

curl -X POST https://api.replicas.dev/v1/replica \
  -H "Authorization: Bearer $REPLICAS_API_KEY" \
  -H "Content-Type: application/json" \
  -H "X-Replicas-Api-Version: 2026-10-07" \
  -d '{
    "name": "fix-login-timeout",
    "environment_id": "ENVIRONMENT_ID",
    "message": "Fix the login timeout and open a pull request",
    "coding_agent": "claude",
    "webhook_url": "https://example.com/replicas-callback"
  }'
  1. Webhook

    POST to a webhook URL

    Any tool that can send JSON fires the automation. The payload is added to the agent’s prompt.

  2. Isolated cloud VM

    Your agent works on your repos

    Claude Code, Codex, Cursor or OpenCode runs in its own VM with your environment, and can run tests.

  3. Result

    A pull request, listed in the run history

    Review the changes with your team before merging.

curl -X POST "https://api.replicas.dev/v1/automations/webhook/whtok_xxxxxxxx?wait_for_workspace=true" \
  -H "Content-Type: application/json" \
  -d '{"feedback": "The export button is stuck"}'

# 201 Created
# { "execution_id": "...", "workspace_id": "...", "workspace_url": "..." }
  1. Schedule

    Every weekday at 9 AM

    An automation runs your prompt once, on chosen days, or on any cron expression.

  2. Isolated cloud VM

    Your agent works on your repos

    Claude Code, Codex, Cursor or OpenCode runs in its own VM with your environment, and can run tests.

  3. Result

    A pull request, listed in the run history

    Review the changes with your team before merging.

curl -X POST https://api.replicas.dev/v1/automations \
  -H "Authorization: Bearer $REPLICAS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "weekday-dependency-review",
    "prompt": "Review dependency updates and open a pull request if any are needed",
    "environment_id": "ENVIRONMENT_ID",
    "triggers": [
      { "type": "cron", "config": { "schedule": "0 9 * * 1-5", "timezone": "UTC" } }
    ]
  }'

From your own code

What you can do without opening the app.

YouReplicas
POST /v1/replica with a messageStarts a workspace in a cloud VM and returns at once
Set webhook_url on the requestCalls your URL when the workspace is ready and when a turn completes
POST /v1/replica/{id}/messagesSends a follow-up to the same workspace, waking it if it slept
Stream events or call the wait endpointFollows the agent live, or returns when it finishes
Add a custom webhook trigger to an automationGives you a URL that runs the prompt with any JSON you post
Add a schedule triggerRuns once, on chosen days, or on a cron expression
Declare automations in replicas.yamlKeeps schedules and triggers in your repository
Use the CLI or the MCP serverDoes the same from a terminal or another agent

Setup

Make the first call in 4 steps.

Automations guide
  1. 01

    In Replicas, create an API key under Settings → API Keys, or a personal key under Personal → API Keys.

  2. 02

    Add your repositories to an environment, then read its ID from GET /v1/environments.

  3. 03

    Call POST /v1/replica with the environment ID and a message, or create an automation with a webhook or schedule trigger.

  4. 04

    Follow the run from the Replicas app, the event stream or your webhook URL, then review the pull request.

FAQs

API, webhook and schedule questions

Get started

Yes. Send POST /v1/replica to api.replicas.dev with an API key, an environment ID and a message. Replicas starts the coding agent you name, such as Claude Code or Codex, in an isolated cloud VM with that environment’s repositories.