Skip to main content
POST
/
api
/
captain
/
auth
/
api-keys
Create API key
curl --request POST \
  --url http://localhost:63372/api/captain/auth/api-keys \
  --header 'Content-Type: application/json' \
  --cookie captain_session= \
  --data '
{
  "name": "CI Pipeline"
}
'
{
  "id": "uuid",
  "name": "CI Pipeline",
  "key": "cptn_abcdef...",
  "prefix": "cptn_abcdef"
}

Authorizations

captain_session
string
cookie
required

HMAC-signed session cookie returned by /api/captain/auth/login. Valid for 7 days. Invalidated when password changes.

Body

application/json
name
string
required
Example:

"CI Pipeline"

Response

API key created. The key field is only returned once.

id
string<uuid>
required
Example:

"uuid"

name
string
required
Example:

"CI Pipeline"

key
string
required

Full API key. Only returned once - store securely.

Example:

"cptn_abcdef..."

prefix
string
required
Example:

"cptn_abcdef"