Enterprise License API

Licensing is only available in Grafana Enterprise. Read more about Grafana Enterprise.

If you are running Grafana Enterprise, for some endpoints you’ll need to have specific permissions. Refer to Role-based access control permissions for more information.

Check license availability

Note: Available in Grafana Enterprise v7.4+.

GET /api/licensing/check

Checks if a valid license is available.

Required permissions

See note in the introduction for an explanation.

ActionScope
licensing:readn/a

Examples

Example request:

  1. GET /api/licensing/check
  2. Accept: application/json
  3. Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk

Example response:

  1. HTTP/1.1 200 OK
  2. Content-Type: application/json
  3. Content-Length: 4
  4. true

Status codes:

  • 200 - OK

Manually force license refresh

Note: Available in Grafana Enterprise v7.4+.

POST /api/licensing/token/renew

Manually ask license issuer for a new token.

Required permissions

See note in the introduction for an explanation.

ActionScope
licensing:writen/a

Examples

Example request:

  1. POST /api/licensing/token/renew
  2. Accept: application/json
  3. Content-Type: application/json
  4. Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
  5. {}

Example response:

  1. HTTP/1.1 200 OK
  2. Content-Type: application/json
  3. Content-Length: 357
  4. {
  5. "jti":"2",
  6. "iss":"https://grafana.com",
  7. "sub":"https://play.grafana.org/"
  8. "lid":"1",
  9. "included_admins":5,
  10. "included_viewers":10,
  11. "lic_exp_warn_days":30,
  12. "tok_exp_warn_days":2,
  13. "update_days":1,
  14. "prod":["grafana-enterprise"],
  15. "company":"Grafana Labs"
  16. }

The response is a JSON blob available for debugging purposes. The available fields may change at any time without any prior notice.

Status Codes:

  • 200 - OK
  • 401 - Unauthorized
  • 403 - Access denied

Remove license from database

Note: Available in Grafana Enterprise v7.4+.

DELETE /api/licensing/token

Removes the license stored in the Grafana database.

Required permissions

See note in the introduction for an explanation.

ActionScope
licensing:deleten/a

Examples

Example request:

  1. DELETE /api/licensing/token
  2. Accept: application/json
  3. Content-Type: application/json
  4. Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
  5. {"instance": "http://play.grafana.org/"}

JSON Body schema:

  • instance – Root URL for the instance for which the license should be deleted. Required.

Example response:

  1. HTTP/1.1 202 Accepted
  2. Content-Type: application/json
  3. Content-Length: 2
  4. {}

Status codes:

  • 202 - Accepted, license removed or did not exist.
  • 401 - Unauthorized
  • 403 - Access denied
  • 422 - Unprocessable entity, incorrect instance name provided.