---
title: "Revoke (delete) one of the current user's API keys by id."
method: DELETE
path: "/api/v1/api-keys"
tags: ["api-keys"]
---

# Revoke (delete) one of the current user's API keys by id.

`DELETE /api/v1/api-keys`

Cookie session only — never inspects Authorization header; pm_live_ Bearer NOT accepted. Delete filters on both id=keyId and user_id=current user, so a user can only revoke their own keys. No workspace role check (unlike POST). Returns a fixed { success:true, message } body regardless of whether a row actually matched.

## Request body

- object
  - `keyId` string, required — Id of the api_keys row to delete; scoped to the authenticated user (eq user_id).

## Response `200`

Key revoked (delete is scoped to eq id + eq user_id; succeeds even if no row matched).

- object

## Other responses

- `400` — Missing keyId.
- `401` — No valid session cookie (API keys not accepted).
- `429` — Rate limit exceeded (apiKeysWrite bucket, 20/h).
- `500` — Delete failure or internal error.
- `503` — SUPABASE_SERVICE_ROLE_KEY not configured (admin client unavailable).

---

[API](https://skmtc.dev/pathmode/apis/pathmode-api.md) · [All operations](https://skmtc.dev/pathmode/apis/pathmode-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/pathmode/pathmode-api/revisions/e419abb0a327/schema)
