Skip to main content

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

HeaderRequiredDescription
AuthorizationYesBearer <access_token>

Path Parameters

ParameterTypeRequiredDescription
data_source_idintegerYesData source ID

Query Parameters

ParameterTypeRequiredDescription
limitintegerNoNumber 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

StatusCodeDescription
401UNAUTHORIZEDInvalid or missing authentication token
403FORBIDDENUser is not a member of any organization
404NOT_FOUNDData 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>"