Everything the server portal and admins do is available as HTTP — the same API
the Telegram bot fronts. Base URL: https://tunneltweak.deployzy.com.
Auth
Send Authorization: Bearer <ttk_key> on every request. Issue keys from the bot
with /apikey. All errors use one envelope: {"error": {"code", "message"}}.
Servers
| Method | Path | Purpose |
|---|---|---|
| POST | /api/v1/servers | Register a VPS + enqueue the install job (returns 202 + job_id) |
| POST | /api/v1/servers/adopt | Register an already-installed box (no reinstall) |
| GET | /api/v1/servers | List your (non-platform) servers |
| GET | /api/v1/servers/{id} | Server details (ports, V2Ray/DNSTT settings) |
| GET | /api/v1/servers/{id}/config | App-importable config URL |
| GET | /api/v1/servers/{id}/health | Live health check |
| POST | /api/v1/servers/{id}/restart | Restart tunnel services |
| DELETE | /api/v1/servers/{id} | Remove the server (cascades accounts) |
POST /api/v1/servers body: label, host, optional ssh_port (22),
root_password or ssh_key, install_profile (1-4), dnstt_domain.
The API SSH-probes first — root access and Ubuntu/Debian required — then installs
in the background; poll the job.
Install jobs
GET /api/v1/jobs/{id} → {id, server_id, status, message, error, started_at, completed_at} with status ∈ queued | running | completed | failed.
Tunnel accounts (VPN users)
| Method | Path | Purpose |
|---|---|---|
| POST | /api/v1/servers/{id}/users | Create an account → 201 with password + connection block |
| GET | /api/v1/servers/{id}/users | List accounts on a server |
| GET | /api/v1/users/{uid} | Account details (no password on read) |
| POST | /api/v1/users/{uid}/renew | Extend — body {"days": n} |
| POST | /api/v1/users/{uid}/password | Reset password (returns it once) |
| POST | /api/v1/users/{uid}/limit | Set max_logins |
| DELETE | /api/v1/users/{uid} | Delete the account |
Create body: optional username, password, days (30), max_logins (2),
selected_configs. The response connection block contains ssh (host,
ports, username, password), v2ray (uuid, port, vless:// share URI + CDN
variant), dnstt (domain, pubkey, nameserver) and payload (SNI host +
WebSocket upgrade request) — everything the app needs to connect.
Ping
GET /api/v1 → {"ok": true, "user_id": n} — confirm the key works.
