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

# List Environments

> View all active desktop environments

Returns a list of all currently active desktop environments with their VM IDs, status, and metadata.

## Response

<ResponseField name="environments" type="array">
  List of environment objects
</ResponseField>

<ResponseField name="total" type="integer">
  Total number of active environments
</ResponseField>

### Environment Object Fields

<ResponseField name="vm_id" type="string">
  Unique VM identifier
</ResponseField>

<ResponseField name="provider" type="string">
  VM provider (e.g., `docker`)
</ResponseField>

<ResponseField name="os_type" type="string">
  Operating system
</ResponseField>

<ResponseField name="status" type="string">
  Environment status (`active`)
</ResponseField>

<ResponseField name="start_time" type="number">
  Unix timestamp of creation
</ResponseField>

<ResponseField name="timeout" type="integer">
  Session timeout in seconds
</ResponseField>

<ResponseField name="age_seconds" type="number">
  Time since creation
</ResponseField>

<ResponseField name="vnc_port" type="integer">
  VNC port number
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET "http://CONTROL_PLANE_IP:PORT/list_desktop_environments"
  ```
</RequestExample>

<ResponseExample>
  ```json Success Response theme={null}
  {
    "environments": [
      {
        "vm_id": "vm-abc123",
        "provider": "docker",
        "os_type": "Ubuntu",
        "status": "active",
        "start_time": 1234567890.123,
        "timeout": 3600,
        "age_seconds": 1200.5,
        "vnc_port": 8001,
        "last_open_connection": 1234568000.0,
        "time_since_last_connection": 90.123
      }
    ],
    "total": 1
  }
  ```

  ```json No Environments theme={null}
  {
    "environments": [],
    "total": 0
  }
  ```
</ResponseExample>
