# Endpoints

## Overview

Overview of all Cntrl API endpoints and capabilities.

Cntrl exposes a simple RESTful API. All endpoints are prefixed with `/api`.

## [Base URL](/content/docs/api#base-url/index.html)

By default, the API is available at:
`http://<YOUR_PC_IP>:9990`

### Custom Ports

`9990` is the default port. If you changed the port during installation or in the `config.json` file, make sure to use your custom port here.

## [Quick Reference](/content/docs/api#quick-reference/index.html)

[**System Info** 
Static hardware information (CPU, GPU, RAM specs).](/content/docs/api/system/index.html) [**Usage Data** 
Dynamic usage metrics (load, temps, percentages).](/content/docs/api/usage/index.html) [**Power Control** 
Shutdown, restart, sleep, and hibernate commands.](/content/docs/api/power/index.html) [**Media Control** 
Control media playback and get now-playing info.](/content/docs/api/media/index.html) [**Processes** 
Top processes by memory usage.](/content/docs/api/processes/index.html) [**SSE Stream** 
Real-time system stats stream.](/content/docs/api/stream/index.html) [**WebSocket** 
Real-time bidirectional API with subscriptions.](/content/docs/ws/index.html)

## [Endpoint Summary](/content/docs/api#endpoint-summary/index.html)

| Method | Endpoint                     | Description                        | Status       |
| ------ | ---------------------------- | ----------------------------------| ------------ |
| `GET`  | `/api/status`                | Health check                      | ✅ Stable    |
| `GET`  | `/api/system`                | Static system info                | ✅ Stable    |
| `GET`  | `/api/usage`                 | Dynamic usage data                | ✅ Stable    |
| `POST` | `/api/pw/*`                  | Power commands                     | ✅ Stable    |
| `GET`  | `/api/media/status`          | Now playing info                  | ✅ Stable    |
| `POST` | `/api/media/control`         | Media controls                    | ✅ Stable    |
| `GET`  | `/api/processes`             | Top processes (Aggregated)       | ✅ Stable    |
| `GET`  | `/api/processes/{name}`      | Process details & PIDs           | ✅ Stable    |
| `POST` | `/api/processes/focus`       | Focus window                      | ✅ Stable    |
| `POST` | `/api/processes/kill`        | Terminate process                 | ✅ Stable    |
| `POST` | `/api/processes/launch`      | Launch application                | ✅ Stable    |
| `GET`  | `/api/stream`                | SSE real-time stats              | ✅ Stable    |
| `WS`   | `/api/ws`                    | WebSocket (bidirectional)         | ✅ Stable    |
| `GET`  | `/api/stats`                 | Combined stats                    | ⚠️ Deprecated |

### Deprecated Endpoint

`/api/stats` is deprecated and will be removed in future updates. Use `/api/system` and `/api/usage` instead.
