# Delete an Instance

You can delete the specified Cubes instance within a data center.

{% hint style="warning" %}
**Warning:**

* If the query parameter is set to `true`, the attached storage volumes will also be removed; otherwise, a separate API call must be made for these actions.
* Deleting an instance also deletes the direct-attached storage NVMe volume. Make a snapshot first in case you need to recreate the instance with the appropriate data device later.
  {% 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 'DELETE' \
  'https://api.ionos.com/cloudapi/v6/datacenters/{datacenterId}/servers/{serverId}' \
  -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 deleted.
