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

# Read a finite retained snapshot of the computer's primary workload output.



## OpenAPI

````yaml /api-reference/openapi.json get /api/v2/computers/{computer_id}/workload/logs
openapi: 3.1.0
info:
  title: Vers API
  description: >-
    REST API for creating, checkpointing, branching, and managing Vers computers
    and projects.
  version: 2.0.0
servers:
  - url: https://api.vers.sh
    description: Vers API
security:
  - bearerAuth: []
tags:
  - name: Computers
    description: Create, inspect, execute commands in, sleep, wake, and delete computers.
  - name: Branches
    description: Branch one or more computers from a live computer, checkpoint, or tag.
  - name: Checkpoints
    description: Capture, inspect, tag, and delete whole-computer checkpoints.
  - name: Projects
    description: >-
      Organize computers into projects with private service networks and grouped
      restores.
  - name: Operations
    description: Inspect and stream status events for asynchronous durable operations.
  - name: Images
    description: >-
      Import and manage custom OCI images, system images, and registry
      artifacts.
  - name: Repositories
    description: Manage checkpoint repositories, tags, and public catalog entries.
  - name: Domains
    description: Register and manage custom domains.
  - name: Environment Variables
    description: Manage account-level environment variables applied to new computers.
  - name: Account & System
    description: Inspect API key identity, usage, and control-plane health.
paths:
  /api/v2/computers/{computer_id}/workload/logs:
    get:
      tags:
        - Computers
      summary: >-
        Read a finite retained snapshot of the computer's primary workload
        output.
      operationId: get_computer_workload_logs
      parameters:
        - name: computer_id
          in: path
          description: Computer identity
          required: true
          schema:
            type: string
            format: uuid
        - name: cursor
          in: query
          description: Exclusive decoded-byte cursor
          required: false
          schema:
            type: integer
            format: int64
            minimum: 0
      responses:
        '200':
          description: Retained workload-log snapshot
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VmWorkloadLogSnapshot'
        '400':
          description: Cursor is ahead of the current frontier
        '401':
          description: Missing or invalid API key
        '404':
          description: Computer not found
        '409':
          description: Computer is sleeping
        '501':
          description: Computer does not support workload logs
components:
  schemas:
    VmWorkloadLogSnapshot:
      type: object
      description: Finite retained primary-workload log snapshot.
      required:
        - log_id
        - events
        - next_cursor
        - retention_floor
        - total_dropped_bytes
      properties:
        events:
          type: array
          items:
            $ref: '#/components/schemas/VmWorkloadLogEvent'
        log_id:
          type: string
          format: uuid
          description: >-
            Stable log identity. It is the VM UUID; fork/restore get a new
            identity.
        next_cursor:
          type: integer
          format: int64
          minimum: 0
        retention_floor:
          type: integer
          format: int64
          minimum: 0
        total_dropped_bytes:
          type: integer
          format: int64
          minimum: 0
    VmWorkloadLogEvent:
      oneOf:
        - type: object
          required:
            - log_id
            - requested_cursor
            - available_cursor
            - dropped_bytes
            - type
          properties:
            available_cursor:
              type: integer
              format: int64
              minimum: 0
            dropped_bytes:
              type: integer
              format: int64
              minimum: 0
            log_id:
              type: string
              format: uuid
            requested_cursor:
              type: integer
              format: int64
              minimum: 0
            type:
              type: string
              enum:
                - gap
        - type: object
          required:
            - log_id
            - cursor
            - next_cursor
            - timestamp
            - stream
            - data_b64
            - type
          properties:
            cursor:
              type: integer
              format: int64
              minimum: 0
            data_b64:
              type: string
              description: Base64-encoded stdout/stderr bytes.
            log_id:
              type: string
              format: uuid
            next_cursor:
              type: integer
              format: int64
              minimum: 0
            stream:
              $ref: '#/components/schemas/VmWorkloadLogStream'
            timestamp:
              type: string
            type:
              type: string
              enum:
                - chunk
        - type: object
          required:
            - log_id
            - cursor
            - error
            - type
          properties:
            cursor:
              type: integer
              format: int64
              minimum: 0
            error:
              $ref: '#/components/schemas/VmWorkloadLogCaptureError'
            log_id:
              type: string
              format: uuid
            type:
              type: string
              enum:
                - capture_error
        - type: object
          required:
            - log_id
            - cursor
            - terminal
            - type
          properties:
            capture_error:
              oneOf:
                - type: 'null'
                - $ref: '#/components/schemas/VmWorkloadLogCaptureError'
            cursor:
              type: integer
              format: int64
              minimum: 0
            log_id:
              type: string
              format: uuid
            terminal:
              $ref: '#/components/schemas/VmWorkloadLogTerminal'
            type:
              type: string
              enum:
                - terminal
        - type: object
          required:
            - log_id
            - next_cursor
            - reason
            - type
          properties:
            log_id:
              type: string
              format: uuid
            message:
              type:
                - string
                - 'null'
            next_cursor:
              type: integer
              format: int64
              minimum: 0
            reason:
              $ref: '#/components/schemas/VmWorkloadLogEndReason'
            type:
              type: string
              enum:
                - end
      description: Snapshot and NDJSON-follow event for primary-workload output.
    VmWorkloadLogStream:
      type: string
      description: Captured primary-workload stream.
      enum:
        - stdout
        - stderr
    VmWorkloadLogCaptureError:
      type: object
      description: Capture-plane failure retained separately from the workload exit status.
      required:
        - code
        - message
      properties:
        code:
          type: string
        message:
          type: string
    VmWorkloadLogTerminal:
      oneOf:
        - type: object
          required:
            - outcome
          properties:
            code:
              type:
                - integer
                - 'null'
              format: int32
            outcome:
              type: string
              enum:
                - exited
            signal:
              type:
                - integer
                - 'null'
              format: int32
        - type: object
          required:
            - phase
            - code
            - message
            - outcome
          properties:
            code:
              type: string
            message:
              type: string
            outcome:
              type: string
              enum:
                - boot_failed
            phase:
              type: string
      description: Typed terminal state of the OCI workload.
    VmWorkloadLogEndReason:
      type: string
      description: Why a bounded follow response ended without a workload terminal event.
      enum:
        - follow_timeout
        - guest_disconnected
        - guest_error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key
      description: 'Vers API key (`VERS_API_KEY`) sent as `Authorization: Bearer <key>`.'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.