Create API key
POST
/keys
The plaintext key is only returned once and must be stored securely. The service will not provide the plaintext key again after creation.
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 (includes plaintext key, 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 (if set).
string | null format: date-time
key
required
The plaintext API key (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": "pat_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6", "name": "ci-deploy-key", "role": "member"}Name must not be empty
Unauthorized
Server error