---
title: "API Key - Update"
method: POST
path: "/api_keys/{merchant_id}/{key_id}"
tags: ["API Key"]
---

# API Key - Update

`POST /api_keys/{merchant_id}/{key_id}`

Update information for the specified API Key.

## Path parameters

- `merchant_id` string, required
- `key_id` string, required

## Request body

- UpdateApiKeyRequest — The request body for updating an API Key.
  - `name` string, nullable — A unique name for the API Key to help you identify it.
  - `description` string, nullable — A description to provide more context about the API Key.
  - `expiration` union
    - 'never'
    - string, date-time

## Response `200`

API Key updated

- RetrieveApiKeyResponse — The response body for retrieving an API Key.
  - `key_id` string, required — The identifier for the API Key.
  - `merchant_id` string, required — The identifier for the Merchant Account.
  - `name` string, required — The unique name for the API Key to help you identify it.
  - `description` string, nullable — The description to provide more context about the API Key.
  - `prefix` string, required — The first few characters of the plaintext API Key to help you identify it.
  - `created` string, date-time, required — The time at which the API Key was created.
  - `expiration` union, required
    - 'never'
    - string, date-time

## Other responses

- `404` — API Key not found

---

[API](https://skmtc.net/hyperswitch/apis/dynamic-routing-openapi-3-0.md) · [All operations](https://skmtc.net/hyperswitch/apis/dynamic-routing-openapi-3-0/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/hyperswitch/dynamic-routing-openapi-3-0/revisions/8fbf69ab2597/schema)
