Skip to content

Report worker telemetry for a run lane (heartbeat + events)

POST
/agents/runs/{id}/events
curl --request POST \
--url https://example.com/api/agents/runs/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/events \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "worker_id": "example", "lease_seconds": 1, "phase": "example", "log_line": "example", "events": [ { "type": "heartbeat", "payload": {} } ] }'

Worker telemetry sidecar. Renews the lane’s claim lease, applies the latest phase/log line, and appends batched lifecycle events. Guarded by worker_id — only the worker holding the claim may report (else 409). Rate limited (600/min/IP).

id
required
string format: uuid
Media type application/json
object
worker_id
required
string
>= 1 characters <= 200 characters
lease_seconds
integer
>= 60 <= 3600
phase
string
<= 200 characters
log_line
string
<= 2000 characters
events
Array<object>
<= 100 items
object
type
required
string
Allowed values: heartbeat log_line phase_change action error ship_complete
payload
object
key
additional properties
any

Telemetry recorded; updated run returned

Media type application/json
object
ok
required
boolean
run
required
object
id
required
string format: uuid
plan_id
required
string format: uuid
project_id
required
string format: uuid
billing_account_id
required
string format: uuid
milestone_id
required
string format: uuid
lane_key
required
string
title
required
string
role
required
string
Allowed values: frontend backend test design devops qa other
ticket_ids
required
Array<string>
state
required
string
Allowed values: queued claimed running paused shipping shipped failed released
phase
string | null
worker_id

Identity of the worker holding the claim (null until claimed).

string | null
claimed_at
string | null format: date-time
lease_expires_at

Claim lease deadline; reclaimed if a heartbeat does not renew it.

string | null format: date-time
last_heartbeat
string | null format: date-time
started_at
string | null format: date-time
finished_at
string | null format: date-time
worktree_path
string | null
branch
string | null
pr_url
string | null
last_log_line
string | null
created_at
required
string format: date-time
updated_at
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

Not found

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