# Create an Instance

You can create an instance in a specific data center with a composite call. A composite call doesn't only configure a single instance but also defines additional devices. This is required because a Cube must include a direct-attached storage device. An instance cannot be provisioned and then mounted with a direct-attached storage volume. Composite calls are used to execute a series of [<mark style="color:blue;">REST API</mark>](https://api.ionos.com/docs/cloud/v6/#tag/Servers)requests into a single API call. You can use the output of one request as the input for a subsequent request.

{% hint style="info" %}
The payload of a composite call to configure a Cubes instance differs from that of a POST request to create an enterprise server. In a single request, you can create a new instance and its direct-attached storage device and image ([<mark style="color:blue;">public images</mark>](https://docs.ionos.com/sections-test/guides/storage-and-backup/images-snapshots/public-images), [<mark style="color:blue;">private images</mark>](https://docs.ionos.com/sections-test/guides/storage-and-backup/images-snapshots/private-images), or [<mark style="color:blue;">snapshots</mark>](https://docs.ionos.com/sections-test/guides/storage-and-backup/images-snapshots/snapshots)). When the request is processed, a Cubes instance is created and the direct-attached storage is mounted automatically.
{% endhint %}

## Endpoint

Use the following endpoint for Cubes: `https://api.ionos.com/cloudapi/v6/datacenters/{datacenterId}/servers`

## Request

{% hint style="info" %}
**Note:** The following request contains sample values. Remember to replace them with the relevant information.
{% endhint %}

```bash
curl -X 'POST' \
  'https://api.ionos.com/cloudapi/v6/datacenters/{datacenterId}/servers' \
  -H 'accept: application/json'
```

To make authenticated requests to the API, the following fields are mandatory in the request header:

| **Name**       | **Type** | **Description**            |
| -------------- | :------: | -------------------------- |
| `datacenterId` |  string  | The ID of the data center. |
| `serverId`     |  string  | The ID of the Cube.        |

## Response

A **202** message confirms that the instance is created.

```json
{
  "id": "15f67991-0f51-4efc-a8ad-ef1fb31a480c",
  "type": "server",
  "href": "<RESOURCE-URI>",
  "metadata": {
    "etag": "45480eb3fbfc31f1d916c1eaa4abdcc3",
    "createdDate": "2015-12-04T14:34:09.809Z",
    "createdBy": "user@example.com",
    "createdByUserId": "user@example.com",
    "lastModifiedDate": "2015-12-04T14:34:09.809Z",
    "lastModifiedBy": "user@example.com",
    "lastModifiedByUserId": "63cef532-26fe-4a64-a4e0-de7c8a506c90",
    "state": "AVAILABLE"
  },
  "properties": {
    "templateUuid": "15f67991-0f51-4efc-a8ad-ef1fb31a480c",
    "name": "My resource",
    "hostname": "myHostname",
    "cores": 4,
    "ram": 4096,
    "availabilityZone": "AUTO",
    "vmState": "RUNNING",
    "bootCdrom": {
      "id": "string",
      "type": "resource",
      "href": "<RESOURCE-URI>"
    },
    "bootVolume": {
      "id": "string",
      "type": "resource",
      "href": "<RESOURCE-URI>"
    },
    "cpuFamily": "INTEL_ICELAKE",
    "type": "CUBE",
    "nicMultiQueue": true
  },
  "entities": {
        "volumes": {
            "items": [
                {
                    "properties": {
                        "name": "My resource",
                        "type": "DAS",
                        "licenceType": "LINUX"
                    }
                }
            ]
        }
    }
}

```
