Skip to content

Record a runner machine heartbeat and telemetry snapshot

POST
/agents/machines/heartbeat
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).

Media type application/json

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
machine_id
required
string
>= 8 characters <= 64 characters
name
required
string
>= 1 characters <= 80 characters
hostname
string
<= 120 characters
backend
string
<= 50 characters
capabilities
Array<string>
default: <= 20 items
cli_meta
object
key
additional properties
any
usage_snapshot
object
key
additional properties
any
sessions
Array<object>
default: <= 50 items
object
key
additional properties
any
active_lanes
Array<object>
default: <= 10 items
object
run_id
required
string format: uuid
phase
string
<= 60 characters
started_at
string
billing_account_id
string format: uuid

Machine heartbeat recorded

Media type application/json
object
ok
required
boolean
machine_id
required
string
server_time
required
string format: date-time

Invalid request

Media type application/json
object
error
required

Human-readable error message

string
code

Stable machine-readable error code for client branching

string
fieldErrors

First validation message per field path

object
key
additional properties
string
issues

Structured validation issues (Zod)

Array<object>
object
path
required
string
message
required
string
retryAfter

Seconds until rate limit resets (429 responses)

number

Not authenticated

Media type application/json
object
error
required

Human-readable error message

string
code

Stable machine-readable error code for client branching

string
fieldErrors

First validation message per field path

object
key
additional properties
string
issues

Structured validation issues (Zod)

Array<object>
object
path
required
string
message
required
string
retryAfter

Seconds until rate limit resets (429 responses)

number
reconnect

True if re-linking GitHub may fix the issue

boolean

Forbidden

Media type application/json
object
error
required

Human-readable error message

string
code

Stable machine-readable error code for client branching

string
fieldErrors

First validation message per field path

object
key
additional properties
string
issues

Structured validation issues (Zod)

Array<object>
object
path
required
string
message
required
string
retryAfter

Seconds until rate limit resets (429 responses)

number

Resource state conflict

Media type application/json
object
error
required

Human-readable error message

string
code

Stable machine-readable error code for client branching

string
fieldErrors

First validation message per field path

object
key
additional properties
string
issues

Structured validation issues (Zod)

Array<object>
object
path
required
string
message
required
string
retryAfter

Seconds until rate limit resets (429 responses)

number

Rate limited

Media type application/json
object
error
required

Human-readable error message

string
code

Stable machine-readable error code for client branching

string
fieldErrors

First validation message per field path

object
key
additional properties
string
issues

Structured validation issues (Zod)

Array<object>
object
path
required
string
message
required
string
retryAfter

Seconds until rate limit resets (429 responses)

number
retryAfter

Seconds until the rate limit resets

number
Retry-After
string

Server error

Media type application/json
object
error
required

Human-readable error message

string
code

Stable machine-readable error code for client branching

string
fieldErrors

First validation message per field path

object
key
additional properties
string
issues

Structured validation issues (Zod)

Array<object>
object
path
required
string
message
required
string
retryAfter

Seconds until rate limit resets (429 responses)

number