Skip to main content
message.sent fires when a message your agent sent is committed to the chat.

Read the payload

This is a complete envelope as the staging agent received it. The data object is the MessageEvent schema from the API contract; the fields around it are the same on every event and are described in the event catalog. Route on event_type, deduplicate on event_id, and keep trace_id for support:
captured-output

Handle the event

Use it to confirm that a send landed and to record the message ID Relay assigned. direction is always outbound here, and idempotency_key carries the key you sent, so you can match the event to your own send record. Nothing needs a reply.

Next steps