Record a runner machine heartbeat and telemetry snapshot
const url = 'https://example.com/api/agents/machines/heartbeat';const options = { method: 'POST', headers: { cookie: 'sb-access-token=<sb-access-token>', 'Content-Type': 'application/json' }, body: '{"machine_id":"example","name":"example","hostname":"example","backend":"example","capabilities":[],"cli_meta":{},"usage_snapshot":{},"sessions":[],"active_lanes":[],"billing_account_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/agents/machines/heartbeat \ --header 'Content-Type: application/json' \ --cookie sb-access-token=<sb-access-token> \ --data '{ "machine_id": "example", "name": "example", "hostname": "example", "backend": "example", "capabilities": [], "cli_meta": {}, "usage_snapshot": {}, "sessions": [], "active_lanes": [], "billing_account_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }'OAuth-authenticated machine presence sidecar. Upserts the caller-owned
machine and refreshes its heartbeat timestamp. Users with access to
multiple billing accounts must send an in-scope billing_account_id.
Rate limited (600/min/IP).
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”Telemetry caps: JSON.stringify(cli_meta).length + JSON.stringify(usage_snapshot).length must be <= 32,768 characters; each session must be <= 4,096 serialized characters; all telemetry combined must be <= 65,536 serialized characters.
object
object
object
object
object
Responses
Section titled “ Responses ”Machine heartbeat recorded
object
Invalid request
object
Human-readable error message
Stable machine-readable error code for client branching
First validation message per field path
object
Structured validation issues (Zod)
object
Seconds until rate limit resets (429 responses)
Not authenticated
object
Human-readable error message
Stable machine-readable error code for client branching
First validation message per field path
object
Structured validation issues (Zod)
object
Seconds until rate limit resets (429 responses)
True if re-linking GitHub may fix the issue
Forbidden
object
Human-readable error message
Stable machine-readable error code for client branching
First validation message per field path
object
Structured validation issues (Zod)
object
Seconds until rate limit resets (429 responses)
Resource state conflict
object
Human-readable error message
Stable machine-readable error code for client branching
First validation message per field path
object
Structured validation issues (Zod)
object
Seconds until rate limit resets (429 responses)
Rate limited
object
Human-readable error message
Stable machine-readable error code for client branching
First validation message per field path
object
Structured validation issues (Zod)
object
Seconds until rate limit resets (429 responses)
Seconds until the rate limit resets
Headers
Section titled “Headers ”Server error
object
Human-readable error message
Stable machine-readable error code for client branching
First validation message per field path
object
Structured validation issues (Zod)
object
Seconds until rate limit resets (429 responses)