# Admin API

> Request format, response structure and error codes of the N1ED Admin API used by SaaS providers to automate API key management.

Source: https://n1ed.com/docs/admin-api  
Section: For developers > Admin API  
Updated: 2026-09-20  
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

> **Note**
>
> Previously called "SaaS API" (after the SaaS providers it was designed for), renamed to better reflect its purpose.

N1ED cloud servers have an API used to edit cloud settings. It provides HTTP requests for:

- [Create API key](https://n1ed.com/docs/admin-api/create-api-key)
- [List API keys](https://n1ed.com/docs/admin-api/list-api-keys)
- [Delete API key](https://n1ed.com/docs/admin-api/delete-api-key)
- [Undelete API key](https://n1ed.com/docs/admin-api/undelete-api-key)
- [Set parent API key](https://n1ed.com/docs/admin-api/set-parent-api-key)
- [Rotate API key](https://n1ed.com/docs/admin-api/rotate-api-key)
- [Rotate Admin API token](https://n1ed.com/docs/admin-api/rotate-admin-token)

It would be useful for website builder owners and other multi-tenant SaaS providers that would like to automate repetitive actions.

This Admin API is available for everyone on the Studio and higher plans and may be connected by agreement on other plans ([contact support](mailto:support@helpdesk.edsdk.com?subject=N1ED%20-%20Admin%20API) for that).

## Request format

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

Please replace "action" in the URL with the desired action from the list of available requests to the Admin API and specify the POST parameters according to the requirements of this request.

## Response format

### Success result

The response format is always the same, and only the `data` section containing the returned data differs. Refer to the request documentation to review the returned structure schema.

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

```js
{
    error: null,
    data: {
        ...
    }
}
```

Result with an error:

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

```js
{
    error: "string-error-code",
    data: null
}
```

Refer to the specific request documentation to review the returned error codes, and don't forget to check whether the request has failed due to network connectivity problems.

Our servers will never respond with a code different from `200` even in the case of an error, but please check other HTTP codes in case of any potentially unhandled errors.

### Code samples

Here are some samples of how to make this request from the Linux console, PHP-based CMSs, and JavaScript/TypeScript Node backends. You can also write code in the language you use.

Of course, the parts `action-name` in the URL and `param1=value1&param2=value2` should be replaced accordingly to the request your code is making.

#### Sh/Bash

This can be called in Linux console if you prefer `curl`.

```bash
curl \
    -X POST https://cloud.n1ed.com/a/admin/action-name \
    -d "param1=value1&param2=value2"
```

And this is the command for `wget` lovers:

```bash
wget \
    --post-data "param1=value1&param2=value2" \
    --header="Content-Type: application/x-www-form-urlencoded" \
    -O - \
    https://cloud.n1ed.com/a/admin/action-name
```

#### PHP

If you use PHP without any libraries, this is the vanilla PHP code for you:

```php
function request() {
    $url = "https://cloud.n1ed.com/a/admin/action-name";
    $data = http_build_query([
        "param1" => "value1",
        "param2" => "value2"
    ]);

    $options = [
        "http" => [
            "header" => "Content-Type: application/x-www-form-urlencoded",
            "method" => "POST",
            "content" => $data
        ]
    ];

    $context = stream_context_create($options);
    $response = file_get_contents($url, false, $context);

    if ($response === false) {
        echo "Request failed";
        return null;
    } else {
        return $response;
    }
}

// Example usage
$response = request();
echo $response;
```

And here is the code for `curl` library users:

```php
function request() {
    $url = "https://cloud.n1ed.com/a/admin/action-name";
    $data = [
        "param1" => "value1",
        "param2" => "value2"
    ];

    $ch = curl_init($url);

    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
    curl_setopt($ch, CURLOPT_HTTPHEADER, [
        "Content-Type: application/x-www-form-urlencoded"
    ]);

    $response = curl_exec($ch);

    if (curl_errno($ch)) {
        echo "cURL Error: " . curl_error($ch);
        curl_close($ch);
        return null;
    }

    curl_close($ch);
    return $response;
}

// Example usage
$response = request();
echo $response;
```

#### JavaScript/TypeScript (NodeJS)

You can make call with Axios library from any framework like Express, NestJS or similar or your custom app:

```js
const axios = require('axios');

async function request() {
    try {
        const params = new URLSearchParams({
            param1: "value1",
            param2: "value2"
        });

        const response = await axios.post(
            "https://cloud.n1ed.com/a/admin/action-name",
            params,
            {
                headers: {
                    "Content-Type": "application/x-www-form-urlencoded"
                }
            }
        );

        return response.data;
    } catch (error) {
        console.error(
            "Error:", 
            error.response ? error.response.data : error.message
        );
        return null;
    }
}

// Example usage
request().then(console.log);
```

#### Other languages

You can write equivalent code in any other language using the samples above. The Admin API is available on any platform that can make HTTP requests. If you encounter any difficulties, ask support, and our developers will assist you.
