Skip to main content
POST
Create an API key for a merchant

Authorizations

Authorization
string
header
required

JWT token for user authentication

Path Parameters

merchantId
string
required

The merchant ID

Body

application/json
name
string
required

Client-chosen label to identify the key

Maximum string length: 100
Example:

"Production backend"

expires_at
string<date-time>

Future datetime when the key stops authenticating; omit for a non-expiring key

Example:

"2027-01-01T00:00:00Z"

permissions
string[]

Permission strings granted to the key (see GET /v1/permissions); omit for full access

Minimum array length: 1
Example:

Response

The created API key, including the full key (shown once)

id
string
required
Example:

"123e4567-e89b-12d3-a456-426614174000"

name
string
required
Example:

"Production backend"

prefix
string
required

First 7 characters of the key, for masked display

Example:

"ak_Ab12"

last4
string
required

Last 4 characters of the key, for masked display

Example:

"x9Zk"

permissions
string[]
required
Example:
last_used_at
string<date-time> | null
required

Last authentication with this key (updated at most every 5 minutes)

Example:

"2026-07-20T12:00:00Z"

expires_at
string<date-time> | null
required

When the key stops authenticating; null means it never expires

Example:

null

revoked_at
string<date-time> | null
required

When the key was revoked; null means it is active

Example:

null

created_at
string<date-time>
required
Example:

"2026-07-01T00:00:00Z"

key
string
required

The full API key. Shown only in this response — store it securely; it cannot be retrieved again.

Example:

"ak_Ab12Cd34Ef56Gh78Ij90Kl12Mn34Op56Qr78x9Zk"