Hand the running server a renewed license key
const url = 'https://example.com/v1/license';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"key":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://example.com/v1/license \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "key": "example" }'What the renewal hands the deployment’s running server (kindgi license renew --runtime), so it runs the new key without a restart. The server checks the key offline, as it does at a start: signed by a key it trusts, for the same licensee and use as the key it runs, and newer (a later exp, or the same exp and an iat no earlier). The same key again is taken as it is. It answers the license status with the new key. Only the deployment’s own token (KINDGI_API_TOKEN), or a system key holding system:license, hands it a key; anyone else is refused (license-operator-only), and the refusal recorded, before the body is read. A deployment that doesn’t take a key this way answers 404.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Examplegenerated
{ "key": "example"}Responses
Section titled “Responses”The license status, with the new key.
object
Example
{ "mode": "development", "use": "production", "standing": "valid", "renewBy": "command", "preview": { "standing": "valid" }}The body isn’t { "key": "kgi_lk_…" } (bad-input).
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" }}Not the deployment’s own token or a system key holding system:license (license-operator-only). On a runtime serving one tenant, a system key holding anything but system:license (system-key-scope-not-served).
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}The server checked the key and refused it (license-key-refused; error.details.reason: malformed, unknown-key, bad-signature, not-yet-valid, expired, other-licensee, other-use or older). It runs on with the key it has.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}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" }}rate-limit-exceeded with details.limit: "api-requests", on a runtime that sets workspace limits (Kindgi Cloud): this workspace’s limit on API requests a minute is reached, so the request wasn’t run; Retry-After says when to send it again.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Headers
Section titled “Headers”The authorization store couldn’t be reached (authz-backend-unavailable), or the database was too busy for the authorization check (database-busy), so the request wasn’t run; Retry-After (whole seconds) says when to try again. Or tenant-state-unavailable (with Retry-After), on a runtime serving many workspaces: the workspace’s state couldn’t be read, so nothing was changed.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Headers
Section titled “Headers”See also
GET /v1/license: Where the deployment's license key stands- Kindgi 0.7.0
- Kindgi 0.8.0
- Error code
authz-backend-unavailable - Error code
bad-input - Error code
database-busy - Error code
license-key-refused - Error code
license-operator-only - Error code
rate-limit-exceeded - Error code
request-too-large - Error code
system-key-scope-not-served - Error code
tenant-state-unavailable - Every error code