Workers
Serverless Health Check
Probe a serverless URL and return the protocol version reported by its metadata endpoint.
Metadata fetch failures are returned as a failure result in a successful HTTP response.
POST https://api.rivet.dev/runner-configs/serverless-health-check
Examples
curl -X POST "https://api.rivet.dev/runner-configs/serverless-health-check?namespace=$RIVET_NAMESPACE" \
-H "Authorization: Bearer $RIVET_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"url": "https://workers.example.com",
"headers": {}
}'
const endpoint = "https://api.rivet.dev";
const namespace = process.env.RIVET_NAMESPACE ?? "default";
const token = process.env.RIVET_TOKEN ?? "";
const params = new URLSearchParams({ namespace });
const response = await fetch(
`${endpoint}/runner-configs/serverless-health-check?${params}`,
{
method: "POST",
headers: {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
url: "https://workers.example.com",
headers: {},
}),
},
);
console.log(await response.json());
export {};
Authentication
Send your namespace token as a bearer token in the Authorization header. Every control plane request also requires the namespace query parameter. See Authentication.
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
namespace | string | Yes | Name of the namespace to operate in. |
Request Body
Content type: application/json.
| Field | Type | Required | Description |
|---|---|---|---|
headers | object | No | Headers to include in the metadata request. |
url | string | Yes | Serverless URL to probe. |
Responses
200
A success result with the reported version or a failure result with error details.
{
"success": {
"version": "<version>"
}
}