Create API key

View as Markdown

Issues a new API key for the organization. Body: { name: string (1-255 chars, required), permissions?: string[] (default []), v1Only?: boolean (default false) }. The plaintext key value is returned ONCE in this 201 response and is never retrievable again. Authorization: organization administrators only. Returns 400 on an invalid body.

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Request

This endpoint expects an object.
namestringRequired1-255 characters
permissionslist of stringsOptionalDefaults to []
The permission slugs the key carries.
v1OnlybooleanOptionalDefaults to false

When true, the key may only call the public /v1 API; every other route answers 403 api_key_v1_only.

Response

The created API key, including its one-time plaintext value.

idstring
namestring
permissionslist of strings
v1Onlyboolean

Restricted to the public /v1 API — all other routes answer 403.

lastUsedAtdatetime or null
createdAtdatetime
createdByobject or null
Who created the key, or null when that is not known.
valuestring
The plaintext key. Returned ONCE, at creation, and never retrievable again.