---
title: "Generate new API key"
method: POST
path: "/merchants/{merchantId}/apiCredentials/{apiCredentialId}/generateApiKey"
tags: ["API key - merchant level"]
---

# Generate new API key

`POST /merchants/{merchantId}/apiCredentials/{apiCredentialId}/generateApiKey`

Returns a new API key for the API credential. You can use the new API key a few minutes after generating it. The old API key stops working 24 hours after generating a new one.

To make this request, your API credential must have the following [roles](https://docs.adyen.com/development-resources/api-credentials#api-permissions):
* Management API—API credentials read and write

## Path parameters

- `merchantId` string, required
- `apiCredentialId` string, required

## Response `200`

OK - the request has succeeded.

- GenerateApiKeyResponse
  - `apiKey` string, required — The generated API key.

## Other responses

- `204` — No Content - the request has been successfully processed, but there is no additional content.
- `400` — Bad Request - a problem reading or understanding the request.
- `401` — Unauthorized - authentication required.
- `403` — Forbidden - insufficient permissions to process the request.
- `422` — Unprocessable Entity - a request validation error.
- `500` — Internal Server Error - the server could not process the request.

---

[API](https://skmtc.net/adyen/apis/management-api.md) · [All operations](https://skmtc.net/adyen/apis/management-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/adyen/management-api/revisions/1089ade06e17/schema)
