REST API¶
All API endpoints require authentication. Two methods are supported:
-
Basic Auth (recommended for CLI/scripts):
-
Session cookie (for web UI): Login via
POST /loginto get a session cookie.
Monitors¶
List Monitors¶
Response: 200 OK
[
{
"id": "uuid",
"name": "Google",
"url": "https://www.google.com",
"pipeline": [{"type": "http"}],
"interval": 30,
"schedule": null,
"enabled": true,
"tags": ["search", "public"],
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-01T00:00:00Z",
"last_check": "2024-01-01T12:00:00Z",
"last_status": "up"
}
]
Create Monitor¶
Request body:
{
"name": "My Service",
"url": "https://api.example.com",
"pipeline": [
{"type": "http"},
{"type": "dhis2", "username": "admin", "password": "district"}
],
"interval": 30,
"schedule": "*/5 * * * *",
"enabled": true,
"tags": ["production", "api"]
}
Response: 201 Created
Get Monitor¶
Response: 200 OK or 404 Not Found
Update Monitor¶
Request body (all fields optional):
{
"name": "Updated Name",
"pipeline": [{"type": "http"}],
"interval": 60,
"enabled": false,
"tags": ["staging"]
}
Response: 200 OK or 404 Not Found
Delete Monitor¶
Response: 204 No Content or 404 Not Found
Run Check¶
Run all configured checks for a monitor immediately.
Response: 200 OK
{
"id": "result-uuid",
"monitor_id": "monitor-uuid",
"status": "up",
"message": "http: 200 OK; dhis2: 2.41.0",
"elapsed_ms": 450.5,
"details": {
"http": {"status_code": 200},
"dhis2": {"version": "2.41.0", "revision": "abc123"}
},
"checked_at": "2024-01-01T12:00:00Z"
}
Check All Monitors¶
Run checks for all enabled monitors (optionally filtered by tag).
Response: 200 OK with array of check results.
Get Results¶
Get historical check results for a monitor.
Response: 200 OK
[
{
"id": "result-uuid",
"monitor_id": "monitor-uuid",
"status": "up",
"message": "http: 200 OK",
"elapsed_ms": 150.0,
"details": {"http": {"status_code": 200}},
"checked_at": "2024-01-01T12:00:00Z"
}
]
Tags¶
List Tags¶
Get all unique tags across monitors.
Response: 200 OK
Check Types¶
HTTP Check¶
Basic HTTP/HTTPS connectivity check with optional custom headers.
With custom headers (e.g., for API authentication):
{
"type": "http",
"headers": {
"Authorization": "Bearer your-token",
"X-API-Key": "your-api-key"
}
}
DHIS2 Check¶
DHIS2 instance check with authentication and version info.
Returns system info including version, revision, build time.
Status Values¶
up- All checks passeddegraded- Some issues but service reachabledown- Service unreachable or check failed