---
type: api
title: Delete an entity
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana-serverless/operation/operation-delete-security-entity-store-entities
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana-serverless/operation/operation-delete-security-entity-store-entities
products:
  - Kibana
---

# Delete an entity

- Server: `https://{kibana_url}`

## Paths

- `DELETE` `/api/security/entity_store/entities/`
- `DELETE` `/s/{space_id}/api/security/entity_store/entities/`

- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/kibana-serverless/authentication#apikeyauth)

## Description

Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.

Delete a single entity record from the Entity Store. The entity is immediately removed from the latest index.<br/><br/>[Required authorization] Route required privileges: securitySolution.

## Request Body

`application/json`

- `entityId` (string) — required
  The identifier of the entity to delete.

## Responses

#### `200`

Indicates the entity was successfully deleted.

#### `404`

Entity not found.

## Code Examples

#### Console

```console
DELETE kbn://api/security/entity_store/entities/
{
  "entityId": "host:web-server-prod-01"
}
```

#### curl

```curl
curl -X DELETE -H "kbn-xsrf: true" -H "Authorization: ApiKey ${API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{"entityId":"host:web-server-prod-01"}' \
  "${KIBANA_URL}/api/security/entity_store/entities/"
```

## Response Examples

#### Entity deleted

The entity was found and successfully removed from the latest index.

```json
{
  "deleted": true
}
```

#### Entity not found

No entity with the specified identifier exists in the Entity Store.

```json
{
  "error": "Not Found",
  "message": "Entity ID \u0027host:web-server-prod-01\u0027 not found",
  "statusCode": 404
}
```

