---
title: "Replaces the customer's active license with a new key, the old one stopping at once, and emails them the new key a couple of minutes later; a key made in the last minute waits, and a license takes three new keys a day."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.sherpo.io/llms.txt
> Use this file to discover all available pages before exploring further.

Path: Sherpo customer API › profile

`POST /v1/stores/{store}/products/{product}/licenses/{license}/rotate`

## Authentication

- `bearer`, http, header `Authorization`, scopes: `profile:write`

## Path parameters

- `store` (`rotateLicense.path.store`; string, required) — A hostname of the store.
- `product` (`rotateLicense.path.product`; string, required) — An id, or `slug:<slug>`.
  - minLength 1
- `license` (`rotateLicense.path.license`; string, required)
  - minLength 1

## Request body

_Optional._

## Example request

```json
{}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url 'https://api.sherpo.io/customer/v1/stores/<store>/products/<product>/licenses/<license>/rotate' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{}'
```

### TypeScript

```typescript
const url = 'https://api.sherpo.io/customer/v1/stores/<store>/products/<product>/licenses/<license>/rotate';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({})
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.sherpo.io/customer/v1/stores/<store>/products/<product>/licenses/<license>/rotate"

payload = {}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

Replaces the customer's active license with a new key, the old one stopping at once, and emails them the new key a couple of minutes later; a key made in the last minute waits, and a license takes three new keys a day.

#### Example

```json
{
  "id": "string",
  "product_id": "string",
  "key": "string",
  "status": "string",
  "expires_at": "string",
  "activation_limit": 0,
  "activations": {
    "count": 0,
    "limit": 0
  },
  "replaced_by": "string",
  "created_at": "string"
}
```

- `id` (`rotateLicense.response.200.id`; string, required)
- `product_id` (`rotateLicense.response.200.product_id`; string, required)
- `key` (`rotateLicense.response.200.key`; any of, required) — The key the customer enters in the software; null to staff acting as the customer.
  - any of: `string`, `null`
- `status` (`rotateLicense.response.200.status`; string, required)
- `expires_at` (`rotateLicense.response.200.expires_at`; any of, required) — When access ends, or ended; null for lifetime access.
  - any of: `string`, `null`
- `activation_limit` (`rotateLicense.response.200.activation_limit`; any of, required) — How many devices it activates at once: its own limit, else its tier's, else its product's; null for no limit.
  - any of: `number`, `null`
- `activations` (`rotateLicense.response.200.activations`; object, required) — The devices it counts now and the most it may hold.
  - `count` (`rotateLicense.response.200.activations.count`; number, required)
  - `limit` (`rotateLicense.response.200.activations.limit`; any of, required)
    - any of: `number`, `null`
- `replaced_by` (`rotateLicense.response.200.replaced_by`; any of, required) — The license whose key took this one's place; null until it is replaced.
  - any of: `string`, `null`
- `created_at` (`rotateLicense.response.200.created_at`; string, required)

### default

A problem; see https://api.sherpo.io/customer/docs/errors.

#### Example

```json
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "code": "string",
  "context": {},
  "reached_core": true,
  "core_answer": "string"
}
```

- `type` (`rotateLicense.response.default.type`; string, required)
  - format `uri`
- `title` (`rotateLicense.response.default.title`; string, required)
- `status` (`rotateLicense.response.default.status`; integer, required)
- `detail` (`rotateLicense.response.default.detail`; string, required)
- `code` (`rotateLicense.response.default.code`; string, optional)
- `context` (`rotateLicense.response.default.context`; object, optional)
- `reached_core` (`rotateLicense.response.default.reached_core`; boolean, optional)
- `core_answer` (`rotateLicense.response.default.core_answer`; string, optional)


Source: https://docs.sherpo.io/customer-api/reference/rotate-license/index.md
