---
title: "Update API key"
method: PATCH
path: "/public/v1/accounts/tokens/{token_id}/"
tags: ["API Keys"]
---

# Update API key

`PATCH /public/v1/accounts/tokens/{token_id}/`

Update an API key's label, active status, expiration date, or scopes. Pass `null` for `expires_at` to remove expiration.

## Path parameters

- `token_id` integer, required

## Request body

- TokenUpdateRequest
  - `name` string — Human-readable label for the token, shown in the token list.
  - `active` boolean — Set to `false` to deactivate the token, or `true` to reactivate it.
  - `expires_at` string, date-time, nullable — Expiration timestamp (ISO 8601). Pass `null` to remove the expiration and make the token non-expiring.
  - `scopes` string[] — Replacement list of scopes for the token. Available value: `all`.

## Response `200`

- Token
  - `id` integer, required — Unique identifier for the API key token.
  - `name` string, required — Human-readable label for the token.
  - `scopes` string[], required — Scopes granted to the token.
  - `active` boolean, required — Whether the token is currently active.
  - `expires_at` string, date-time, nullable — Expiration timestamp, or null if the token never expires.
  - `token` string — The API key value used as the Bearer credential. Returned in full on every read.
  - `created_at` string, date-time, required — When the token was created.
  - `last_used_at` string, date-time, nullable — When the token was last used to authenticate a request, or null if never used.

## Other responses

- `400` — Validation error
- `401` — Unauthorized — missing or invalid API key.
- `403` — Forbidden — caller is not permitted to perform this action.
- `404` — Token not found
- `422` — Unprocessable entity — validation failed.
- `429` — Too Many Requests — rate or capacity limit exceeded. Inspect the `Retry-After` header and the `retry_after` body field for the wait time in seconds.

## Changes

- **2026-08-18** `87e654ac822e` — 13 info
  - added the media type `application/json` for the response with the status `400`
  - added the non-success response with the status `403`
  - added the non-success response with the status `429`
  - added the optional property `active_batches` to the response with the `404` status
  - …9 more

[Change history](https://skmtc.dev/influencers/apis/core-api-concepts/changes/public/v1/accounts/tokens/:token_id/patch.md)

---

[API](https://skmtc.dev/influencers/apis/core-api-concepts.md) · [All operations](https://skmtc.dev/influencers/apis/core-api-concepts/llms.txt) · [OpenAPI document](https://skmtc.dev/influencers/apis/core-api-concepts/revisions/8e30ca66a18c?raw)
