POST/api-keys/create

Create an API key

Creates a new API key with a display name and optional expiration date. Supply name and, if the key should expire, set expiresAt to an ISO 8601 datetime. The created key's token is shown only once.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

2 body fields

API key details, including its required display name and optional expiration date.

expiresAtstringoptional
Expiration date in ISO 8601 format (e.g. `2025-12-31T23:59:59Z`). If omitted, the key does not expire.
namestringrequired
Display name for the API key (e.g. "CI/CD Pipeline").

3 status codes
200Returns the created API key; its token is shown only once.
dataobjectoptional
statusintegeroptional
successbooleanoptional
400Returned when the request fails validation.
errorstringoptional
Reason phrase, for example `Bad Request`.
messagestringoptional
statusCodeintegeroptional
403Returned when the authenticated user is forbidden from creating an API key.
errorstringoptional
Reason phrase, for example `Bad Request`.
messagestringoptional
statusCodeintegeroptional

Error handling

A 400 is returned when name is missing or the request fails validation; expiresAt, when provided, must be an ISO 8601 datetime. A 403 is returned when the authenticated user is forbidden from creating an API key.