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

# Server & Settings

> Settings, tasks, metrics, updates and hot reload

All endpoints need an [admin token](https://docs.kernelmedia.tv/api-reference/admin/overview.md#authentication).

## Settings

| Method | Path | Description |
| - | - | - |
| `GET` | `/api/admin/settings` | Current server settings, as `{"settings": {...}}` |
| `PUT` | `/api/admin/settings` | Update settings |

`PUT` merges the fields you send into the current settings, so you only need to send what changes. It returns the merged result in the same `{"settings": {...}}` shape.

```bash theme={null}
curl -X PUT http://<server>:9014/api/admin/settings \
  -H "Authorization: Bearer <admin-jwt>" \
  -H "Content-Type: application/json" \
  -d '{"Server": {"timezone": "America/Chicago"}}'
```

> [!NOTE]
>
> Pro/Lifetime settings (the remote transcoder and self-heal blocks) are kept as they were unless the server is linked to a Pro account. The save still succeeds.

## Hot reload

`POST /api/admin/server/reload` <sup>New in 0.9.0</sup>

Re-executes the server binary in place without stopping Live TV streams. Sending `SIGUSR2` to the process does the same thing.

## Libraries

| Method | Path | Description |
| - | - | - |
| `GET` | `/api/admin/library-counts` <sup>New</sup> | Live item count per library: movies for movie libraries, series for TV libraries. Not cached, so it moves while a library syncs. |
| `PUT` | `/libraries/order` <sup>New</sup> | Set the order libraries appear in the menu. Body: `{"ids": ["<library-id>", ...]}` |

## Refresh Live TV

| Method | Path | Description |
| - | - | - |
| `POST` | `/api/admin/refresh` | Re-fetch every Live TV source and EPG, then rebuild the guide |
| `POST` | `/api/admin/refresh/epg` | Re-fetch the EPG only |

Both run in the background and return `{"status": "started"}` right away.

## Tasks

Long-running jobs run as tasks.

| Method | Path | Description |
| - | - | - |
| `GET` | `/api/admin/tasks` | List tasks |
| `POST` | `/api/admin/tasks` | Start a task |
| `GET` | `/api/admin/tasks/{task_id}` | One task's status and progress |
| `POST` | `/api/admin/tasks/{task_id}/cancel` | Cancel a running task |

`POST /api/admin/tasks` takes a `task_type` plus the target it applies to:

**task\_type** `string` *required*

`library_scan`, `live_tv_refresh`, `detect_markers` (intro and credits detection) or `segment_pregenerate`

**library\_id** `string`

**movie\_id** `string`

**series\_id** `string`

**episode\_id** `string`

## Metrics

`GET /api/admin/metrics` returns a snapshot for the dashboard: `cpu`, `memory`, `network`, the server process's own `process_cpu` and `process_memory`, active `connections`, and a `timestamp`.

## Updates

For zip installs. Package-managed installs (apt, dnf, Homebrew) refuse these and tell you to upgrade with the package manager. See [Updating](https://docs.kernelmedia.tv/updating.md).

| Method | Path | Description |
| - | - | - |
| `POST` | `/api/admin/updates/check` | Check for a newer release |
| `POST` | `/api/admin/updates/download` | Download and verify the update, staging it on disk |
| `POST` | `/api/admin/updates/apply` | Swap in the staged binary and restart |

## Linked account

Links the server to a kernelmedia.tv account, which is what unlocks [Pro features](https://docs.kernelmedia.tv/pro-features.md).

| Method | Path | Description |
| - | - | - |
| `GET` | `/api/admin/linked-account` | Link status (any signed-in user) |
| `POST` | `/api/admin/linked-account/initiate` | Start linking. Returns `{auth_url, state}`; open `auth_url` in a browser. |
| `POST` | `/api/admin/linked-account/complete` | Finish linking. Body: `{"code": "...", "state": "..."}` |
| `DELETE` | `/api/admin/linked-account` | Unlink |


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