Skip to content

Create API Key

POST
/api/ApiKeys
curl --request POST \
--url https://example.com/api/ApiKeys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "merchantId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "name": "example", "expiresAt": "2026-04-15T12:00:00Z", "createdByUserId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }'

Mints a new API key. The plaintext token is included in the response exactly once — store it securely before navigating away. The server only persists a SHA-256 hash and a short prefix that’s safe to display in lists.

object
merchantId
required
string format: uuid
name
required
string
>= 1 characters <= 200 characters
expiresAt
string format: date-time
nullable
createdByUserId
string format: uuid
nullable
Example generated
{
"merchantId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"name": "example",
"expiresAt": "2026-04-15T12:00:00Z",
"createdByUserId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
}

Key created.

Media type application/json
object
outcome
string
Allowed values: Ok MerchantNotFound
id
string format: uuid
nullable
token
string
nullable
signingSecret
string
nullable
apiKey
object
id
string format: uuid
name
string
nullable
keyPrefix
string
nullable
signingSecretPrefix
string
nullable
webhookUrl
string
nullable
webhookEvents
Array<string>
nullable
webhookEnabled
boolean
expiresAt
string format: date-time
nullable
lastUsedAt
string format: date-time
nullable
revokedAt
string format: date-time
nullable
createdAt
string format: date-time
Example
{
"outcome": "Ok"
}

Merchant not found.

Media type application/json
object
type
string
nullable
title
string
nullable
status
integer format: int32
nullable
detail
string
nullable
instance
string
nullable
key
additional properties
Example generated
{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example"
}