Agent heartbeat
Updates the last-seen timestamp for an agent instance and optionally reports its current status.
curl --request POST \
--url https://api.svantic.com/agents/heartbeat \
--header 'Content-Type: application/json' \
--data '
{
"instance_id": "navigator-prod-01",
"status": "available",
"current_sessions": 3,
"max_concurrent_sessions": 16,
"consecutive_failures": 0
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
instance_id: 'navigator-prod-01',
status: 'available',
current_sessions: 3,
max_concurrent_sessions: 16,
consecutive_failures: 0
})
};
fetch('https://api.svantic.com/agents/heartbeat', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.svantic.com/agents/heartbeat"
payload = {
"instance_id": "navigator-prod-01",
"status": "available",
"current_sessions": 3,
"max_concurrent_sessions": 16,
"consecutive_failures": 0
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.svantic.com/agents/heartbeat"
payload := strings.NewReader("{\n \"instance_id\": \"navigator-prod-01\",\n \"status\": \"available\",\n \"current_sessions\": 3,\n \"max_concurrent_sessions\": 16,\n \"consecutive_failures\": 0\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"ok": true
}{
"error": "Invalid request body",
"code": "BAD_REQUEST"
}{
"error": "Invalid or expired token",
"code": "unauthorized"
}{
"error": "JWT does not include the required scope for this operation",
"code": "forbidden"
}{
"error": "Not found",
"code": "NOT_FOUND",
"request_id": "req_01EXAMPLE",
"timestamp": "2026-03-31T12:00:00.000Z"
}{
"error": "Request timeout",
"code": "REQUEST_TIMEOUT"
}{
"error": "Internal server error",
"code": "INTERNAL_ERROR",
"request_id": "req_01EXAMPLE",
"timestamp": "2026-03-31T12:00:00.000Z"
}{
"error": "Bad gateway",
"code": "BAD_GATEWAY"
}{
"error": "Service temporarily unavailable",
"code": "SERVICE_UNAVAILABLE"
}Body
Heartbeat payload posted by an agent instance.
Accepts either the raw payload (shown below) or a shared
AgentVerbEnvelope wrapper of the same shape. The gateway normalises
both forms before handling the request.
Enveloped form:
{
"v": 1,
"id": "<uuid-v7>",
"ts": "2026-04-17T13:41:22.814Z",
"payload": { "instance_id": "...", "current_sessions": 3 }
}
All fields other than instance_id are optional. Agents should emit
a heartbeat every 30 s (the shared HEARTBEAT_INTERVAL_MS) and
immediately on any status change. The same payload shape is sent as
a heartbeat frame over the connected-mode WebSocket.
The registered instance sending the heartbeat.
Self-reported routing liveness. Optional — if omitted the gateway keeps the previously reported value.
available, busy, draining, offline, unhealthy, unknown Number of sessions currently bound to this instance. Drives the least-loaded router tie-break.
x >= 0Upper bound on concurrent sessions. 0 means unlimited.
x >= 0Number of consecutive dispatch failures observed by the agent. Informational; the mesh tracks authoritative failure counts server-side.
x >= 0Response
Heartbeat acknowledged.
curl --request POST \
--url https://api.svantic.com/agents/heartbeat \
--header 'Content-Type: application/json' \
--data '
{
"instance_id": "navigator-prod-01",
"status": "available",
"current_sessions": 3,
"max_concurrent_sessions": 16,
"consecutive_failures": 0
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
instance_id: 'navigator-prod-01',
status: 'available',
current_sessions: 3,
max_concurrent_sessions: 16,
consecutive_failures: 0
})
};
fetch('https://api.svantic.com/agents/heartbeat', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.svantic.com/agents/heartbeat"
payload = {
"instance_id": "navigator-prod-01",
"status": "available",
"current_sessions": 3,
"max_concurrent_sessions": 16,
"consecutive_failures": 0
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.svantic.com/agents/heartbeat"
payload := strings.NewReader("{\n \"instance_id\": \"navigator-prod-01\",\n \"status\": \"available\",\n \"current_sessions\": 3,\n \"max_concurrent_sessions\": 16,\n \"consecutive_failures\": 0\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"ok": true
}{
"error": "Invalid request body",
"code": "BAD_REQUEST"
}{
"error": "Invalid or expired token",
"code": "unauthorized"
}{
"error": "JWT does not include the required scope for this operation",
"code": "forbidden"
}{
"error": "Not found",
"code": "NOT_FOUND",
"request_id": "req_01EXAMPLE",
"timestamp": "2026-03-31T12:00:00.000Z"
}{
"error": "Request timeout",
"code": "REQUEST_TIMEOUT"
}{
"error": "Internal server error",
"code": "INTERNAL_ERROR",
"request_id": "req_01EXAMPLE",
"timestamp": "2026-03-31T12:00:00.000Z"
}{
"error": "Bad gateway",
"code": "BAD_GATEWAY"
}{
"error": "Service temporarily unavailable",
"code": "SERVICE_UNAVAILABLE"
}