REST API overview¶
Everything the UI does goes through a JSON REST API you can script against.
- ๐ Reference: API reference covers every endpoint, with parameters, examples, edge cases and recipes.
- ๐งพ OpenAPI 3.1: browse it interactively or download openapi.yaml and import it into Postman, Insomnia, Bruno or Swagger UI.
- External apps:
http://<host>:5959/api/external, with an API key. - On a trusted network:
http://<host>:5959/api/proxy, the web app's own path, without a key.
HV=http://localhost:5959/api/proxy
curl "$HV/health" # {"status":"ok",...}
curl "$HV/search?q=drill&include_all=true" # where's the drill?
curl -X POST "$HV/items" -H 'Content-Type: application/json' \
-d '{"name":"AA Batteries","quantity":8,"quantity_min":4,"container_id":12}'
curl -X POST "$HV/images/item/42" -F "image=@photo.jpg;type=image/jpeg"
curl -X POST "$HV/backups/run"
API keys¶
- Open Settings โ API Keys, name the key, choose Read only or Read and write, and optionally an expiry.
- Copy the key. It is shown only once.
- Send it with each request:
curl -H "Authorization: Bearer $HV_KEY" "http://localhost:5959/api/external/search?q=drill&include_all=true"
Revoke a key from the same page at any time. Keys can never manage other keys, change backup or NAS settings, restore backups or edit raw tables. Details are in API reference.
Use GET /api/proxy/health for uptime monitoring (Uptime Kuma, Home Assistant).
The image already includes a Docker health check.