Payload Format
When an event fires, your endpoint receives an HTTP POST request with Content-Type: application/json and this JSON body.
Event Payload
All webhook deliveries follow this structure.
POST payload
{
"event": "email.received",
"timestamp": "2026-02-07T12:00:00Z",
"webhook_id": "<webhook-uuid>",
"agent_id": "<agent-uuid>",
"email_account_id": "<account-uuid>",
"email": {
"id": "<email-uuid>",
"message_id": "<message-id@xobni.ai>",
"thread_id": "<thread-uuid>",
"direction": "inbound",
"from_address": "sender@example.com",
"is_trusted_sender": true,
"trusted_sender_name": "John Smith",
"to_addresses": ["agent@xobni.ai"],
"cc_addresses": [],
"subject": "Hello from a customer",
"snippet": "First 200 characters of the email body...",
"status": "received",
"has_attachments": true,
"attachment_count": 2,
"received_at": "2026-02-07T12:00:00Z"
}
}Payloads are lightweight — they include email metadata and a 200-character snippet, not the full body. Use the read_email API or MCP tool to fetch full content when needed.
Payload Fields
Top-level fields
eventEvent type: "email.received", "email.sent", or "test"timestampISO 8601 timestamp of when the event occurredwebhook_idUUID of the webhook that triggered this deliveryagent_idUUID of the agentemail_account_idUUID of the email accountemail object
idUUID of the emailmessage_idRFC 5322 Message-ID headerthread_idUUID of the thread (if threaded)direction"inbound" or "outbound"from_addressSender email addressis_trusted_senderWhether the sender is on the trusted senders listtrusted_sender_nameDisplay name of the trusted sender (null if not trusted)to_addressesArray of recipient addressessubjectEmail subject linesnippetFirst 200 characters of body texthas_attachmentsBoolean indicating if attachments existattachment_countNumber of attachments