---
type: api
title: Revoke previously rotated service API Keys
description: Revoke API keys used for a Cloud Connected service that are pending revocation after a rotation operation.
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/cloud-connect/operation/operation-revokependingserviceapikeys
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/cloud-connect/operation/operation-revokependingserviceapikeys
products:
  - Elastic Cloud Hosted
---

# Revoke previously rotated service API Keys

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

## Paths

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

- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/cloud-connect/authentication#apikey)

## Description

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

## Responses

#### `200`

The previous API Key has been deleted.

#### `401`

Unauthorized

`application/json`

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

Forbidden

`application/json`

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

Not Found

`application/json`

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

#### Console

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

#### curl

```curl
curl -X POST "https://api.elastic-cloud.com/api/v1/cloud-connected/clusters/{id}/apikey/{service}/_revoke-pending"
```

