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

> Update a connection's status or timestamps.

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



## OpenAPI

````yaml /openapi.json patch /v1/connections/{connection_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/connections/{connection_id}:
    patch:
      tags:
        - connections
      summary: Update Connection
      description: >-
        Update a connection's status or timestamps.


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

        The connection must belong to a machine owned by the authenticated
        organization.
      operationId: update_connection_v1_connections__connection_id__patch
      parameters:
        - name: connection_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Connection 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/ConnectionUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectionResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    ConnectionUpdate:
      properties:
        status:
          anyOf:
            - $ref: '#/components/schemas/ConnectionStatus'
            - type: 'null'
        last_ping:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Ping
        disconnected_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Disconnected At
      type: object
      title: ConnectionUpdate
      description: Schema for updating a connection
    ConnectionResponse:
      properties:
        websocket_id:
          type: string
          maxLength: 255
          minLength: 1
          title: Websocket Id
        ip_address:
          anyOf:
            - type: string
            - type: 'null'
          title: Ip Address
        user_agent:
          anyOf:
            - type: string
            - type: 'null'
          title: User Agent
        id:
          type: string
          format: uuid
          title: Id
        machine_id:
          type: string
          format: uuid
          title: Machine Id
        connected_at:
          type: string
          format: date-time
          title: Connected At
        disconnected_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Disconnected At
        last_ping:
          type: string
          format: date-time
          title: Last Ping
        status:
          $ref: '#/components/schemas/ConnectionStatus'
      type: object
      required:
        - websocket_id
        - id
        - machine_id
        - connected_at
        - disconnected_at
        - last_ping
        - status
      title: ConnectionResponse
      description: Connection response schema
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ConnectionStatus:
      type: string
      enum:
        - connected
        - disconnected
        - error
      title: ConnectionStatus
    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
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````