Homerouter Proxy API
Access
API base: https://vpn.homerouter.io/api/v1
Use the admin page with its secure session cookie, or send Authorization: Bearer <token> from a trusted backend service.
Configure the service token as PROXY_API_TOKEN on the proxy. It must be at least 32 characters and must not be exposed in browser code. Without a token, server-to-server clients can use the admin login and session cookie.
After the first admin sign-in, change the bootstrap password before managing users.
Routes
| Method | Route | Description | Success |
|---|---|---|---|
| GET | /status | API, data file, log level, and live traffic overview | 200 |
| GET/PATCH | /settings/logging | Read or update the persistent Docker log level | 200 |
| POST | /proxy/disconnect | Close this user's active connections | 200 |
| POST | /proxy/verify | Verify proxy credentials directly over HTTPS | 200 / 401 |
| GET | /users | User metadata and active requests/tunnels | 200 |
| POST | /users | Create a proxy user; duplicate names return 409 | 201 / 409 |
| GET | /users/{username} | Read one user's metadata | 200 |
| PATCH | /users/{username} | Change the password, disabled state, or both | 204 |
| DELETE | /users/{username} | Delete a proxy user | 204 |
All JSON requests use Content-Type: application/json. Errors are returned as {"error":"..."}. Passwords must be at least 12 characters.
Docker Log Level
GET /api/v1/settings/logging returns the current level. Use PATCH /api/v1/settings/logging with {"level":"DEBUG"} to apply and persist a new level immediately.
Valid levels: DEBUG, INFO, WARNING, ERROR. Log lines include username, remote IP, target host, status, bytes, and duration; passwords, auth headers, URL paths, and request bodies are never logged.
Follow Docker output with docker compose logs -f vpn-proxy.
The admin view refreshes live users and connections every five seconds. A user is counted only while an HTTP request is processing or a CONNECT tunnel is open; this is not a persistent login session.
Disconnect Proxy Connections
The extension's DISCONNECT TUNNEL action sends the proxy username and password over HTTPS to POST /api/v1/proxy/disconnect. The server cancels all active requests and tunnels for that username. If the account is used on multiple devices, all of them are disconnected.
A forced browser or OS shutdown cannot send the disconnect request; TCP connections close through normal socket cleanup instead.
Verify Proxy Credentials
The extension verifies the username and password directly with POST /api/v1/proxy/verify over HTTPS before testing proxy traffic. This bypasses Chrome's cached proxy authentication, so the browser does not need to be restarted after credential changes.
The endpoint only reports whether the credentials are valid; it does not create a session.
Example: Create a User
curl --request POST \
--url https://vpn.homerouter.io/api/v1/users \
--header 'Authorization: Bearer <PROXY_API_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{"username":"service-user","password":"<12+ character secret>"}'