---
title: "Update Api Key"
method: PATCH
path: "/api/api-keys/{key_id}"
tags: ["api-keys"]
---

# Update Api Key

`PATCH /api/api-keys/{key_id}`

## Request

- Base URL: `https://app.ctlsurf.com` (the document declares no server; this is the origin it was published from)
- URL: `https://app.ctlsurf.com/api/api-keys/{key_id}`
- Auth: HTTP bearer

Update an API key (e.g., deactivate it).

## Path parameters

- `key_id` string, uuid, required

## Request body

- ApiKeyUpdate: Schema for updating an API key.
  - `is_active` boolean, nullable

## Response `200`

Successful Response

- ApiKeyResponse: Schema for API key response (without the actual key).
  - `id` string, uuid, required
  - `name` string, required
  - `key_prefix` string, required
  - `is_active` boolean, required
  - `created_at` string, date-time, required
  - `last_used_at` string, date-time, nullable

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/ctlsurf/apis/notebook-control-plane.md) · [All operations](https://skmtc.dev/ctlsurf/apis/notebook-control-plane/llms.txt) · [OpenAPI document](https://skmtc.dev/ctlsurf/apis/notebook-control-plane/revisions/ddfbbe20d5ce?raw)
