Skip to content

License API

The License API allows you to check the license status, generate license request codes, and apply license keys programmatically.

Tip

For complete API documentation, including request/response schemas, visit the API docs.

Warning

License endpoints are only relevant for self-hosted deployments. In managed deployments, the is_saas_deployment field from GET /api/license/expiration returns true and the UI hides all license management features.

All endpoints use the base URL of your Qualytics deployment (e.g., https://your-instance.qualytics.io/api).


Get License Info

Retrieve the license expiration date, deployment type, and grace period information.

Endpoint: GET /api/license/expiration

Permission: Admin user role

Example request and response

Request:

curl -X GET "https://your-instance.qualytics.io/api/license/expiration" \
  -H "Authorization: Bearer YOUR_TOKEN"

Response (active license):

{
  "license_expiration": "2027-12-30T21:00:00Z",
  "is_saas_deployment": false,
  "days_since_first_db_creation": 45
}

Response (no license):

{
  "license_expiration": null,
  "is_saas_deployment": false,
  "days_since_first_db_creation": 10
}

Response Schema

Field Type Description
license_expiration datetime or null The license expiration date in UTC. null if no license exists.
is_saas_deployment boolean If true, licenses are not enforced and the UI hides license management.
days_since_first_db_creation integer or null Days since the first datastore was created (the field name uses db as shorthand for datastore, not database). Used to calculate the remaining days in the 31-day grace period. null if no datastores exist.

For the UI equivalent, see the Introduction page.


Generate License Request

Generate an encoded license request code to send to your Qualytics representative for renewal.

Endpoint: GET /api/license/request

Permission: Admin user role

Example request and response

Request:

curl -X GET "https://your-instance.qualytics.io/api/license/request" \
  -H "Authorization: Bearer YOUR_TOKEN"

Response:

{
  "license_request": "eJyrVkrOz0nVUbJSKs9ILUpVslIqS8wpTgUA..."
}

Response Schema

Field Type Description
license_request string An encoded license request containing your deployment's fingerprint. Send this to the Qualytics support team to receive a license key.

For the UI equivalent, see the Generate License Request page.


Assign License

Apply a new or renewed license key to the deployment.

Note

This endpoint is called Assign License in the API, but corresponds to the Update License button in the UI. Both perform the same action — applying a signed license key to the deployment.

Endpoint: POST /api/license/assign

Permission: Admin user role

Request Body:

Field Type Required Description
signed_license string Yes An unexpired signed license key from Qualytics.
Example request

Request:

curl -X POST "https://your-instance.qualytics.io/api/license/assign" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "signed_license": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9..."
  }'

Response: 204 No Content (empty body)

For the UI equivalent, see the Update License page.


Error Responses

Status Code Description
400 Bad Request Invalid license key — signature, format, expiration, or fingerprint mismatch. Also returned when deployment data is in an invalid state.
401 Unauthorized Missing or invalid API token.
403 Forbidden User does not have the Admin role.
Error response examples

403 Forbidden:

{ "detail": "Not enough permissions" }

400 Bad Request (invalid license signature):

{ "detail": "Invalid license signature. Please contact your Qualytics account manager for assistance." }

400 Bad Request (expired license):

{ "detail": "License has expired. Please contact your Qualytics account manager for assistance" }

400 Bad Request (fingerprint mismatch):

{ "detail": "License is invalid due to fingerprint mismatch. Please contact your Qualytics account manager for assistance" }

400 Bad Request (invalid format):

{ "detail": "Invalid license format: Expecting value" }

400 Bad Request (missing required field):

{ "detail": "Missing required field in license: expiration_time" }

400 Bad Request (invalid deployment state):

{ "detail": "This deployment's data is in an invalid state. Please contact your Qualytics account representative" }

400 Bad Request (grace period exceeded, no license):

{ "detail": "A license is required after 31 days of datastore connectivity. Please contact your Qualytics account representative" }

Permission Summary

Operation Minimum Permission
Get license info Admin user role
Generate license request Admin user role
Assign license Admin user role

Info

All License API endpoints require the Admin role. See the Permissions page for the full matrix.