# Update API key

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

Endpoint: PATCH /public/v1/accounts/tokens/{token_id}/
Version: 1.0.0
Security: Bearer

## Path parameters:

  - `token_id` (integer, required)

## Request fields (application/json):

  - `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,null)
    Expiration timestamp (ISO 8601). Pass null to remove the expiration and make the token non-expiring.

  - `scopes` (array)
    Replacement list of scopes for the token. Available value: all.

## Response 200 fields (application/json):

  - `id` (integer, required)
    Unique identifier for the API key token.

  - `name` (string, required)
    Human-readable label for the token.

  - `scopes` (array, required)
    Scopes granted to the token.

  - `active` (boolean, required)
    Whether the token is currently active.

  - `expires_at` (string,null)
    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, required)
    When the token was created.

  - `last_used_at` (string,null)
    When the token was last used to authenticate a request, or null if never used.


## Response 400 fields

## Response 401 fields

## Response 422 fields
