---
type: api
title: Get license information
description: Get information about your Elastic license including its type, its status, when it was issued, and when it expires.
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/elasticsearch-serverless/operation/operation-license-get
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/elasticsearch-serverless/operation/operation-license-get
products:
  - Elasticsearch Serverless
---

# Get license information

## Paths

- `GET` `/_license`

## Description

Get information about your Elastic license including its type, its status, when it was issued, and when it expires.

>info
> 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.

## Authentication

- Api key: `Authorization: <value>`
  Elasticsearch APIs use key-based authentication.
  You must create an API key and use the encoded value in the request header.
  For example:
  
  
  ```
  curl -X GET "${ES_URL}/_cat/indices?v=true" \
    -H "Authorization: ApiKey ${API_KEY}"
  ```
  
  For more information about where to find API keys for the Elasticsearch endpoint (${ES_URL}) for a project, go to [Get started with Elasticsearch Serverless](https://www.elastic.co/docs/solutions/search/serverless-elasticsearch-get-started).

## Query string parameters

- `accept_enterprise` (boolean · default: true) — optional — deprecated
  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.
This parameter is deprecated and will always be set to true in 8.x.
- `local` (boolean · default: true) — optional
  Specifies whether to retrieve local information.
From 9.2 onwards the default value is `true`, which means the information is retrieved from the responding node.
In earlier versions the default is `false`, which means the information is retrieved from the elected master node.

## Response

`application/json`

- `license` (object)
  - `expiry_date` (union)
    The date and time the license expires in ISO 8601 format.
  - `expiry_date_in_millis` (number)
    The date and time the license expires in milliseconds since the Unix epoch.
  - `issue_date` (union)
    The date and time the license was issued in ISO 8601 format.
  - `issue_date_in_millis` (number)
    The date and time the license was issued in milliseconds since the Unix epoch.
  - `issued_to` (string)
    The name of the customer or organization that received the license.
  - `issuer` (string)
    The name of the organization that issued the license.
  - `max_nodes` (union number | string) — nullable
    The maximum number of nodes the license allows.
  - `max_resource_units` (union number | string) — nullable
    The maximum number of resource units the license allows (for enterprise licenses only).
  - `status` (enum)
    The status of the license. For example,active, valid, invalid, or expired.
    Values: `active`, `valid`, `invalid`, `expired`
  - `type` (enum)
    The type of the license. For example, trial, basic, gold, platinum, or enterprise.
    Values: `missing`, `trial`, `basic`, `standard`, `dev`, `silver`, `gold`, `platinum`, `enterprise`
  - `uid` (string)
    The unique identifier of the license.
  - `start_date_in_millis` (number)
    The date and time the license was started in milliseconds since the Unix epoch.
## Code examples

#### Console

```console
GET /_license
```

#### JavaScript

```javascript
const response = await client.license.get();
```

#### Python

```python
resp = client.license.get()
```

#### curl

```curl
curl -X GET "$ELASTICSEARCH_URL/_license" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY"
```

#### Java

```java
client.license().get(g -> g);
```

#### C#

```c#
var response = await client.LicenseManagement.GetAsync();
```

#### PHP

```php
$resp = $client->license()->get();
```

#### Ruby

```ruby
response = client.license.get
```

## Response examples

#### Get license response example1

A successful response from `GET /_license`.

```json
{
  "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
  }
}
```

