Health Reference
Endpoint
GET /health
What this endpoint does
Verifies that the Capricorn Transaction Experience API is available and can process requests using the same authentication and authorization context as the business endpoints.
Request Headers
In the tables below, Required indicates that Capricorn cannot process the request without that value.
| Header | Type | Required | Description | Constraints | Example |
|---|---|---|---|---|---|
client_id | string | Yes | Client application identifier for the calling system. | 32-character alphanumeric, pattern ^([A-Za-z0-9]){32}$ | 0123456789ABCDEF0123456789ABCDEF |
client_secret | string | Yes | Client application secret for the calling system. | 32-character alphanumeric, pattern ^([A-Za-z0-9]){32}$ | ABCDEF0123456789ABCDEF0123456789 |
x-captoken | string | Yes | Mandatory Capricorn authorization token for the calling system so the health check validates the same documented request context. | 64-character SHA-256 hash, pattern ^[a-fA-F0-9]64$ | opaque-token |
X-Correlation-ID | string | No | Optional correlation value used for tracing and support. | Pattern ^[0-9a-zA-Z(\-){}]+$, min length 1 | a0235ed0-d884-11ef-957a-005056afc7ce |
URI / Query Parameters
| Parameter | Type | Required | Description | Constraints | Example |
|---|---|---|---|---|---|
| None | n/a | No | This endpoint does not define URI or query parameters. | n/a | n/a |
Code Examples
Replace the example credentials with the values provided during onboarding. If the example includes a supplierId, use your own supplier ID associated with your x-captoken.
- cURL
- HTTP
- JavaScript
- Python
- C
- Java
curl -X GET 'https://api.capricorn.example.com/health' \
-H 'client_id: 0123456789ABCDEF0123456789ABCDEF' \
-H 'client_secret: ABCDEF0123456789ABCDEF0123456789' \
-H 'x-captoken: opaque-token' \
-H 'X-Correlation-ID: a0235ed0-d884-11ef-957a-005056afc7ce'
GET /health HTTP/1.1
Host: api.capricorn.example.com
client_id: 0123456789ABCDEF0123456789ABCDEF
client_secret: ABCDEF0123456789ABCDEF0123456789
x-captoken: opaque-token
X-Correlation-ID: a0235ed0-d884-11ef-957a-005056afc7ce
const response = await fetch('https://api.capricorn.example.com/health', {
method: 'GET',
headers: {
'client_id': '0123456789ABCDEF0123456789ABCDEF',
'client_secret': 'ABCDEF0123456789ABCDEF0123456789',
'x-captoken': 'opaque-token',
'X-Correlation-ID': 'a0235ed0-d884-11ef-957a-005056afc7ce',
},
});
const data = await response.json();
console.log(data);
import requests
response = requests.request(
'GET',
'https://api.capricorn.example.com/health',
headers={
'client_id': '0123456789ABCDEF0123456789ABCDEF',
'client_secret': 'ABCDEF0123456789ABCDEF0123456789',
'x-captoken': 'opaque-token',
'X-Correlation-ID': 'a0235ed0-d884-11ef-957a-005056afc7ce',
},
)
print(response.status_code)
print(response.json())
#include <curl/curl.h>
int main(void) {
CURL *curl = curl_easy_init();
struct curl_slist *headers = NULL;
if (!curl) return 1;
curl_easy_setopt(curl, CURLOPT_URL, "https://api.capricorn.example.com/health");
headers = curl_slist_append(headers, "client_id: 0123456789ABCDEF0123456789ABCDEF");
headers = curl_slist_append(headers, "client_secret: ABCDEF0123456789ABCDEF0123456789");
headers = curl_slist_append(headers, "x-captoken: opaque-token");
headers = curl_slist_append(headers, "X-Correlation-ID: a0235ed0-d884-11ef-957a-005056afc7ce");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_perform(curl);
curl_slist_free_all(headers);
curl_easy_cleanup(curl);
return 0;
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
HttpClient client = HttpClient.newHttpClient();
HttpRequest.Builder builder = HttpRequest.newBuilder()
.uri(URI.create("https://api.capricorn.example.com/health"))
.header("client_id", "0123456789ABCDEF0123456789ABCDEF")
.header("client_secret", "ABCDEF0123456789ABCDEF0123456789")
.header("x-captoken", "opaque-token")
.header("X-Correlation-ID", "a0235ed0-d884-11ef-957a-005056afc7ce")
.GET();
HttpResponse<String> response = client.send(builder.build(), HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode());
System.out.println(response.body());
Responses
X-Correlation-ID is generated automatically if omitted and may appear as correlationId in the response body.
200 OK
Returned when the Capricorn Transaction Experience API is reachable and responding to authenticated requests.
| Field | Type | Description | Example |
|---|---|---|---|
message | string | Confirmation that the API process is running and reachable. | The API is running |
{
"message": "The API is running"
}
400 Bad Request
Returned when the request headers are malformed, for example if a supplied correlation identifier does not match the documented pattern.
| Field | Type | Description | Example |
|---|---|---|---|
error.type | string | Error category for request-shape or validation problems. | CAP:BAD_REQUEST |
error.description | string | Short summary of the failure category. | Bad request |
error.message | string | Message describing what to correct before retrying. | Invalid Request, Please validate the request message. |
{
"error": {
"type": "CAP:BAD_REQUEST",
"description": "Bad request",
"message": "Invalid Request, Please validate the request message."
}
}
401 Unauthorized
Returned when client_id or client_secret is missing or invalid.
| Field | Type | Description | Example |
|---|---|---|---|
error.type | string | Error category returned when authentication fails. | CAP:UNAUTHORIZED |
error.description | string | Short summary of the authentication failure. | Unauthorized |
error.message | string | Explains that the supplied client credentials were rejected. | Client id or secret is invalid. |
{
"error": {
"type": "CAP:UNAUTHORIZED",
"description": "Unauthorized",
"message": "Client id or secret is invalid."
}
}
404 Not Found
The published asset includes this response example for /health, but the payload text is clearly account-oriented rather than health-check-oriented. It is reproduced here exactly because it exists in the current specification; treat it as a source-spec anomaly rather than a supported /health contract until the upstream asset is corrected.
| Field | Type | Description | Example |
|---|---|---|---|
error.type | string | Error category returned when the requested record is not available. | CAP:NOT_FOUND |
error.description | string | Short summary of the missing-resource condition. | Not found / CAP's resource not found |
error.message | string | Message published in the asset for the not-found case. | The specified account could not be located. |
{
"error": {
"type": "CAP:NOT_FOUND",
"description": "Not found / CAP's resource not found",
"message": "The specified account could not be located."
}
}
429 Too Many Requests
Returned when the caller exceeds the API rate limit.
| Field | Type | Description | Example |
|---|---|---|---|
message | string | Rate-limit message returned when too many requests are sent in a short period. | Too Many Requests |
{
"message": "Too Many Requests"
}
500 Internal Server Error
Returned when the API encounters an unexpected server-side failure.
| Field | Type | Description | Example |
|---|---|---|---|
error.type | string | Error category for unexpected server-side failures. | CAP:INTERNAL_SERVER_ERROR |
error.description | string | Short summary of the server-side error. | Internal server error |
error.message | string | Advises the client to retry later. | API encountered an unexpected error. Please retry later. |
{
"error": {
"type": "CAP:INTERNAL_SERVER_ERROR",
"description": "Internal server error",
"message": "API encountered an unexpected error. Please retry later."
}
}
503 Service Unavailable
Returned when a downstream dependency is unavailable or times out. The service can include a retry hint for clients.
Response headers
| Header | Type | Description |
|---|---|---|
Retry-After | string | Optional delay, in seconds, that the client should wait before retrying the request. |
Response Body
| Field | Type | Description | Example |
|---|---|---|---|
error.type | string | Error category for temporary downstream or platform outages. | CAP:SERVICE_UNAVAILABLE |
error.description | string | Short summary of the availability issue. | Service unavailable |
error.message | string | Indicates the API timed out or could not reach a backend service. | A timeout occurred while processing the request. |
{
"error": {
"type": "CAP:SERVICE_UNAVAILABLE",
"description": "Service unavailable",
"message": "A timeout occurred while processing the request."
}
}