> For the complete documentation index, see [llms.txt](https://docs.suble.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.suble.io/virtual-machine/list.md).

# List

## List

<mark style="color:blue;">`GET`</mark> `https://api.suble.io/projects/:projectId/vm`

Retrieve a list of all virtual machines in the project.

#### Path Parameters

| Name      | Type   | Description               |
| --------- | ------ | ------------------------- |
| projectId | string | Unique id for the project |

#### Headers

| Name          | Type   | Description               |
| ------------- | ------ | ------------------------- |
| Authorization | string | User token or project key |

{% tabs %}
{% tab title="200 Returns an array of virtual machine objects" %}

```
[
    {
        "_id": ObjectId,
        "project": ObjectId,
        "name": String,
        "status": String ("offline" | "online"),
        "online": Boolean,
        "created": Number, // Datetime Unix
        "network": {
            "ipv4": {
                "public": String,
                "private": {
                    "network": ObjectId,
                    "address": String,
                    "macaddress": String
                }
            },
            "floating": Array
        },
        "package": {
            "name": String,
            "cores": Number,
            "memory": Number, // Defined in MB
            "storage": Number, // Defined in MB,
            "price": Number // Defined as 1 DKK = 100 
        },
        "esxi": Number,
        "datacenter": String, // Example: aad1-dc1
        "node": Number,
        "renew": Number, // Datetime Unix
        "image": {
            "long": String, // linux-ubuntu-20.10
            "short": String, // ubuntu-20.10
            "flavor": String, // ubuntu
            "version": String, // 20.10
            "icon": String, //ubuntu (MDI Icon)
        },
        usage: {
            cpu: Number,
            ram: Number,
            date: Number // Datetime Unix
        }
    }
]4
```

{% endtab %}

{% tab title="400 Error can occur if request was made unauthorized or with an invalid project id." %}

```
{
    "error": String
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.suble.io/virtual-machine/list.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
