---
title: "Revoke an API key"
---

> Documentation Index
> Fetch the complete documentation index at: https://simplcron.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Revoke an API key

Path: Simplcron API › API keys

`DELETE /v1/keys/{keyId}`

Revoke an API key from an owner or admin browser session.

## Authentication

Requires one of the following:

- `browserSession`, apiKey, in cookie
- `localBrowserSession`, apiKey, in cookie

## Path parameters

- `keyId` (`revokeApiKey.path.keyId`; string, required) — ID of an API key in the current environment.

## Header parameters

- `X-Simplcron-Environment` (`revokeApiKey.header.X-Simplcron-Environment`; string, optional) — Environment for a browser session. Bearer keys always use their fixed environment.
  - one of `"production"`, `"development"` · default: `"production"`

## Code samples

### cURL

```bash
curl --request DELETE \
  --url '<base-url>/v1/keys/<keyId>' \
  --cookie '__Host-simplcron_session=<__Host-simplcron_session>'
```

### TypeScript

```typescript
const url = '<base-url>/v1/keys/<keyId>';
const options = {
  method: 'DELETE',
  headers: {cookie: '__Host-simplcron_session=<__Host-simplcron_session>'}
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "<base-url>/v1/keys/<keyId>"

headers = {"cookie": "__Host-simplcron_session=<__Host-simplcron_session>"}

response = requests.delete(url, headers=headers)

print(response.text)
```

## Responses

### 204

API key revoked

### 401

Authentication is required

#### Example

```json
{
  "error": "string"
}
```

- `error` (`revokeApiKey.response.401.error`; string, required)

### 403

The credential lacks permission

#### Example

```json
{
  "error": "string"
}
```

- `error` (`revokeApiKey.response.403.error`; string, required)

### 404

Resource not found in this environment

#### Example

```json
{
  "error": "string"
}
```

- `error` (`revokeApiKey.response.404.error`; string, required)


Source: https://simplcron.dev/docs/api/revoke-api-key/index.md
