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

# List machines

> The machines the workspace runs programs on, its own host first, each
checked now: `managed` when Mirage sees and stops every process its
programs start there, `reachable` when only what it started itself,
`unreachable` when the check failed.

> [accordion] Errors
>
> | Status | Meaning |
> | - | - |
> | `401` | The token is missing or wrong |
> | `404` | The workspace, session, job or file does not exist |
> | `422` | Validation Error |
> | `429` | Past a rate limit, or a new session past max\_sessions |
>
> See [error examples and recovery steps](https://docs.mirage.strukto.ai/api/errors.md). The [complete OpenAPI contract](https://github.com/strukto-ai/mirage/blob/main/docs/openapi.yaml) includes every response schema.


## OpenAPI

````yaml /openapi.yaml get /v1/workspaces/{workspace_id}/machines
openapi: 3.2.0
info:
  title: Mirage API
  version: '0.1'
servers:
  - url: http://127.0.0.1:8765
    description: A local server on its default port
security:
  - bearerAuth: []
tags:
  - name: Workspace operations
    x-group: Workspaces
  - name: Workspaces
    x-group: Lifecycle
    parent: Workspace operations
  - name: Sessions
  - name: Shell
    parent: Workspace operations
  - name: VFS
    parent: Workspace operations
  - name: Tools
  - name: Documents
    parent: Workspace operations
  - name: Snapshots
  - name: Templates
  - name: Saved VFS
    x-group: VFS
    parent: Saved configurations
  - name: Saved CLIs
    x-group: CLIs
    parent: Saved configurations
  - name: Saved runtimes
    x-group: Runtimes
    parent: Saved configurations
  - name: Saved machines
    x-group: Machines
    parent: Saved configurations
  - name: Saved configurations
  - name: Policies
  - name: Asks
    parent: Workspace operations
  - name: Lines
    parent: Workspace operations
  - name: Jobs
    parent: Workspace operations
  - name: Processes
    parent: Workspace operations
  - name: Machines
    parent: Workspace operations
  - name: Service
  - name: Daemon
  - name: Auth
paths:
  /v1/workspaces/{workspace_id}/machines:
    get:
      tags:
        - Machines
      summary: List machines
      description: |-
        The machines the workspace runs programs on, its own host first, each
        checked now: `managed` when Mirage sees and stops every process its
        programs start there, `reachable` when only what it started itself,
        `unreachable` when the check failed.
      operationId: list_machines_v1_workspaces__workspace_id__machines_get
      parameters:
        - $ref: '#/components/parameters/workspaceId'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MachineResponse'
                title: >-
                  Response List Machines V1 Workspaces  Workspace Id  Machines
                  Get
components:
  parameters:
    workspaceId:
      name: workspace_id
      in: path
      required: true
      description: The workspace's id.
      schema:
        type: string
      example: demo
  schemas:
    MachineResponse:
      properties:
        id:
          type: string
          title: Id
          description: The machine's id, written `provider:name`.
        state:
          $ref: '#/components/schemas/MachineState'
        checked_at:
          type: number
          title: Checked At
          description: When the check ran, in epoch seconds.
      type: object
      required:
        - id
        - state
        - checked_at
      title: MachineResponse
    MachineState:
      type: string
      enum:
        - managed
        - reachable
        - unreachable
      title: MachineState
      description: >-
        How far Mirage reaches a machine, as its last check found it: `managed`
        (Mirage sees and stops every process its programs start there),
        `reachable` (only what it started itself) or `unreachable` (the last
        check failed).
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        The server's token (MIRAGE_AUTH_TOKEN) or a JWT. A daemon in the default
        local mode with no token accepts requests without one.

````

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