Skip to main content
POST
Create an API key

Authorizations

scribe_session
string
cookie
required

Browser session cookie set by the WorkOS sign-in flow.

Body

application/json

Key name, access level, and optional expiry.

Create a new API key.

name
string
required

Human-readable name for the new key.

Required string length: 1 - 120
Example:

"CI docs bot"

access
enum<string>
required

Access level to grant the new key: read, comment, or edit.

Available options:
read,
comment,
edit
Example:

"read"

expiresInDays
integer

Days until the key expires. Omit for a non-expiring key.

Required range: 1 <= x <= 3650
Example:

90

Response

The created key with its secret token. The token cannot be retrieved again.

A freshly created API key together with its secret token (returned only once).

key
object
required

An organization-scoped API key (agent credential). Never contains the secret token.

Example:
token
string
required

The full secret token. Shown exactly once — it cannot be retrieved again.

Example:

"scrb_agt_AbCdEfGhIjKlMnOpQrStUvWxYz0123456789AbCdEfGh"