API Key - Update

POST /api_keys/{merchant_id}/{key_id}

Update an API Key.

Try it: https://sandbox.hyperswitch.io/api_keys/{merchant_id}/{key_id}

Admin API keys allow you to perform some privileged actions such as creating a merchant account and Merchant Connector account.

cURL

Update API Key (cURL)
curl --request POST \
  --url https://sandbox.hyperswitch.io/api_keys/{merchant_id}/{key_id} \
  --header 'Content-Type: application/json' \
  --header 'api-key: <api-key>' \
  --data '
{
  "name": "Sandbox integration key",
  "description": "Key used by our developers to integrate with the sandbox environment",
  "expiration": "never"
}
'

Example response (200)


Authorization

  • Header: api-key (string, required)

Path parameters

  • merchant_id (string, required) The unique identifier for the merchant account.

  • key_id (string, required) The unique identifier for the API Key.

Request body (application/json)

The request body for updating an API Key.

  • name (string | null) A unique name for the API Key to help you identify it. Maximum length: 64 Example: "Sandbox integration key"

  • description (string | null) A description to provide more context about the API Key. Maximum length: 256 Example: "Key used by our developers to integrate with the sandbox environment"

  • expiration (enum | string) Available options: "never"

Response (200 — application/json)

The response body for retrieving an API Key.

  • key_id (string, required) The identifier for the API Key. Max length: 64 Example: "5hEEqkgJUyuxgSKGArHA4mWSnX"

  • merchant_id (string, required) The identifier for the Merchant Account. Max length: 64 Example: "y3oqhf46pyzuxjbcn2giaqnb44"

  • name (string, required) The unique name for the API Key. Max length: 64 Example: "Sandbox integration key"

  • prefix (string, required) The first few characters of the plaintext API Key to help you identify it. Max length: 64

  • created (string, required) The time at which the API Key was created. Example: "2022-09-10T10:11:12Z"

  • expiration (enum | string, required) Available options: "never"

  • description (string | null) The description to provide more context about the API Key. Max length: 256 Example: "Key used by our developers to integrate with the sandbox environment"


Related:

  • API Key - Retrieve: https://api-reference.hyperswitch.io/v1/api-key/api-key--retrieve

  • API Key - Revoke: https://api-reference.hyperswitch.io/v1/api-key/api-key--revoke

Suggest edits: https://github.com/juspay/hyperswitch/edit/main/api-reference/v1/api-key/api-key--update.mdx Raise issue: https://github.com/juspay/hyperswitch/issues/new?title=Issue%20on%20docs&body=Path:%20/v1/api-key/api-key--update