Dependencies API
Send dependency health check results to xrelia to monitor the availability and latency of services that your service instance depends on.
Dependency health checks can be used to monitor external APIs, databases, third-party services, or other systems that are critical to your application’s operation.
Endpoint
Section titled “Endpoint”POST https://api.xrelia.com/v1/dependenciesThe request must include a valid X-API-Key header. See Authentication section for details.
Request body
Section titled “Request body”The request body must be a JSON object containing the target platform, service instance, and one or more dependency health check results.
{ "platformId": "PLATFORM_ID", "instanceId": "INSTANCE_ID", "checkResults": [ { "id": "DEPENDENCY_HEALTH_CHECK_ID", "ts": 1785513412, "sts": 0, "ms": 280 }, { "id": "DEPENDENCY_HEALTH_CHECK_ID", "ts": 1785513412, "sts": 100, "ms": 400 } ]}Request fields
Section titled “Request fields”| Field | Type | Required | Description |
|---|---|---|---|
platformId |
string | Yes | ID of the platform receiving the health check results. Obtain this from the xrelia console. |
instanceId |
string | Yes | ID of the service instance associated with the dependency. Obtain this from the xrelia console. |
checkResults |
array | Yes | Collection of dependency health check results to submit. |
checkResults[].id |
string | Yes | ID of the dependency health check. Obtain this ID from the xrelia console. |
checkResults[].ts |
integer | Yes | Unix timestamp indicating when the dependency health check was performed. |
checkResults[].sts |
integer | Yes | Dependency status. 0 means the dependency is down and 100 means it is up. |
checkResults[].ms |
number | No | Dependency response latency in milliseconds. Can be omitted when the dependency is down and no latency measurement is available. |
Dependency health check ID
Section titled “Dependency health check ID”Each dependency health check configured in xrelia has a unique ID. The ID identifies which dependency the result belongs to.
Use the ID assigned to the dependency health check in the xrelia console when submitting results.
Timestamp
Section titled “Timestamp”The ts field specifies when the dependency check was performed, rather than when the result was submitted to xrelia.
The value must be a Unix timestamp expressed in seconds.
For example:
1785513412Status
Section titled “Status”The sts field indicates whether the dependency was available when the check was performed.
xrelia currently supports a binary dependency status:
| Value | Meaning |
|---|---|
0 |
Dependency is down |
100 |
Dependency is up |
Intermediate status values are not currently supported.
Latency
Section titled “Latency”The optional ms field contains the dependency response time in milliseconds.
For an available dependency, include the measured latency whenever possible:
{ "id": "DEPENDENCY_HEALTH_CHECK_ID", "ts": 1785513412, "sts": 100, "ms": 400}When the dependency is down and no meaningful latency measurement is available, ms can be omitted:
{ "id": "DEPENDENCY_HEALTH_CHECK_ID", "ts": 1785513412, "sts": 0}Response
Section titled “Response”A successful request returns:
200 OKIf the request cannot be processed, xrelia returns an appropriate HTTP error status together with a descriptive error message.
A 207 Multi-Status response is returned when a request is only partially successful—for example, when some dependency health check results are accepted while others fail validation.
See API Overview for general response and error handling.
Example
Section titled “Example”curl -X POST "https://api.xrelia.com/v1/dependencies" \ -H "Content-Type: application/json" \ -H "X-API-Key: YOUR_API_KEY" \ -d '{ "platformId": "PLATFORM_ID", "instanceId": "INSTANCE_ID", "checkResults": [ { "id": "DATABASE_HEALTH_CHECK_ID", "ts": 1785513412, "sts": 100, "ms": 28 }, { "id": "PAYMENT_API_HEALTH_CHECK_ID", "ts": 1785513412, "sts": 0 } ] }'Dependency health results become part of the service instance’s reliability data, allowing xrelia to incorporate dependency availability and latency into its overall health and confidence analysis.
