Get Connection Health
Sprint 3
Get connection health status and history for a data source.
Endpoint
GET /api/v1/data-sources/{data_source_id}/health
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer <access_token> |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
data_source_id | integer | Yes | Data source ID |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
limit | integer | No | Number of health check records to return (default: 10) |
Response
Success (200)
{
"success": true,
"data": {
"data_source_id": 1,
"current_status": "active",
"last_health_check": {
"status": "active",
"response_time_ms": 45,
"checked_at": "2024-12-01T11:00:00Z"
},
"health_history": [
{
"status": "active",
"response_time_ms": 45,
"checked_at": "2024-12-01T11:00:00Z"
},
{
"status": "active",
"response_time_ms": 42,
"checked_at": "2024-12-01T10:00:00Z"
}
],
"uptime_percentage": 99.5,
"avg_response_time_ms": 44,
"min_response_time_ms": 38,
"max_response_time_ms": 52,
"failure_count_24h": 0,
"last_failure_at": null
},
"message": "Health status retrieved successfully"
}
Error Codes
| Status | Code | Description |
|---|---|---|
| 401 | UNAUTHORIZED | Invalid or missing authentication token |
| 403 | FORBIDDEN | User is not a member of any organization |
| 404 | NOT_FOUND | Data source not found |
Features
- Current connection status
- Health check history
- Response time statistics (avg, min, max)
- Uptime percentage
- Failure count and last failure time
- Configurable history limit
Example
curl -X GET "https://api.rivergen.com/api/v1/data-sources/1/health?limit=20" \
-H "Authorization: Bearer <access_token>"
Related Endpoints
- Test Connection - Manually test connection
- Get Data Source - Get data source details