---
type: api
title: Delete Stateless Resource from Deployment
description: Delete Stateless Resource belonging to a given Deployment. Deployment must be shutdown already.
url: https://www.elastic.co/elastic/docs-builder/docs/4641/api/doc/cloud-enterprise/v3/operation/operation-delete-deployment-stateless-resource
resource: https://www.elastic.co/elastic/docs-builder/docs/4641/api/doc/cloud-enterprise/v3/operation/operation-delete-deployment-stateless-resource
products:
  - Elastic Cloud Enterprise
---

# Delete Stateless Resource from Deployment

Authentication: required

## Paths

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

#### Path parameters

- `deployment_id` (string) — required
  Identifier for the Deployment
- `stateless_resource_kind` (enum) — required
  The kind of stateless resource
  Values: `kibana`, `apm`, `appsearch`, `enterprise_search`, `integrations_server`
- `ref_id` (string) — required
  User-specified RefId for the Resource (or '_main' if there is only one)

## Description

Delete Stateless Resource belonging to a given Deployment. Deployment must be shutdown already.

## Responses

#### `200`

Standard Deployment Resource Crud Response

`application/json`

- `id` (string)
  The id of the deployment
- `kind` (string)
  The kind of the stateless resource
- `ref_id` (string)
  The reference id of the resource
#### `400`

Resource has still instances. (code: `deployments.resource_has_instances`)

`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

#### `404`

* The Deployment specified by {deployment_id} cannot be found. (code: `deployments.deployment_not_found`)
* The Resource specified by {ref_id} cannot be found. (code: `deployments.deployment_resource_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

#### `500`

We have failed you. (code: `deployments.deployment_resource_no_longer_exists`)

`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}/kibana/${REF_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",
  "kind": "string",
  "ref_id": "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"
      ]
    }
  ]
}
```

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

#### 500

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

