Saltar al contenido principal
POST
Create a key

Autorizaciones

x-api-key
string
header
requerido

Cuerpo

application/json
name
string
requerido

Where the key is used, e.g. ERP.

Maximum string length: 80
permissions
enum<string>[]
requerido

What the key may do. A write brings the reads it needs.

Minimum array length: 1

A permission a key can hold. See Key permissions.

Opciones disponibles:
payment:read,
refund:write,
oneTimePayment:read,
oneTimePayment:write,
paymentLink:read,
subscription:read,
paymentMethod:read,
paymentMethod:write,
paymentIntent:read,
paymentIntent:write,
terminal:read,
salesperson:read,
product:read,
promotion:read,
fee:read,
payout:read,
bankAccount:read,
organization:read,
member:read,
apiKey:write
expiresAt
string<date-time> | null

When the key stops working: between 1 hour and 2 years from now. null or omitted: never.

Respuesta

Created. The only response that carries the whole key.

An API key. Never its secret, which only the responses that create or rotate a key carry.

id
string<uuid>
requerido
name
string | null
requerido
start
string | null
requerido

The first characters of the secret, e.g. cmp_7Hk2.

lastFour
string | null
requerido

The last four characters of the secret. null on keys created before they were recorded.

status
enum<string>
requerido
Opciones disponibles:
active,
disabled,
expired
fullAccess
boolean
requerido

true for a key created before permissions: it holds every permission but apiKey:write, including ones added later.

permissions
enum<string>[]
requerido

What the key holds, each write with the reads it needs.

A permission a key can hold. See Key permissions.

Opciones disponibles:
payment:read,
refund:write,
oneTimePayment:read,
oneTimePayment:write,
paymentLink:read,
subscription:read,
paymentMethod:read,
paymentMethod:write,
paymentIntent:read,
paymentIntent:write,
terminal:read,
salesperson:read,
product:read,
promotion:read,
fee:read,
payout:read,
bankAccount:read,
organization:read,
member:read,
apiKey:write
expiresAt
string<date-time> | null
requerido

When the key stops working. null if it never expires.

lastUsedAt
string<date-time> | null
requerido

The last request made with the key, to the minute.

createdAt
string<date-time>
requerido
replacedBy
string<uuid> | null
requerido

Set once the key was rotated: the id of the key that replaced it. This one works until expiresAt.

key
string
requerido

The whole key, starting with cmp_. Shown only in this response: store it now.