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

> Update a machine's information.

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

For machine_sensitive_parameters: provide actual secret values and they will be
stored in Basis Theory. Only aliases will be stored in the database.



## OpenAPI

````yaml /openapi.json patch /v1/machines/{machine_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/machines/{machine_id}:
    patch:
      tags:
        - machines
      summary: Update Machine
      description: >-
        Update a machine's information.


        Only the fields provided in the request body will be updated.

        The machine must belong to the authenticated organization.


        For machine_sensitive_parameters: provide actual secret values and they
        will be

        stored in Basis Theory. Only aliases will be stored in the database.
      operationId: update_machine_v1_machines__machine_id__patch
      parameters:
        - name: machine_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Machine 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/MachineUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MachineResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    MachineUpdate:
      properties:
        name:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Name
        version:
          anyOf:
            - type: string
              maxLength: 50
            - type: 'null'
          title: Version
        hostname:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Hostname
        os_info:
          anyOf:
            - type: string
            - type: 'null'
          title: Os Info
        status:
          anyOf:
            - $ref: '#/components/schemas/MachineStatus'
            - type: 'null'
        is_available:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Available
        last_seen:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Seen
        reserved_session_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Reserved Session Id
          description: >-
            Set to null to clear reservation; server will cancel any
            scheduling/running run on this machine, clear reservation, mark
            machine available, and trigger matching
        machine_parameters:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Machine Parameters
          description: Machine-specific input values. Provide empty dict {} to clear all.
        machine_sensitive_parameters:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          title: Machine Sensitive Parameters
          description: >-
            Machine-specific sensitive input values (will be stored in Basis
            Theory). Provide empty dict {} to clear all.
      type: object
      title: MachineUpdate
      description: Schema for updating a machine
    MachineResponse:
      properties:
        name:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Name
        version:
          anyOf:
            - type: string
              maxLength: 50
            - type: 'null'
          title: Version
        hostname:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Hostname
        os_info:
          anyOf:
            - type: string
            - type: 'null'
          title: Os Info
        machine_parameters:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Machine Parameters
          description: Machine-specific input values that auto-populate runs
        machine_sensitive_parameters:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          title: Machine Sensitive Parameters
          description: Machine-specific sensitive input aliases (stored in Basis Theory)
        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
        unkey_key_id:
          type: string
          title: Unkey Key Id
        status:
          $ref: '#/components/schemas/MachineStatus'
        is_available:
          type: boolean
          title: Is Available
        reserved_session_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Reserved Session Id
        linked_keepalive_machine_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Linked Keepalive Machine Id
        physical_server_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Physical Server Id
          description: Fly machine ID hosting the WebSocket connection
        created_at:
          type: string
          format: date-time
          title: Created At
        last_seen:
          type: string
          format: date-time
          title: Last Seen
        pools:
          anyOf:
            - items:
                $ref: '#/components/schemas/PoolResponse'
              type: array
            - type: 'null'
          title: Pools
      type: object
      required:
        - id
        - unkey_key_id
        - status
        - is_available
        - created_at
        - last_seen
      title: MachineResponse
      description: Machine response schema
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    MachineStatus:
      type: string
      enum:
        - connected
        - disconnected
        - error
      title: MachineStatus
    PoolResponse:
      properties:
        name:
          type: string
          maxLength: 255
          minLength: 1
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        id:
          type: string
          format: uuid
          title: Id
        organization_id:
          type: string
          title: Organization Id
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        machine_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Machine Count
          description: Number of machines in this pool
          default: 0
      type: object
      required:
        - name
        - id
        - organization_id
        - created_at
        - updated_at
      title: PoolResponse
      description: Pool response schema
    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
          title: Context
          additionalProperties: true
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````