Mint an API key (returns the plaintext exactly once)
Creates a service API key for the authenticated user. scope=“read” (default) only allows GET/HEAD; scope=“write” enables mutations according to the user role. The plaintext secret only appears in this response.
POST
/api-keysAuthorization
AuthorizationAPI key · headerrequiredAPI key prefixed with Bearer . Alternative: the x-api-key header with the raw key. Available scopes: read and write (see /.well-known/oauth-protected-resource).
or
x-api-keyAPI key · headerrequiredRaw API key (without Bearer ), alternative to Authorization.
Header parameters
X-Workspace-IdstringActive workspace to operate on. Optional: when omitted, the default workspace of the user who owns the key is used (pickActiveOrg).
Request body
requiredapplication/jsonnamestringrequiredmin length 1 · max length 120
scopeApiKeyScoperequiredAllowed:
readwriteexpiresAtstring<date-time>matches ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
Responses
201
OK
dataApiKeyCreatedrequiredShow propertiesHide properties
idstringrequirednamestringrequiredscopeApiKeyScoperequiredAllowed:
readwritekeyPrefixstringrequiredlastUsedAtstring<date-time> | nullrequiredShow propertiesHide properties
Any of:
string<date-time>
string<date-time>null
nullexpiresAtstring<date-time> | nullrequiredShow propertiesHide properties
Any of:
string<date-time>
string<date-time>null
nullrevokedAtstring<date-time> | nullrequiredShow propertiesHide properties
Any of:
string<date-time>
string<date-time>null
nullcreatedAtstring<date-time>requiredmatches ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
keystringrequired401
Missing or invalid credential.
errorobjectrequiredShow propertiesHide properties
codestringrequiredmessagestringrequiredretryablebooleanrequireddetailsany403
Insufficient role or resource not accessible.
errorobjectrequiredShow propertiesHide properties
codestringrequiredmessagestringrequiredretryablebooleanrequireddetailsany404
Resource does not exist or is out of scope.
errorobjectrequiredShow propertiesHide properties
codestringrequiredmessagestringrequiredretryablebooleanrequireddetailsany422
Request body/parameter validation failed.
errorobjectrequiredShow propertiesHide properties
codestringrequiredmessagestringrequiredretryablebooleanrequireddetailsany
