API
gpsu serves a JSON API under /api/v1 at the same address as the web UI. Sign-In and the API describes both.
Authentication
| Credential | Source |
|---|---|
| Browser session | Browser sign-in |
| Identity provider access token (bearer) | gpsu login |
| Personal API token (bearer) | My account |
- A browser session also needs its CSRF token to make changes.
- A caller can do through the API only what their role and capabilities allow in the web UI.
Routes
Paths are relative to /api/v1.
| Route | Serves | Who |
|---|---|---|
/me | The signed-in user and their role | Anyone signed in |
/servers, /servers/{name} | Each server’s state | Anyone signed in |
/servers/{name}/history | A server’s readings over a time range. The default range is the last hour. | Anyone signed in |
/servers/{name}/series | The series a server can chart | Anyone signed in |
/readings?series=1,2&from=…&to=…&points=300 | Readings for the series you name | Anyone signed in |
/events | The live event stream | Anyone signed in |
/dashboards | The dashboards the caller may see | Anyone signed in |
/users | Every user | Admins |
/users/{subject} | One user. me stands for the caller. | That user and admins |
/access | Each role’s capabilities | Admins |
/provider | The identity provider | Admins |
/settings/servers | Each server’s settings | Admins |
/settings/dashboards | Which built-in dashboards appear and the default start page | Admins |
/settings/backups | When the daily backup runs and how many backups stay | Admins |
/settings/history | How long each reading and each five-minute summary stays | Admins |
/settings/learning | How curves learn from readings | Admins |
/settings/sign-in-limits | How long a browser stays signed in, how failed sign-ins slow down, and who needs a second factor | Admins |
/notifications | Notification targets. The route exists only when the notifications block is set. | Admins |
/audit | The audit log | Admins |
User routes
Each user has these routes under /users/{subject}:
| Route | Serves |
|---|---|
logins | The user’s logins |
sign-out | Signs the user out everywhere |
tokens | The user’s personal API tokens |
preferences | Themes, temperature unit, time zone, start page, default chart range, and live updates |
Only that user can read or change their preferences.
Dashboard settings
GET /api/v1/settings/dashboards reads the dashboard settings. PUT replaces them with a body like this:
{"hidden": ["default-7d"], "start": ""}| Field | Values |
|---|---|
hidden | Built-in dashboards to hide. The IDs are default-1h, default-6h, default (24 hours), and default-7d. At least one must stay visible. |
start | The default start page. Empty means the 24-hour built-in dashboard. It can also name a shared dashboard. A user’s own start page takes precedence. |
Backup settings
GET /api/v1/settings/backups reads when the daily backup runs and how many backups stay. PUT replaces them with a body like this:
{"daily": true, "at": "03:00", "keep": 14}| Field | Values |
|---|---|
daily | true runs the daily backup |
at | The time of day such as 03:00, in gpsu’s local time zone |
keep | How many backups stay: 3, 7, 14, 30, 60, or 90 |
History retention
GET /api/v1/settings/history reads how long the history stays. PUT replaces it with a body like this:
{"raw": "336h", "rollup": "9600h"}| Field | Values |
|---|---|
raw | How long each reading stays: 24h, 72h, 168h, 336h, 720h, 1440h, or 2160h |
rollup | How long each five-minute summary stays: 2160h, 4320h, 9600h, 17520h, or 43800h |
Learning settings
GET /api/v1/settings/learning reads how curves learn. PUT replaces the settings with a body like this:
{"target": 70, "margin": 3, "step": 2, "windowDays": 7, "minWindows": 3, "at": "04:00"}Learning lists each default and range.
Sign-in limits
GET /api/v1/settings/sign-in-limits reads the limits. set holds what an admin set. inForce holds every limit with its defaults filled in. PUT replaces what is set with a body like this. DELETE returns every limit to its default.
{"idleTimeout": "2h", "failures": 3, "requireSecondFactor": true}| Field | Values |
|---|---|
idleTimeout, sessionLength, firstWait, longestWait | Durations such as 12h. Leave one out to use its default. |
failures | Failed sign-ins in a row before a wait. Leave it out to use its default. |
requireSecondFactor | true makes every local account add an authenticator app. Leave it out to require one of admins only. |
Sign-in limits lists each default and range.
Overrides
Operators and admins can set overrides. Admins can also let viewers hand off to the iDRAC. Overrides describes each kind.
| Request | Body | Effect |
|---|---|---|
PUT /api/v1/servers/{name}/override | {"kind": "fixed", "percent": 40, "duration": "2h"} | Holds a fixed speed |
PUT /api/v1/servers/{name}/override | {"kind": "auto", "duration": "30m"} | Hands off the fans to the iDRAC |
DELETE /api/v1/servers/{name}/override | Ends the override early | |
POST /api/v1/servers/hand-all | Hands off every server’s fans to the iDRAC for the Hand off all duration | |
GET /api/v1/overrides | Lists the durations an override can use, its default, and its longest |
Curves
Anyone signed in can read a curve. Only admins can change one.
| Request | Body | Effect |
|---|---|---|
GET /api/v1/servers/{name}/curve | The running curve, the template curve, and the revisions | |
PUT /api/v1/servers/{name}/curve | {"curve": [...], "reason": "..."} | Saves a new revision and runs it |
POST /api/v1/servers/{name}/curve/rollback | {"revision": 12} | Runs that revision. Revision 0 runs the template curve. |
PUT /api/v1/servers/{name}/curve/pin | Pins the curve. Learning can’t change a pinned curve. | |
DELETE /api/v1/servers/{name}/curve/pin | Unpins it | |
PUT /api/v1/servers/{name}/curve/learning | Turns learning on | |
DELETE /api/v1/servers/{name}/curve/learning | Turns learning off |
Servers
Admins manage servers under /api/v1/settings/servers. Each change reaches the server’s fan control at once.
A read-only API token can only read these routes.
| Request | Effect |
|---|---|
GET /api/v1/settings/servers | Lists each server’s settings and whether its fan control is running. A server that didn’t start includes the reason. |
POST /api/v1/settings/servers | Adds a server and starts fan control for it |
GET /api/v1/settings/servers/{name} | Shows one server’s settings |
PUT /api/v1/settings/servers/{name} | Replaces a server’s settings and restarts its fan control |
DELETE /api/v1/settings/servers/{name} | Hands off the server’s fans to the iDRAC and removes it |
POST /api/v1/settings/servers/{name}/test | Reads the server’s sensors from its iDRAC and marks the ones gpsu uses |
POST and PUT take a body like this:
{"settings": {...}, "password": "..."}settingsholds the fields the Servers page describes.- gpsu stores
passwordencrypted with the seal key. - Leave out
passwordwhensettingsnamespasswordVault. - A
PUTwithoutpasswordkeeps the stored password. - Responses never include a password.
- A server’s name can’t change.
Test responses
A test uses the iDRAC session that fan control already holds. It never opens a second session. It also respects the wait after a refused login.
| Status | Meaning |
|---|---|
200 | The test ran. The body lists the sensors. |
409 | Fan control isn’t running for the server. The body gives the reason. |
503 | The server is waiting after a refused login. The body says when gpsu will try again. |
Notifications
Admins manage notification targets under /api/v1/notifications. Each target is one Shoutrrr URL. Changes need a browser session.
| Request | Effect |
|---|---|
GET /api/v1/notifications | Lists targets |
POST /api/v1/notifications | Adds a target |
PATCH /api/v1/notifications/{id} | Changes a target. An empty url keeps the current one. |
DELETE /api/v1/notifications/{id} | Removes a target |
POST /api/v1/notifications/test | Sends a test notification to a URL before it’s saved. The body is {"name": "phone", "url": "<Shoutrrr URL>"}. |
POST /api/v1/notifications/{id}/test | Sends a test notification to a saved target. A body with a url tests that URL in place of the saved one. |
GET /api/v1/notifications/history | Lists sent notifications, newest first |
GET /api/v1/notifications/policy | Reads the delivery rules |
PUT /api/v1/notifications/policy | Replaces the delivery rules |
A target looks like this:
{"name": "phone", "url": "<Shoutrrr URL>", "minSeverity": "warning", "enabled": true}A test answers with:
| Status | Meaning |
|---|---|
204 | The target accepted the test. |
400 | The URL is missing, doesn’t read, or breaks the delivery rules. |
429 | The test came within 10 seconds of the last one. Each saved target and each admin’s unsaved URLs count apart. |
502 | The target refused the test. The body says why. It never holds the URL. |
The delivery rules look like this. Leave services out to allow every service.
{"allowPrivate": true, "services": ["gotify", "ntfy"]}History
Each history entry has an outcome for every target:
outcome | Meaning |
|---|---|
pending | The notification is queued for the target. |
sent | The target accepted it. |
failed | The target refused it or didn’t answer. reason says why. |
held | The target’s rate limit delayed it. |
dropped | The target’s queue was full. |
?before=returns entries older than a time.?limit=sets the page size.
gpsu keeps history as long as it keeps five-minute reading summaries. Storage and Backups sets that retention. History never stores a target’s URL.