# Update Licenses (Bulk)

{% hint style="info" %}
When updating `valid_duration`, `validity_period` and `trial_days` you should also send the `is_trial` field.
{% endhint %}

{% hint style="warning" %}
`valid_duration` and `validity_period` can't be sent in the same update license request.
{% endhint %}

URL: `/api/v1/licenses/bulk_update/`

Method: `PATCH`

Parameters for each license:

* `id` - Integer
  * Required
  * Must be provided in order to specify which fields will be updated on which License
* `max_activations` - Integer
* `max_consumptions` - Integer
* `allow_overages` - Boolean
* `max_overages` - Integer
* `reset_consumption` - Boolean
* `consumption_period` - String
  * Choices: `daily`, `weekly`, `monthly`, `annualy`
* `is_trial` - Boolean
* `trial_days` - Integer
* `enable_maintenance_period` - Boolean
* `maintenance_duration` - String
  * Choices examples: `35d` (35 days), `4m` (4 months), `2y` (2 years)
* `is_floating` - Boolean
* `is_floating_cloud` - Boolean
* `floating_users` - Integer
* `valid_duration` - String
  * Choices examples: `35d` (35 days), `4m` (4 months), `2y` (2 years)
* `validity_period` - Date
  * Format: `yyyy-mm-dd` (2020-09-30)
* `prevent_vm` - Boolean
* `note` - String
* `max_license_users` - Integer
  * Default: 0 (unlimited)
* `floating_timeout` - Integer
* `max_transfers` - Integer
  * Default: 0 (unlimited)
* `metadata` - JSON object
* `start_date` - String
* `installation_file` - Integer

Data example:

{% code title="request.json" %}

```json
[
    {
        "id": 1604392188374249,
        "is_trial": 1
    },
    {
        "id": 1599050404885519,
        "is_trial": 1,
        "enable_maintenance_period": 1
    },
    {
        "id": 1606299860676369,
        "validity_period": "2030-01-02",
        "is_trial": 1
    }
]
```

{% endcode %}

Success response:

Code: `200 OK`

Content example:

{% code title="response.json" %}

```json
{
    "detail": "Licenses Updated."
}
```

{% endcode %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.licensespring.com/management-api/license/update-licenses-bulk.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
