API Key - Create
Create an API Key.
POST /v2/api-keys
Request (cURL)
curl --request POST \
--url https://sandbox.hyperswitch.io/v2/api-keys \
--header 'Content-Type: application/json' \
--header 'api-key: <api-key>' \
--data '
{
"name": "Sandbox integration key",
"expiration": "never",
"description": "Key used by our developers to integrate with the sandbox environment"
}
'Authorizations
Header:
api-key(string) — required Admin API keys allow privileged actions such as creating a merchant account and Connector account.
Body (application/json)
The request body for creating an API Key.
name (string, required) A unique name for the API Key to help you identify it. Maximum length: 64 Example:
"Sandbox integration key"expiration (enum|string, required) Available options:
neverdescription (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"
Response (200 — application/json)
API Key created
Response fields:
key_id (string, required) — Identifier for the API Key. Max length: 64. Example:
"5hEEqkgJUyuxgSKGArHA4mWSnX"merchant_id (string, required) — 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"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. Max length: 128
created (string, required) — Creation timestamp. Example:
"2022-09-10T10:11:12Z"expiration (enum|string, required) — Available options:
neverdescription (string | null) — Description for the API Key. Max length: 256. Example:
"Key used by our developers to integrate with the sandbox environment"
Store the returned api_key securely when created — it will not be shown again.
Related
Connector Account - Update: https://api-reference.hyperswitch.io/v2/connector-account/connector-account--update
API Key - Retrieve: https://api-reference.hyperswitch.io/v2/api-key/api-key--retrieve
Suggest edits: https://github.com/juspay/hyperswitch/edit/main/api-reference/v2/api-key/api-key--create.mdx Raise issue: https://github.com/juspay/hyperswitch/issues/new?title=Issue%20on%20docs&body=Path:%20/v2/api-key/api-key--create