Skip to main content
POST
Create an API key for an agent or CI

Authorizations

Authorization
string
header
required

An API key (pch_...) or the token from pch login.

Body

application/json
name
string
required
Required string length: 1 - 100
scopes
enum<string>[]
Minimum array length: 1
Available options:
read,
publish,
admin
expires_in_days
integer
Required range: 1 <= x <= 3650

Response

The new key, shown once

id
string<uuid>
required
name
string | null
required
start
string | null
required

The first characters, to tell keys apart

scopes
enum<string>[]
required
Available options:
read,
publish,
admin
created_at
string
required
expires_at
string | null
required
last_used_at
string | null
required
key
string
required

Shown once. Starts with pch_.