---
title: "Update automation"
method: PATCH
path: "/v1/automations/{id}"
tags: ["Automations"]
---

# Update automation

`PATCH /v1/automations/{id}`

## Request

- Base URL: `https://api.replicas.dev`
- URL: `https://api.replicas.dev/v1/automations/{id}`
- Auth: HTTP bearer

Updates only the fields you send. `triggers` replaces all triggers.

## Path parameters

- `id` string, uuid, required

## Headers

- `X-Replicas-Api-Version` '2026-10-07'

## Request body

- UpdateAutomationRequest: Request body for updating an automation. Only provided fields are updated.
  - `name` string: New name
  - `description` string: New description
  - `triggers` AutomationTrigger[]: Replaces all triggers. At most one cron trigger and one trigger per event.
    - `type` 'cron' | 'github' | 'gitlab' | 'slack' | 'sentry' | 'custom', required: The trigger type
    - `config` union, required: Trigger configuration. Its schema depends on `type`: `CronTriggerConfig`, `GitHubTriggerConfig`, `GitLabTriggerConfig`, `SlackTriggerConfig`, `SentryTriggerConfig`, or an empty object for `custom`.
      - CronTriggerConfig: Configuration for a cron (scheduled) trigger
        - `schedule` string, required: Cron expression (e.g. "0 9 * * 1-5" for weekdays at 9am UTC)
        - `timezone` string: IANA timezone for the schedule (defaults to UTC)
      - GitHubTriggerConfig: Configuration for a GitHub event trigger
        - `event` 'pull_request.opened' | 'pull_request.synchronize' | 'pull_request.ready_for_review' | 'pull_request.merged' | 'pull_request.closed' | 'pull_request.command', required: The GitHub event to listen for
        - `repository_ids` string[]: Optional filter: only fire for events from these repositories. If omitted, fires for all repositories.
        - `group_pr_events` boolean: Send later opened, synchronize, ready for review, and command events for the same pull request to the existing workspace instead of creating a new one.
        - `excluded_actors` string[]: Optional exclusion list: events sent by these GitHub usernames never fire the automation (e.g. `dependabot[bot]`). Matching is case-insensitive and ignores a leading `@`.
      - GitLabTriggerConfig: Configuration for a GitLab merge request event trigger
        - `event` 'merge_request.opened' | 'merge_request.updated' | 'merge_request.merged' | 'merge_request.closed', required: The GitLab event to listen for
        - `repository_ids` string[]: Optional filter: only fire for events from these GitLab projects. If omitted, fires for all projects.
        - `group_pr_events` boolean: Send later opened and updated events for the same merge request to the existing workspace instead of creating a new one.
        - `excluded_actors` string[]: Optional exclusion list: events sent by these GitLab usernames never fire the automation. Matching is case-insensitive and ignores a leading `@`.
      - SlackTriggerConfig: Configuration for a Slack event trigger
        - `event` 'message', required: The Slack event to listen for
        - `channel_ids` string[]: Optional filter: only fire for events from these Slack channels. If omitted, fires for all channels.
        - `group_thread_replies` boolean: When true (default), thread replies flow to the same workspace as the root message instead of spawning new ones.
      - SentryTriggerConfig: Configuration for a Sentry event trigger
        - `event` 'event_alert.triggered' | 'issue.created' | 'error.created', required: The Sentry event to listen for
        - `project_slugs` string[]: Optional filter: only fire for events from these Sentry project slugs. If omitted, fires for all projects.
        - `min_level` 'debug' | 'info' | 'warning' | 'error' | 'fatal': Optional minimum severity level (inclusive). If omitted, fires for all levels.
      - CustomTriggerConfig: Configuration for a custom webhook trigger. The config is intentionally empty: the automation's generated `webhook_token` is the only thing that needs to be stored.
  - `prompt` string: New prompt
  - `debounce_seconds` integer, nullable: Seconds to wait for trigger events to stop before running once with the latest payload. GitHub and GitLab events debounce per pull or merge request. `null` or `0` disables debouncing.
  - `github_check_names` string[]: Set or clear the GitHub check names this automation reports its verdict on. A non-empty list requires a pull_request.opened or pull_request.synchronize trigger. Pass an empty array to stop creating checks.
  - `environment_id` string, uuid: Move this automation to a different environment.
  - `enabled` boolean: Enable or disable the automation
  - `workspace_lifecycle_policy` 'default' | 'archive_when_done' | 'sleep_when_done' | 'delete_when_done': New lifecycle policy
  - `workspace_auto_stop_minutes` integer, nullable: New inactivity timeout in minutes for the default keep-alive policy (set to null to clear)
  - `workspace_size` 'small' | 'large' | 'ultra': New compute size for every workspace this automation fires off. `small` (2 vCPU, 8 GB memory), `large` (4 vCPU, 16 GB memory), or `ultra` (8 vCPU, 32 GB memory); see [Billing](https://docs.replicas.dev/admin/billing#rates) for per-size rates.
  - `config` WorkspaceConfig: Workspace behavior configuration. Defaults depend on the workspace source; see each setting.
    - `memoryRetentionEnabled` boolean: Whether sessions are added to session history when the workspace sleeps. Defaults to false for API and automation workspaces.
    - `capabilities` object: Actions this workspace is allowed to perform. Automations snapshot this config onto each workspace they create; API-created workspaces can set it at creation time.
      - `pr_followups` boolean: Whether matching pull requests can receive Replicas follow-up actions. Only applies to workspaces created from an automation, where it defaults to false; other workspaces always receive follow-ups. When enabled, later CI and review-comment replies can route back to this workspace.
      - `read_only_contents` boolean: Whether the workspace GitHub token is restricted to read-only repository contents, keeping write access for pull request comments, issues, and checks. Defaults to false, so the workspace can push branches and open pull requests.
    - `preferences` object: Workspace behavior preferences that do not grant new action permissions.
      - `keep_open_on_pr_merge` boolean: Whether the workspace should remain open after its last tracked PR is merged. Defaults to false.
      - `keep_open_on_pr_close` boolean: Whether the workspace should remain open after its last tracked PR is closed without merging. Defaults to false.
    - `provisioning_error` object: Setup/provisioning or wake/resume failure captured when the workspace remains queryable in `error` status. Some wake/resume failures can be retried; the `error` status can also represent an unrecoverable sandbox failure.
      - `message` string: Underlying setup failure message, such as repository clone/auth errors.
  - `agent_provider` 'claude' | 'codex' | 'cursor' | 'muse' | 'opencode' | 'pi' | 'null', nullable: New coding agent override. Null inherits the organization default.
  - `model` string, nullable: New model override. Requires `agent_provider` when set. Must be a model your organization allows for that agent; hidden models are rejected with 400.
  - `thinking_level` 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra' | 'ultracode' | 'null', nullable: New thinking/reasoning level override. `ultra` is available for Codex and Muse Code; `ultracode` is Claude Code-only.
  - `plan_mode` boolean: Enable or disable plan mode for automation messages.
  - `goal_mode` boolean, nullable: Enable or disable goal mode for automation messages. Null inherits the resolved agent default; false explicitly disables it.
  - `fast_mode` boolean, nullable: Enable or disable fast mode for automation messages. Null inherits the resolved agent default; false explicitly disables it.
  - `scope` 'org': Set to `org` to move a personal automation to the organization so teammates can see and edit it. Requires a shared environment and Automations write access. Cannot be undone.

## Response `200`

Automation updated successfully

- AutomationResponse: Response containing a single automation
  - `automation` AutomationRecord, required: An automation record
    - `access` EnvironmentAccess: Effective permissions for the caller. Read allows discovery, full inspection, and selection for workspaces or automations. Write allows all mutations and implies Read.
      - `can_write` boolean, required
      - `can_read` boolean, required
    - `my_alert_level` 'muted' | 'normal' | 'every': Which phone pushes the signed-in person gets from this automation: `muted` (none), `normal` (when it needs them or stops working) or `every` (each result too). Defaults to `normal` for whoever made it and `muted` for everyone else. Absent when no person is signed in, as with an organization API key.
    - `id` string, uuid, required: Unique identifier for the automation
    - `organization_id` string, uuid, required: Organization that owns this automation
    - `name` string, required: Human-readable name for the automation
    - `description` string, nullable, required: Optional description
    - `triggers` AutomationTrigger[], required: Triggers that fire this automation
      - `type` 'cron' | 'github' | 'gitlab' | 'slack' | 'sentry' | 'custom', required: The trigger type
      - `config` union, required: Trigger configuration. Its schema depends on `type`: `CronTriggerConfig`, `GitHubTriggerConfig`, `GitLabTriggerConfig`, `SlackTriggerConfig`, `SentryTriggerConfig`, or an empty object for `custom`.
        - CronTriggerConfig: Configuration for a cron (scheduled) trigger
          - `schedule` string, required: Cron expression (e.g. "0 9 * * 1-5" for weekdays at 9am UTC)
          - `timezone` string: IANA timezone for the schedule (defaults to UTC)
        - GitHubTriggerConfig: Configuration for a GitHub event trigger
          - `event` 'pull_request.opened' | 'pull_request.synchronize' | 'pull_request.ready_for_review' | 'pull_request.merged' | 'pull_request.closed' | 'pull_request.command', required: The GitHub event to listen for
          - `repository_ids` string[]: Optional filter: only fire for events from these repositories. If omitted, fires for all repositories.
          - `group_pr_events` boolean: Send later opened, synchronize, ready for review, and command events for the same pull request to the existing workspace instead of creating a new one.
          - `excluded_actors` string[]: Optional exclusion list: events sent by these GitHub usernames never fire the automation (e.g. `dependabot[bot]`). Matching is case-insensitive and ignores a leading `@`.
        - GitLabTriggerConfig: Configuration for a GitLab merge request event trigger
          - `event` 'merge_request.opened' | 'merge_request.updated' | 'merge_request.merged' | 'merge_request.closed', required: The GitLab event to listen for
          - `repository_ids` string[]: Optional filter: only fire for events from these GitLab projects. If omitted, fires for all projects.
          - `group_pr_events` boolean: Send later opened and updated events for the same merge request to the existing workspace instead of creating a new one.
          - `excluded_actors` string[]: Optional exclusion list: events sent by these GitLab usernames never fire the automation. Matching is case-insensitive and ignores a leading `@`.
        - SlackTriggerConfig: Configuration for a Slack event trigger
          - `event` 'message', required: The Slack event to listen for
          - `channel_ids` string[]: Optional filter: only fire for events from these Slack channels. If omitted, fires for all channels.
          - `group_thread_replies` boolean: When true (default), thread replies flow to the same workspace as the root message instead of spawning new ones.
        - SentryTriggerConfig: Configuration for a Sentry event trigger
          - `event` 'event_alert.triggered' | 'issue.created' | 'error.created', required: The Sentry event to listen for
          - `project_slugs` string[]: Optional filter: only fire for events from these Sentry project slugs. If omitted, fires for all projects.
          - `min_level` 'debug' | 'info' | 'warning' | 'error' | 'fatal': Optional minimum severity level (inclusive). If omitted, fires for all levels.
        - CustomTriggerConfig: Configuration for a custom webhook trigger. The config is intentionally empty: the automation's generated `webhook_token` is the only thing that needs to be stored.
    - `prompt` string, required: The instruction sent to the coding agent when the automation fires
    - `debounce_seconds` integer, nullable, required: Seconds to wait for trigger events to stop before running once with the latest payload. GitHub and GitLab events debounce per pull or merge request. `null` or `0` disables debouncing.
    - `github_check_names` string[], required: GitHub check names the automation reports a verdict on.
    - `environment_id` string, uuid, required: ID of the environment this automation runs in. The environment supplies env vars / MCPs / skills layered on top of the environments it builds on and decides which repositories are cloned.
    - `enabled` boolean, required: Whether the automation is active
    - `auto_paused_at` string, date-time, nullable, required: When Replicas paused the automation after it failed every run for 7 days. Null once it's enabled again.
    - `failing_cause` string, nullable, required: Error from the latest failed run while every run since its last completed one has failed. Null once a run completes.
    - `webhook_token` string, nullable, required: Token for the `custom` trigger URL, `POST /v1/automations/webhook/{webhook_token}`. Anyone with the URL can run the automation, so keep it secret.
    - `cron_next_fire_at` string, date-time, nullable, required: Next scheduled fire time for cron automations
    - `user_id` string, uuid, nullable, required: User ID for personal automations, null for org-owned automations
    - `created_by` string, uuid, nullable, required: User who created the automation
    - `workspace_lifecycle_policy` 'default' | 'archive_when_done' | 'sleep_when_done' | 'delete_when_done' | 'delete_after_inactivity', required: Lifecycle policy for workspaces created by this automation
    - `workspace_auto_stop_minutes` integer, nullable, required: Inactivity timeout in minutes (3-1440) for the default keep-alive policy
    - `workspace_size` 'small' | 'large' | 'ultra' | 'null', nullable, required: Compute size for workspaces fired off by this automation. Defaults to `small` when omitted.
    - `config` WorkspaceConfig, required: Workspace behavior configuration. Defaults depend on the workspace source; see each setting.
      - `memoryRetentionEnabled` boolean: Whether sessions are added to session history when the workspace sleeps. Defaults to false for API and automation workspaces.
      - `capabilities` object: Actions this workspace is allowed to perform. Automations snapshot this config onto each workspace they create; API-created workspaces can set it at creation time.
        - `pr_followups` boolean: Whether matching pull requests can receive Replicas follow-up actions. Only applies to workspaces created from an automation, where it defaults to false; other workspaces always receive follow-ups. When enabled, later CI and review-comment replies can route back to this workspace.
        - `read_only_contents` boolean: Whether the workspace GitHub token is restricted to read-only repository contents, keeping write access for pull request comments, issues, and checks. Defaults to false, so the workspace can push branches and open pull requests.
      - `preferences` object: Workspace behavior preferences that do not grant new action permissions.
        - `keep_open_on_pr_merge` boolean: Whether the workspace should remain open after its last tracked PR is merged. Defaults to false.
        - `keep_open_on_pr_close` boolean: Whether the workspace should remain open after its last tracked PR is closed without merging. Defaults to false.
      - `provisioning_error` object: Setup/provisioning or wake/resume failure captured when the workspace remains queryable in `error` status. Some wake/resume failures can be retried; the `error` status can also represent an unrecoverable sandbox failure.
        - `message` string: Underlying setup failure message, such as repository clone/auth errors.
    - `agent_provider` 'claude' | 'codex' | 'cursor' | 'muse' | 'opencode' | 'pi' | 'null', nullable, required: Coding agent override for this automation. Null inherits the organization default.
    - `model` string, nullable, required: Model override for this automation. Null uses the agent default.
    - `thinking_level` 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra' | 'ultracode' | 'null', nullable, required: Thinking/reasoning level override for this automation. `ultra` is available for Codex and Muse Code; `ultracode` is Claude Code-only.
    - `plan_mode` boolean, required: Whether automation messages run in plan mode.
    - `goal_mode` boolean, nullable, required: Whether automation messages are set as goals. Null inherits the resolved agent default; false explicitly disables it. Only applies when the resolved agent is Claude Code or Codex.
    - `fast_mode` boolean, nullable, required: Whether automation messages run in fast mode. Null inherits the resolved agent default; false explicitly disables it.
    - `created_at` string, date-time, required: When the automation was created
    - `updated_at` string, date-time, required: When the automation was last updated

## Other responses

- `400`: Bad request - Missing or invalid parameters
- `401`: Unauthorized - Invalid or missing API key
- `404`: Resource not found
- `500`: Internal server error

---

[API](https://skmtc.dev/replicas/apis/replicas-api.md) - [All operations](https://skmtc.dev/replicas/apis/replicas-api/llms.txt) - [OpenAPI document](https://skmtc.dev/replicas/apis/replicas-api/revisions/2703ac1c9cb7?raw)
