> ## 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.

# Get automation



## OpenAPI

````yaml /openapi.json get /v1/automations/{id}
openapi: 3.1.0
info:
  title: Replicas API
  version: 2.0.0
  description: >-
    Create and control workspaces, and manage the environments, automations, and
    learnings they run with.
servers:
  - url: https://api.replicas.dev
    description: Production API
security:
  - apiKey: []
tags:
  - name: Replica
    description: >-
      A replica is a Replicas workspace: a cloud sandbox where a coding agent
      works on your repositories.
  - name: Chats
    description: Manage the agent chats inside a replica.
  - name: Message queue
    description: Messages waiting for the agent to finish its turn.
  - name: Commands and terminals
    description: Run commands and open shells in a replica.
  - name: Pull requests
    description: Inspect and act on pull requests a replica opened.
  - name: Previews
    description: Public URLs for ports in a replica.
  - name: Canvas
    description: Plans, reports, and other files agents produce.
  - name: Sharing
    description: Add replicas to members' Shared view.
  - name: Environments
    description: >-
      Environments define what a workspace starts with. The `global` environment
      applies to every workspace.
  - name: Environment variables
    description: Variables injected into workspaces.
  - name: Environment files
    description: Files written into workspaces.
  - name: Environment skills
    description: Agent skills installed into workspaces.
  - name: Environment MCPs
    description: MCP servers available to workspace agents.
  - name: Hooks
    description: Scripts that run when warm pool snapshots build and when workspaces start.
  - name: Warm pools
    description: Pre-built workspaces that start faster.
  - name: Automations
    description: Run agents on schedules and events.
  - name: Repositories
    description: Repositories and repository sets connected to the organization.
  - name: Learnings
    description: Organization skills every workspace agent loads.
  - name: Agent credentials
    description: >-
      API keys and endpoints that coding agents use. Connect Claude, Codex, and
      Muse subscriptions with the CLI.
  - name: Plugins
    description: Connect integrations that workspace agents can use.
  - name: Organization
    description: Who you are and who is in your organization.
  - name: Media
    description: Screenshots, recordings, and other files workspaces produce.
  - name: Slack
    description: Route Slack threads to workspaces.
  - name: Workspace identity
    description: OIDC keys for verifying workspace identity tokens.
paths:
  /v1/automations/{id}:
    get:
      tags:
        - Automations
      summary: Get automation
      operationId: getAutomation
      parameters:
        - name: id
          in: path
          description: The unique identifier of the automation
          required: true
          schema:
            type: string
            format: uuid
        - $ref: '#/components/parameters/ApiVersion'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AutomationResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  parameters:
    ApiVersion:
      name: X-Replicas-Api-Version
      in: header
      description: >-
        API version. `2026-10-07` returns `snake_case` responses. See
        [versioning](/features/api#versioning).
      required: false
      schema:
        type: string
        enum:
          - '2026-10-07'
  schemas:
    AutomationResponse:
      type: object
      description: Response containing a single automation
      properties:
        automation:
          $ref: '#/components/schemas/AutomationRecord'
      required:
        - automation
    AutomationRecord:
      type: object
      description: An automation record
      properties:
        access:
          $ref: '#/components/schemas/EnvironmentAccess'
          description: The caller's effective permissions on this automation.
        id:
          type: string
          format: uuid
          description: Unique identifier for the automation
        organization_id:
          type: string
          format: uuid
          description: Organization that owns this automation
        name:
          type: string
          description: Human-readable name for the automation
        description:
          type:
            - string
            - 'null'
          description: Optional description
        triggers:
          type: array
          items:
            $ref: '#/components/schemas/AutomationTrigger'
          description: Triggers that fire this automation
        prompt:
          type: string
          description: The instruction sent to the coding agent when the automation fires
        debounce_seconds:
          type:
            - integer
            - 'null'
          minimum: 0
          maximum: 86400
          description: >-
            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:
          type: array
          items:
            type: string
            maxLength: 100
          maxItems: 10
          description: GitHub check names the automation reports a verdict on.
        environment_id:
          type: string
          format: uuid
          description: >-
            ID of the environment this automation runs in. The environment
            supplies env vars / MCPs / skills layered on top of the org-wide
            Global environment and may optionally bind a repository or
            repository set.
        enabled:
          type: boolean
          description: Whether the automation is active
        webhook_token:
          type:
            - string
            - 'null'
          description: >-
            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_expression:
          type:
            - string
            - 'null'
          description: Derived cron expression (from the cron trigger, if any)
        cron_timezone:
          type:
            - string
            - 'null'
          description: Timezone for the cron schedule
        cron_next_fire_at:
          type:
            - string
            - 'null'
          format: date-time
          description: Next scheduled fire time for cron automations
        user_id:
          type:
            - string
            - 'null'
          format: uuid
          description: User ID for personal automations, null for org-owned automations
        created_by:
          type:
            - string
            - 'null'
          format: uuid
          description: User who created the automation
        workspace_lifecycle_policy:
          type: string
          description: Lifecycle policy for workspaces created by this automation
          enum:
            - default
            - archive_when_done
            - sleep_when_done
            - delete_after_inactivity
        workspace_auto_stop_minutes:
          type:
            - integer
            - 'null'
          description: >-
            Inactivity timeout in minutes (3-1440) for the default keep-alive
            policy
          minimum: 3
          maximum: 1440
        workspace_size:
          type:
            - string
            - 'null'
          description: >-
            Compute size for workspaces fired off by this automation. Defaults
            to `small` when omitted.
          enum:
            - small
            - large
            - ultra
            - null
        config:
          $ref: '#/components/schemas/WorkspaceConfig'
        agent_provider:
          type:
            - string
            - 'null'
          description: >-
            Coding agent override for this automation. Null inherits the
            organization default.
          enum:
            - claude
            - codex
            - cursor
            - muse
            - opencode
            - pi
            - null
        model:
          type:
            - string
            - 'null'
          description: Model override for this automation. Null uses the agent default.
        thinking_level:
          type:
            - string
            - 'null'
          description: >-
            Thinking/reasoning level override for this automation. `ultra` is
            available for Codex and Muse Code; `ultracode` is Claude Code-only.
          enum:
            - low
            - medium
            - high
            - xhigh
            - max
            - ultra
            - ultracode
            - null
        plan_mode:
          type: boolean
          description: Whether automation messages run in plan mode.
        goal_mode:
          type:
            - boolean
            - 'null'
          description: >-
            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:
          type:
            - boolean
            - 'null'
          description: >-
            Whether automation messages run in fast mode. Null inherits the
            resolved agent default; false explicitly disables it.
        created_at:
          type: string
          format: date-time
          description: When the automation was created
        updated_at:
          type: string
          format: date-time
          description: When the automation was last updated
      required:
        - id
        - organization_id
        - name
        - description
        - triggers
        - prompt
        - debounce_seconds
        - github_check_names
        - environment_id
        - enabled
        - user_id
        - webhook_token
        - cron_expression
        - cron_timezone
        - cron_next_fire_at
        - created_by
        - workspace_lifecycle_policy
        - workspace_auto_stop_minutes
        - workspace_size
        - config
        - agent_provider
        - model
        - thinking_level
        - plan_mode
        - goal_mode
        - fast_mode
        - created_at
        - updated_at
    Error:
      type: object
      properties:
        error:
          type: string
          description: Error message
        details:
          type:
            - string
            - 'null'
          description: Additional error details
        code:
          type: string
          description: Machine-readable error code when available
      required:
        - error
    EnvironmentAccess:
      type: object
      description: >-
        Effective permissions for the caller. Read allows discovery, full
        inspection, and selection for workspaces or automations. Write allows
        all mutations and implies Read.
      properties:
        can_write:
          type: boolean
        can_read:
          type: boolean
      required:
        - can_read
        - can_write
    AutomationTrigger:
      type: object
      description: A trigger that determines when an automation fires
      properties:
        type:
          type: string
          description: The trigger type
          enum:
            - cron
            - github
            - gitlab
            - slack
            - sentry
            - custom
        config:
          description: >-
            Trigger configuration. Its schema depends on `type`:
            `CronTriggerConfig`, `GitHubTriggerConfig`, `GitLabTriggerConfig`,
            `SlackTriggerConfig`, `SentryTriggerConfig`, or an empty object for
            `custom`.
          anyOf:
            - $ref: '#/components/schemas/CronTriggerConfig'
            - $ref: '#/components/schemas/GitHubTriggerConfig'
            - $ref: '#/components/schemas/GitLabTriggerConfig'
            - $ref: '#/components/schemas/SlackTriggerConfig'
            - $ref: '#/components/schemas/SentryTriggerConfig'
            - $ref: '#/components/schemas/CustomTriggerConfig'
      required:
        - type
        - config
    WorkspaceConfig:
      type: object
      description: >-
        Workspace behavior configuration. Defaults depend on the workspace
        source; see each setting.
      properties:
        memoryRetentionEnabled:
          type: boolean
          description: >-
            Whether sessions are added to session history when the workspace
            sleeps. Defaults to false for API and automation workspaces.
        capabilities:
          type: object
          description: >-
            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.
          properties:
            pr_followups:
              type: boolean
              description: >-
                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:
              type: boolean
              description: >-
                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.
          additionalProperties: true
        preferences:
          type: object
          description: >-
            Workspace behavior preferences that do not grant new action
            permissions.
          properties:
            keep_open_on_pr_merge:
              type: boolean
              description: >-
                Whether the workspace should remain open after its last tracked
                PR is merged. Defaults to false.
              default: false
            keep_open_on_pr_close:
              type: boolean
              description: >-
                Whether the workspace should remain open after its last tracked
                PR is closed without merging. Defaults to false.
              default: false
          additionalProperties: true
        provisioning_error:
          type: object
          description: >-
            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.
          properties:
            message:
              type: string
              description: >-
                Underlying setup failure message, such as repository clone/auth
                errors.
          additionalProperties: true
      additionalProperties: true
    CronTriggerConfig:
      type: object
      description: Configuration for a cron (scheduled) trigger
      properties:
        schedule:
          type: string
          description: Cron expression (e.g. "0 9 * * 1-5" for weekdays at 9am UTC)
          example: 0 9 * * 1-5
        timezone:
          type: string
          description: IANA timezone for the schedule (defaults to UTC)
          default: UTC
          example: America/New_York
      required:
        - schedule
    GitHubTriggerConfig:
      type: object
      description: Configuration for a GitHub event trigger
      properties:
        event:
          type: string
          description: The GitHub event to listen for
          enum:
            - pull_request.opened
            - pull_request.synchronize
            - pull_request.merged
            - pull_request.closed
            - pull_request.command
        repository_ids:
          type: array
          items:
            type: string
            format: uuid
          description: >-
            Optional filter: only fire for events from these repositories. If
            omitted, fires for all repositories.
        group_pr_events:
          type: boolean
          description: >-
            Send later opened, synchronize, and command events for the same pull
            request to the existing workspace instead of creating a new one.
        excluded_actors:
          type: array
          items:
            type: string
          description: >-
            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 `@`.
      required:
        - event
    GitLabTriggerConfig:
      type: object
      description: Configuration for a GitLab merge request event trigger
      properties:
        event:
          type: string
          description: The GitLab event to listen for
          enum:
            - merge_request.opened
            - merge_request.updated
            - merge_request.merged
            - merge_request.closed
        repository_ids:
          type: array
          items:
            type: string
            format: uuid
          description: >-
            Optional filter: only fire for events from these GitLab projects. If
            omitted, fires for all projects.
        group_pr_events:
          type: boolean
          description: >-
            Send later opened and updated events for the same merge request to
            the existing workspace instead of creating a new one.
        excluded_actors:
          type: array
          items:
            type: string
          description: >-
            Optional exclusion list: events sent by these GitLab usernames never
            fire the automation. Matching is case-insensitive and ignores a
            leading `@`.
      required:
        - event
    SlackTriggerConfig:
      type: object
      description: Configuration for a Slack event trigger
      properties:
        event:
          type: string
          description: The Slack event to listen for
          enum:
            - message
        channel_ids:
          type: array
          items:
            type: string
          description: >-
            Optional filter: only fire for events from these Slack channels. If
            omitted, fires for all channels.
        group_thread_replies:
          type: boolean
          description: >-
            When true (default), thread replies flow to the same workspace as
            the root message instead of spawning new ones.
          default: true
      required:
        - event
    SentryTriggerConfig:
      type: object
      description: Configuration for a Sentry event trigger
      properties:
        event:
          type: string
          description: The Sentry event to listen for
          enum:
            - event_alert.triggered
            - issue.created
            - error.created
        project_slugs:
          type: array
          items:
            type: string
          description: >-
            Optional filter: only fire for events from these Sentry project
            slugs. If omitted, fires for all projects.
        min_level:
          type: string
          description: >-
            Optional minimum severity level (inclusive). If omitted, fires for
            all levels.
          enum:
            - debug
            - info
            - warning
            - error
            - fatal
      required:
        - event
    CustomTriggerConfig:
      type: object
      description: >-
        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.
      properties: {}
  responses:
    Unauthorized:
      description: Unauthorized - Invalid or missing API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    InternalServerError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: Organization or personal API key from **Settings → API Keys**.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.