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

# Reattach to a retained process stream from a cursor.



## OpenAPI

````yaml /api-reference/openapi.json post /api/v2/computers/{computer_id}/exec/stream/attach
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}/exec/stream/attach:
    post:
      tags:
        - Computers
      summary: Reattach to a retained process stream from a cursor.
      operationId: attach_computer_stream
      parameters:
        - name: computer_id
          in: path
          description: Computer identity
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VmExecStreamAttachRequest'
        required: true
      responses:
        '200':
          description: NDJSON output replay followed by the terminal exit event
          content:
            application/x-ndjson:
              schema:
                $ref: '#/components/schemas/VmExecStreamEvent'
        '401':
          description: Missing or invalid API key
        '404':
          description: Computer or retained process stream not found
        '409':
          description: Computer is sleeping
        '501':
          description: Process execution is unsupported
        '502':
          description: Computer process service is unavailable
components:
  schemas:
    VmExecStreamAttachRequest:
      type: object
      description: >-
        Request body for `POST
        /api/v2/computers/{computer_id}/exec/stream/attach`.
      required:
        - exec_id
      properties:
        cursor:
          type:
            - integer
            - 'null'
          format: int64
          description: >-
            Optional cursor to resume from (exclusive). If omitted, the full
            retained backlog is replayed.
          minimum: 0
        exec_id:
          type: string
          format: uuid
          description: Identifier of the exec stream session to reattach to.
        from_latest:
          type:
            - boolean
            - 'null'
          description: Start streaming after the latest retained chunk (ignores cursor).
    VmExecStreamEvent:
      oneOf:
        - type: object
          required:
            - cursor
            - stream
            - data_b64
            - type
          properties:
            cursor:
              type: integer
              format: int64
              minimum: 0
            data_b64:
              type: string
            exec_id:
              type:
                - string
                - 'null'
              format: uuid
            stream:
              $ref: '#/components/schemas/VmExecLogStream'
            type:
              type: string
              enum:
                - chunk
        - type: object
          required:
            - cursor
            - exit_code
            - type
          properties:
            cursor:
              type: integer
              format: int64
              minimum: 0
            exec_id:
              type:
                - string
                - 'null'
              format: uuid
            exit_code:
              type: integer
              format: int32
            infrastructure_error:
              oneOf:
                - type: 'null'
                - $ref: '#/components/schemas/VmExecStreamInfrastructureError'
            type:
              type: string
              enum:
                - exit
      description: >-
        Streaming exec events emitted over the exec stream endpoint (NDJSON
        lines).
    VmExecLogStream:
      type: string
      description: Streams available for exec logging.
      enum:
        - stdout
        - stderr
    VmExecStreamInfrastructureError:
      type: object
      description: >-
        Machine-readable infrastructure failure attached to a terminal exec
        event.
      required:
        - code
        - message
      properties:
        code:
          type: string
        message:
          type: string
  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.