Get license APIedit

This API enables you to retrieve licensing information.


GET /_license


This API returns information about the type of license, when it was issued, and when it expires, for example.

For more information about the different types of licenses, see

If the master node is generating a new cluster state, the get license API may return a 404 Not Found response. If you receive an unexpected 404 response after cluster startup, wait a short period and retry the request.

Query Parametersedit

(Boolean) Specifies whether to retrieve local information. The default value is false, which means the information is retrieved from the master node.
(Boolean) If true, this parameter returns enterprise for Enterprise license types. If false, this parameter returns platinum for both platinum and enterprise license types. This behavior is maintained for backwards compatibility.

Deprecated in 7.6.0.

This parameter is deprecated and will always be set to true in 8.x.


You must have monitor cluster privileges to use this API. For more information, see Security privileges.


The following example provides information about a trial license:

response = client.license.get
puts response
GET /_license
  "license" : {
    "status" : "active",
    "uid" : "cbff45e7-c553-41f7-ae4f-9205eabd80xx",
    "type" : "trial",
    "issue_date" : "2018-10-20T22:05:12.332Z",
    "issue_date_in_millis" : 1540073112332,
    "expiry_date" : "2018-11-19T22:05:12.332Z",
    "expiry_date_in_millis" : 1542665112332,
    "max_nodes" : 1000,
    "max_resource_units" : null,
    "issued_to" : "test",
    "issuer" : "elasticsearch",
    "start_date_in_millis" : -1