> ## Documentation Index
> Fetch the complete documentation index at: https://aeros-c1d071c8.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Endpoints

> Reference for every REST endpoint of the panel.

Paths are relative to the panel origin, for example `http://127.0.0.1:3000`. Unless marked otherwise, every endpoint needs the `aeros_session` cookie. See [API overview](https://aeros-c1d071c8.mintlify.site/api/overview.md) for authentication and errors.

## Health

### `GET /api/health`

No authentication.

```json 200 theme={null}
{ "ok": true, "uptime": 86400 }
```

`uptime` is the panel process uptime in seconds.

## Auth

### `GET /api/auth/status`

No authentication. Tells the frontend whether to show the login or setup screen.

```json 200 theme={null}
{
  "authenticated": true,
  "setupRequired": false,
  "user": { "id": 1, "username": "admin" }
}
```

`user` is `null` when not authenticated.

### `POST /api/auth/setup`

No authentication. Creates the first admin and logs in. Only works while no user exists.

**username** `string` (default: admin)

3 to 32 letters, digits, `_`, or `-`.

**password** `string` *required*

At least 10 characters.

Returns `201` with `{"authenticated": true, "user": {"id": 1, "username": "admin"}}` and sets the session cookie. Returns `409` if an admin already exists.

### `POST /api/auth/login`

No authentication. Rate limited to 10 attempts per IP per 15 minutes.

**username** `string` *required*

**password** `string` *required*

Returns `200` with `{"authenticated": true, "user": {...}}` and sets the session cookie. `401` for wrong credentials, `429` when rate limited.

### `POST /api/auth/logout`

Deletes the current session and clears the cookie. Returns `{"success": true}`.

### `POST /api/auth/password`

Changes the password of the logged-in user, deletes all of their sessions, and sets a new session cookie.

**currentPassword** `string` *required*

**newPassword** `string` *required*

At least 10 characters.

Returns `{"success": true}`. `401` if `currentPassword` is wrong.

## System

### `GET /api/system/metrics`

Live host metrics, cached for 1 second.

```json 200 theme={null}
{
  "cpu": { "usage": 6, "cores": 2 },
  "memory": { "total": 4013891584, "used": 1053999104, "percentage": 26.26 },
  "storage": { "total": 117040975872, "used": 8589934592, "percentage": 7.34 },
  "thermal": { "temperature": 43.5 },
  "battery": { "percentage": 98, "status": "NOT CHARGING" }
}
```

* `cpu.usage` is a percentage over the interval since the previous call.
* Bytes are reported for `memory` and `storage` (root filesystem).
* `thermal.temperature` is in °C from `thermal_zone0`, or `null`.
* `battery.status` is the kernel status in upper case, `AC_POWER` with `percentage: 100` when there is no battery, or `NOT_FOUND` when `/sys/class/power_supply` is unreadable.

### `GET /api/system/info`

Host facts and remote access detection. Host facts and remote access probes are cached for 30 seconds.

```json 200 theme={null}
{
  "hostname": "celeron-homelab",
  "os": "Debian GNU/Linux 13 (trixie)",
  "kernel": "6.12.48+deb13-amd64",
  "uptime": 412800,
  "cpu": "Intel(R) Celeron(R) CPU N3060 @ 1.60GHz",
  "cores": 2,
  "memory": 4013891584,
  "ipv4": "192.0.2.10",
  "mac": "00:00:5e:00:53:01",
  "storageTotal": 117040975872,
  "panelPort": 3000,
  "remoteAccess": {
    "tailscale": { "installed": true, "connected": true, "ip": "100.64.0.1", "dnsName": "celeron-homelab.tailnet.ts.net", "panelUrl": "http://celeron-homelab.tailnet.ts.net:3000" },
    "cloudflare": { "installed": false, "active": false, "hostnames": [], "panelUrl": null },
    "caddy": { "installed": true, "active": true, "routes": [{ "serviceName": "discord-bot", "domain": "app.example.com", "port": 3001 }] }
  }
}
```

`ipv4` and `mac` belong to the first non-internal IPv4 interface, or `UNKNOWN`.

## Templates

### `GET /api/templates`

Returns the five project templates with their defaults: `id` (`node`, `python`, `static`, `java`, `custom`), `name`, `shortLabel`, `description`, `defaultExecStart`, `defaultBuildCmd`, `defaultMemoryMax`, `defaultCpuQuota`, `defaultUser`, and `hint`. See [Services and templates](https://aeros-c1d071c8.mintlify.site/services-and-templates.md#templates).

### `POST /api/templates/preview`

Validates unit fields and returns the generated unit without writing anything.

**name** `string` (default: My Service)

**service\_name** `string` (default: my-service)

**template** `string` (default: node)

`node`, `python`, `static`, `java`, or `custom`.

**work\_dir** `string`

Defaults to `/opt/<service_name>`.

**exec\_start** `string`

Defaults to the template's command.

**run\_user** `string`

**memory\_max** `string`

For example `256M`.

**cpu\_quota** `string`

For example `50%`.

```json 200 theme={null}
{
  "config": {
    "name": "My Service",
    "serviceName": "my-service",
    "template": "node",
    "workDir": "/opt/my-service",
    "execStart": "/usr/bin/node dist/index.js",
    "runUser": "",
    "memoryMax": "256M",
    "cpuQuota": ""
  },
  "unitContent": "[Unit]\nDescription=AerosPanel Service: My Service\n..."
}
```

Validation errors return `400`.

## Projects

### `GET /api/projects`

Lists projects with live status. Each item:

| Field | Type | Notes |
| :- | :- | :- |
| `id`, `name`, `service_name` | | |
| `repository`, `branch`, `build_cmd` | string or null | |
| `template`, `work_dir`, `exec_start` | string | |
| `run_user`, `memory_max`, `cpu_quota` | string or null | |
| `autostart` | `0` or `1` | |
| `use_tailscale` | `0` or `1` | Legacy column, not used. |
| `last_deploy_at` | ISO string or null | |
| `current_commit`, `previous_commit` | SHA or null | See [Deploy and rollback](https://aeros-c1d071c8.mintlify.site/deploy-and-rollback.md#commit-history). |
| `domain`, `port` | string, number, or null | Caddy route. |
| `has_webhook` | boolean | The secret itself is never returned. |
| `status` | string | `active`, `reloading`, `refreshing`, or `inactive`. |
| `metrics` | object or null | `{"memoryBytes": number or null, "cpuUsageNSec": number or null}`. `null` when inactive. |
| `deploying` | boolean | A deploy or rollback is running. |
| `deployment_action` | `deploy`, `rollback`, or null | |

### `POST /api/projects`

Creates a project and, by default, writes and loads its unit.

**name** `string` *required*

**service\_name** `string` *required*

Must pass `assertManageableServiceName`.

**template** `string` (default: custom)

**repository** `string`

`https://`, `http://`, `ssh://`, or `git@host:path`.

**branch** `string` (default: main)

**work\_dir** `string`

**exec\_start** `string`

**build\_cmd** `string`

Defaults to the template's build command. Send an empty string for none.

**run\_user** `string`

**memory\_max** `string`

**cpu\_quota** `string`

**create\_unit** `boolean` (default: true)

Set to `false` to only register the project.

```json 201 theme={null}
{
  "id": 3,
  "success": true,
  "unit": {
    "installed": true,
    "unitPath": "/etc/systemd/system/discord-bot.service",
    "content": "[Unit]\n..."
  }
}
```

`unit.warning` is set when the unit could not be written, for example on a non-Linux host, or when the failure alert drop-in could not be installed.

### `DELETE /api/projects/:id`

Deletes the project, its failure alert drop-in, and its Caddy route.

**removeUnit** `string`

Set to `1` to also stop, disable, and delete the unit file.

Returns `{"success": true}` or `404`.

### `POST /api/projects/:id/start`, `/stop`, `/restart`

Run `systemctl start|stop|restart` on the project's service. Return `{"success": true}`.

### `POST /api/projects/:id/autostart`

**enabled** `boolean` *required*

`true` runs `systemctl enable`, `false` runs `systemctl disable`.

Returns `{"success": true}`.

### `POST /api/projects/:id/deploy`

Starts the [deploy pipeline](https://aeros-c1d071c8.mintlify.site/deploy-and-rollback.md#deploy) in the background.

```json 202 theme={null}
{ "started": true, "service_name": "discord-bot" }
```

`409` if a deploy or rollback is already running for this service.

### `POST /api/projects/:id/rollback`

Starts a [rollback](https://aeros-c1d071c8.mintlify.site/deploy-and-rollback.md#rollback) to `previous_commit` in the background.

**commit** `string`

The SHA you expect to roll back to. If sent and it differs from the stored `previous_commit`, the request fails with `409`.

Returns `202` like deploy. `409` if a deploy is running or no previous commit is stored.

## Webhook configuration

### `POST /api/projects/:id/webhook`

Generates a new 32-byte webhook secret, replacing any previous one. The response has `Cache-Control: no-store`.

```json 200 theme={null}
{
  "enabled": true,
  "secret": "<64 hex characters>",
  "path": "/api/webhooks/github/3"
}
```

### `DELETE /api/projects/:id/webhook`

Removes the secret, which disables the webhook. Returns `{"enabled": false}`.

## Environment file

### `GET /api/projects/:id/env`

```json 200 theme={null}
{ "env_vars": "NODE_ENV=production\nPORT=3001\n" }
```

Returns the contents saved by the panel, not the file on disk. `Cache-Control: no-store`.

### `POST /api/projects/:id/env`

**env\_vars** `string` *required*

The full file contents.

Saves the text and writes `<work_dir>/.env` with mode `0600` if the directory exists. Returns `{"success": true}`. `400` if the working directory fails `validateWorkDir`. See [.env editor](https://aeros-c1d071c8.mintlify.site/env-editor.md).

## Caddy

### `GET /api/caddy/status`

```json 200 theme={null}
{
  "installed": true,
  "active": true,
  "routes": [{ "serviceName": "discord-bot", "domain": "app.example.com", "port": 3001 }]
}
```

`routes` lists the `aeros-*.caddy` snippets in `/etc/caddy/conf.d/`, and is empty when Caddy is not active.

### `PUT /api/projects/:id/domain`

**domain** `string` *required*

A lowercase FQDN.

**port** `number` *required*

1 to 65535.

Writes the snippet and reloads Caddy. Returns `{"success": true, "domain": "app.example.com", "port": 3001}`. `400` for an invalid domain or port, or when Caddy is not active.

### `DELETE /api/projects/:id/domain`

Deletes the snippet and reloads Caddy if it is active. Returns `{"success": true}`.

## Backups

### `GET /api/backups`

```json 200 theme={null}
[
  {
    "id": 1,
    "name": "panel-db",
    "paths": ["/opt/aeros-panel/backend/aeros.db"],
    "schedule": "daily",
    "enabled": true,
    "status": "active",
    "destination": "/var/backups/aeros-panel",
    "created_at": 1763748000000
  }
]
```

`status` is the timer's `systemctl is-active` result, `active` or `inactive`. `created_at` is in milliseconds since the epoch.

### `POST /api/backups`

**name** `string` *required*

1 to 40 characters: lowercase letters, digits, `-`, `_`.

**paths** `string[]` *required*

1 to 20 absolute paths.

**schedule** `string` (default: daily)

`hourly`, `daily`, `weekly`, `monthly`, or `HH:MM`.

**enabled** `boolean` (default: false)

Enable and start the timer right away.

```json 201 theme={null}
{
  "id": 1,
  "name": "panel-db",
  "paths": ["/opt/aeros-panel/backend/aeros.db"],
  "schedule": "daily",
  "enabled": true,
  "unitName": "aeros-backup-panel-db",
  "installed": true
}
```

`warning` is set when the units could not be written.

### `POST /api/backups/:id/toggle`

**enabled** `boolean` *required*

Runs `systemctl enable --now` or `disable --now` on the timer. Returns `{"success": true, "enabled": true}`.

### `POST /api/backups/:id/run`

Runs the backup service once with `systemctl start`. Returns `{"success": true}` when it finishes.

### `DELETE /api/backups/:id`

Disables the timer and deletes both units. Archives are kept. Returns `{"success": true}`.

## Settings

### `GET /api/settings/public-status`

```json 200 theme={null}
{ "enabled": false, "token": "" }
```

### `PUT /api/settings/public-status`

**enabled** `boolean`

**token** `string`

An empty string removes the token.

Fields not sent are left unchanged. Returns the updated settings. See [Public status](https://aeros-c1d071c8.mintlify.site/api/public-status.md).

### `GET /api/settings/alerts`

```json 200 theme={null}
{ "enabled": true, "provider": "discord", "supported": true, "configured": true }
```

`supported` is `false` on hosts without Linux and `systemd`. `configured` is `true` when `/etc/aeros-panel/alerts.env` exists. The webhook URL is never returned.

### `PUT /api/settings/alerts`

**enabled** `boolean` *required*

**provider** `string` *required*

`discord`, `telegram`, `ntfy`, or `json`.

**webhookUrl** `string`

Required the first time, or when changing provider. Omit it to keep the saved URL.

Writes the alert files and drop-ins, rolling back to the previous configuration if anything fails. Returns `{"enabled": true, "provider": "discord", "supported": true, "configured": true}`. `409` on unsupported hosts. See [Failure alerts](https://aeros-c1d071c8.mintlify.site/alerts.md).

### `POST /api/settings/alerts/test`

Sends a test alert to the saved webhook. Returns `{"ok": true}`, `409` if no URL is saved, or `502` if the webhook could not be reached or did not answer with `2xx`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.