# 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 %}
