HF PanelDocsv1.0.0

API: status and sync

Read the server's load, memory, disk and services, and the websites a token may sync with HF Server.

These endpoints describe the server, its status page and the websites a token can see. The HF Server desktop app shows them on its Servers page; monitoring scripts can use them too. Any token may call them, Read only tokens included.

bash
A=https://api.yourdomain.com:2087/v1
H="Authorization: Bearer hf_xxx"

GET /v1/status

The server's version and health, and how many accounts and websites the token sees.

bash
curl -s -H "$H" $A/status
json
{
    "ok": true,
    "data": {
        "version": "1.0.0",
        "host": "panel.yourdomain.com",
        "time": 1793023200,
        "accounts": 42,
        "sites": 57,
        "load": [
            0.12,
            0.08,
            0.05
        ],
        "uptime": "3 days, 4 hours",
        "memory": {
            "used": 812,
            "total": 3915
        },
        "disk": {
            "used": 6120,
            "total": 77012
        },
        "services": {
            "nginx": true,
            "php": true,
            "mariadb": true,
            "mail": true,
            "dns": true
        }
    }
}
Field What it is
version the HF Panel version
host the panel's host name
time the server's clock, as a Unix timestamp
accounts hosting accounts the token sees: all for an administrator, the reseller's customers for a reseller, 1 for a customer
sites domains of those accounts
load the load average over 1, 5 and 15 minutes
uptime how long the server has been running
memory, disk used and total, in MB
services whether each service is running

Note: when the server's agent does not answer, load, uptime, memory, disk and services are left out. The other fields are always there.

The status page

GET /v1/status/page needs no token: it answers the public status page as JSON — the same as /status.json — or 404 while the page is switched off.

bash
curl -s $A/status/page

Administrator tokens can also read and write incidents and maintenance:

bash
curl -s -H "$H" $A/status/incidents
curl -s -X POST -H "$H" -H "Content-Type: application/json" $A/status/incidents \
  -d '{"title":"Email is slow to arrive","body":"We are looking into it.","parts":["mail"],"impact":"minor"}'
curl -s -X POST -H "$H" -H "Content-Type: application/json" $A/status/incidents/9/updates \
  -d '{"status":"resolved","body":"Fixed."}'

For maintenance, send "kind":"maintenance" with starts (and optionally ends) in UTC. Add "email":true to email every customer, as the screen's checkbox does. parts are web, mail, dns, db and panel.

GET /v1/sync/sites

The websites the token may sync with, as the HF Server desktop app lists them. Parked domains are left out.

  • With a customer's token: the token's own account.
  • With an administrator's or reseller's token: every account the token sees, or one account with ?account=<username>.
bash
curl -s -H "$H" "$A/sync/sites?account=sarahbakes"
json
{
    "ok": true,
    "data": {
        "server": "panel.yourdomain.com",
        "version": "1.0.0",
        "sites": [
            {
                "name": "example.com",
                "domain": "example.com",
                "account": "sarahbakes",
                "url": "https://example.com",
                "ssl": true,
                "php": "8.3",
                "folder": "web/example.com/public_html",
                "type": "domain"
            }
        ]
    }
}
Field What it is
url the website's address: https:// when it has SSL, else http://
php the PHP version
folder the website's folder as HF Server uses it
type domain or subdomain