API
Everything the dashboard does, over HTTP. Monitors, incidents, status pages, on-call and push are all available, so a deployment can be managed by whatever you already use to manage things.
The address
Every request goes to
https://monitrx.fyi/api/v1, or to the address of your own deployment. The dashboard calls the same API, so anything you can do here you can do in a script.
export MONITRX_API="https://monitrx.fyi/api/v1" export MONITRX_KEY="mxk_..."
Authentication
Send an API key as a bearer token. Keys are created under Settings → API keys and belong to a person, so they carry that person's access.
curl -H "Authorization: Bearer $MONITRX_KEY" \ "https://monitrx.fyi/api/v1/orgs/acme/monitors"
A key can be read-only, which lets it list monitors and incidents, or read-write, which can also create and change them. The read-only one is the right choice for a script that only reports.
Organisations
Every resource belongs to an organisation, named by its slug. The slug is in the address bar of the dashboard, and the list is here too.
/orgsThe organisations you belong to./orgs/{slug}/monitorsEvery monitor, with its current state./orgs/{slug}/monitorsCreate a monitor./orgs/{slug}/monitors/{id}One monitor./orgs/{slug}/monitors/{id}Change a monitor./orgs/{slug}/monitors/{id}Remove a monitor and its history./orgs/{slug}/monitors/{id}/resultsRecent checks and uptime for a window./orgs/{slug}/monitors/{id}/seriesThe bucketed history behind the charts./orgs/{slug}/monitors/seriesThe history for every monitor, in one call./orgs/{slug}/summaryCounts for the dashboard header.Incidents
/orgs/{slug}/incidentsIncidents, newest first./orgs/{slug}/monitors/{id}/incidentsOne monitor's incident history./orgs/{slug}/incidents/{id}/acknowledgeStop the on-call being paged for it./orgs/{slug}/incidents/{id}Remove a resolved incident.Importing
Monitors can be brought in from another monitoring system, and their history with them.
/orgs/{slug}/monitors/import/previewRead a source and list what it contains. Creates nothing./orgs/{slug}/monitors/importCreate the chosen monitors, and optionally their history.The source is either an Uptime Kuma instance, read through its own API with a token, or a JSON document pasted in. The document is forgiving about spelling: a name under
nameor
label, an address under
url,
target,
address,
hostnameor
host, and a type as a name or a number.
curl -X POST "$MONITRX_API/orgs/acme/monitors/import" \
-H "Authorization: Bearer $MONITRX_KEY" \
-H "Content-Type: application/json" \
-d '{
"source": "json",
"region": "eu-west",
"names": ["API", "Website"],
"payload": [
{"name": "API", "url": "https://api.example.com", "type": "http", "interval": 60}
]
}'Status pages
A status page is public, so its read endpoint needs no key. It is also the one that is cached, because strangers read it.
/status/{slug}A public status page. No key needed./status/{slug}/incidentsA page's incident history./status/{slug}/maintenancesA page's maintenance history./orgs/{slug}/status-pagesYour status pages./orgs/{slug}/status-pagesCreate a status page.On-call and escalation
/orgs/{slug}/on-call/schedulesThe rotas./orgs/{slug}/on-call/schedules/{id}/membersWho is on a rota./orgs/{slug}/escalation/policiesThe escalation ladders./orgs/{slug}/push/subscriptionsDevices registered for push.Errors
Errors come back as JSON with an
errorand a
codethat says which kind of thing went wrong, so a script can tell a missing monitor from a bad key without matching on the message.
{
"error": "monitor not found",
"code": "not_found"
}