Servers Endpoint
List, get, and manage monitored servers programmatically.
GET /api/v1/servers
List every server in your organization. Scope: read:servers. Filters: ?status=online|offline|stale, ?collector_mode=hosted|agent, plus the standard ?page=1&limit=50.
{
"data": [
{
"id": 4,
"name": "prod-db-writer",
"host": "prod.abc.eu-west-1.rds.amazonaws.com",
"port": 5432,
"organization_id": 1,
"collector_mode": "hosted",
"environment_type": "amazon_rds",
"status": "online",
"last_collected": "2026-04-24T20:17:59Z",
"created_at": "2026-04-24T17:18:54Z"
}
],
"meta": { "page": 1, "limit": 50, "total": 1 }
}
GET /api/v1/servers/:id
Full details for one server, including discovered databases, installed extensions, and current GUC overrides. Scope: read:servers.
DELETE /api/v1/servers/:id
Removes the server from monitoring. Scope: admin:servers (write-level, restricted). 204 on success.
Worth knowing: deleting through the API does not drop the monpg_monitor role on your DB. You run the rollback script for that — it's printed in Settings → Servers → Rollback. If you skip the rollback step, the role stays on your DB harmlessly until you delete it manually. (Some teams keep it forever in case they re-add the server.)
Watchdog example
Cron from anywhere. Pings once an hour to verify MonPG is collecting your fleet:
curl -H "Authorization: Bearer $MONPG_KEY" "https://api.monpg.app/api/v1/servers?status=offline" | jq '.data | length'
Output greater than 0 means at least one monitored server has gone stale. Page your team through whatever channel you'd rather hear from than us.