# Delete API key

> Free a N1ED license slot by deleting an API key through the Admin API, and learn which keys cannot be deleted and how to restore one.

Source: https://n1ed.com/docs/admin-api/delete-api-key  
Section: For developers > Admin API > Delete API key  
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 a customer leaves your CMS or website builder, or one of your websites is decommissioned, delete its API key with this [Admin API](https://n1ed.com/docs/admin-api) request (available on Studio and higher plans) so it no longer counts against your license and cannot be used to load the editor anymore.

The deletion is reversible: the configuration is kept on N1ED servers, and the key can be restored later with the [Undelete API key](https://n1ed.com/docs/admin-api/undelete-api-key) request. Deleted API keys remain reserved — they will never be reassigned when new keys are generated. You can review them at any moment using [List API keys](https://n1ed.com/docs/admin-api/list-api-keys) with the `deleted=true` parameter.

Note that some API keys cannot be deleted: the default (first) API key of the account, keys with a license or a Flmngr access key attached, and keys used as a [parent](https://n1ed.com/docs/multisite/parent-and-child-api-keys) by other active keys (detach or delete the children first).

## Request format

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

- `adminToken`: Your secret Admin API token
- `apiKey`: API key on the current account to be deleted. Please specify the full (24-character) API key.

## Response format

The server will return an "OK" confirmation 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: "OK"
}
```

Possible error codes:

- `NO-SUCH-API-KEY` - there is no active API key with this value on your account. Are you trying to delete an already deleted API key?
- `UNABLE-TO-CHANGE-NOT-OWN-API-KEY` - the specified API key does not belong to your account.
- `CANT-DELETE-DEFAULT-API-KEY` - the default (first) API key of the account cannot be deleted.
- `CANT-DELETE-API-KEY-WITH-LICENSE` - a license is attached to this API key, so it cannot be deleted.
- `CANT-DELETE-API-KEY-WITH-ACCESS-KEY` - a Flmngr access key is attached to this API key, so it cannot be deleted.
- `CANT-DELETE-PARENT-API-KEY` - other active API keys use this key as their [parent](https://n1ed.com/docs/multisite/parent-and-child-api-keys). Detach or delete the child keys first.
- `INCORRECT-TOKEN` - the `adminToken` parameter has been incorrectly specified.

## 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/api-key-delete \
    -d "adminToken=your-secret-admin-token&apiKey=your-api-key"
```

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.
