---
type: api
title: Delete stack version
description: Uses the `deleted` flag, which removes only that version of the Elastic Stack from the list of available versions. To restore the version, send an update request. For more information, see the PUT request.
url: https://www.elastic.co/elastic/docs-builder/docs/4641/api/doc/cloud-enterprise/operation/operation-delete-version-stack
resource: https://www.elastic.co/elastic/docs-builder/docs/4641/api/doc/cloud-enterprise/operation/operation-delete-version-stack
products:
  - Elastic Cloud Enterprise
---

# Delete stack version

Authentication: required

## Paths

- `DELETE` `/stack/versions/{version}`

#### Path parameters

- `version` (string) — required
  The Elastic Stack version. For example, `5.3.1` or `5.0.0-RC4`.

## Description

Uses the `deleted` flag, which removes only that version of the Elastic Stack from the list of available versions. To restore the version, send an update request. For more information, see the PUT request.

## Responses

#### `200`

The `deleted` flag is applied to the specified Elastic Stack version.

`application/json`

Type: `object`

#### `404`

The Elastic Stack version can't be found. (code: `stackpack.version_not_found`)

`application/json`

- `errors` (object[])
  A list of errors that occurred in the failing request
  - `code` (string)
    A structured code representing the error type that occurred
  - `message` (string)
    A human readable message describing the error that occurred
  - `fields` (string[])
    If the error can be tied to a specific field or fields in the user request, this lists those fields
##### Response headers

- `x-cloud-error-codes` (enum)
  The error codes associated with the response

## Code examples

#### curl

```curl
curl -X DELETE "${API_URL}/stack/versions/${VERSION}" \
  -u "${USERNAME}:${PASSWORD}"
```

## Response examples

#### 200

`application/json`

Generated from the API spec. Values are representative. Unions use the first variant; deeply nested or large bodies may omit fields.

```json
{}
```

#### 404

`application/json`

Generated from the API spec. Values are representative. Unions use the first variant; deeply nested or large bodies may omit fields.

```json
{
  "errors": [
    {
      "code": "string",
      "message": "string",
      "fields": [
        "string"
      ]
    }
  ]
}
```

