Create API key

View as Markdown
Issues a new API key for the organization. The plaintext value is returned once, at creation, and is never retrievable again.

Authentication

AuthorizationBearer

WorkOS session JWT or an organization API key, sent as Authorization: Bearer <token>.

Request

This endpoint expects an object.
namestringRequired1-255 characters
permissionslist of stringsOptionalDefaults to []
canImpersonatebooleanOptionalDefaults to false

Response

The created API key, including its plaintext value.
idstring
namestring
permissionslist of strings
canImpersonateboolean
lastUsedAtstring or null
createdAtstring
valuestring
The plaintext key, returned only at creation.

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error