diff --git a/docs/sources/developers/http_api/licensing.md b/docs/sources/developers/http_api/licensing.md index d6e361307ba..d2588e9839e 100644 --- a/docs/sources/developers/http_api/licensing.md +++ b/docs/sources/developers/http_api/licensing.md @@ -59,6 +59,66 @@ Status codes: - **200** - OK +## Add license + +> **Note:** Available in Grafana Enterprise v7.4+. + +`POST /api/licensing/token` + +Applies a license to a Grafana instance. + +**Required permissions** + +See note in the [introduction]({{< ref "#enterprise-license-api" >}}) for an explanation. + +| Action | Scope | +| --------------- | ----- | +| licensing:write | n/a | + +### Examples + +**Example request:** + +```http +POST /licensing/token +Accept: application/json +Content-Type: application/json +Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk + +{"token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0aGlzIjoiaXMiLCJub3QiOiJhIiwidmFsaWQiOiJsaWNlbnNlIn0.bxDzxIoJlYMwiEYKYT_l2s42z0Y30tY-6KKoyz9RuLE"} +``` + +**Example response:** + +```http +HTTP/1.1 200 OK +Content-Type: application/json +Content-Length: 357 + +{ + "jti":"2", + "iss":"https://grafana.com", + "sub":"https://play.grafana.org/" + "lid":"1", + "included_users":15, + "lic_exp_warn_days":30, + "tok_exp_warn_days":2, + "update_days":1, + "prod":["grafana-enterprise"], + "company":"Grafana Labs" +} + +``` + +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 +- **400** - Bad request +- **500** - Internal server error (refer to server logs for more details) + ## Manually force license refresh > **Note:** Available in Grafana Enterprise v7.4+. @@ -100,8 +160,7 @@ Content-Length: 357 "iss":"https://grafana.com", "sub":"https://play.grafana.org/" "lid":"1", - "included_admins":5, - "included_viewers":10, + "included_users":15, "lic_exp_warn_days":30, "tok_exp_warn_days":2, "update_days":1,