---
title: "Revoke an API key"
description: "Revokes one API key using an owner access token; a matching revocation fence invalidates cached authentication and closes the terminal and port-proxy sessions the key opened immediately."
canonical: "https://www.cool.computer/docs/api-reference/authentication/revoke-an-api-key"
---
# Revoke an API key

> Revokes one API key using an owner access token; a matching revocation fence invalidates cached authentication and closes the terminal and port-proxy sessions the key opened immediately.

```http
DELETE https://api.cool.computer/api/api-keys/{id}
```

Revokes one API key using an owner access token; a matching revocation fence invalidates cached authentication and closes the terminal and port-proxy sessions the key opened immediately. A process that misses the fence still refuses later requests within the five-second authentication cache, but closes the sessions already open in it only when the fence reaches it. API keys are rejected with access_token_required.

## Authorization

- A WorkOS access token returned by the self-serve email authorization flow. A claimed agent access token is also accepted for creating an API key, and only for that. API keys are not accepted for API-key administration.

## Parameters

- `id` (path, string, at least 1 characters, required): API key identifier returned by the list operation.

## Responses

- `204`: The API key was revoked.
- `401`: Unauthorized.
- `403`: A user access token from email sign-in (cool login) is required; API keys receive access_token_required.
- `404`: Not Found.
- `429`: Too Many Requests. If the problem code is api_request_rate_exceeded, wait for Retry-After seconds; other problem codes describe a separate limit.
- `500`: Internal Server Error.
- `default`: A machine-readable API error with a stable code and recovery instruction.

An error is an `application/problem+json` document with a stable `code`; [API errors](/docs/api-reference/errors) says how to handle one.

## Example

```sh
curl -X DELETE "https://api.cool.computer/api/api-keys/$PARAM_ID" \
  -H "authorization: Bearer $TOKEN"
```
