Update the license Generally available

POST /_license

All methods and paths for this operation:

PUT /_license

POST /_license

You can update your license at runtime without shutting down your nodes. License updates take effect immediately. If the license you are installing does not support all of the features that were available with your previous license, however, you are notified in the response. You must then re-submit the API request with the acknowledge parameter set to true.

NOTE: If Elasticsearch security features are enabled and you are installing a gold or higher license, you must enable TLS on the transport networking layer before you install the license. If the operator privileges feature is enabled, only operator users can use this API.

Required authorization

  • Cluster privileges: manage

Query parameters

  • acknowledge boolean

    Specifies whether you acknowledge the license changes.

  • master_timeout string

    The period to wait for a connection to the master node.

    Values are -1 or 0.

  • timeout string

    The period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

    Values are -1 or 0.

application/json

Body

  • license object
    Hide license attributes Show license attributes object
    • expiry_date_in_millis number

      Time unit for milliseconds

    • issue_date_in_millis number

      Time unit for milliseconds

    • start_date_in_millis number

      Time unit for milliseconds

    • issued_to string Required
    • issuer string Required
    • max_nodes number | string | null

    • max_resource_units number
    • signature string Required
    • type string Required

      Values are missing, trial, basic, standard, dev, silver, gold, platinum, or enterprise.

    • uid string Required
  • licenses array[object]

    A sequence of one or more JSON documents containing the license information.

    Hide licenses attributes Show licenses attributes object
    • expiry_date_in_millis number

      Time unit for milliseconds

    • issue_date_in_millis number

      Time unit for milliseconds

    • start_date_in_millis number

      Time unit for milliseconds

    • issued_to string Required
    • issuer string Required
    • max_nodes number | string | null

    • max_resource_units number
    • signature string Required
    • type string Required

      Values are missing, trial, basic, standard, dev, silver, gold, platinum, or enterprise.

    • uid string Required

Responses

  • 200 application/json
    Hide response attributes Show response attributes object
    • acknowledge object
      Hide acknowledge attributes Show acknowledge attributes object
      • license array[string] Required
      • message string Required
    • acknowledged boolean Required
    • license_status string Required

      Values are active, valid, invalid, or expired.

PUT _license
{
  "licenses": [
    {
      "uid":"893361dc-9749-4997-93cb-802e3d7fa4xx",
      "type":"basic",
      "issue_date_in_millis":1411948800000,
      "expiry_date_in_millis":1914278399999,
      "max_nodes":1,
      "issued_to":"issuedTo",
      "issuer":"issuer",
      "signature":"xx"
    }
    ]
}
resp = client.license.post(
    licenses=[
        {
            "uid": "893361dc-9749-4997-93cb-802e3d7fa4xx",
            "type": "basic",
            "issue_date_in_millis": 1411948800000,
            "expiry_date_in_millis": 1914278399999,
            "max_nodes": 1,
            "issued_to": "issuedTo",
            "issuer": "issuer",
            "signature": "xx"
        }
    ],
)
const response = await client.license.post({
  licenses: [
    {
      uid: "893361dc-9749-4997-93cb-802e3d7fa4xx",
      type: "basic",
      issue_date_in_millis: 1411948800000,
      expiry_date_in_millis: 1914278399999,
      max_nodes: 1,
      issued_to: "issuedTo",
      issuer: "issuer",
      signature: "xx",
    },
  ],
});
response = client.license.post(
  body: {
    "licenses": [
      {
        "uid": "893361dc-9749-4997-93cb-802e3d7fa4xx",
        "type": "basic",
        "issue_date_in_millis": 1411948800000,
        "expiry_date_in_millis": 1914278399999,
        "max_nodes": 1,
        "issued_to": "issuedTo",
        "issuer": "issuer",
        "signature": "xx"
      }
    ]
  }
)
$resp = $client->license()->post([
    "body" => [
        "licenses" => array(
            [
                "uid" => "893361dc-9749-4997-93cb-802e3d7fa4xx",
                "type" => "basic",
                "issue_date_in_millis" => 1411948800000,
                "expiry_date_in_millis" => 1914278399999,
                "max_nodes" => 1,
                "issued_to" => "issuedTo",
                "issuer" => "issuer",
                "signature" => "xx",
            ],
        ),
    ],
]);
curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d '{"licenses":[{"uid":"893361dc-9749-4997-93cb-802e3d7fa4xx","type":"basic","issue_date_in_millis":1411948800000,"expiry_date_in_millis":1914278399999,"max_nodes":1,"issued_to":"issuedTo","issuer":"issuer","signature":"xx"}]}' "$ELASTICSEARCH_URL/_license"
client.license().post(p -> p
    .licenses(l -> l
        .expiryDateInMillis(1914278399999L)
        .issueDateInMillis(1411948800000L)
        .issuedTo("issuedTo")
        .issuer("issuer")
        .maxNodes(1L)
        .signature("xx")
        .type(LicenseType.Basic)
        .uid("893361dc-9749-4997-93cb-802e3d7fa4xx")
    )
);
Request example
Run `PUT _license` to update to a basic license. NOTE: These values are invalid; you must substitute the appropriate contents from your license file.
{
  "licenses": [
    {
      "uid":"893361dc-9749-4997-93cb-802e3d7fa4xx",
      "type":"basic",
      "issue_date_in_millis":1411948800000,
      "expiry_date_in_millis":1914278399999,
      "max_nodes":1,
      "issued_to":"issuedTo",
      "issuer":"issuer",
      "signature":"xx"
    }
    ]
}
Response examples (200)
If you update to a basic license and you previously had a license with more features, you receive this type of response. You must re-submit the API request and set the `acknowledge` parameter to `true`.
{
  "acknowledged": false,
  "license_status": "valid",
  "acknowledge": {
    "message": "\"\"\"This license update requires acknowledgement. To acknowledge the license, please read the following messages and update the license again, this time with the \"acknowledge=true\" parameter:\"\"\"",
    "watcher": [
      "Watcher will be disabled"
    ],
    "logstash": [
      "Logstash will no longer poll for centrally-managed pipelines"
    ],
    "security": [
      "The following X-Pack security functionality will be disabled ..."
    ]
  }
}