---
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` — Bad request — invalid or missing parameters.
- `401` — Unauthorized — missing or invalid API key.
- `404` — Token not found
- `422` — Unprocessable entity — validation failed.

---

[API](https://skmtc.net/influencers/apis/core-api-concepts.md) · [All operations](https://skmtc.net/influencers/apis/core-api-concepts/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/influencers/core-api-concepts/versions/cd6c016f2cd6/schema)
