Skip to content
API

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

CredentialSource
Browser sessionBrowser 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.

RouteServesWho
/meThe signed-in user and their roleAnyone signed in
/servers, /servers/{name}Each server’s stateAnyone signed in
/servers/{name}/historyA server’s readings over a time range. The default range is the last hour.Anyone signed in
/servers/{name}/seriesThe series a server can chartAnyone signed in
/readings?series=1,2&from=…&to=…&points=300Readings for the series you nameAnyone signed in
/eventsThe live event streamAnyone signed in
/dashboardsThe dashboards the caller may seeAnyone signed in
/usersEvery userAdmins
/users/{subject}One user. me stands for the caller.That user and admins
/accessEach role’s capabilitiesAdmins
/providerThe identity providerAdmins
/settings/serversEach server’s settingsAdmins
/settings/dashboardsWhich built-in dashboards appear and the default start pageAdmins
/settings/backupsWhen the daily backup runs and how many backups stayAdmins
/settings/historyHow long each reading and each five-minute summary staysAdmins
/settings/learningHow curves learn from readingsAdmins
/settings/sign-in-limitsHow long a browser stays signed in, how failed sign-ins slow down, and who needs a second factorAdmins
/notificationsNotification targets. The route exists only when the notifications block is set.Admins
/auditThe audit logAdmins

User routes

Each user has these routes under /users/{subject}:

RouteServes
loginsThe user’s logins
sign-outSigns the user out everywhere
tokensThe user’s personal API tokens
preferencesThemes, 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": ""}
FieldValues
hiddenBuilt-in dashboards to hide. The IDs are default-1h, default-6h, default (24 hours), and default-7d. At least one must stay visible.
startThe 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}
FieldValues
dailytrue runs the daily backup
atThe time of day such as 03:00, in gpsu’s local time zone
keepHow 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"}
FieldValues
rawHow long each reading stays: 24h, 72h, 168h, 336h, 720h, 1440h, or 2160h
rollupHow 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}
FieldValues
idleTimeout, sessionLength, firstWait, longestWaitDurations such as 12h. Leave one out to use its default.
failuresFailed sign-ins in a row before a wait. Leave it out to use its default.
requireSecondFactortrue 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.

RequestBodyEffect
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}/overrideEnds the override early
POST /api/v1/servers/hand-allHands off every server’s fans to the iDRAC for the Hand off all duration
GET /api/v1/overridesLists the durations an override can use, its default, and its longest

Curves

Anyone signed in can read a curve. Only admins can change one.

RequestBodyEffect
GET /api/v1/servers/{name}/curveThe 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/pinPins the curve. Learning can’t change a pinned curve.
DELETE /api/v1/servers/{name}/curve/pinUnpins it
PUT /api/v1/servers/{name}/curve/learningTurns learning on
DELETE /api/v1/servers/{name}/curve/learningTurns 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.

RequestEffect
GET /api/v1/settings/serversLists each server’s settings and whether its fan control is running. A server that didn’t start includes the reason.
POST /api/v1/settings/serversAdds 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}/testReads the server’s sensors from its iDRAC and marks the ones gpsu uses

POST and PUT take a body like this:

{"settings": {...}, "password": "..."}
  • settings holds the fields the Servers page describes.
  • gpsu stores password encrypted with the seal key.
  • Leave out password when settings names passwordVault.
  • A PUT without password keeps 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.

StatusMeaning
200The test ran. The body lists the sensors.
409Fan control isn’t running for the server. The body gives the reason.
503The 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.

RequestEffect
GET /api/v1/notificationsLists targets
POST /api/v1/notificationsAdds 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/testSends a test notification to a URL before it’s saved. The body is {"name": "phone", "url": "<Shoutrrr URL>"}.
POST /api/v1/notifications/{id}/testSends 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/historyLists sent notifications, newest first
GET /api/v1/notifications/policyReads the delivery rules
PUT /api/v1/notifications/policyReplaces the delivery rules

A target looks like this:

{"name": "phone", "url": "<Shoutrrr URL>", "minSeverity": "warning", "enabled": true}

A test answers with:

StatusMeaning
204The target accepted the test.
400The URL is missing, doesn’t read, or breaks the delivery rules.
429The test came within 10 seconds of the last one. Each saved target and each admin’s unsaved URLs count apart.
502The 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:

outcomeMeaning
pendingThe notification is queued for the target.
sentThe target accepted it.
failedThe target refused it or didn’t answer. reason says why.
heldThe target’s rate limit delayed it.
droppedThe 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.