Create API key
const url = 'https://localhost:8080/api/v1/api-keys';const options = { method: 'POST', headers: {Authorization: '<Authorization>', 'Content-Type': 'application/json'}, body: '{"allowedIps":["example"],"description":"example","expiresAt":"2026-12-31T23:59:59Z","name":"example","organizationId":1,"projectId":1,"scopes":["example"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://localhost:8080/api/v1/api-keys \ --header 'Authorization: <Authorization>' \ --header 'Content-Type: application/json' \ --data '{ "allowedIps": [ "example" ], "description": "example", "expiresAt": "2026-12-31T23:59:59Z", "name": "example", "organizationId": 1, "projectId": 1, "scopes": [ "example" ] }'Create a new API key for service-to-service authentication. JWT/session only — API keys cannot manage API keys. Scopes must be grantable by the creator; "" is organization-owner only, and "" or empty is rejected when projectId binds the key. expiresAt is required, in the future, within 365 days
Authorizations
Section titled “Authorizations ”Request Body
Section titled “Request Body ”API key configuration
object
Enforced on every request when set
Future, within MaxAPIKeyLifetime
Example
2026-12-31T23:59:59ZScopes the key to an organization
Scopes the key to a project
”*” (full access) must be alone
Responses
Section titled “ Responses ”Created API key (key shown only once)
A newly created API key together with its plaintext secret, which is shown only in this response
object
An API key for service-to-service authentication; the secret itself is never returned here
object
Set via the revoke endpoint
Resolved from the caller
Only returned once during creation
Example
{ "apiKey": { "status": "active" }}Bad request - Invalid body, name, description, expiry, or scopes
Error body returned across the auth endpoints; the message is human-readable and not a stable identifier
object
Example
{ "error": "Unauthorized", "error_description": "Invalid token"}Unauthorized - Authentication required
Error body returned across the auth endpoints; the message is human-readable and not a stable identifier
object
Example
{ "error": "Unauthorized", "error_description": "Invalid token"}Forbidden - API keys cannot manage API keys
Error body returned across the auth endpoints; the message is human-readable and not a stable identifier
object
Example
{ "error": "Unauthorized", "error_description": "Invalid token"}Internal server error
Error body returned across the auth endpoints; the message is human-readable and not a stable identifier
object
Example
{ "error": "Unauthorized", "error_description": "Invalid token"}