Appearance
Dashboard API Reference
This guide provides detailed information about the Dashboard API endpoints.
Authentication
All dashboard endpoints require authentication using a Project API Token. Include your token in the Authorization header:
bash
Authorization: Bearer YOUR_PROJECT_API_TOKENFor more information about authentication, see the Authentication Guide.
Get Dashboard Statistics
Retrieve dashboard statistics for your project, including overall uptime, monitor counts, and average response time.
http
GET /api/v1/dashboard/statistics
Authorization: Bearer YOUR_PROJECT_API_TOKENExample with curl:
bash
curl -X GET "https://app.uptinio.com/api/v1/dashboard/statistics?period=30d" \
-H "Authorization: Bearer YOUR_PROJECT_API_TOKEN" \
-H "Content-Type: application/json"Query Parameters
| Parameter | Type | Description | Default |
|---|---|---|---|
| period | string | Time period for uptime calculation (24h, 7d, 30d) | 30d |
Response
json
{
"overall_uptime": 99.95,
"period": "30d",
"period_start": "2024-01-01T00:00:00Z",
"period_end": "2024-01-31T23:59:59Z",
"total_monitors": 133,
"active_monitors": 113,
"down_monitors": 20,
"paused_monitors": 0,
"operational_monitors": 113,
"average_response_time": 4592.038,
"status_counts": {
"success": 113,
"failure": 20,
"paused": 0
}
}Response Fields
| Field | Type | Description |
|---|---|---|
| overall_uptime | float | Overall uptime percentage across all monitors for the specified period |
| period | string | Time period used for calculation (24h, 7d, 30d) |
| period_start | string | ISO 8601 timestamp of the period start |
| period_end | string | ISO 8601 timestamp of the period end |
| total_monitors | integer | Total number of network monitors in the project |
| active_monitors | integer | Number of monitors with status 'success' and not paused |
| down_monitors | integer | Number of monitors with status 'failure' |
| paused_monitors | integer | Number of monitors that are paused |
| operational_monitors | integer | Number of monitors that are operational (same as active_monitors) |
| average_response_time | float|null | Average response time in milliseconds across all monitors (from last 24 hours) |
| status_counts | object | Breakdown of monitors by status |
| status_counts.success | integer | Number of monitors with 'success' status |
| status_counts.failure | integer | Number of monitors with 'failure' status |
| status_counts.paused | integer | Number of monitors that are paused |
Notes
- Overall Uptime: Calculated as the average success rate across all monitors for the specified time period.
- Average Response Time: Calculated from transactions in the last 24 hours, excluding SSL and domain transactions.
- Period Options:
24h: Last 24 hours7d: Last 7 days30d: Last 30 days (default)
- Monitor Status Definitions:
success: Monitor is operational with no ongoing incidentsfailure: Monitor has ongoing incidentspaused: Monitor is manually pausedinitializing: Monitor has no transactions yet
Example Use Cases
Get 30-day statistics (default):
bash
curl -X GET "https://app.uptinio.com/api/v1/dashboard/statistics" \
-H "Authorization: Bearer YOUR_PROJECT_API_TOKEN"Get 24-hour statistics:
bash
curl -X GET "https://app.uptinio.com/api/v1/dashboard/statistics?period=24h" \
-H "Authorization: Bearer YOUR_PROJECT_API_TOKEN"Get 7-day statistics:
bash
curl -X GET "https://app.uptinio.com/api/v1/dashboard/statistics?period=7d" \
-H "Authorization: Bearer YOUR_PROJECT_API_TOKEN"Error Codes
| Code | Description |
|---|---|
| unauthorized | Invalid or missing authentication token |