---
title: "Remove someone from an API key"
method: DELETE
path: "/api-keys/{id}/shares/{userId}"
tags: ["Account"]
---

# Remove someone from an API key

`DELETE /api-keys/{id}/shares/{userId}`

## Request

- Base URL: `https://api.varg.ai/v2`
- URL: `https://api.varg.ai/v2/api-keys/{id}/shares/{userId}`
- Auth: HTTP bearer

Ends a person's access to the key. The key's owner (or a manager of the
owning team) can remove anyone; a person the key is shared with can
remove themselves. Requires an app session (Supabase JWT), not an API key.

## Path parameters

- `id` string, uuid, required
- `userId` string, uuid, required

## Response `200`

Access removed

- object
  - `deleted` boolean, required

## Other responses

- `401`: Missing or invalid API key / JWT
- `403`: Only app sessions can manage API keys (API keys and connected applications are rejected)
- `404`: Unknown API key, or the key is not shared with that person (`share_not_found`)

## Changes

- **2026-10-20** `43bcf5ea398d`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/varg/apis/varg-api/changes/api-keys/:id/shares/:userId/delete.md)

---

[API](https://skmtc.dev/varg/apis/varg-api.md) · [All operations](https://skmtc.dev/varg/apis/varg-api/llms.txt) · [OpenAPI document](https://skmtc.dev/varg/apis/varg-api/revisions/09d49a6d852f?raw)
