Mint a system key
const url = 'https://example.com/v1/system/keys';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"scopes":["system:tenants"],"label":"example","expiresAt":"2026-04-15T12:00:00Z"}'};
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://example.com/v1/system/keys \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "scopes": [ "system:tenants" ], "label": "example", "expiresAt": "2026-04-15T12:00:00Z" }'A system key (kgi_sy_…) is the operator’s, for a service that acts for it (sign-up, the orchestrator, billing, the license renewal), with the least scope that service needs. It acts in no tenant: it reaches /v1/system/* and the deployment’s license, and every other route refuses it (system-key-on-tenant-route). Every request it makes is recorded. Only the full system capability (kindgi:system: the deployment’s own token, or a full system key) mints one, and a key can’t outlive the key minting it. Returns the plaintext token exactly once. On a runtime serving one tenant, only the deployment’s own token reaches the system keys, and a key holds system:license alone: it reads GET /v1/license and GET /v1/license/usage, and hands the running server a renewed key (PUT /v1/license), for the license renewal, and every other route refuses it.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
Responses
Section titled “Responses”System key minted.
The new system key, plus its secret.
object
Example
{ "scopes": [ "system:tenants" ]}Malformed request body: no scopes, one that is not a system scope, a scope twice, kindgi:system beside another, a past expiresAt, or an empty label; on a runtime serving one tenant, any scope but system:license.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Missing / malformed / expired / revoked bearer token.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}A tenant’s key or session (system-principal-required); a scoped system key (system-scope-missing, details.scope kindgi:system; on a runtime serving one tenant, system-key-scope-not-served for one holding anything but system:license); a key that would outlive the key minting it (token-expiry-exceeds-minter, its details.latestExpiresAt the latest allowed); a full key minted by another system key without expiresAt (system-key-expiry-required: only the deployment’s own token mints one that never expires).
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Idempotency-Key reused with a different body (idempotency-key-body-mismatch), or a retry of a request that succeeded: its answer carried a secret, which isn’t kept (idempotency-key-replay-withheld). Or idempotency-key-in-flight (with Retry-After): a request with the same Idempotency-Key still runs, so this one wasn’t run; send it again after Retry-After to get that request’s answer.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Headers
Section titled “Headers”The request body is over the API’s limit (request-too-large; details.maxBytes says how much).
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Server error (unmapped domain code or framework crash).
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}The operator’s access record can’t be written, so nothing was done (access-record-unavailable): a request that changes something is recorded before it acts. Or the Idempotency-Key store couldn’t be read before the request ran (idempotency-store-unavailable, with Retry-After), so nothing was changed. Or the authorization store couldn’t be reached (authz-backend-unavailable, with Retry-After), or the database was too busy for the authorization check (database-busy, with Retry-After), so the request wasn’t run.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Headers
Section titled “Headers”See also
GET /v1/system/keys: List system keysPOST /v1/system/keys/{keyId}/revoke: Revoke a system key- Error code
access-record-unavailable - Error code
authz-backend-unavailable - Error code
database-busy - Error code
idempotency-key-body-mismatch - Error code
idempotency-key-in-flight - Error code
idempotency-key-replay-withheld - Error code
idempotency-store-unavailable - Error code
request-too-large - Error code
system-key-expiry-required - Error code
system-key-scope-not-served - Error code
system-principal-required - Error code
system-scope-missing - Error code
token-expiry-exceeds-minter - Every error code