---
title: "Update a vault key"
method: PATCH
path: "/v2/directories/{directoryId}/vault/keys/{keyId}"
tags: ["TokenVaultKeys"]
---

# Update a vault key

`PATCH /v2/directories/{directoryId}/vault/keys/{keyId}`

## Request

- Base URL: `https://global.api.konghq.com`
- URL: `https://global.api.konghq.com/v2/directories/{directoryId}/vault/keys/{keyId}`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer
  - HTTP bearer
  - HTTP bearer

Partially updates an existing vault key. Only the key's name can be changed;
the public key material is immutable. A PUT operation is not offered because
key material cannot be replaced.

## Path parameters

- `directoryId` string, uuid, required
- `keyId` string, uuid, required

## Request body

- PatchVaultKeyBody
  - `name` string, nullable

## Response `200`

A vault key

- VaultKey: A PEM-encoded RSA or EC public key registered to encrypt token vault data for a token-vault enabled directory.
  - `id` string, uuid, required: Contains a unique identifier used for this resource.
  - `directory_id` string, uuid, required: Contains a unique identifier used for this resource.
  - `name` string, required
  - `public_key` string, required: The PEM-encoded public key.
  - `kid` string, required: RFC 7638 JWK thumbprint (base64url-encoded SHA-256 digest) of the public key.
  - `algorithm` 'RSA' | 'EC', required: The asymmetric algorithm of the vault key.
  - `key_size` integer, required: Size of the key in bits (for example 2048 for RSA, 256 for EC P-256).
  - `created_at` string, date-time, required: An ISO-8601 timestamp representation of entity creation date.
  - `updated_at` string, date-time, required: An ISO-8601 timestamp representation of entity update date.

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found

## Changes

- **2026-11-05** `f018071a4515`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/kong/apis/konnect-api/changes/v2/directories/:directoryId/vault/keys/:keyId/patch.md)

---

[API](https://skmtc.dev/kong/apis/konnect-api.md) - [All operations](https://skmtc.dev/kong/apis/konnect-api/llms.txt) - [OpenAPI document](https://skmtc.dev/kong/apis/konnect-api/revisions/5da43f6209ea?raw)
