---
type: api
title: Delete allocator
description: Deletes the allocator.
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/cloud-enterprise/operation/operation-delete-allocator
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/cloud-enterprise/operation/operation-delete-allocator
products:
  - Elastic Cloud Enterprise
---

# Delete allocator

## Paths

- `DELETE` `/platform/infrastructure/allocators/{allocator_id}`

#### Path parameters

- `allocator_id` (string) — required
  The allocator identifier.

## Description

Deletes the allocator.

## Authentication

- Basic: `Authorization: Basic <credentials>`
- Api key: `Authorization: <value>`

## Query string parameters

- `remove_instances` (boolean · default: false) — optional
  Removes the instances from the deleted allocator.

## Responses

#### `200`

The allocator specified by {allocator_id} was successfully deleted

`application/json`

Type: `object`

#### `400`

* The allocator specified by {allocator_id} could not be deleted. (code: `allocators.delete_connected_allocator_attempt`)
* The allocator specified by {allocator_id} could not be deleted. (code: `allocators.delete_allocator_with_instances_attempt`)

`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 allocator specified by {allocator_id} cannot be found. (code: `allocators.allocator_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}/platform/infrastructure/allocators/${ALLOCATOR_ID}" \
  -u "${USERNAME}:${PASSWORD}"
```

