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

# Update Run

> Update a run's data.

Only the fields provided in the request body will be updated.
The run must belong to the authenticated organization.



## OpenAPI

````yaml /openapi.json patch /v1/runs/{run_id}
openapi: 3.1.0
info:
  title: Cyberdesk Cloud
  description: >-
    The Cyberdesk API provides programmatic access to all platform features,
    enabling you to automate desktop tasks at scale.
  version: 1.0.0
servers:
  - url: https://api.cyberdesk.io
    description: Production server
  - url: https://cyberdesk-api-dev.fly.dev
    description: Development server
security: []
paths:
  /v1/runs/{run_id}:
    patch:
      tags:
        - runs
      summary: Update Run
      description: |-
        Update a run's data.

        Only the fields provided in the request body will be updated.
        The run must belong to the authenticated organization.
      operationId: update_run_v1_runs__run_id__patch
      parameters:
        - name: run_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Run Id
        - name: Idempotency-Key
          in: header
          required: false
          description: >-
            Unique key for idempotent requests. If provided, the server ensures
            the request is processed at most once. Retries with the same key
            return the original response. SDKs auto-generate this for write
            requests.
          schema:
            type: string
            example: 550e8400-e29b-41d4-a716-446655440000
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RunUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RunResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    RunUpdate:
      properties:
        status:
          anyOf:
            - $ref: '#/components/schemas/RunStatus'
            - type: 'null'
        error:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Error
        output_data:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Output Data
        output_attachment_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Output Attachment Ids
        run_message_history:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Run Message History
        input_values:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Input Values
        usage_metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Usage Metadata
        post_run_checks:
          anyOf:
            - items:
                $ref: '#/components/schemas/RunPostRunCheckSnapshot'
              type: array
            - type: 'null'
          title: Post Run Checks
        started_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Started At
        ended_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Ended At
        release_session_after:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Release Session After
      type: object
      title: RunUpdate
      description: Schema for updating a run
    RunResponse:
      properties:
        workflow_id:
          type: string
          format: uuid
          title: Workflow Id
        machine_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Machine Id
        id:
          type: string
          format: uuid
          title: Id
        user_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: User Id
        organization_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Organization Id
        status:
          $ref: '#/components/schemas/RunStatus'
        error:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Error
        output_data:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Output Data
        input_attachment_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Input Attachment Ids
        output_attachment_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Output Attachment Ids
        run_message_history:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Run Message History
        input_values:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Input Values
        main_prompt:
          anyOf:
            - type: string
            - type: 'null'
          title: Main Prompt
          description: >-
            Per-run prompt override used for execution. Null means the run falls
            back to the workflow's current main_prompt.
        model_metadata:
          anyOf:
            - $ref: '#/components/schemas/WorkflowModelMetadata'
            - type: 'null'
          description: >-
            Per-run model metadata overrides used for execution. Null means the
            run falls back to the workflow's model_metadata.
        pool_ids:
          anyOf:
            - items:
                type: string
                format: uuid
              type: array
            - type: 'null'
          title: Pool Ids
        sensitive_input_aliases:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          title: Sensitive Input Aliases
        usage_metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Usage Metadata
          description: >-
            Arbitrary usage/billing metadata captured during a run (schema is
            flexible)
        post_run_checks:
          anyOf:
            - items:
                $ref: '#/components/schemas/RunPostRunCheckSnapshot'
              type: array
            - type: 'null'
          title: Post Run Checks
          description: Version-tolerant snapshot/results for the run's post-run checks.
        session_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Session Id
        session_alias:
          anyOf:
            - type: string
            - type: 'null'
          title: Session Alias
        release_session_after:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Release Session After
        created_at:
          type: string
          format: date-time
          title: Created At
        started_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Started At
        ended_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Ended At
      type: object
      required:
        - workflow_id
        - machine_id
        - id
        - status
        - created_at
      title: RunResponse
      description: Run response schema
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    RunStatus:
      type: string
      enum:
        - scheduling
        - running
        - running_checks
        - success
        - cancelled
        - task_failed
        - error
      title: RunStatus
    RunPostRunCheckSnapshot:
      properties:
        id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Id
        post_run_check_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Post Run Check Id
        snapshot_version:
          anyOf:
            - type: integer
            - type: 'null'
          title: Snapshot Version
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        type:
          anyOf:
            - $ref: '#/components/schemas/PostRunCheckType'
            - type: 'null'
        order:
          anyOf:
            - type: integer
            - type: 'null'
          title: Order
        file_target_mode:
          anyOf:
            - $ref: '#/components/schemas/PostRunCheckFileTargetMode'
            - type: 'null'
        file_names:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: File Names
        file_name_regex:
          anyOf:
            - type: string
            - type: 'null'
          title: File Name Regex
        expected_match_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Expected Match Count
        expected_match_count_ref:
          anyOf:
            - type: string
            - type: 'null'
          title: Expected Match Count Ref
        loop_input:
          anyOf:
            - type: string
            - type: 'null'
          title: Loop Input
        loop_item_filename_template:
          anyOf:
            - type: string
            - type: 'null'
          title: Loop Item Filename Template
        allow_missing_attachments:
          type: boolean
          title: Allow Missing Attachments
          default: false
        check_prompt:
          anyOf:
            - type: string
            - type: 'null'
          title: Check Prompt
        model:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Model
        status:
          $ref: '#/components/schemas/PostRunCheckStatus'
        started_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Started At
        ended_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Ended At
        error_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Message
        messages:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Messages
        matched_filenames:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Matched Filenames
      additionalProperties: true
      type: object
      required:
        - status
      title: RunPostRunCheckSnapshot
      description: >-
        Version-tolerant run-level snapshot/result for one post-run check
        invocation.
    WorkflowModelMetadata:
      properties:
        main_agent_model_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Main Agent Model Id
          description: >-
            ModelConfiguration.id used for the main agent. Null → Cyberdesk
            default.
        cache_detection_model_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Cache Detection Model Id
          description: >-
            ModelConfiguration.id used for cache detection. Null → Cyberdesk
            default.
        fallback_model_1_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Fallback Model 1 Id
          description: ModelConfiguration.id used as fallback 1 (global across agents).
        fallback_model_2_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Fallback Model 2 Id
          description: ModelConfiguration.id used as fallback 2 (global across agents).
      type: object
      title: WorkflowModelMetadata
      description: >-
        JSONB-backed workflow model configuration metadata.


        Stored on the Workflow row as `model_metadata` to avoid adding many FK
        columns.

        All fields are optional; when missing/null, the system falls back to
        Cyberdesk defaults.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          additionalProperties: true
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    PostRunCheckType:
      type: string
      enum:
        - run_attachment_exists
        - run_attachment_image_check
        - output_data_passes_schema_validation
        - output_data_agentic_check
      title: PostRunCheckType
    PostRunCheckFileTargetMode:
      type: string
      enum:
        - exact
        - regex
        - loop_items
      title: PostRunCheckFileTargetMode
    PostRunCheckStatus:
      type: string
      enum:
        - pending
        - running
        - success
        - failed
        - infra_error
        - cancelled
      title: PostRunCheckStatus
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````