POST
Issue an API key

Authorizations

Authorization
string
header
required

Authorization: Bearer twk_<prefix>_<secret>.

The prefix is public and safe to log: it is what identifies which credential leaked. The secret is never logged, never returned after creation, and stored only as a SHA-256 hash.

Body

application/json
name
string
required
Maximum string length: 100
scopes
string[]
required

A caller may not grant a scope they do not hold.

Minimum array length: 1
expires_at
string<date-time>

Optional. Default 90 days, maximum 365. There is no value meaning never.

Response

The new key. secret appears here and nowhere else, ever.

api_key
object
secret
string
warning
string