---
type: api
title: Start a trial
description: Start a 30-day trial, which gives access to all subscription features.
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/elasticsearch/operation/operation-license-post-start-trial
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/elasticsearch/operation/operation-license-post-start-trial
products:
  - Elasticsearch
---

# Start a trial

Availability: Generally available since 6.1

## Paths

- `POST` `/_license/start_trial`

## Description

Start a 30-day trial, which gives access to all subscription features.

NOTE: You are allowed to start a trial only if your cluster has not already activated a trial for the current major product version.
For example, if you have already activated a trial for v8.0, you cannot start a new trial until v9.0. You can, however, request an extended trial at https://www.elastic.co/trialextension.

To check the status of your trial, use the get trial status API.

## Required authorization

- Cluster privileges: `manage`

## Authentication

- Api key: `Authorization: <value>`
  Elasticsearch APIs support 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}"
  ```
  
  To get API keys, use the `/_security/api_key` APIs.
- Basic: `Authorization: Basic <credentials>`
- Bearer: `Authorization: Bearer <token>`
  Elasticsearch APIs support the use of bearer tokens in the `Authorization` HTTP header to authenticate with the API.
  For examples, refer to [Token-based authentication services](https://www.elastic.co/docs/deploy-manage/users-roles/cluster-or-deployment-auth/token-based-authentication-services)

## Query string parameters

- `acknowledge` (boolean · default: false) — optional
  To start a trial, you must accept the acknowledge messages and set this parameter to `true`.
- `type` (string · default: trial) — optional
  The type of trial license to generate
- `master_timeout` (string · default: 30s) — optional
  Period to wait for a connection to the master node.

## Response

`application/json`

- `acknowledged` (boolean)
- `error_message` (string)
- `trial_was_started` (boolean)
- `type` (enum)
  Values: `missing`, `trial`, `basic`, `standard`, `dev`, `silver`, `gold`, `platinum`, `enterprise`
## Code examples

#### Console

```console
POST /_license/start_trial?acknowledge=true
```

#### JavaScript

```javascript
const response = await client.license.postStartTrial({
  acknowledge: "true",
});
```

#### Python

```python
resp = client.license.post_start_trial(
    acknowledge=True,
)
```

#### curl

```curl
curl -X POST "$ELASTICSEARCH_URL/_license/start_trial?acknowledge=true" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY"
```

#### Java

```java
client.license().postStartTrial(p -> p
    .acknowledge(true)
);
```

#### C#

```c#
var response = await client.LicenseManagement
    .PostStartTrialAsync(d1 => d1
        .Acknowledge(true)
    );
```

#### PHP

```php
$resp = $client->license()->postStartTrial([
    "acknowledge" => "true",
]);
```

#### Ruby

```ruby
response = client.license.post_start_trial(
  acknowledge: "true"
)
```

## Response examples

#### Start trial license response example1

A successful response from `POST /_license/start_trial?acknowledge=true`.

```json
{
  "trial_was_started": true,
  "acknowledged": true
}
```

