> ## Documentation Index
> Fetch the complete documentation index at: https://docs.akua.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Wait for an operation to reach a terminal state

> Long-polls server-side until the operation reaches a terminal state (`SUCCEEDED`, `FAILED`, `CANCELLED`) or the timeout elapses. Returns the latest `Operation` either way — check `done` to distinguish.

Server-side this is a live subscription on the operation row, not a polling loop, so the response fires within milliseconds of the workflow reaching its terminal state.

State for in-flight operations is eventually consistent — may lag actual execution by a few seconds. State for completed operations (`done: true`) is immutable.



## OpenAPI

````yaml /openapi-public.json post /operations/{id}:wait
openapi: 3.1.0
info:
  title: Akua API
  version: 1.0.0
  description: >-
    Public API for managing Akua workspaces, clusters, products, and installs.


    Authenticate with a workspace API token via the `Authorization: Bearer
    sk_akua_...` header.


    A workspace-owned token implies its workspace. Broad tokens select the
    active workspace via the optional `Akua-Context` header.
  contact:
    name: Akua API support
    email: support@akua.dev
    url: https://akua.dev/docs
servers:
  - url: https://api.akua.dev/v1
    description: Production
security: []
tags:
  - name: Auth
    description: Authentication and token management.
  - name: Agents
    description: Agent identities and configuration.
  - name: Agent sessions
    description: Durable agent conversations and tasks.
  - name: Agent turns
    description: Submitted agent work and event emission.
  - name: Agent events
    description: Normalized agent event history and streams.
  - name: Custom domains
    description: Workspace custom domains and routing targets.
  - name: Cloudflare
    description: Cloudflare account credentials and gateway control.
  - name: Clusters
    description: Kubernetes clusters and cluster access operations.
  - name: ComputeConfigs
    description: Workspace compute provider configurations.
  - name: Entitlements
    description: Effective workspace capabilities and limits.
  - name: Dashboards
    description: Dashboard and widget resources.
  - name: Installs
    description: Installation and render operations.
  - name: Machines
    description: Compute machines and lifecycle events.
  - name: Notifications
    description: User notification state.
  - name: Offer Channels
    description: Private offer channels and policy versions.
  - name: Offers
    description: Marketplace offers and redemption tracking.
  - name: Operations
    description: Long-running operation status and controls.
  - name: Order Drafts
    description: Draft checkout orders and checkout sessions.
  - name: Organizations
    description: Organizations, memberships, and managed workspaces.
  - name: Packages
    description: Software packages, versions, and input schemas.
  - name: Products
    description: Marketplace product catalog resources.
  - name: Preview hostnames
    description: Install preview hostnames and routing state.
  - name: Quotas
    description: Workspace quota limits and usage.
  - name: Regions
    description: Available deployment regions.
  - name: Registry
    description: Container registry credentials and repositories.
  - name: Repository change requests
    description: Fork-backed repository change reviews and lifecycle actions.
  - name: Repositories
    description: Source repositories available to the workspace.
  - name: Secrets
    description: Workspace secrets and secret versions.
  - name: Snippets
    description: Reusable snippets and snippet runs.
  - name: Workspace subdomains
    description: Workspace subdomain identity.
  - name: Workspaces
    description: Workspace resources, members, and billing state.
paths:
  /operations/{id}:wait:
    post:
      tags:
        - Operations
      summary: Wait for an operation to reach a terminal state
      description: >-
        Long-polls server-side until the operation reaches a terminal state
        (`SUCCEEDED`, `FAILED`, `CANCELLED`) or the timeout elapses. Returns the
        latest `Operation` either way — check `done` to distinguish.


        Server-side this is a live subscription on the operation row, not a
        polling loop, so the response fires within milliseconds of the workflow
        reaching its terminal state.


        State for in-flight operations is eventually consistent — may lag actual
        execution by a few seconds. State for completed operations (`done:
        true`) is immutable.
      operationId: operations.wait
      parameters:
        - schema:
            type: string
            minLength: 1
            maxLength: 53
            description: >-
              Operation ID. Prefixed form `op_<id>` is canonical; bare IDs
              accepted during transition.
            example: op_j572abc...
          required: true
          description: >-
            Operation ID. Prefixed form `op_<id>` is canonical; bare IDs
            accepted during transition.
          name: id
          in: path
        - schema:
            type: integer
            minimum: 1
            maximum: 60
            description: >-
              Max seconds to wait for the operation to reach a terminal state.
              Default 30, max 60.
          required: false
          description: >-
            Max seconds to wait for the operation to reach a terminal state.
            Default 30, max 60.
          name: timeout
          in: query
      responses:
        '200':
          description: >-
            Operation in its latest known state (terminal or still running on
            timeout)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Operation'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    Operation:
      type: object
      properties:
        id:
          type: string
          minLength: 1
          maxLength: 53
        workspace_id:
          type:
            - string
            - 'null'
          minLength: 1
          maxLength: 53
        organization_id:
          type:
            - string
            - 'null'
          minLength: 1
          maxLength: 54
        owner_type:
          type: string
          enum:
            - install
            - repository_change_request
            - repository
            - workspace
            - machine
            - cluster
            - package
          description: Domain entity collection the operation acts on.
        owner_id:
          type: string
          description: >-
            Prefixed ID of the entity this operation acts on. Prefix matches
            `owner_type` (`ws_`, `mch_`, `clu_`, `pkg_`, `inst_`, `rcr_`,
            `repo_`).
        parent_operation_id:
          type:
            - string
            - 'null'
          minLength: 1
          maxLength: 53
          description: ID of the chained parent operation, when present.
        state:
          type: string
          enum:
            - RUNNING
            - SUCCEEDED
            - FAILED
            - CANCELLED
          description: Lifecycle state. Past-participle terminal states per AIP-216.
        done:
          type: boolean
          description: True iff state is a terminal value.
        html_url:
          type: string
          maxLength: 2048
          format: uri
          description: >-
            Deep link to the dashboard view of this operation's owning resource
            when available, otherwise the operation detail page.
          example: https://akua.dev/installs/inst_j572abc123def456?tab=operations
        metadata:
          $ref: '#/components/schemas/OperationMetadata'
        response:
          $ref: '#/components/schemas/OperationResponse'
        error:
          type:
            - object
            - 'null'
          properties:
            message:
              type: string
          required:
            - message
          description: Populated when `state` is `FAILED` or `CANCELLED`.
        last_error:
          type:
            - object
            - 'null'
          properties:
            message:
              type: string
            step_name:
              type: string
          required:
            - message
          description: >-
            Latest error from any failed step. Populated even mid-flight;
            cleared when the step succeeds on retry.
        started_at:
          type: integer
          minimum: 0
          description: Unix timestamp (seconds)
        completed_at:
          type:
            - integer
            - 'null'
          minimum: 0
          description: Unix timestamp (seconds)
        steps:
          type: array
          items:
            $ref: '#/components/schemas/OperationStep'
      required:
        - id
        - workspace_id
        - organization_id
        - owner_type
        - owner_id
        - parent_operation_id
        - state
        - done
        - html_url
        - metadata
        - response
        - error
        - last_error
        - started_at
        - completed_at
    ApiErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - false
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ApiErrorEntry'
        result:
          type: object
          properties: {}
          description: Always empty for error responses
      required:
        - success
        - errors
        - result
    OperationMetadata:
      oneOf:
        - type: object
          properties:
            type:
              type: string
              enum:
                - machine.create
            workspace_id:
              type: string
              minLength: 1
              maxLength: 53
            cluster_id:
              type: string
              minLength: 1
              maxLength: 54
            compute_config_id:
              type: string
              minLength: 1
              maxLength: 54
            instance_type:
              type: string
            managed:
              type: boolean
            request_fingerprint:
              type: string
              minLength: 1
          required:
            - type
            - workspace_id
            - cluster_id
            - instance_type
            - managed
            - request_fingerprint
        - type: object
          properties:
            type:
              type: string
              enum:
                - cluster.delete
            cluster_id:
              type: string
              minLength: 1
              maxLength: 54
          required:
            - type
            - cluster_id
        - type: object
          properties:
            type:
              type: string
              enum:
                - cluster.create
            workspace_id:
              type: string
              minLength: 1
              maxLength: 53
            region_id:
              type: string
              minLength: 1
              maxLength: 54
            name:
              type: string
          required:
            - type
            - workspace_id
            - region_id
            - name
        - type: object
          properties:
            type:
              type: string
              enum:
                - cluster.suspend
            cluster_id:
              type: string
              minLength: 1
              maxLength: 54
          required:
            - type
            - cluster_id
        - type: object
          properties:
            type:
              type: string
              enum:
                - cluster.resume
            cluster_id:
              type: string
              minLength: 1
              maxLength: 54
          required:
            - type
            - cluster_id
        - type: object
          properties:
            type:
              type: string
              enum:
                - cluster.capabilities.refresh
            cluster_id:
              type: string
              minLength: 1
              maxLength: 54
          required:
            - type
            - cluster_id
        - type: object
          properties:
            type:
              type: string
              enum:
                - cluster.capability.ensure
            cluster_id:
              type: string
              minLength: 1
              maxLength: 54
            capability:
              type: string
              minLength: 1
          required:
            - type
            - cluster_id
            - capability
        - type: object
          properties:
            type:
              type: string
              enum:
                - cluster.worker_bootstrap.revoke
            cluster_id:
              type: string
              minLength: 1
              maxLength: 54
            worker_bootstrap_id:
              type: string
              minLength: 1
              maxLength: 54
          required:
            - type
            - cluster_id
            - worker_bootstrap_id
        - type: object
          properties:
            type:
              type: string
              enum:
                - install.create
            idempotency_key:
              type: string
            workspace_id:
              type: string
              minLength: 1
              maxLength: 53
            product_id:
              type: string
              minLength: 1
              maxLength: 55
          required:
            - type
            - idempotency_key
            - workspace_id
        - type: object
          properties:
            type:
              type: string
              enum:
                - install.render
            install_id:
              type: string
              minLength: 1
              maxLength: 55
            trigger_commit_sha:
              type: string
          required:
            - type
            - install_id
        - type: object
          properties:
            type:
              type: string
              enum:
                - install.delete
            install_id:
              type: string
              minLength: 1
              maxLength: 55
          required:
            - type
            - install_id
        - type: object
          properties:
            type:
              type: string
              enum:
                - preview_hostname.bind_pinned
            install_id:
              type: string
              minLength: 1
              maxLength: 55
            render_id:
              type: string
              minLength: 1
              maxLength: 54
            protocol:
              type: string
              enum:
                - http
                - websocket
                - grpc
            routing_mode:
              type: string
              enum:
                - through_dispatcher
                - bypass_dispatcher
            idempotency_key:
              type: string
          required:
            - type
            - install_id
            - render_id
            - protocol
            - routing_mode
            - idempotency_key
        - type: object
          properties:
            type:
              type: string
              enum:
                - preview_hostname.bind_floating
            install_id:
              type: string
              minLength: 1
              maxLength: 55
            track:
              type: string
              minLength: 1
              maxLength: 100
            render_id:
              type: string
              minLength: 1
              maxLength: 54
            protocol:
              type: string
              enum:
                - http
                - websocket
                - grpc
            routing_mode:
              type: string
              enum:
                - through_dispatcher
                - bypass_dispatcher
            idempotency_key:
              type: string
          required:
            - type
            - install_id
            - track
            - render_id
            - protocol
            - routing_mode
            - idempotency_key
        - type: object
          properties:
            type:
              type: string
              enum:
                - preview_hostname.delete
            install_id:
              type: string
              minLength: 1
              maxLength: 55
            preview_hostname_id:
              type: string
              minLength: 1
              maxLength: 54
            if_match:
              type: string
            idempotency_key:
              type: string
          required:
            - type
            - install_id
            - preview_hostname_id
            - if_match
            - idempotency_key
        - type: object
          properties:
            type:
              type: string
              enum:
                - workspace.delete
            workspace_id:
              type: string
              minLength: 1
              maxLength: 53
          required:
            - type
            - workspace_id
        - type: object
          properties:
            type:
              type: string
              enum:
                - workspace.subscription.cancel
            workspace_id:
              type: string
              minLength: 1
              maxLength: 53
            mode:
              type: string
              enum:
                - period_end
          required:
            - type
            - workspace_id
            - mode
        - type: object
          properties:
            type:
              type: string
              enum:
                - workspace.subdomain.set_name
            workspace_id:
              type: string
              minLength: 1
              maxLength: 53
            name:
              type: string
              minLength: 1
              maxLength: 63
            idempotency_key:
              type: string
          required:
            - type
            - workspace_id
            - name
            - idempotency_key
        - type: object
          properties:
            type:
              type: string
              enum:
                - custom_domain.create
            workspace_id:
              type: string
              minLength: 1
              maxLength: 53
            hostname:
              type: string
              minLength: 1
              maxLength: 253
            target:
              oneOf:
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - install
                    install_id:
                      type: string
                      minLength: 1
                      maxLength: 55
                  required:
                    - kind
                    - install_id
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - cluster
                    cluster_id:
                      type: string
                      minLength: 1
                      maxLength: 54
                  required:
                    - kind
                    - cluster_id
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - external
                    endpoint:
                      type: string
                      format: uri
                    mtls_secret_id:
                      type: string
                      minLength: 1
                      maxLength: 54
                  required:
                    - kind
                    - endpoint
            protocol:
              type: string
              enum:
                - http
                - websocket
                - grpc
            routing_mode:
              type: string
              enum:
                - through_dispatcher
                - bypass_dispatcher
            idempotency_key:
              type: string
          required:
            - type
            - workspace_id
            - hostname
            - target
            - protocol
            - routing_mode
            - idempotency_key
        - type: object
          properties:
            type:
              type: string
              enum:
                - custom_domain.update
            workspace_id:
              type: string
              minLength: 1
              maxLength: 53
            custom_domain_id:
              type: string
              minLength: 1
              maxLength: 54
            target:
              oneOf:
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - install
                    install_id:
                      type: string
                      minLength: 1
                      maxLength: 55
                  required:
                    - kind
                    - install_id
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - cluster
                    cluster_id:
                      type: string
                      minLength: 1
                      maxLength: 54
                  required:
                    - kind
                    - cluster_id
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - external
                    endpoint:
                      type: string
                      format: uri
                    mtls_secret_id:
                      type: string
                      minLength: 1
                      maxLength: 54
                  required:
                    - kind
                    - endpoint
            protocol:
              type: string
              enum:
                - http
                - websocket
                - grpc
            routing_mode:
              type: string
              enum:
                - through_dispatcher
                - bypass_dispatcher
            if_match:
              type: string
            idempotency_key:
              type: string
          required:
            - type
            - workspace_id
            - custom_domain_id
            - if_match
            - idempotency_key
        - type: object
          properties:
            type:
              type: string
              enum:
                - custom_domain.delete
            workspace_id:
              type: string
              minLength: 1
              maxLength: 53
            custom_domain_id:
              type: string
              minLength: 1
              maxLength: 54
            if_match:
              type: string
            idempotency_key:
              type: string
          required:
            - type
            - workspace_id
            - custom_domain_id
            - if_match
            - idempotency_key
        - type: object
          properties:
            type:
              type: string
              enum:
                - cloudflare.private_origin_route.prepare
            workspace_id:
              type: string
              minLength: 1
              maxLength: 53
            cluster_id:
              type: string
              minLength: 1
              maxLength: 54
            route_intent_id:
              type: string
              minLength: 1
              maxLength: 54
          required:
            - type
            - workspace_id
            - cluster_id
            - route_intent_id
        - type: object
          properties:
            type:
              type: string
              enum:
                - cloudflare.private_origin_route.release
            workspace_id:
              type: string
              minLength: 1
              maxLength: 53
            route_intent_id:
              type: string
              minLength: 1
              maxLength: 54
          required:
            - type
            - workspace_id
            - route_intent_id
        - type: object
          properties:
            type:
              type: string
              enum:
                - package.create
            idempotency_key:
              type: string
            workspace_id:
              type: string
              minLength: 1
              maxLength: 53
            name:
              type: string
          required:
            - type
            - idempotency_key
            - workspace_id
            - name
        - type: object
          properties:
            type:
              type: string
              enum:
                - repository_change_request.create
            workspace_id:
              type: string
              minLength: 1
              maxLength: 53
            parent_repository_id:
              type: string
              minLength: 1
              maxLength: 55
            created_by_kind:
              type: string
              enum:
                - agent
                - wizard
                - user
          required:
            - type
            - workspace_id
            - parent_repository_id
            - created_by_kind
        - type: object
          properties:
            type:
              type: string
              enum:
                - repository_change_request.accept
            repository_change_request_id:
              type: string
              minLength: 1
              maxLength: 54
            user_id:
              type: string
          required:
            - type
            - repository_change_request_id
            - user_id
        - type: object
          properties:
            type:
              type: string
              enum:
                - repository_change_request.reject
            repository_change_request_id:
              type: string
              minLength: 1
              maxLength: 54
            user_id:
              type: string
            reason:
              type: string
          required:
            - type
            - repository_change_request_id
            - user_id
            - reason
        - type: object
          properties:
            type:
              type: string
              enum:
                - repository_change_request.withdraw
            repository_change_request_id:
              type: string
              minLength: 1
              maxLength: 54
            user_id:
              type: string
          required:
            - type
            - repository_change_request_id
            - user_id
        - type: object
          properties:
            type:
              type: string
              enum:
                - repository_change_request.expire
            repository_change_request_id:
              type: string
              minLength: 1
              maxLength: 54
          required:
            - type
            - repository_change_request_id
        - type: object
          properties:
            type:
              type: string
              enum:
                - repository.delete
            repository_id:
              type: string
              minLength: 1
              maxLength: 55
          required:
            - type
            - repository_id
    OperationResponse:
      anyOf:
        - type: object
          properties:
            type:
              type: string
              enum:
                - machine.create
            machine_id:
              type: string
              minLength: 1
              maxLength: 54
            provider_id:
              type: string
          required:
            - type
            - machine_id
            - provider_id
        - type: object
          properties:
            type:
              type: string
              enum:
                - cluster.delete
            cluster_id:
              type: string
              minLength: 1
              maxLength: 54
          required:
            - type
            - cluster_id
        - type: object
          properties:
            type:
              type: string
              enum:
                - cluster.create
            cluster_id:
              type: string
              minLength: 1
              maxLength: 54
          required:
            - type
            - cluster_id
        - type: object
          properties:
            type:
              type: string
              enum:
                - cluster.suspend
            cluster_id:
              type: string
              minLength: 1
              maxLength: 54
          required:
            - type
            - cluster_id
        - type: object
          properties:
            type:
              type: string
              enum:
                - cluster.resume
            cluster_id:
              type: string
              minLength: 1
              maxLength: 54
          required:
            - type
            - cluster_id
        - type: object
          properties:
            type:
              type: string
              enum:
                - cluster.capabilities.refresh
            cluster_id:
              type: string
              minLength: 1
              maxLength: 54
          required:
            - type
            - cluster_id
        - type: object
          properties:
            type:
              type: string
              enum:
                - cluster.capability.ensure
            cluster_id:
              type: string
              minLength: 1
              maxLength: 54
            capability:
              type: string
              minLength: 1
          required:
            - type
            - cluster_id
            - capability
        - type: object
          properties:
            type:
              type: string
              enum:
                - cluster.worker_bootstrap.revoke
            note:
              type: string
          required:
            - type
        - type: object
          properties:
            type:
              type: string
              enum:
                - install.create
            install_id:
              type: string
              minLength: 1
              maxLength: 55
            argo_app_name:
              type: string
            argo_app_namespace:
              type: string
          required:
            - type
            - install_id
            - argo_app_name
            - argo_app_namespace
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              enum:
                - install.create
            install_id:
              type: string
              minLength: 1
              maxLength: 55
            sandbox_skipped:
              type: boolean
              enum:
                - true
          required:
            - type
            - install_id
            - sandbox_skipped
          additionalProperties: false
        - type: object
          properties:
            type:
              type: string
              enum:
                - install.render
            install_render_id:
              type: string
              minLength: 1
              maxLength: 54
            repository_id:
              type: string
              minLength: 1
              maxLength: 55
            commit_sha:
              type: string
            render_hash:
              type: string
            skipped:
              type: boolean
          required:
            - type
            - install_render_id
            - repository_id
            - render_hash
            - skipped
        - type: object
          properties:
            type:
              type: string
              enum:
                - install.delete
            argo_app_deleted:
              type: boolean
            repo_purged:
              type: boolean
          required:
            - type
            - argo_app_deleted
            - repo_purged
        - type: object
          properties:
            type:
              type: string
              enum:
                - preview_hostname.bind_pinned
            install_id:
              type: string
              minLength: 1
              maxLength: 55
            preview_hostname_id:
              type: string
              minLength: 1
              maxLength: 54
            hostname:
              type: string
              minLength: 1
              maxLength: 253
          required:
            - type
            - install_id
            - preview_hostname_id
            - hostname
        - type: object
          properties:
            type:
              type: string
              enum:
                - preview_hostname.bind_floating
            install_id:
              type: string
              minLength: 1
              maxLength: 55
            preview_hostname_id:
              type: string
              minLength: 1
              maxLength: 54
            hostname:
              type: string
              minLength: 1
              maxLength: 253
          required:
            - type
            - install_id
            - preview_hostname_id
            - hostname
        - type: object
          properties:
            type:
              type: string
              enum:
                - preview_hostname.delete
            install_id:
              type: string
              minLength: 1
              maxLength: 55
            preview_hostname_id:
              type: string
              minLength: 1
              maxLength: 54
            hostname:
              type: string
              minLength: 1
              maxLength: 253
          required:
            - type
            - install_id
            - preview_hostname_id
            - hostname
        - type: object
          properties:
            type:
              type: string
              enum:
                - workspace.delete
            workspace_id:
              type: string
              minLength: 1
              maxLength: 53
          required:
            - type
            - workspace_id
        - type: object
          properties:
            type:
              type: string
              enum:
                - workspace.subscription.cancel
            subscription_id:
              type: string
            cancel_at:
              type: integer
              minimum: 0
              description: Unix timestamp (seconds)
          required:
            - type
            - subscription_id
            - cancel_at
        - type: object
          properties:
            type:
              type: string
              enum:
                - workspace.subdomain.set_name
            workspace_id:
              type: string
              minLength: 1
              maxLength: 53
            workspace_subdomain_id:
              type: string
              minLength: 1
              maxLength: 54
            fqdn:
              type: string
              minLength: 1
              maxLength: 253
          required:
            - type
            - workspace_id
            - workspace_subdomain_id
            - fqdn
        - type: object
          properties:
            type:
              type: string
              enum:
                - custom_domain.create
            workspace_id:
              type: string
              minLength: 1
              maxLength: 53
            custom_domain_id:
              type: string
              minLength: 1
              maxLength: 54
            hostname:
              type: string
              minLength: 1
              maxLength: 253
          required:
            - type
            - workspace_id
            - custom_domain_id
            - hostname
        - type: object
          properties:
            type:
              type: string
              enum:
                - custom_domain.update
            workspace_id:
              type: string
              minLength: 1
              maxLength: 53
            custom_domain_id:
              type: string
              minLength: 1
              maxLength: 54
            hostname:
              type: string
              minLength: 1
              maxLength: 253
          required:
            - type
            - workspace_id
            - custom_domain_id
            - hostname
        - type: object
          properties:
            type:
              type: string
              enum:
                - custom_domain.delete
            workspace_id:
              type: string
              minLength: 1
              maxLength: 53
            custom_domain_id:
              type: string
              minLength: 1
              maxLength: 54
            hostname:
              type: string
              minLength: 1
              maxLength: 253
          required:
            - type
            - workspace_id
            - custom_domain_id
            - hostname
        - type: object
          properties:
            type:
              type: string
              enum:
                - cloudflare.private_origin_route.prepare
            origin_route_id:
              type: string
              minLength: 1
              maxLength: 54
          required:
            - type
            - origin_route_id
        - type: object
          properties:
            type:
              type: string
              enum:
                - cloudflare.private_origin_route.release
            route_intent_id:
              type: string
              minLength: 1
              maxLength: 54
          required:
            - type
            - route_intent_id
        - type: object
          properties:
            type:
              type: string
              enum:
                - package.create
            package_id:
              type: string
              minLength: 1
              maxLength: 54
            package_version_id:
              type: string
              minLength: 1
              maxLength: 55
            repository_id:
              type: string
              minLength: 1
              maxLength: 55
          required:
            - type
            - package_id
            - package_version_id
            - repository_id
        - type: object
          properties:
            type:
              type: string
              enum:
                - repository_change_request.create
            repository_change_request_id:
              type: string
              minLength: 1
              maxLength: 54
            fork_repository_id:
              type: string
              minLength: 1
              maxLength: 55
            expires_at:
              type: integer
              minimum: 0
              description: Unix timestamp (seconds)
          required:
            - type
            - repository_change_request_id
            - fork_repository_id
            - expires_at
        - type: object
          properties:
            type:
              type: string
              enum:
                - repository_change_request.accept
            merged_at:
              type: integer
              minimum: 0
              description: Unix timestamp (seconds)
            triggered_install_render:
              type: boolean
          required:
            - type
            - merged_at
            - triggered_install_render
        - type: object
          properties:
            type:
              type: string
              enum:
                - repository_change_request.reject
            rejected_at:
              type: integer
              minimum: 0
              description: Unix timestamp (seconds)
          required:
            - type
            - rejected_at
        - type: object
          properties:
            type:
              type: string
              enum:
                - repository_change_request.withdraw
            withdrawn_at:
              type: integer
              minimum: 0
              description: Unix timestamp (seconds)
          required:
            - type
            - withdrawn_at
        - type: object
          properties:
            type:
              type: string
              enum:
                - repository_change_request.expire
            expired:
              type: boolean
          required:
            - type
            - expired
        - type: object
          properties:
            type:
              type: string
              enum:
                - repository.delete
            purged_at:
              type: integer
              minimum: 0
              description: Unix timestamp (seconds)
          required:
            - type
            - purged_at
        - type: 'null'
      description: >-
        Populated only when `done && state === "SUCCEEDED"`. Discriminated by
        `type`.
    OperationStep:
      type: object
      properties:
        name:
          type: string
          description: User-visible milestone name.
        status:
          type: string
          enum:
            - pending
            - running
            - completed
            - failed
            - skipped
          description: Step lifecycle state.
        execution_type:
          type: string
          enum:
            - system
            - user
            - approval
            - skipped
          description: >-
            Step execution kind. `user`/`approval` mean the workflow is blocked
            on a human action. Internal bookkeeping steps are filtered from
            public responses.
        started_at:
          type: integer
          minimum: 0
          description: Unix timestamp (seconds)
        completed_at:
          type:
            - integer
            - 'null'
          minimum: 0
          description: Unix timestamp (seconds)
        error_message:
          type:
            - string
            - 'null'
        retryable:
          type: boolean
        skippable:
          type: boolean
      required:
        - name
        - status
        - execution_type
        - started_at
        - completed_at
        - error_message
        - retryable
        - skippable
    ApiErrorEntry:
      type: object
      properties:
        code:
          type: integer
          example: 7002
          description: Machine-readable error code
        message:
          type: string
          example: Resource not found
          description: Human-readable error message
        path:
          type: array
          items:
            type: string
          example:
            - body
            - name
          description: Field path that caused the error, when applicable
        metadata:
          type: object
          additionalProperties:
            type: string
      required:
        - code
        - message
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        workspace API token (sk_akua_...) or OAuth2 JWT. Create tokens at
        https://akua.dev/developers/api-tokens

````