Skip to main content
POST
Create an API key

Authorizations

oc_session
string
cookie
required

The console's session cookie (httpOnly, SameSite=Lax, 30 days), set by signup and login.

Body

application/json
name
string
required

What the key is for, like ci; usage groups by it.

Required string length: 1 - 64
kind
enum<string>

Defaults to personal for a person. Only an owner may make a service key; the operator's keys are always service.

Available options:
personal,
service

Response

The new key, with its secret.

key
string
required

The secret, sk_offstage_…. Shown this once only; send it as Authorization: Bearer <key>.

Pattern: ^sk_offstage_
id
string
required

key_….

Pattern: ^key_
keyId
string
required

The same as id.

Pattern: ^key_
name
string
required
mask
string
required
createdAt
integer
required

A time, in Unix milliseconds.

Required range: x >= 0
lastUsedAt
integer | null
required
createdBy
object | null
required
kind
enum<string>
required

personal: made by a person; revoked when they leave or are removed from the team, or recover the account (password reset, or a GitHub/Google sign-in reclaiming an unverified account). service: the team's (an owner's on purpose, or the operator's); revoked only explicitly.

Available options:
personal,
service