---
title: "Delete API Key"
api: "DELETE /v1/api/keys/{id}"
description: "Delete an API key. The key stops working for authentication immediately."
lastUpdated: "2026-11-04"
---

> **For AI agents:** the complete documentation index is at [llms.txt](https://trillet-ai.jamdesk.app/llms.txt). Append `.md` to any page URL for its markdown version.

You can only delete keys that belong to you. Another user's key, or a workspace service key, returns `404`.

<Note>
Your role needs the `api_keys:delete` permission. Otherwise the request fails with `403 {"error": "Insufficient permissions", ...}`. Connected apps (OAuth tokens) get `403 {"error": "API keys cannot be managed by connected apps."}`.
</Note>

## Headers
<ParamField header="x-workspace-id" type="string" required>
The workspace used for the permission check.
</ParamField>

## Path Parameters

<ParamField path="id" type="string" required>
The key record's `_id` (not the key itself).
</ParamField>

## Response Fields

<ResponseField name="success" type="boolean">
`true` when the key was deleted.
</ResponseField>

## Errors

| Status | Body | When |
| --- | --- | --- |
| `403` | `{"error": "Insufficient permissions", ...}` | Your role lacks `api_keys:delete` |
| `403` | `{"error": "API keys cannot be managed by connected apps."}` | The request used an OAuth (connected app) token |
| `404` | `{"error": "API key not found"}` | No key with that ID belongs to you |
| `500` | `{"error": "Internal server error", "message": "..."}` | Unexpected server error |

<ResponseExample>
```json
{
  "success": true
}
```
</ResponseExample>


---

📦 **OpenAPI specs:** Every OpenAPI specification referenced by this documentation is available as a single download — https://trillet-ai.jamdesk.app/api-specs.zip
