# Controls

## Controls

<mark style="color:green;">`POST`</mark> `https://api.suble.io/projects/:projectId/vm/:vmId/controls/:type`

This endpoint allows you to start, stop or reset a virtual machine.

#### Path Parameters

| Name      | Type   | Description                       |
| --------- | ------ | --------------------------------- |
| projectId | string | Unique id for the project         |
| vmId      | string | Unique id for the virtual machine |
| type      | string | Enum (start / stop / reset)       |

#### Headers

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

{% tabs %}
{% tab title="200 Returns action data" %}

```
{
        "_id": ObjectId,
        "user": ObjectId, // nullable
        "apikey": String, // nullable
        "type": String,
        "command": String,
        "vm": String,
        "running": Boolean,
        "progress": Number,
        "date": Number // Date time unix
}
```

{% endtab %}

{% tab title="400 Error will occur if control type is invalid or the vm doesn't exist." %}

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

{% endtab %}
{% endtabs %}


---

# Agent Instructions: 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/controls.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.
