---
title: "Update API key"
method: PATCH
path: "/api-keys/{id}"
tags: ["API Keys"]
---

# Update API key

`PATCH /api-keys/{id}`

## Request

- Base URL: `https://xquik.com/api/v1`
- URL: `https://xquik.com/api/v1/api-keys/{id}`
- Auth: API key in cookie `__Host-xquik_session`

Renames an active API key or changes its scope. Send name, scope or both.

## Path parameters

- `id` string, required

## Request body

- object
  - `name` string: Up to 100 characters. An empty name saves the key as Default.
  - `scope` 'full' | 'paid_reads': The scope to save. The key's next request uses it.

## Response `200`

API key updated

- ApiKey: API key metadata returned when listing keys.
  - `id` string, required
  - `name` string, required
  - `prefix` string, required
  - `scope` 'full' | 'paid_reads', required: full calls every route an API key can use. paid_reads calls paid X read routes only, & other routes answer it with 403.
  - `isActive` boolean, required
  - `createdAt` string, date-time, required
  - `expiresAt` string, date-time: When the key stops working. Missing when it never expires.
  - `lastUsedAt` string, date-time: When the key last made a request. Missing until it does.

## Other responses

- `400`: Invalid input. A value past its maxLength gets this answer, & the message names the field & its limit.
- `401`: Unauthenticated
- `403`: An API key or OAuth token called a route that needs a dashboard session. Sign in at dashboard.xquik.com/account instead.
- `404`: Not found
- `429`: Too many requests right now. Each user gets 500 reads a second. Each minute allows 120 writes & 60 deletes. `x_api_rate_limited` means X limits this read for now. Neither answer costs anything. Wait for the seconds in `Retry-After`, then retry.

## Changes

- **2026-10-22** `cfc837dd4f9d`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/xquik-dev/apis/xquik-api/changes/api-keys/:id/patch.md)

---

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