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

# Register a Linux/systemd virtual machine and issue initial agent key



## OpenAPI

````yaml /openapi/control-plane-public.json post /api/v1/workspaces/{workspaceId}/virtual-machines
openapi: 3.1.0
info:
  title: AcornOps Control Plane API
  version: 0.0.1-experimental.1
  description: >-
    Control plane API for workspaces, targets, Kubernetes clusters, virtual
    machines, sessions, runs, auth, and internal execution wiring.
servers:
  - url: https://api.acornops.dev
security: []
tags:
  - name: health
    description: Health and readiness endpoints.
  - name: auth
    description: >-
      OIDC, password, browser session, and external integration account link
      endpoints.
  - name: workspaces
    description: Workspace, target, Kubernetes cluster, and VM management endpoints.
  - name: webhooks
    description: Best-effort webhook subscription and delivery history endpoints.
  - name: sessions
    description: Session and message endpoints.
  - name: runs
    description: Run query, cancel, and stream endpoints.
  - name: workflows
    description: >-
      Workspace workflow definitions, schedules, sessions, and approval inbox
      endpoints.
  - name: agents
    description: >-
      Workspace-scoped custom agent definitions, triggers, versions, tests, and
      activity.
  - name: admin
    description: Operator-only admin API protected exclusively by admin bearer tokens.
  - name: internal
    description: Internal execution endpoints for execution-engine.
paths:
  /api/v1/workspaces/{workspaceId}/virtual-machines:
    post:
      tags:
        - workspaces
      summary: Register a Linux/systemd virtual machine and issue initial agent key
      parameters:
        - in: path
          name: workspaceId
          required: true
          schema:
            type: string
            format: uuid
            example: 4b930d98-add9-4924-ab26-3c16d96ec373
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
              properties:
                name:
                  type: string
                  example: payments-vm-01
                hostname:
                  type: string
                  example: payments-vm-01.internal
                osFamily:
                  type: string
                  enum:
                    - linux
                  example: linux
                serviceManager:
                  type: string
                  enum:
                    - systemd
                  example: systemd
                allowedLogSources:
                  type: array
                  items:
                    type: string
                  example:
                    - system
                    - app
                    - security
      responses:
        '201':
          description: VM registration created with systemd agent install instructions.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VirtualMachineRegistration'
        '400':
          description: Error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: >-
            Virtual machine quota exceeded. Returns QUOTA_EXCEEDED with
            quotaKey=virtualMachines.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - userSession: []
components:
  schemas:
    VirtualMachineRegistration:
      type: object
      required:
        - virtualMachine
        - agentKey
        - installInstructions
      properties:
        virtualMachine:
          $ref: '#/components/schemas/VirtualMachine'
        agentKey:
          type: string
        installInstructions:
          $ref: '#/components/schemas/InstallInstructions'
      additionalProperties: true
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
            message:
              type: string
            retryable:
              type: boolean
            details:
              type: object
              additionalProperties: true
              description: Optional structured error details.
    VirtualMachine:
      allOf:
        - type: object
          required:
            - id
            - workspaceId
            - targetType
            - name
          properties:
            id:
              type: string
              format: uuid
            workspaceId:
              type: string
              format: uuid
            targetType:
              type: string
              enum:
                - kubernetes
                - virtual_machine
            name:
              type: string
            status:
              type: string
            connectionStatus:
              type: string
            latestSnapshot:
              $ref: '#/components/schemas/SnapshotReference'
            summary:
              type: object
              additionalProperties: true
            permissions:
              type: object
              additionalProperties:
                type: boolean
          additionalProperties: true
      properties:
        hostname:
          type: string
        osFamily:
          type: string
          enum:
            - linux
        serviceManager:
          type: string
          enum:
            - systemd
        allowedLogSources:
          type: array
          items:
            type: string
    InstallInstructions:
      type: object
      properties:
        command:
          type: string
        environment:
          type: object
          additionalProperties:
            type: string
      additionalProperties: true
    SnapshotReference:
      type: object
      properties:
        workspaceId:
          type: string
          format: uuid
        clusterId:
          type: string
          format: uuid
        targetId:
          type: string
          format: uuid
        timestamp:
          type: string
          format: date-time
      additionalProperties: true
  securitySchemes:
    userSession:
      type: apiKey
      in: cookie
      name: acornops_cp_session

````