# Create

## Create

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

#### Path Parameters

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

#### Headers

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

#### Request Body

| Name          | Type   | Description                            |
| ------------- | ------ | -------------------------------------- |
| name          | string | Name of the virtual machine            |
| package       | string | Package of the virtual machine         |
| image         | object | Operating system of the virtual        |
| image.flavor  | string | OS name, example ubuntu                |
| image.version | string | OS version, example 20.10              |
| couponCode    | String | Discount code                          |
| rdns          | String | Predefine rDNS domain                  |
| password      | String | Default Root or Administrator password |

{% tabs %}
{% tab title="200 " %}

```
{
    "root_password": String,
    "server": {
        "_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
        }
    }
}
```

{% endtab %}

{% tab title="400 " %}

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

{% endtab %}
{% endtabs %}
