[[reference-license]]
== client.license

////////
===========================================================================================================================
||                                                                                                                       ||
||                                                                                                                       ||
||                                                                                                                       ||
||        ██████╗ ███████╗ █████╗ ██████╗ ███╗   ███╗███████╗                                                            ||
||        ██╔══██╗██╔════╝██╔══██╗██╔══██╗████╗ ████║██╔════╝                                                            ||
||        ██████╔╝█████╗  ███████║██║  ██║██╔████╔██║█████╗                                                              ||
||        ██╔══██╗██╔══╝  ██╔══██║██║  ██║██║╚██╔╝██║██╔══╝                                                              ||
||        ██║  ██║███████╗██║  ██║██████╔╝██║ ╚═╝ ██║███████╗                                                            ||
||        ╚═╝  ╚═╝╚══════╝╚═╝  ╚═╝╚═════╝ ╚═╝     ╚═╝╚══════╝                                                            ||
||                                                                                                                       ||
||                                                                                                                       ||
||    This file is autogenerated, DO NOT send pull requests that changes this file directly.                             ||
||    You should update the script that does the generation, which can be found in:                                      ||
||    https://github.com/elastic/elastic-client-generator-js                                                             ||
||                                                                                                                       ||
||    You can run the script with the following command:                                                                 ||
||       npm run elasticsearch -- --version <version>                                                                    ||
||                                                                                                                       ||
||                                                                                                                       ||
||                                                                                                                       ||
===========================================================================================================================
////////
++++
<style>
.lang-ts a.xref {
  text-decoration: underline !important;
}
</style>
++++


[discrete]
[[client.license.delete]]
== `client.license.delete()`

Deletes licensing information for the cluster

{ref}/delete-license.html[{es} documentation]
[discrete]
=== Function signature

[source,ts]
----
(request: LicenseDeleteRequest, options?: TransportRequestOptions) => Promise<LicenseDeleteResponse>
----

[discrete]
=== Request

[source,ts,subs=+macros]
----
interface LicenseDeleteRequest extends <<RequestBase>> {}

----


[discrete]
=== Response

[source,ts,subs=+macros]
----
type LicenseDeleteResponse = <<AcknowledgedResponseBase>>

----


[discrete]
[[client.license.get]]
== `client.license.get()`

Get license information. Returns information about your Elastic license, including its type, its status, when it was issued, and when it expires. For more information about the different types of licenses, refer to [Elastic Stack subscriptions](https://www.elastic.co/subscriptions).

{ref}/get-license.html[{es} documentation]
[discrete]
=== Function signature

[source,ts]
----
(request: LicenseGetRequest, options?: TransportRequestOptions) => Promise<LicenseGetResponse>
----

[discrete]
=== Request

[source,ts,subs=+macros]
----
interface LicenseGetRequest extends <<RequestBase>> {
  accept_enterprise?: boolean
  local?: boolean
}

----


[discrete]
=== Response

[source,ts,subs=+macros]
----
interface LicenseGetResponse {
  license: LicenseGetLicenseInformation
}

----


[discrete]
[[client.license.getBasicStatus]]
== `client.license.getBasicStatus()`

Retrieves information about the status of the basic license.

{ref}/get-basic-status.html[{es} documentation]
[discrete]
=== Function signature

[source,ts]
----
(request: LicenseGetBasicStatusRequest, options?: TransportRequestOptions) => Promise<LicenseGetBasicStatusResponse>
----

[discrete]
=== Request

[source,ts,subs=+macros]
----
interface LicenseGetBasicStatusRequest extends <<RequestBase>> {}

----


[discrete]
=== Response

[source,ts,subs=+macros]
----
interface LicenseGetBasicStatusResponse {
  eligible_to_start_basic: boolean
}

----


[discrete]
[[client.license.getTrialStatus]]
== `client.license.getTrialStatus()`

Retrieves information about the status of the trial license.

{ref}/get-trial-status.html[{es} documentation]
[discrete]
=== Function signature

[source,ts]
----
(request: LicenseGetTrialStatusRequest, options?: TransportRequestOptions) => Promise<LicenseGetTrialStatusResponse>
----

[discrete]
=== Request

[source,ts,subs=+macros]
----
interface LicenseGetTrialStatusRequest extends <<RequestBase>> {}

----


[discrete]
=== Response

[source,ts,subs=+macros]
----
interface LicenseGetTrialStatusResponse {
  eligible_to_start_trial: boolean
}

----


[discrete]
[[client.license.post]]
== `client.license.post()`

Updates the license for the cluster.

{ref}/update-license.html[{es} documentation]
[discrete]
=== Function signature

[source,ts]
----
(request: LicensePostRequest, options?: TransportRequestOptions) => Promise<LicensePostResponse>
----

[discrete]
=== Request

[source,ts,subs=+macros]
----
interface LicensePostRequest extends <<RequestBase>> {
  acknowledge?: boolean
  license?: <<LicenseLicense>>
  licenses?: <<LicenseLicense>>[]
}

----


[discrete]
=== Response

[source,ts,subs=+macros]
----
interface LicensePostResponse {
  acknowledge?: LicensePostAcknowledgement
  acknowledged: boolean
  license_status: <<LicenseLicenseStatus>>
}

----


[discrete]
[[client.license.postStartBasic]]
== `client.license.postStartBasic()`

The start basic API enables you to initiate an indefinite basic license, which gives access to all the basic features. If the basic license does not support all of the features that are available with your current license, however, you are notified in the response. You must then re-submit the API request with the acknowledge parameter set to true. To check the status of your basic license, use the following API: [Get basic status](https://www.elastic.co/guide/en/elasticsearch/reference/current/get-basic-status.html).

{ref}/start-basic.html[{es} documentation]
[discrete]
=== Function signature

[source,ts]
----
(request: LicensePostStartBasicRequest, options?: TransportRequestOptions) => Promise<LicensePostStartBasicResponse>
----

[discrete]
=== Request

[source,ts,subs=+macros]
----
interface LicensePostStartBasicRequest extends <<RequestBase>> {
  acknowledge?: boolean
}

----


[discrete]
=== Response

[source,ts,subs=+macros]
----
interface LicensePostStartBasicResponse {
  acknowledged: boolean
  basic_was_started: boolean
  error_message?: string
  type?: <<LicenseLicenseType>>
  acknowledge?: Record<string, string | string[]>
}

----


[discrete]
[[client.license.postStartTrial]]
== `client.license.postStartTrial()`

The start trial API enables you to start a 30-day trial, which gives access to all subscription features.

{ref}/start-trial.html[{es} documentation]
[discrete]
=== Function signature

[source,ts]
----
(request: LicensePostStartTrialRequest, options?: TransportRequestOptions) => Promise<LicensePostStartTrialResponse>
----

[discrete]
=== Request

[source,ts,subs=+macros]
----
interface LicensePostStartTrialRequest extends <<RequestBase>> {
  acknowledge?: boolean
  type_query_string?: string
}

----


[discrete]
=== Response

[source,ts,subs=+macros]
----
interface LicensePostStartTrialResponse {
  acknowledged: boolean
  error_message?: string
  trial_was_started: boolean
  type?: <<LicenseLicenseType>>
}

----


