Skip to main content
POST

Authorizations

Authorization
string
header
required

Send Authorization: Bearer tst_live_….

Format (services/api-keys.ts): the literal prefix tst_live_ followed by 24 random bytes rendered as 32 base64url characters. Only the SHA-256 hash is stored server-side. The shape check that routes a token down the API-key path rather than the Clerk JWT path requires the tst_live_ prefix and a total length of at least 25 characters.

Keys are minted in the dashboard at /settings/team. The same header also accepts a Clerk session JWT, which is how the web app authenticates, but the JWT path is out of scope for this document.

Body

application/json
name
string
required

Label for the key, e.g. GitHub Actions. Trimmed, then truncated to 80 characters at storage.

Required string length: 1 - 80
expiresAt

Optional expiry as an ISO-8601 string (max 80 characters) or a positive integer of epoch milliseconds. Must parse and must be in the future. Null or omitted means the key never expires.

Response

Key created. This is the only response that ever contains the plaintext key.

The 201 body of POST /api/keys. The only place the plaintext key ever appears.

id
string<uuid>
required
name
string
required
prefix
string
required
key
string
required

The plaintext key. Shown once and never recoverable. Only its SHA-256 hash is stored. Send it as Authorization: Bearer <key>.

Example:

"tst_live_a1b2C3d4E5f6G7h8I9j0K1l2M3n4O5p6"

createdAt
string<date-time>
required