Create API key
POST
/keys
Returns a JWT bearer token usable directly as the API key. The full token is shown once; only metadata (id, name, expiry) is retrievable later.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”Request to create a new API key.
object
expires_in_days
Optional expiration in days from now.
integer | null format: int64
name
required
Human-readable name for the key.
string
role
Role for the API key (defaults to member if not specified).
string | null
Example
{ "expires_in_days": 90, "name": "ci-deploy-key", "role": "member"}Responses
Section titled “ Responses ”Created
API key creation response. The key field contains a JWT bearer token
usable directly in the Authorization header. Shown only once.
object
api_key_id
required
Unique key identifier.
string format: uuid
created_at
required
When the key was created.
string format: date-time
expires_at
When the key expires.
string | null format: date-time
key
required
The JWT bearer token (store securely, only shown once).
string
name
required
Human-readable name.
string
role
required
Role assigned to this key.
string
Example
{ "api_key_id": "b4d2f8a0-1c3e-4f5a-9b6d-7e8f90a1b2c3", "created_at": "2025-01-15T10:30:00Z", "expires_at": "2025-04-15T10:30:00Z", "key": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...", "name": "ci-deploy-key", "role": "member"}Name must not be empty
Unauthorized
API key tokens cannot manage API keys
Server error