---
type: api
title: Revoke previously rotated Cluster API Keys
description: Revoke API keys for this cluster that are pending revocation after a rotation operation.
url: https://www.elastic.co/elastic/docs-builder/docs/4641/api/doc/cloud-connect/operation/operation-revokependingclusterapikeys
resource: https://www.elastic.co/elastic/docs-builder/docs/4641/api/doc/cloud-connect/operation/operation-revokependingclusterapikeys
products:
  - Elastic Cloud Hosted
---

# Revoke previously rotated Cluster API Keys

Authentication: required

- Server: `https://api.elastic-cloud.com`

## Paths

- `POST` `/api/v1/cloud-connected/clusters/{id}/apikey/_revoke-pending`

#### Path parameters

- `id` (string · pattern: ^[a-z0-9]{32}$) — required
  The ID of the Cloud Connected cluster

## Description

Revoke API keys for this cluster that are pending revocation after a rotation operation.
The `_rotate` endpoint schedules revocation in 7 days; this endpoint revokes those pending keys immediately.

## Header parameters

- `If-Match` (string) — optional
  ETag value fetched in a previous GET cluster request. Used to prevent simultaneous updates

## Responses

#### `200`

The previous API Key has been deleted.

#### `401`

Unauthorized

`application/json`

- `errors` (object[])
  - `message` (string)
    A human-readable message of the error.
  - `code` (string)
    An identifier for this type of error.
#### `403`

Forbidden

`application/json`

- `errors` (object[])
  - `message` (string)
    A human-readable message of the error.
  - `code` (string)
    An identifier for this type of error.
#### `404`

Not Found

`application/json`

- `errors` (object[])
  - `message` (string)
    A human-readable message of the error.
  - `code` (string)
    An identifier for this type of error.
## Code examples

#### curl

```curl
curl -X POST "https://api.elastic-cloud.com/api/v1/cloud-connected/clusters/${ID}/apikey/_revoke-pending" \
  -H "Authorization: ApiKey ${API_KEY}"
```

## Response examples

#### 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": [
    {
      "message": "Explicative error message",
      "code": "code.error"
    }
  ]
}
```

#### 403

`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": [
    {
      "message": "Explicative error message",
      "code": "code.error"
    }
  ]
}
```

#### 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": [
    {
      "message": "Explicative error message",
      "code": "code.error"
    }
  ]
}
```

