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

# Put apiv1vm files



## OpenAPI

````yaml /api-reference/openapi.json put /api/v1/vm/{vm_id}/files
openapi: 3.1.0
info:
  title: Orchestrator Control Plane API
  description: ''
  license:
    name: ''
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/vm/{vm_id}/files:
    put:
      tags:
        - vm
      operationId: write_file_vm
      parameters:
        - name: vm_id
          in: path
          description: VM ID
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VmWriteFileRequest'
        required: true
      responses:
        '200':
          description: File written successfully
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: VM not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearer_auth: []
components:
  schemas:
    VmWriteFileRequest:
      type: object
      description: Request body for PUT /api/vm/{vm_id}/files
      required:
        - path
        - content_b64
      properties:
        content_b64:
          type: string
          description: File contents, base64-encoded.
        create_dirs:
          type: boolean
          description: Create parent directories if they don't exist.
        mode:
          type: integer
          format: int32
          description: File mode (e.g. 0644). Defaults to 0644 if omitted.
          minimum: 0
        path:
          type: string
          description: Destination path on the VM.
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Reason of error
        success:
          type: boolean
          description: 'Is always: false'
  securitySchemes:
    bearer_auth:
      type: http
      scheme: bearer
      bearerFormat: Token

````