---
type: api
title: Add or update license
description: Adds a new or updates an existing license.
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/cloud-enterprise/operation/operation-set-license
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/cloud-enterprise/operation/operation-set-license
products:
  - Elastic Cloud Enterprise
---

# Add or update license

## Paths

- `PUT` `/platform/license`

- [Basic auth](/elastic/docs-builder/docs/4371/api/doc/cloud-enterprise/authentication#basicauth)
- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/cloud-enterprise/authentication#apikey)

## Description

Adds a new or updates an existing license.

## Request Body

`application/json`

The license to add or update.

- `license` ({} LicenseInfo) — required
  Information about a license.
  - `version` (integer) — optional
    Version of the license
  - `uid` (string) — required
    Unique identifier of the license
  - `issuer` (string) — required
    Issuer of the license
  - `issued_to` (string) — required
    Entity the license was issued to
  - `issue_date_in_millis` (integer) — required
    When the license was issued, in milliseconds since the Unix epoch
  - `type` (string) — required
    Type of the license
  - `subscription_type` (string) — optional
    Type of the license subscription
  - `signature` (string) — required
    Digital signature
  - `start_date_in_millis` (integer) — required
    Initial validity of the license, in milliseconds since the Unix epoch
  - `expiry_date_in_millis` (integer) — required
    When the license expires, in milliseconds since the Unix epoch
  - `max_allocators` (integer) — optional
    Maximum number of allocators. Empty for version >= 3
  - `max_ram_per_allocator_mb` (integer) — optional
    Maximum RAM per allocator in MB. Empty for version >= 3
  - `max_instances` (integer) — optional
    Maximum number of instances. Only present for version 3
  - `max_resource_units` (integer) — optional
    Maximum number of resource units, where each unit is 64GB. Only present for version > 3
  - `operation_mode` (string) — optional
    Operation mode
  - `cluster_licenses` ([] ClusterLicenseInfo) — optional
    List of cluster licenses
    - `license` (object) — required
      Object containing the cluster license data
- `usage_stats` ({} UsageStats) — optional
  Information about the current usage.
  - `total_connected_memory_total` (integer) — required
    The total amount of memory available to your system

## Responses

#### `200`

The license was updated.

`application/json`

Type: `EmptyResponse`

#### `400`

The license could not be updated. (code: `license.invalid_license`)

`application/json`

- `errors` ([] BasicFailedReplyElement)
  A list of errors that occurred in the failing request
  - `code` (string)
    A structured code representing the error type that occurred
  - `message` (string)
    A human readable message describing the error that occurred
  - `fields` ([] string)
    If the error can be tied to a specific field or fields in the user request, this lists those fields
##### Response Headers

- `x-cloud-error-codes` (enum)
  The error codes associated with the response

## Code Examples

#### Console

```console
PUT /platform/license
```

#### curl

```curl
curl -X PUT "/platform/license"
```

