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

# Update an API key

`PATCH /api-keys/{api-key-id}`

## Request

- Base URL: `https://api.withpersona.com/api/v1`
- URL: `https://api.withpersona.com/api/v1/api-keys/{api-key-id}`
- Auth: HTTP bearer

Updates an existing API key.

## Path parameters

- `api-key-id` string, required

## Query parameters

- `include` string
- `fields` object

## Headers

- `Key-Inflection` 'camel' | 'kebab' | 'snake'
- `Idempotency-Key` string
- `Persona-Version` '2026-09-29' | '2025-12-08' | '2025-10-27' | '2023-01-05' | '2022-09-01' | '2021-08-18' | '2021-07-05' | '2021-02-21' | '2020-05-18': Server API version. More info on versioning can be found [here](https://docs.withpersona.com/versioning).

## Request body

- object
  - `data` ApiKeysApiKeyIdPatchRequestBodyContentApplicationJsonSchemaData, required
    - `attributes` ApiKeysApiKeyIdPatchRequestBodyContentApplicationJsonSchemaDataAttributes, required
      - `name` string: Human-readable name of the API key.
      - `note` string: Human readable context about the use of the API key.
      - `api-version` '2026-09-29' | '2025-12-08' | '2025-10-27' | '2023-01-05' | '2022-09-01' | '2021-08-18' | '2021-07-05' | '2021-02-21' | '2020-05-18': Server API version. More info on versioning can be found [here](https://docs.withpersona.com/versioning).
      - `api-key-inflection` string: Default API response key inflection. Default is kebab-case.
      - `api-attributes-blocklist` string[]: Attributes blocked from API responses.
      - `ip-address-allowlist` string[]: IP addresses permitted for use by the API key.
      - `permissions` string[]: Abilities permitted to the API key.
      - `file-access-token-expires-in` integer: How soon any file access tokens returned in API responses expire. For more info see [Downloading Files](https://docs.withpersona.com/downloading-files).

## Response `200`

This endpoint returns an API key object.

- APIKeysUpdateAnApiKeyResponse200
  - `data` ApiKey, required: An API Key resource
    - `type` 'api-key'
    - `id` string
    - `attributes` ApiKeySharedAttributes
      - `name` string
      - `note` string, nullable
      - `api-version` '2026-09-29' | '2025-12-08' | '2025-10-27' | '2023-01-05' | '2022-09-01' | '2021-08-18' | '2021-07-05' | '2021-02-21' | '2020-05-18': Server API version. More info on versioning can be found [here](https://docs.withpersona.com/versioning).
      - `api-key-inflection` string
      - `api-attributes-blocklist` string[]
      - `permissions` string[]
      - `ip-address-allowlist` string[]
      - `file-access-token-expires-in` integer
      - `last-used-at` string, nullable
      - `expires-at` string, nullable
      - `created-at` string, date-time
  - `included` unknown[]: Excluded from the response by default. Will be an empty array when the `include` query parameter in the request was explicitly set to empty.
    - unknown

## Other responses

- `400`: The request was unacceptable, often due to invalid parameters.
- `401`: An invalid API key was provided.
- `403`: The given API key doesn’t have permissions to perform the request or a quota has been exceeded.
- `404`: The requested resource doesn’t exist.
- `409`: The request conflicts with another request, often due to attempting to create a duplicate resource.
- `422`: The request modifies the resource in an unacceptable way, often due to an invalid action or parameter.
- `429`: Your organization’s rate limit has been exceeded. We recommend an exponential backoff on requests.

---

[API](https://skmtc.dev/withpersona/apis/withpersona-2.md) - [All operations](https://skmtc.dev/withpersona/apis/withpersona-2/llms.txt) - [OpenAPI document](https://skmtc.dev/withpersona/apis/withpersona-2/revisions/f1c78133b3b2?raw)
