# Revoke an API Key

DELETE /api/v1/connect-keys/ {key_id}

Revoke an API key so it stops working at once, and answer 204 with no body.

The call is idempotent, so revoking a key that is already gone still succeeds.

Idempotent: a key that's already gone from WorkOS still updates the mirror's `revoked_at` (in case earlier revoke succeeded in WorkOS but failed locally) and flushes the validator cache so any in-flight cached token rejects immediately.

Path parameters

key_id string Required

Identifier of the API key, as returned in the `id` field when it was created.

Returns

Successful Response

Errors

Status When

422 Validation Error

[Previous ← Update API Key Metadata](https://heyarchie.com/en-gb/developers/api-reference/connect-keys/update-api-key-metadata/)

```
curl https://uk.heyarchie.com/api/v1/connect-keys/<key_id> \
  -X DELETE \
  -H "Authorization: Bearer sk_..."
```

```
import requests

headers = {"Authorization": "Bearer sk_..."}

r = requests.delete("https://uk.heyarchie.com/api/v1/connect-keys/<key_id>", headers=headers)
print(r.json())
```

```
const r = await fetch("https://uk.heyarchie.com/api/v1/connect-keys/<key_id>", {
  method: "DELETE",
  headers: { "Authorization": "Bearer sk_..." },
});
const data = await r.json();
console.log(data);
```

Response

```
{
  "detail": [
    {
      "loc": [
        null
      ],
      "msg": "<string>",
      "type": "<string>"
    }
  ]
}
```

Every response also carries X-Request-ID. Quote it if you write to us about a call.
