---
title: "Delete an API key"
method: DELETE
path: "/v2/api_keys/{api_key_id}"
tags: ["API Keys"]
---

# Delete an API key

`DELETE /v2/api_keys/{api_key_id}`

Deletes an API key. Delete a key when it is no longer needed or when it is compromised.

Users that hold none of the `corpus_administrator`, `administrator`, or `owner` roles can only delete their own personal API key; a key that exists but belongs to another user returns a `404` error. Machine credentials — API keys, app clients, and service accounts — without one of those three roles cannot call this operation.

## Path parameters

- `api_key_id` string, required

## Headers

- `Request-Timeout` integer
- `Request-Timeout-Millis` integer

## Response `204`

The API key was deleted.

## Other responses

- `403` — The caller's roles do not allow deleting API keys. A machine credential — an API key, app client, or service account — that holds none of the `corpus_administrator`, `administrator`, or `owner` roles is always refused.
- `404` — No API key with this ID is visible to the caller.

---

[API](https://skmtc.net/vectara/apis/vectara-rest-api-v2.md) · [All operations](https://skmtc.net/vectara/apis/vectara-rest-api-v2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/vectara/vectara-rest-api-v2/versions/e85040b266cc/schema)
