---
title: HTTP API Reference
slug: api/http-api-reference
docTags: 
createdAt: 2026-03-26T10:42:34.180Z
---

## `GET /ping`

```sh
curl -x GET http://localhost:3005/ping
```

## `GET /logs.txt?unit=$unit_id&from=$timestamp&until=$timestamp`

```sh
curl -x GET http://localhost:3005/logs.txt
```

## `POST /reboot`

```sh
curl -x POST http://localhost:3005/reboot
```

## `POST /shutdown`

```sh
curl -x POST http://localhost:3005/shutdown
```

## `WS /connect`

```text
client -> server: start-log-stream(from = timestamp)
client -> server: stop-log-stream() -> timestamp
server -> client: logs
client -> server: start-service-status-stream()
client -> server: stop-service-status-stream()
server -> client: ServiceUpdate
client -> server: start-machine-status-stream()
client -> server: stop-machine-status-stream()
server -> client: MachineStatusUpdate
```

```sh
websocat ws://localhost:3005/connect
SEND: {"kind": "start-service-status-stream"}
RECV: {"kind":"service-status-update","data":[{"id":"test.service","names":["test.service"],"description":"test.service","active_state":"inactive","substate":"dead"}]}
```

## `GET /unit/$unit_id`

```sh
curl -x GET http://localhost:3005/service/test.service
```

## `POST /unit/$unit_id/start`

```sh
curl -x POST http://localhost:3005/service/test.service/start
```

## `POST /unit/$unit_id/stop`

```sh
curl -x POST http://localhost:3005/service/test.service/stop
```

## `POST /unit/$unit_id/restart`

```sh
curl -x POST http://localhost:3005/service/test.service/restart
```

## `GET /machine-status`

```sh
curl -x GET http://localhost:3005/machine-status
```

```rust
type ServiceUpdate = Vec<ServiceInfo>;
```

```rust
struct ServiceInfo {
	unit_id: String,
	active_state: ServiceState,
	substate: String,
}
```

```rust
struct MachineStatusUpdate {
	device_name: Option<String>,
	network_interfaces: Option<Vec<NetworkInterface>>,
	system_version: Option<String>,
	host_os_version: Option<String>,
	boot_time: Option<DateTime/Timestamp>,
}
```

```rust
struct NetworkInterface {
	name: String,
	mac_address: String,
	ip_addresses: Vec<String>,
}
```
