# Rotate Admin API token

> Replace an exposed N1ED Admin API token with a new one and store it at once, because the old token stops working immediately.

Source: https://n1ed.com/docs/admin-api/rotate-admin-token  
Section: For developers > Admin API > Rotate Admin API token  
Updated: 2026-09-29  
Every page of n1ed.com has a Markdown copy at its URL + `.md` (`index.md` after a URL that ends in `/`); all of them are in one file: https://n1ed.com/llms-full.txt

When you feel your Admin API token (a key for accessing Admin API) might have been suddenly exposed to 3rd persons, or as part of periodically changing secrets for security purposes, you can change (rotate) it. Admin API token rotation may be used only with the help of [Admin API](https://n1ed.com/docs/admin-api) available on Studio adn higher plans.

When you change Admin API token it will be rotated immediately, so you must immediately save it in the DB or you lose access to Admin API, and only support may help you then.

## Request format

**URL:** `https://cloud.n1ed.com/a/admin/admin-token-rotate`  
**Request type:** `POST`  
**Content type:** `application/x-www-form-urlencoded`  
**Parameters:**

- `adminToken`: Your secret Admin API token

## Response format

The server will return the new Admin API token in the data section if the request succeeds, or an error code otherwise.

**HTTP code:** `200`  
**Content type:** `application/json`  
**Body:**

```js
{
    error: null,
    data: {
        adminToken: "rotated-admin-token"
    }
}
```

Possible error codes:

- `INCORRECT-TOKEN` - the `adminToken` parameter has been incorrectly specified. Are you trying to rotate the same old Admin API token a second time?

## Sample request

Here is a sample of how to make this request from the Linux console (sh, bash, or any other shell).

```bash
curl \
    -X POST https://cloud.n1ed.com/a/admin/admin-token-rotate \
    -d "adminToken=your-secret-admin-token"
```

Please refer to [Admin API](https://n1ed.com/docs/admin-api) to see samples for PHP, JS, and learn how to write code for other languages.
