---
type: api
title: Delete Deployment
description: Deletes a Deployment and all its resources.
url: https://www.elastic.co/elastic/docs-builder/docs/4641/api/doc/cloud-enterprise/v3/operation/operation-delete-deployment
resource: https://www.elastic.co/elastic/docs-builder/docs/4641/api/doc/cloud-enterprise/v3/operation/operation-delete-deployment
products:
  - Elastic Cloud Enterprise
---

# Delete Deployment

Authentication: required

## Paths

- `DELETE` `/deployments/{deployment_id}`

#### Path parameters

- `deployment_id` (string) — required
  Identifier for the Deployment

## Description

Deletes a Deployment and all its resources.

## Responses

#### `200`

The request was valid and the deployment was deleted.

`application/json`

- `id` (string)
  The id of the deployment
- `name` (string)
  The name of the deployment
- `orphaned` (object)
  Details about orphaned resources.
  - `elasticsearch` (object[])
    List of orphaned Elasticsearch resources
    - `id` (string)
      The id of the orphaned resource
    - `dependents` (object[])
      List of orphaned dependent resources
      - `id` (string)
        The id of the orphaned resource
      - `kind` (string)
        The kind of resource
  - `kibana` (string[])
    List of orphaned Kibana resource ids
  - `apm` (string[])
    List of orphaned APM resource ids
  - `appsearch` (string[])
    List of orphaned AppSearch resource ids
  - `enterprise_search` (string[])
    List of orphaned Enterprise Search resource ids
  - `integrations_server` (string[])
    List of orphaned Integrations Server resource ids
#### `400`

The Deployment resources have not been shutdown yet.

`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
#### `401`

You are not authorized to perform this action.

`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
#### `404`

The Deployment specified by {deployment_id} cannot be found. (code: `deployments.deployment_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}/deployments/${DEPLOYMENT_ID}" \
  -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
{
  "id": "string",
  "name": "string",
  "orphaned": {
    "elasticsearch": [
      {
        "id": "string",
        "dependents": [
          {
            "id": "string",
            "kind": "string"
          }
        ]
      }
    ],
    "kibana": [
      "string"
    ],
    "apm": [
      "string"
    ],
    "appsearch": [
      "string"
    ],
    "enterprise_search": [
      "string"
    ],
    "integrations_server": [
      "string"
    ]
  }
}
```

#### 400

`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"
      ]
    }
  ]
}
```

#### 401

`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"
      ]
    }
  ]
}
```

#### 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"
      ]
    }
  ]
}
```

