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.
- REST API
POST /v1/replica
Your code sends an environment, a message and the agent to use. The call returns at once.
- 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.
- 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"
}'- Webhook
POST to a webhook URL
Any tool that can send JSON fires the automation. The payload is added to the agent’s prompt.
- 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.
- 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": "..." }- Schedule
Every weekday at 9 AM
An automation runs your prompt once, on chosen days, or on any cron expression.
- 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.
- 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.
| You | Replicas |
|---|---|
| POST /v1/replica with a message | Starts a workspace in a cloud VM and returns at once |
| Set webhook_url on the request | Calls your URL when the workspace is ready and when a turn completes |
| POST /v1/replica/{id}/messages | Sends a follow-up to the same workspace, waking it if it slept |
| Stream events or call the wait endpoint | Follows the agent live, or returns when it finishes |
| Add a custom webhook trigger to an automation | Gives you a URL that runs the prompt with any JSON you post |
| Add a schedule trigger | Runs once, on chosen days, or on a cron expression |
| Declare automations in replicas.yaml | Keeps schedules and triggers in your repository |
| Use the CLI or the MCP server | Does the same from a terminal or another agent |
Setup
Make the first call in 4 steps.
Automations guide- 01
In Replicas, create an API key under Settings → API Keys, or a personal key under Personal → API Keys.
- 02
Add your repositories to an environment, then read its ID from GET /v1/environments.
- 03
Call POST /v1/replica with the environment ID and a message, or create an automation with a webhook or schedule trigger.
- 04
Follow the run from the Replicas app, the event stream or your webhook URL, then review the pull request.