Skip to main content
Relay sends six JSON text frames after the upgrade, and your backend sends three back.

Read the ready frame

The first frame after the upgrade is ready. Read acked_through for the agent’s durable checkpoint and full_sync_required to learn whether delivery is paused for recovery. An observer connection carries one extra field, shown on observe events.

Read the event frame

Each event frame carries one sequence number and one event envelope, the same envelope a webhook delivers. Sequences are decimal strings scoped to one agent, sent oldest first. A replay after an uncertain close can repeat an event_id under a new sequence, so read acknowledgements before you accept anything:
captured-output
Route on event.event_type and open its page in the event catalog for the data shape.

Handle backpressure

Relay pauses delivery when the connection holds max_in_flight unacknowledged events, and your cumulative ACK opens the next window. A backend that stops acknowledging stops receiving, which is how you slow Relay down when your inbox is busy.

Handle heartbeats

Relay sends a ping frame every 30 seconds. Answer within 60 seconds or Relay closes the connection with reason heartbeat_timeout. Heartbeats only show that the connection is alive; ACKs are what advance delivery:

When it fails

An error frame names the problem in code. A fatal error ends consumption on that connection: stop using it, and let retryable decide whether to reconnect with backoff or fix the named condition first. A protocol mistake needs a corrected frame, not a retry of the same one. A disconnect frame arrives before Relay closes the socket, and the close code repeats the reason. A 4410 means the agent now has a webhook subscription; read choose the delivery path before you reconnect.

Next steps