---
type: api
title: Delete API keys
description: Delete or invalidate API keys.
url: https://www.elastic.co/elastic/docs-builder/docs/4641/api/doc/cloud-enterprise/v4/operation/operation-delete-api-keys
resource: https://www.elastic.co/elastic/docs-builder/docs/4641/api/doc/cloud-enterprise/v4/operation/operation-delete-api-keys
products:
  - Elastic Cloud Enterprise
---

# Delete API keys

Authentication: required

## Paths

- `DELETE` `/users/auth/keys`

## Description

Delete or invalidate API keys.

## Request body

The request to delete API keys

`application/json`

- `keys` (string[]) — required
  The list of API key IDs.

## Response

The API keys are deleted.

`application/json`

Type: `object`

## Code examples

#### curl

```curl
curl -X DELETE "${API_URL}/users/auth/keys" \
  -u "${USERNAME}:${PASSWORD}" \
  -H "Content-Type: application/json" \
  -d '{
    "keys": [
      "string"
    ]
  }'
```

## 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
{}
```

