v0.2.19
Admin API
This release introduces the Admin API. A full set of REST endpoints for managing your Uptime Monitor configuration programmatically. Create, read, update, and delete monitors, groups, status pages, notification channels, and pulse monitors without manually editing config.toml.
Getting Started
Add this to your config.toml to enable the Admin API:
[adminAPI]
enabled = true
token = "your-secure-admin-token-here"All endpoints are authenticated via Authorization: Bearer <token>.
Endpoints
| Resource | List / Create | Get / Update / Delete |
|---|---|---|
| Configuration | GET /v1/admin/config |
- |
| Monitors | GET/POST /v1/admin/monitors |
GET/PUT/DELETE /v1/admin/monitors/:id |
| Groups | GET/POST /v1/admin/groups |
GET/PUT/DELETE /v1/admin/groups/:id |
| Status Pages | GET/POST /v1/admin/status-pages |
GET/PUT/DELETE /v1/admin/status-pages/:id |
| Notification Channels | GET/POST /v1/admin/notifications |
GET/PUT/DELETE /v1/admin/notifications/:id |
| Pulse Monitors | GET/POST /v1/admin/pulse-monitors |
GET/PUT/DELETE /v1/admin/pulse-monitors/:id |
Highlights
- Safe for production - all inputs are validated before writing. If a config reload fails after write, the previous configuration is automatically restored.
- Automatic reference cleanup - deleting a group removes its
groupIdfrom monitors, its ID from status page items, and itsparentIdfrom child groups. Same applies to monitors, notification channels, and pulse monitors. - Partial updates -
PUTendpoints accept only the fields you want to change. Set a field tonullto remove optional values. - Conflict detection - duplicate IDs, tokens, and slugs are rejected with
409 Conflict. - OpenAPI spec updated - all admin endpoints are fully documented in
/openapi.json
Example: Create a Monitor
curl -X POST http://localhost:3000/v1/admin/monitors \
-H "Authorization: Bearer your-secure-admin-token-here" \
-H "Content-Type: application/json" \
-d '{
"id": "api-staging",
"name": "Staging API",
"token": "tk_staging_api_secret",
"interval": 30,
"maxRetries": 2,
"resendNotification": 0,
"groupId": "staging",
"notificationChannels": ["critical"]
}'