---
title: "Delete root key"
method: POST
path: "/v2/rootKeys.deleteKey"
tags: ["rootKeys"]
---

# Delete root key

`POST /v2/rootKeys.deleteKey`

## Request

- Base URL: `https://api.unkey.com`
- URL: `https://api.unkey.com/v2/rootKeys.deleteKey`
- Auth: HTTP bearer

Deletes a root key in the authenticated workspace.
Requires `unkey:v1:<workspace_id>:rootKeys/<key_id>#delete`.
Use `rootKeys/*#delete` to delete any root key in the workspace.
Deleted keys cannot authenticate.

## Request body

- V2RootKeysDeleteKeyRequestBody
  - `keyId` string, required: Root key identifier returned by rootKeys.createKey or rootKeys.listKeys.

## Response `200`

Root key deleted.

- V2RootKeysDeleteKeyResponseBody
  - `meta` Meta, required: Metadata object included in every API response. This provides context about the request and is essential for debugging, audit trails, and support inquiries. The `requestId` is particularly important when troubleshooting issues with the Unkey support team.
    - `requestId` string, required: A unique id for this request. Always include this ID when contacting support about a specific API request. This identifier allows Unkey's support team to trace the exact request through logs and diagnostic systems to provide faster assistance.
  - `data` EmptyResponse, required: Empty response object by design. A successful response indicates this operation was successfully executed.

## Other responses

- `400`: Invalid request.
- `401`: Authentication is required.
- `403`: The caller cannot delete this root key.
- `404`: The root key was not found.
- `429`: Too many requests.
- `500`: The root key could not be deleted.

## Changes

- **2026-09-30** `2cf3cf769b2e`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/unkeyed/apis/unkey-api/changes/v2/rootKeys.deleteKey/post.md)

---

[API](https://skmtc.dev/unkeyed/apis/unkey-api.md) - [All operations](https://skmtc.dev/unkeyed/apis/unkey-api/llms.txt) - [OpenAPI document](https://skmtc.dev/unkeyed/apis/unkey-api/revisions/6fbaa27f19e0?raw)
