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

# API Key - Create

`POST /api_keys/{merchant_id}`

Create a new API Key for accessing our APIs from your servers. The plaintext API Key will be
displayed only once on creation, so ensure you store it securely.

## Path parameters

- `merchant_id` string, required

## Request body

- CreateApiKeyRequest — The request body for creating an API Key.
  - `name` string, required — 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, required
    - 'never'
    - string, date-time

## Response `200`

API Key created

- CreateApiKeyResponse — The response body for creating 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.
  - `api_key` string, required — The plaintext API Key used for server-side API access. Ensure you store the API Key securely as you will not be able to see it again.
  - `created` string, date-time, required — The time at which the API Key was created.
  - `expiration` union, required
    - 'never'
    - string, date-time

## Other responses

- `400` — Invalid data

---

[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)
