Outlook Webhook Payload

Outlook webhooks are sent for incoming and outgoing emails via connected Outlook/Microsoft 365 accounts.

Example payload

1{
2 "event": {
3 "id": "evt_outlook_abc123",
4 "channel": "outlook",
5 "timestamp": 1706640000.0,
6 "data": {
7 "timestamp": 1706640000.0,
8 "direction": "inbound",
9 "platform": "outlook",
10 "email_id": "email_xyz789",
11 "message_id": "<Message-ID@outlook.com>",
12 "subject": "Re: Project proposal",
13 "body": "<html><body><p>Thanks for sending over the details...</p></body></html>",
14 "body_plain": "Thanks for sending over the details...",
15 "is_from_account": false,
16 "account_id": "acc_123",
17 "from_attendee": {
18 "display_name": "John Doe",
19 "identifier": "john@company.com",
20 "identifier_type": "EMAIL_ADDRESS"
21 },
22 "to_attendees": [
23 {
24 "display_name": "Your Business",
25 "identifier": "sales@yourbusiness.com",
26 "identifier_type": "EMAIL_ADDRESS"
27 }
28 ],
29 "cc_attendees": [
30 {
31 "display_name": "Manager",
32 "identifier": "manager@company.com",
33 "identifier_type": "EMAIL_ADDRESS"
34 }
35 ],
36 "bcc_attendees": [],
37 "reply_to_attendees": [],
38 "email_event_type": "mail_received",
39 "date": 1706640000.0,
40 "read_date": null,
41 "folders": ["Inbox"],
42 "has_attachments": false,
43 "attachments": [],
44 "in_reply_to": {
45 "message_id": "<Previous-Message@outlook.com>",
46 "id": "email_prev123"
47 },
48 "is_complete": true,
49 "origin": "external",
50 "usage_data": {
51 "prompt_tokens": 250,
52 "completion_tokens": 120,
53 "model": "gpt-4"
54 },
55 "tools_called": [],
56 "analysis_result": {
57 "sentiment": "positive",
58 "intent": "follow_up"
59 }
60 }
61 },
62 "lead_id": "lead_123",
63 "lead_contact": {
64 "number": "",
65 "email": "john@company.com",
66 "name": "John Doe"
67 },
68 "business_id": "biz_456",
69 "lead_created": false
70}

Field reference

Core fields

FieldTypeRequiredDescription
timestampfloatYesUnix epoch timestamp
directionstringYesinbound or outbound
platformstringYesAlways outlook
email_idstringYesInternal email ID
message_idstringYesRFC822 Message-ID header
subjectstringYesEmail subject line
bodystringYesHTML email body
is_from_accountbooleanYesTrue if sent by connected account
account_idstringYesConnected Outlook account ID
email_event_typestringYesEvent type
datefloatYesServer acknowledgment timestamp

email_event_type values

ValueDescription
mail_receivedIncoming email
mail_sentOutgoing email

from_attendee object

FieldTypeDescription
display_namestringSender display name (optional)
identifierstringEmail address
identifier_typestringAlways EMAIL_ADDRESS

to_attendees array

Array of recipient objects with same structure as from_attendee.

Optional fields

FieldTypeDescription
body_plainstringPlain text version
cc_attendeesarrayCC recipients
bcc_attendeesarrayBCC recipients
reply_to_attendeesarrayReply-To addresses
read_datefloatWhen email was read
foldersarrayEmail folders
rolestringFolder role
has_attachmentsbooleanWhether has attachments
attachmentsarrayEmail attachments
in_reply_toobjectParent email reference
is_completebooleanWhether fully loaded
tracking_idstringInternal tracking ID
originstringunipile or external
usage_dataobjectLLM token usage
tools_calledarrayTool names executed
analysis_resultobjectAI analysis output
appointmentsarrayExtracted appointments
execution_contextobjectSource trigger context

attachments array

FieldTypeDescription
idstringAttachment ID
namestringFilename
sizeintegerSize in bytes
mimetypestringMIME type
urlstringDownload URL

in_reply_to object

FieldTypeDescription
message_idstringParent RFC822 Message-ID
idstringParent internal ID

Outlook and Gmail payloads share the same structure. The only difference is the platform field value.