Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

webhooks/intercom: Add webhook fixtures for conversation events.

sathwikshetty33dfb14de14cb2
diff --git a/zerver/webhooks/intercom/fixtures/conversation_admin_assigned.json b/zerver/webhooks/intercom/fixtures/conversation_admin_assigned.json
new file mode 100644
index 00000000000..398e2b3a08a
--- /dev/null
+++ b/zerver/webhooks/intercom/fixtures/conversation_admin_assigned.json
@@ -0,0 +1,159 @@
+{
+ "type": "notification_event",
+ "app_id": "abc123def",
+ "data": {
+ "type": "notification_event_data",
+ "item": {
+ "type": "conversation",
+ "id": "215472621202693",
+ "created_at": 1768031789,
+ "updated_at": 1768032000,
+ "waiting_since": null,
+ "snoozed_until": null,
+ "source": {
+ "type": "conversation",
+ "id": "3381828792",
+ "delivered_as": "customer_initiated",
+ "subject": "",
+ "body": "<p>helklo</p>",
+ "author": {
+ "type": "lead",
+ "id": "696205460674dbb9050aa7fd",
+ "name": null,
+ "email": ""
+ },
+ "attachments": [],
+ "url": "http://localhost:5500/test.html",
+ "redacted": false
+ },
+ "contacts": {
+ "type": "contact.list",
+ "contacts": [
+ {
+ "type": "contact",
+ "id": "696205460674dbb9050aa7fd",
+ "external_id": "5e68ece4-0ec8-4792-baac-02deba39e7fe"
+ }
+ ]
+ },
+ "first_contact_reply": {
+ "created_at": 1768031789,
+ "type": "conversation",
+ "url": "http://localhost:5500/test.html"
+ },
+ "admin_assignee_id": 9608799,
+ "team_assignee_id": null,
+ "open": true,
+ "state": "open",
+ "read": false,
+ "tags": {
+ "type": "tag.list",
+ "tags": []
+ },
+ "priority": "not_priority",
+ "sla_applied": null,
+ "statistics": {
+ "type": "conversation_statistics",
+ "time_to_assignment": 211,
+ "time_to_admin_reply": 211,
+ "time_to_first_close": null,
+ "time_to_last_close": null,
+ "median_time_to_reply": 211,
+ "first_contact_reply_at": "2026-01-10T07:56:29.000Z",
+ "first_assignment_at": "2026-01-10T08:00:00.000Z",
+ "first_admin_reply_at": "2026-01-10T08:00:00.000Z",
+ "first_close_at": null,
+ "last_assignment_at": "2026-01-10T08:00:00.000Z",
+ "last_assignment_admin_reply_at": "2026-01-10T08:00:00.000Z",
+ "last_contact_reply_at": "2026-01-10T07:56:29.000Z",
+ "last_admin_reply_at": "2026-01-10T08:00:00.000Z",
+ "last_close_at": null,
+ "last_closed_by_id": null,
+ "count_reopens": 0,
+ "count_assignments": 1,
+ "count_conversation_parts": 6,
+ "assigned_team_first_response_time": [],
+ "assigned_team_first_response_time_in_office_hours": [],
+ "handling_time": null
+ },
+ "conversation_rating": null,
+ "teammates": {
+ "type": "admin.list",
+ "admins": [
+ {
+ "type": "admin",
+ "id": "9608799"
+ }
+ ]
+ },
+ "title": "",
+ "custom_attributes": {
+ "Has attachments": false,
+ "Imported via standalone": false,
+ "Auto-translated": false,
+ "Fin AI Agent: Preview": false,
+ "Fin AI Agent: Image used in reply": false,
+ "Copilot used": false
+ },
+ "topics": {
+ "type": "topic.list",
+ "topics": [],
+ "total_count": 0
+ },
+ "ticket": null,
+ "linked_objects": {
+ "type": "list",
+ "data": [],
+ "total_count": 0,
+ "has_more": false
+ },
+ "ai_agent": null,
+ "ai_agent_participated": false,
+ "conversation_parts": {
+ "type": "conversation_part.list",
+ "conversation_parts": [
+ {
+ "type": "conversation_part",
+ "id": "37358198341",
+ "part_type": "assignment",
+ "body": "<p class=\"no-margin\">aMSIJJO</p>",
+ "created_at": 1768032000,
+ "updated_at": 1768032000,
+ "notified_at": 1768032000,
+ "assigned_to": {
+ "type": "admin",
+ "id": "9608799"
+ },
+ "author": {
+ "id": "9608799",
+ "type": "admin",
+ "name": "John Doe",
+ "email": "[email protected]",
+ "from_ai_agent": false,
+ "is_ai_answer": false
+ },
+ "attachments": [],
+ "external_id": null,
+ "redacted": false,
+ "metadata": {},
+ "email_message_metadata": null,
+ "state": "open",
+ "tags": [],
+ "event_details": {},
+ "app_package_code": null
+ }
+ ],
+ "total_count": 1
+ }
+ }
+ },
+ "links": {},
+ "id": "notif_4ad4cf66-d924-4d6a-8308-3979cae180de",
+ "topic": "conversation.admin.assigned",
+ "delivery_status": "pending",
+ "delivery_attempts": 1,
+ "delivered_at": 0,
+ "first_sent_at": 1768032001,
+ "created_at": 1768032001,
+ "self": null
+}
diff --git a/zerver/webhooks/intercom/fixtures/conversation_admin_closed.json b/zerver/webhooks/intercom/fixtures/conversation_admin_closed.json
new file mode 100644
index 00000000000..ac8d324f6cf
--- /dev/null
+++ b/zerver/webhooks/intercom/fixtures/conversation_admin_closed.json
@@ -0,0 +1,156 @@
+{
+ "type": "notification_event",
+ "app_id": "abc123def",
+ "data": {
+ "type": "notification_event_data",
+ "item": {
+ "type": "conversation",
+ "id": "215472621202693",
+ "created_at": 1768031789,
+ "updated_at": 1768032815,
+ "waiting_since": null,
+ "snoozed_until": null,
+ "source": {
+ "type": "conversation",
+ "id": "3381828792",
+ "delivered_as": "customer_initiated",
+ "subject": "",
+ "body": "<p>helklo</p>",
+ "author": {
+ "type": "lead",
+ "id": "696205460674dbb9050aa7fd",
+ "name": null,
+ "email": ""
+ },
+ "attachments": [],
+ "url": "http://localhost:5500/test.html",
+ "redacted": false
+ },
+ "contacts": {
+ "type": "contact.list",
+ "contacts": [
+ {
+ "type": "contact",
+ "id": "696205460674dbb9050aa7fd",
+ "external_id": "5e68ece4-0ec8-4792-baac-02deba39e7fe"
+ }
+ ]
+ },
+ "first_contact_reply": {
+ "created_at": 1768031789,
+ "type": "conversation",
+ "url": "http://localhost:5500/test.html"
+ },
+ "admin_assignee_id": 9608799,
+ "team_assignee_id": null,
+ "open": false,
+ "state": "closed",
+ "read": false,
+ "tags": {
+ "type": "tag.list",
+ "tags": []
+ },
+ "priority": "not_priority",
+ "sla_applied": null,
+ "statistics": {
+ "type": "conversation_statistics",
+ "time_to_assignment": 211,
+ "time_to_admin_reply": 211,
+ "time_to_first_close": 1026,
+ "time_to_last_close": 1026,
+ "median_time_to_reply": 117,
+ "first_contact_reply_at": "2026-01-10T07:56:29.000Z",
+ "first_assignment_at": "2026-01-10T08:00:00.000Z",
+ "first_admin_reply_at": "2026-01-10T08:00:00.000Z",
+ "first_close_at": "2026-01-10T08:13:35.000Z",
+ "last_assignment_at": "2026-01-10T08:00:00.000Z",
+ "last_assignment_admin_reply_at": "2026-01-10T08:00:00.000Z",
+ "last_contact_reply_at": "2026-01-10T08:13:08.000Z",
+ "last_admin_reply_at": "2026-01-10T08:13:32.000Z",
+ "last_close_at": "2026-01-10T08:13:35.000Z",
+ "last_closed_by_id": 9608799,
+ "count_reopens": 0,
+ "count_assignments": 1,
+ "count_conversation_parts": 15,
+ "assigned_team_first_response_time": [],
+ "assigned_team_first_response_time_in_office_hours": [],
+ "handling_time": 756
+ },
+ "conversation_rating": null,
+ "teammates": {
+ "type": "admin.list",
+ "admins": [
+ {
+ "type": "admin",
+ "id": "9608799"
+ }
+ ]
+ },
+ "title": "",
+ "custom_attributes": {
+ "Has attachments": false,
+ "Imported via standalone": false,
+ "Auto-translated": false,
+ "Fin AI Agent: Preview": false,
+ "Fin AI Agent: Image used in reply": false,
+ "Copilot used": false
+ },
+ "topics": {
+ "type": "topic.list",
+ "topics": [],
+ "total_count": 0
+ },
+ "ticket": null,
+ "linked_objects": {
+ "type": "list",
+ "data": [],
+ "total_count": 0,
+ "has_more": false
+ },
+ "ai_agent": null,
+ "ai_agent_participated": false,
+ "conversation_parts": {
+ "type": "conversation_part.list",
+ "conversation_parts": [
+ {
+ "type": "conversation_part",
+ "id": "37358541098",
+ "part_type": "close",
+ "body": null,
+ "created_at": 1768032815,
+ "updated_at": 1768032815,
+ "notified_at": 1768032815,
+ "assigned_to": null,
+ "author": {
+ "id": "9608799",
+ "type": "admin",
+ "name": "John Doe",
+ "email": "[email protected]",
+ "from_ai_agent": false,
+ "is_ai_answer": false
+ },
+ "attachments": [],
+ "external_id": null,
+ "redacted": false,
+ "metadata": {},
+ "email_message_metadata": null,
+ "state": "closed",
+ "tags": [],
+ "event_details": {},
+ "app_package_code": null
+ }
+ ],
+ "total_count": 1
+ }
+ }
+ },
+ "links": {},
+ "id": "notif_93e58991-66f7-43b9-a20a-f8cc02b0ff2d",
+ "topic": "conversation.admin.closed",
+ "delivery_status": "pending",
+ "delivery_attempts": 1,
+ "delivered_at": 0,
+ "first_sent_at": 1768032815,
+ "created_at": 1768032815,
+ "self": null
+}
diff --git a/zerver/webhooks/intercom/fixtures/conversation_admin_noted.json b/zerver/webhooks/intercom/fixtures/conversation_admin_noted.json
new file mode 100644
index 00000000000..8b66d822c69
--- /dev/null
+++ b/zerver/webhooks/intercom/fixtures/conversation_admin_noted.json
@@ -0,0 +1,167 @@
+{
+ "type": "notification_event",
+ "app_id": "abc123def",
+ "data": {
+ "type": "notification_event_data",
+ "item": {
+ "type": "conversation",
+ "id": "215472621202693",
+ "created_at": 1768031789,
+ "updated_at": 1768033309,
+ "waiting_since": 1768032894,
+ "snoozed_until": null,
+ "source": {
+ "type": "conversation",
+ "id": "3381828792",
+ "delivered_as": "customer_initiated",
+ "subject": "",
+ "body": "<p>helklo</p>",
+ "author": {
+ "type": "lead",
+ "id": "696205460674dbb9050aa7fd",
+ "name": null,
+ "email": ""
+ },
+ "attachments": [],
+ "url": "http://localhost:5500/test.html",
+ "redacted": false
+ },
+ "contacts": {
+ "type": "contact.list",
+ "contacts": [
+ {
+ "type": "contact",
+ "id": "696205460674dbb9050aa7fd",
+ "external_id": "5e68ece4-0ec8-4792-baac-02deba39e7fe"
+ }
+ ]
+ },
+ "first_contact_reply": {
+ "created_at": 1768031789,
+ "type": "conversation",
+ "url": "http://localhost:5500/test.html"
+ },
+ "admin_assignee_id": 9608799,
+ "team_assignee_id": null,
+ "open": true,
+ "state": "open",
+ "read": true,
+ "tags": {
+ "type": "tag.list",
+ "tags": [
+ {
+ "type": "tag",
+ "id": "12934044",
+ "name": "Feature Request",
+ "applied_at": 1768033257,
+ "applied_by": {
+ "type": "admin",
+ "id": "9608799"
+ }
+ }
+ ]
+ },
+ "priority": "not_priority",
+ "sla_applied": null,
+ "statistics": {
+ "type": "conversation_statistics",
+ "time_to_assignment": 211,
+ "time_to_admin_reply": 211,
+ "time_to_first_close": 1026,
+ "time_to_last_close": 1026,
+ "median_time_to_reply": 117,
+ "first_contact_reply_at": "2026-01-10T07:56:29.000Z",
+ "first_assignment_at": "2026-01-10T08:00:00.000Z",
+ "first_admin_reply_at": "2026-01-10T08:00:00.000Z",
+ "first_close_at": "2026-01-10T08:13:35.000Z",
+ "last_assignment_at": "2026-01-10T08:00:00.000Z",
+ "last_assignment_admin_reply_at": "2026-01-10T08:00:00.000Z",
+ "last_contact_reply_at": "2026-01-10T08:14:54.000Z",
+ "last_admin_reply_at": "2026-01-10T08:13:32.000Z",
+ "last_close_at": "2026-01-10T08:13:35.000Z",
+ "last_closed_by_id": 9608799,
+ "count_reopens": 1,
+ "count_assignments": 1,
+ "count_conversation_parts": 21,
+ "assigned_team_first_response_time": [],
+ "assigned_team_first_response_time_in_office_hours": [],
+ "handling_time": 865
+ },
+ "conversation_rating": null,
+ "teammates": {
+ "type": "admin.list",
+ "admins": [
+ {
+ "type": "admin",
+ "id": "9608799"
+ }
+ ]
+ },
+ "title": "",
+ "custom_attributes": {
+ "Has attachments": false,
+ "Imported via standalone": false,
+ "Auto-translated": false,
+ "Fin AI Agent: Preview": false,
+ "Fin AI Agent: Image used in reply": false,
+ "Copilot used": false
+ },
+ "topics": {
+ "type": "topic.list",
+ "topics": [],
+ "total_count": 0
+ },
+ "ticket": null,
+ "linked_objects": {
+ "type": "list",
+ "data": [],
+ "total_count": 0,
+ "has_more": false
+ },
+ "ai_agent": null,
+ "ai_agent_participated": false,
+ "conversation_parts": {
+ "type": "conversation_part.list",
+ "conversation_parts": [
+ {
+ "type": "conversation_part",
+ "id": "37358737362",
+ "part_type": "note",
+ "body": "<p class=\"no-margin\">hwdqjhgj</p>",
+ "created_at": 1768033309,
+ "updated_at": 1768033309,
+ "notified_at": 1768033309,
+ "assigned_to": null,
+ "author": {
+ "id": "9608799",
+ "type": "admin",
+ "name": "John Doe",
+ "email": "[email protected]",
+ "from_ai_agent": false,
+ "is_ai_answer": false
+ },
+ "attachments": [],
+ "external_id": null,
+ "redacted": false,
+ "metadata": {},
+ "email_message_metadata": null,
+ "state": "open",
+ "tags": [],
+ "event_details": {},
+ "app_package_code": null
+ }
+ ],
+ "total_count": 1
+ }
+ }
+ },
+ "links": {},
+ "id": "notif_c8794d57-5428-43ac-b313-7e03317c1d44",
+ "topic": "conversation.admin.noted",
+ "delivery_status": "pending",
+ "delivery_attempts": 1,
+ "delivered_at": 0,
+ "first_sent_at": 1768033310,
+ "created_at": 1768033310,
+ "self": null
+}
diff --git a/zerver/webhooks/intercom/fixtures/conversation_admin_open_assigned.json b/zerver/webhooks/intercom/fixtures/conversation_admin_open_assigned.json
new file mode 100644
index 00000000000..fdbada3483c
--- /dev/null
+++ b/zerver/webhooks/intercom/fixtures/conversation_admin_open_assigned.json
@@ -0,0 +1,159 @@
+{
+ "type": "notification_event",
+ "app_id": "abc123def",
+ "data": {
+ "type": "notification_event_data",
+ "item": {
+ "type": "conversation",
+ "id": "215472621202693",
+ "created_at": 1768031789,
+ "updated_at": 1768032000,
+ "waiting_since": null,
+ "snoozed_until": null,
+ "source": {
+ "type": "conversation",
+ "id": "3381828792",
+ "delivered_as": "customer_initiated",
+ "subject": "",
+ "body": "<p>helklo</p>",
+ "author": {
+ "type": "lead",
+ "id": "696205460674dbb9050aa7fd",
+ "name": null,
+ "email": ""
+ },
+ "attachments": [],
+ "url": "http://localhost:5500/test.html",
+ "redacted": false
+ },
+ "contacts": {
+ "type": "contact.list",
+ "contacts": [
+ {
+ "type": "contact",
+ "id": "696205460674dbb9050aa7fd",
+ "external_id": "5e68ece4-0ec8-4792-baac-02deba39e7fe"
+ }
+ ]
+ },
+ "first_contact_reply": {
+ "created_at": 1768031789,
+ "type": "conversation",
+ "url": "http://localhost:5500/test.html"
+ },
+ "admin_assignee_id": 9608799,
+ "team_assignee_id": null,
+ "open": true,
+ "state": "open",
+ "read": false,
+ "tags": {
+ "type": "tag.list",
+ "tags": []
+ },
+ "priority": "not_priority",
+ "sla_applied": null,
+ "statistics": {
+ "type": "conversation_statistics",
+ "time_to_assignment": 211,
+ "time_to_admin_reply": 211,
+ "time_to_first_close": null,
+ "time_to_last_close": null,
+ "median_time_to_reply": 211,
+ "first_contact_reply_at": "2026-01-10T07:56:29.000Z",
+ "first_assignment_at": "2026-01-10T08:00:00.000Z",
+ "first_admin_reply_at": "2026-01-10T08:00:00.000Z",
+ "first_close_at": null,
+ "last_assignment_at": "2026-01-10T08:00:00.000Z",
+ "last_assignment_admin_reply_at": "2026-01-10T08:00:00.000Z",
+ "last_contact_reply_at": "2026-01-10T07:56:29.000Z",
+ "last_admin_reply_at": "2026-01-10T08:00:00.000Z",
+ "last_close_at": null,
+ "last_closed_by_id": null,
+ "count_reopens": 0,
+ "count_assignments": 1,
+ "count_conversation_parts": 6,
+ "assigned_team_first_response_time": [],
+ "assigned_team_first_response_time_in_office_hours": [],
+ "handling_time": null
+ },
+ "conversation_rating": null,
+ "teammates": {
+ "type": "admin.list",
+ "admins": [
+ {
+ "type": "admin",
+ "id": "9608799"
+ }
+ ]
+ },
+ "title": "",
+ "custom_attributes": {
+ "Has attachments": false,
+ "Imported via standalone": false,
+ "Auto-translated": false,
+ "Fin AI Agent: Preview": false,
+ "Fin AI Agent: Image used in reply": false,
+ "Copilot used": false
+ },
+ "topics": {
+ "type": "topic.list",
+ "topics": [],
+ "total_count": 0
+ },
+ "ticket": null,
+ "linked_objects": {
+ "type": "list",
+ "data": [],
+ "total_count": 0,
+ "has_more": false
+ },
+ "ai_agent": null,
+ "ai_agent_participated": false,
+ "conversation_parts": {
+ "type": "conversation_part.list",
+ "conversation_parts": [
+ {
+ "type": "conversation_part",
+ "id": "37358198341",
+ "part_type": "assignment",
+ "body": "<p class=\"no-margin\">aMSIJJO</p>",
+ "created_at": 1768032000,
+ "updated_at": 1768032000,
+ "notified_at": 1768032000,
+ "assigned_to": {
+ "type": "admin",
+ "id": "9608799"
+ },
+ "author": {
+ "id": "9608799",
+ "type": "admin",
+ "name": "John Doe",
+ "email": "[email protected]",
+ "from_ai_agent": false,
+ "is_ai_answer": false
+ },
+ "attachments": [],
+ "external_id": null,
+ "redacted": false,
+ "metadata": {},
+ "email_message_metadata": null,
+ "state": "open",
+ "tags": [],
+ "event_details": {},
+ "app_package_code": null
+ }
+ ],
+ "total_count": 1
+ }
+ }
+ },
+ "links": {},
+ "id": "notif_58e78c8e-1755-4e61-954a-dc1bb1cead0d",
+ "topic": "conversation.admin.open.assigned",
+ "delivery_status": "pending",
+ "delivery_attempts": 1,
+ "delivered_at": 0,
+ "first_sent_at": 1768032001,
+ "created_at": 1768032001,
+ "self": null
+}
diff --git a/zerver/webhooks/intercom/fixtures/conversation_admin_opened.json b/zerver/webhooks/intercom/fixtures/conversation_admin_opened.json
new file mode 100644
index 00000000000..10c41302118
--- /dev/null
+++ b/zerver/webhooks/intercom/fixtures/conversation_admin_opened.json
@@ -0,0 +1,156 @@
+{
+ "type": "notification_event",
+ "app_id": "abc123def",
+ "data": {
+ "type": "notification_event_data",
+ "item": {
+ "type": "conversation",
+ "id": "215472621202693",
+ "created_at": 1768031789,
+ "updated_at": 1768032818,
+ "waiting_since": null,
+ "snoozed_until": null,
+ "source": {
+ "type": "conversation",
+ "id": "3381828792",
+ "delivered_as": "customer_initiated",
+ "subject": "",
+ "body": "<p>helklo</p>",
+ "author": {
+ "type": "lead",
+ "id": "696205460674dbb9050aa7fd",
+ "name": null,
+ "email": ""
+ },
+ "attachments": [],
+ "url": "http://localhost:5500/test.html",
+ "redacted": false
+ },
+ "contacts": {
+ "type": "contact.list",
+ "contacts": [
+ {
+ "type": "contact",
+ "id": "696205460674dbb9050aa7fd",
+ "external_id": "5e68ece4-0ec8-4792-baac-02deba39e7fe"
+ }
+ ]
+ },
+ "first_contact_reply": {
+ "created_at": 1768031789,
+ "type": "conversation",
+ "url": "http://localhost:5500/test.html"
+ },
+ "admin_assignee_id": 9608799,
+ "team_assignee_id": null,
+ "open": true,
+ "state": "open",
+ "read": false,
+ "tags": {
+ "type": "tag.list",
+ "tags": []
+ },
+ "priority": "not_priority",
+ "sla_applied": null,
+ "statistics": {
+ "type": "conversation_statistics",
+ "time_to_assignment": 211,
+ "time_to_admin_reply": 211,
+ "time_to_first_close": 1026,
+ "time_to_last_close": 1026,
+ "median_time_to_reply": 117,
+ "first_contact_reply_at": "2026-01-10T07:56:29.000Z",
+ "first_assignment_at": "2026-01-10T08:00:00.000Z",
+ "first_admin_reply_at": "2026-01-10T08:00:00.000Z",
+ "first_close_at": "2026-01-10T08:13:35.000Z",
+ "last_assignment_at": "2026-01-10T08:00:00.000Z",
+ "last_assignment_admin_reply_at": "2026-01-10T08:00:00.000Z",
+ "last_contact_reply_at": "2026-01-10T08:13:08.000Z",
+ "last_admin_reply_at": "2026-01-10T08:13:32.000Z",
+ "last_close_at": "2026-01-10T08:13:35.000Z",
+ "last_closed_by_id": 9608799,
+ "count_reopens": 1,
+ "count_assignments": 1,
+ "count_conversation_parts": 16,
+ "assigned_team_first_response_time": [],
+ "assigned_team_first_response_time_in_office_hours": [],
+ "handling_time": 756
+ },
+ "conversation_rating": null,
+ "teammates": {
+ "type": "admin.list",
+ "admins": [
+ {
+ "type": "admin",
+ "id": "9608799"
+ }
+ ]
+ },
+ "title": "",
+ "custom_attributes": {
+ "Has attachments": false,
+ "Imported via standalone": false,
+ "Auto-translated": false,
+ "Fin AI Agent: Preview": false,
+ "Fin AI Agent: Image used in reply": false,
+ "Copilot used": false
+ },
+ "topics": {
+ "type": "topic.list",
+ "topics": [],
+ "total_count": 0
+ },
+ "ticket": null,
+ "linked_objects": {
+ "type": "list",
+ "data": [],
+ "total_count": 0,
+ "has_more": false
+ },
+ "ai_agent": null,
+ "ai_agent_participated": false,
+ "conversation_parts": {
+ "type": "conversation_part.list",
+ "conversation_parts": [
+ {
+ "type": "conversation_part",
+ "id": "37358542539",
+ "part_type": "open",
+ "body": null,
+ "created_at": 1768032818,
+ "updated_at": 1768032818,
+ "notified_at": 1768032818,
+ "assigned_to": null,
+ "author": {
+ "id": "9608799",
+ "type": "admin",
+ "name": "John Doe",
+ "email": "[email protected]",
+ "from_ai_agent": false,
+ "is_ai_answer": false
+ },
+ "attachments": [],
+ "external_id": null,
+ "redacted": false,
+ "metadata": {},
+ "email_message_metadata": null,
+ "state": "open",
+ "tags": [],
+ "event_details": {},
+ "app_package_code": null
+ }
+ ],
+ "total_count": 1
+ }
+ }
+ },
+ "links": {},
+ "id": "notif_13d516f4-fc98-46ef-9e99-260e6c8918d7",
+ "topic": "conversation.admin.opened",
+ "delivery_status": "pending",
+ "delivery_attempts": 1,
+ "delivered_at": 0,
+ "first_sent_at": 1768032819,
+ "created_at": 1768032819,
+ "self": null
+}
diff --git a/zerver/webhooks/intercom/fixtures/conversation_admin_replied.json b/zerver/webhooks/intercom/fixtures/conversation_admin_replied.json
new file mode 100644
index 00000000000..400fe1b8b99
--- /dev/null
+++ b/zerver/webhooks/intercom/fixtures/conversation_admin_replied.json
@@ -0,0 +1,159 @@
+{
+ "type": "notification_event",
+ "app_id": "abc123def",
+ "data": {
+ "type": "notification_event_data",
+ "item": {
+ "type": "conversation",
+ "id": "215472621202693",
+ "created_at": 1768031789,
+ "updated_at": 1768032000,
+ "waiting_since": null,
+ "snoozed_until": null,
+ "source": {
+ "type": "conversation",
+ "id": "3381828792",
+ "delivered_as": "customer_initiated",
+ "subject": "",
+ "body": "<p>helklo</p>",
+ "author": {
+ "type": "lead",
+ "id": "696205460674dbb9050aa7fd",
+ "name": null,
+ "email": ""
+ },
+ "attachments": [],
+ "url": "http://localhost:5500/test.html",
+ "redacted": false
+ },
+ "contacts": {
+ "type": "contact.list",
+ "contacts": [
+ {
+ "type": "contact",
+ "id": "696205460674dbb9050aa7fd",
+ "external_id": "5e68ece4-0ec8-4792-baac-02deba39e7fe"
+ }
+ ]
+ },
+ "first_contact_reply": {
+ "created_at": 1768031789,
+ "type": "conversation",
+ "url": "http://localhost:5500/test.html"
+ },
+ "admin_assignee_id": 9608799,
+ "team_assignee_id": null,
+ "open": true,
+ "state": "open",
+ "read": false,
+ "tags": {
+ "type": "tag.list",
+ "tags": []
+ },
+ "priority": "not_priority",
+ "sla_applied": null,
+ "statistics": {
+ "type": "conversation_statistics",
+ "time_to_assignment": 211,
+ "time_to_admin_reply": 211,
+ "time_to_first_close": null,
+ "time_to_last_close": null,
+ "median_time_to_reply": 211,
+ "first_contact_reply_at": "2026-01-10T07:56:29.000Z",
+ "first_assignment_at": "2026-01-10T08:00:00.000Z",
+ "first_admin_reply_at": "2026-01-10T08:00:00.000Z",
+ "first_close_at": null,
+ "last_assignment_at": "2026-01-10T08:00:00.000Z",
+ "last_assignment_admin_reply_at": "2026-01-10T08:00:00.000Z",
+ "last_contact_reply_at": "2026-01-10T07:56:29.000Z",
+ "last_admin_reply_at": "2026-01-10T08:00:00.000Z",
+ "last_close_at": null,
+ "last_closed_by_id": null,
+ "count_reopens": 0,
+ "count_assignments": 1,
+ "count_conversation_parts": 6,
+ "assigned_team_first_response_time": [],
+ "assigned_team_first_response_time_in_office_hours": [],
+ "handling_time": null
+ },
+ "conversation_rating": null,
+ "teammates": {
+ "type": "admin.list",
+ "admins": [
+ {
+ "type": "admin",
+ "id": "9608799"
+ }
+ ]
+ },
+ "title": "",
+ "custom_attributes": {
+ "Has attachments": false,
+ "Imported via standalone": false,
+ "Auto-translated": false,
+ "Fin AI Agent: Preview": false,
+ "Fin AI Agent: Image used in reply": false,
+ "Copilot used": false
+ },
+ "topics": {
+ "type": "topic.list",
+ "topics": [],
+ "total_count": 0
+ },
+ "ticket": null,
+ "linked_objects": {
+ "type": "list",
+ "data": [],
+ "total_count": 0,
+ "has_more": false
+ },
+ "ai_agent": null,
+ "ai_agent_participated": false,
+ "conversation_parts": {
+ "type": "conversation_part.list",
+ "conversation_parts": [
+ {
+ "type": "conversation_part",
+ "id": "37358198341",
+ "part_type": "assignment",
+ "body": "<p class=\"no-margin\">aMSIJJO</p>",
+ "created_at": 1768032000,
+ "updated_at": 1768032000,
+ "notified_at": 1768032000,
+ "assigned_to": {
+ "type": "admin",
+ "id": "9608799"
+ },
+ "author": {
+ "id": "9608799",
+ "type": "admin",
+ "name": "John Doe",
+ "email": "[email protected]",
+ "from_ai_agent": false,
+ "is_ai_answer": false
+ },
+ "attachments": [],
+ "external_id": null,
+ "redacted": false,
+ "metadata": {},
+ "email_message_metadata": null,
+ "state": "open",
+ "tags": [],
+ "event_details": {},
+ "app_package_code": null
+ }
+ ],
+ "total_count": 1
+ }
+ }
+ },
+ "links": {},
+ "id": "notif_726976e0-dde4-4944-9c90-2545c2bb7ac7",
+ "topic": "conversation.admin.replied",
+ "delivery_status": "pending",
+ "delivery_attempts": 1,
+ "delivered_at": 0,
+ "first_sent_at": 1768032001,
+ "created_at": 1768032001,
+ "self": null
+}
diff --git a/zerver/webhooks/intercom/fixtures/conversation_admin_single_created.json b/zerver/webhooks/intercom/fixtures/conversation_admin_single_created.json
new file mode 100644
index 00000000000..62d2b198a81
--- /dev/null
+++ b/zerver/webhooks/intercom/fixtures/conversation_admin_single_created.json
@@ -0,0 +1,119 @@
+{
+ "type": "notification_event",
+ "app_id": "abc123def",
+ "data": {
+ "type": "notification_event_data",
+ "item": {
+ "type": "conversation",
+ "id": "215472621305755",
+ "created_at": 1768033580,
+ "updated_at": 1768033580,
+ "waiting_since": null,
+ "snoozed_until": null,
+ "source": {
+ "type": "conversation",
+ "id": "219032411",
+ "delivered_as": "admin_initiated",
+ "subject": "",
+ "body": "<p class=\"no-margin\">qftweqwrfeyufy</p>",
+ "author": {
+ "type": "admin",
+ "id": "9608799",
+ "name": "John Doe",
+ "email": "[email protected]"
+ },
+ "attachments": [],
+ "url": null,
+ "redacted": false
+ },
+ "contacts": {
+ "type": "contact.list",
+ "contacts": [
+ {
+ "type": "contact",
+ "id": "6961e6de046e053d93e4da0b",
+ "external_id": "fixture-user-1"
+ }
+ ]
+ },
+ "first_contact_reply": null,
+ "admin_assignee_id": null,
+ "team_assignee_id": null,
+ "open": true,
+ "state": "open",
+ "read": false,
+ "tags": {
+ "type": "tag.list",
+ "tags": []
+ },
+ "priority": "not_priority",
+ "sla_applied": null,
+ "statistics": {
+ "type": "conversation_statistics",
+ "time_to_assignment": null,
+ "time_to_admin_reply": null,
+ "time_to_first_close": null,
+ "time_to_last_close": null,
+ "median_time_to_reply": null,
+ "first_contact_reply_at": null,
+ "first_assignment_at": null,
+ "first_admin_reply_at": null,
+ "first_close_at": null,
+ "last_assignment_at": null,
+ "last_assignment_admin_reply_at": null,
+ "last_contact_reply_at": null,
+ "last_admin_reply_at": null,
+ "last_close_at": null,
+ "last_closed_by_id": null,
+ "count_reopens": 0,
+ "count_assignments": 0,
+ "count_conversation_parts": 1,
+ "assigned_team_first_response_time": [],
+ "assigned_team_first_response_time_in_office_hours": [],
+ "handling_time": null
+ },
+ "conversation_rating": null,
+ "teammates": {
+ "type": "admin.list",
+ "admins": []
+ },
+ "title": null,
+ "custom_attributes": {
+ "Has attachments": false,
+ "Imported via standalone": false,
+ "Auto-translated": false,
+ "Fin AI Agent: Preview": false,
+ "Fin AI Agent: Image used in reply": false,
+ "Copilot used": false
+ },
+ "topics": {
+ "type": "topic.list",
+ "topics": [],
+ "total_count": 0
+ },
+ "ticket": null,
+ "linked_objects": {
+ "type": "list",
+ "data": [],
+ "total_count": 0,
+ "has_more": false
+ },
+ "ai_agent": null,
+ "ai_agent_participated": false,
+ "conversation_parts": {
+ "type": "conversation_part.list",
+ "conversation_parts": [],
+ "total_count": 0
+ }
+ }
+ },
+ "links": {},
+ "id": "notif_b735a345-53e3-4e99-ab8e-6bfd955d862c",
+ "topic": "conversation.admin.single.created",
+ "delivery_status": "pending",
+ "delivery_attempts": 1,
+ "delivered_at": 0,
+ "first_sent_at": 1768033580,
+ "created_at": 1768033580,
+ "self": null
+}
diff --git a/zerver/webhooks/intercom/fixtures/conversation_admin_snoozed.json b/zerver/webhooks/intercom/fixtures/conversation_admin_snoozed.json
new file mode 100644
index 00000000000..ac7386ea86c
--- /dev/null
+++ b/zerver/webhooks/intercom/fixtures/conversation_admin_snoozed.json
@@ -0,0 +1,156 @@
+{
+ "type": "notification_event",
+ "app_id": "abc123def",
+ "data": {
+ "type": "notification_event_data",
+ "item": {
+ "type": "conversation",
+ "id": "215472621202693",
+ "created_at": 1768031789,
+ "updated_at": 1768032729,
+ "waiting_since": 1768032450,
+ "snoozed_until": 1768102200,
+ "source": {
+ "type": "conversation",
+ "id": "3381828792",
+ "delivered_as": "customer_initiated",
+ "subject": "",
+ "body": "<p>helklo</p>",
+ "author": {
+ "type": "lead",
+ "id": "696205460674dbb9050aa7fd",
+ "name": null,
+ "email": ""
+ },
+ "attachments": [],
+ "url": "http://localhost:5500/test.html",
+ "redacted": false
+ },
+ "contacts": {
+ "type": "contact.list",
+ "contacts": [
+ {
+ "type": "contact",
+ "id": "696205460674dbb9050aa7fd",
+ "external_id": "5e68ece4-0ec8-4792-baac-02deba39e7fe"
+ }
+ ]
+ },
+ "first_contact_reply": {
+ "created_at": 1768031789,
+ "type": "conversation",
+ "url": "http://localhost:5500/test.html"
+ },
+ "admin_assignee_id": 9608799,
+ "team_assignee_id": null,
+ "open": true,
+ "state": "snoozed",
+ "read": false,
+ "tags": {
+ "type": "tag.list",
+ "tags": []
+ },
+ "priority": "not_priority",
+ "sla_applied": null,
+ "statistics": {
+ "type": "conversation_statistics",
+ "time_to_assignment": 211,
+ "time_to_admin_reply": 211,
+ "time_to_first_close": null,
+ "time_to_last_close": null,
+ "median_time_to_reply": 211,
+ "first_contact_reply_at": "2026-01-10T07:56:29.000Z",
+ "first_assignment_at": "2026-01-10T08:00:00.000Z",
+ "first_admin_reply_at": "2026-01-10T08:00:00.000Z",
+ "first_close_at": null,
+ "last_assignment_at": "2026-01-10T08:00:00.000Z",
+ "last_assignment_admin_reply_at": "2026-01-10T08:00:00.000Z",
+ "last_contact_reply_at": "2026-01-10T08:07:30.000Z",
+ "last_admin_reply_at": "2026-01-10T08:00:00.000Z",
+ "last_close_at": null,
+ "last_closed_by_id": null,
+ "count_reopens": 0,
+ "count_assignments": 1,
+ "count_conversation_parts": 12,
+ "assigned_team_first_response_time": [],
+ "assigned_team_first_response_time_in_office_hours": [],
+ "handling_time": null
+ },
+ "conversation_rating": null,
+ "teammates": {
+ "type": "admin.list",
+ "admins": [
+ {
+ "type": "admin",
+ "id": "9608799"
+ }
+ ]
+ },
+ "title": "",
+ "custom_attributes": {
+ "Has attachments": false,
+ "Imported via standalone": false,
+ "Auto-translated": false,
+ "Fin AI Agent: Preview": false,
+ "Fin AI Agent: Image used in reply": false,
+ "Copilot used": false
+ },
+ "topics": {
+ "type": "topic.list",
+ "topics": [],
+ "total_count": 0
+ },
+ "ticket": null,
+ "linked_objects": {
+ "type": "list",
+ "data": [],
+ "total_count": 0,
+ "has_more": false
+ },
+ "ai_agent": null,
+ "ai_agent_participated": false,
+ "conversation_parts": {
+ "type": "conversation_part.list",
+ "conversation_parts": [
+ {
+ "type": "conversation_part",
+ "id": "37358507060",
+ "part_type": "snoozed",
+ "body": null,
+ "created_at": 1768032729,
+ "updated_at": 1768032729,
+ "notified_at": 1768032729,
+ "assigned_to": null,
+ "author": {
+ "id": "9608799",
+ "type": "admin",
+ "name": "John Doe",
+ "email": "[email protected]",
+ "from_ai_agent": false,
+ "is_ai_answer": false
+ },
+ "attachments": [],
+ "external_id": null,
+ "redacted": false,
+ "metadata": {},
+ "email_message_metadata": null,
+ "state": "snoozed",
+ "tags": [],
+ "event_details": {},
+ "app_package_code": null
+ }
+ ],
+ "total_count": 1
+ }
+ }
+ },
+ "links": {},
+ "id": "notif_b9366b10-8d05-4954-a111-47537bda35b6",
+ "topic": "conversation.admin.snoozed",
+ "delivery_status": "pending",
+ "delivery_attempts": 1,
+ "delivered_at": 0,
+ "first_sent_at": 1768032729,
+ "created_at": 1768032729,
+ "self": null
+}
diff --git a/zerver/webhooks/intercom/fixtures/conversation_admin_unsnoozed.json b/zerver/webhooks/intercom/fixtures/conversation_admin_unsnoozed.json
new file mode 100644
index 00000000000..cd9352ca538
--- /dev/null
+++ b/zerver/webhooks/intercom/fixtures/conversation_admin_unsnoozed.json
@@ -0,0 +1,156 @@
+{
+ "type": "notification_event",
+ "app_id": "abc123def",
+ "data": {
+ "type": "notification_event_data",
+ "item": {
+ "type": "conversation",
+ "id": "215472621202693",
+ "created_at": 1768031789,
+ "updated_at": 1768032989,
+ "waiting_since": 1768032894,
+ "snoozed_until": null,
+ "source": {
+ "type": "conversation",
+ "id": "3381828792",
+ "delivered_as": "customer_initiated",
+ "subject": "",
+ "body": "<p>helklo</p>",
+ "author": {
+ "type": "lead",
+ "id": "696205460674dbb9050aa7fd",
+ "name": null,
+ "email": ""
+ },
+ "attachments": [],
+ "url": "http://localhost:5500/test.html",
+ "redacted": false
+ },
+ "contacts": {
+ "type": "contact.list",
+ "contacts": [
+ {
+ "type": "contact",
+ "id": "696205460674dbb9050aa7fd",
+ "external_id": "5e68ece4-0ec8-4792-baac-02deba39e7fe"
+ }
+ ]
+ },
+ "first_contact_reply": {
+ "created_at": 1768031789,
+ "type": "conversation",
+ "url": "http://localhost:5500/test.html"
+ },
+ "admin_assignee_id": 9608799,
+ "team_assignee_id": null,
+ "open": true,
+ "state": "open",
+ "read": true,
+ "tags": {
+ "type": "tag.list",
+ "tags": []
+ },
+ "priority": "not_priority",
+ "sla_applied": null,
+ "statistics": {
+ "type": "conversation_statistics",
+ "time_to_assignment": 211,
+ "time_to_admin_reply": 211,
+ "time_to_first_close": 1026,
+ "time_to_last_close": 1026,
+ "median_time_to_reply": 117,
+ "first_contact_reply_at": "2026-01-10T07:56:29.000Z",
+ "first_assignment_at": "2026-01-10T08:00:00.000Z",
+ "first_admin_reply_at": "2026-01-10T08:00:00.000Z",
+ "first_close_at": "2026-01-10T08:13:35.000Z",
+ "last_assignment_at": "2026-01-10T08:00:00.000Z",
+ "last_assignment_admin_reply_at": "2026-01-10T08:00:00.000Z",
+ "last_contact_reply_at": "2026-01-10T08:14:54.000Z",
+ "last_admin_reply_at": "2026-01-10T08:13:32.000Z",
+ "last_close_at": "2026-01-10T08:13:35.000Z",
+ "last_closed_by_id": 9608799,
+ "count_reopens": 1,
+ "count_assignments": 1,
+ "count_conversation_parts": 19,
+ "assigned_team_first_response_time": [],
+ "assigned_team_first_response_time_in_office_hours": [],
+ "handling_time": 865
+ },
+ "conversation_rating": null,
+ "teammates": {
+ "type": "admin.list",
+ "admins": [
+ {
+ "type": "admin",
+ "id": "9608799"
+ }
+ ]
+ },
+ "title": "",
+ "custom_attributes": {
+ "Has attachments": false,
+ "Imported via standalone": false,
+ "Auto-translated": false,
+ "Fin AI Agent: Preview": false,
+ "Fin AI Agent: Image used in reply": false,
+ "Copilot used": false
+ },
+ "topics": {
+ "type": "topic.list",
+ "topics": [],
+ "total_count": 0
+ },
+ "ticket": null,
+ "linked_objects": {
+ "type": "list",
+ "data": [],
+ "total_count": 0,
+ "has_more": false
+ },
+ "ai_agent": null,
+ "ai_agent_participated": false,
+ "conversation_parts": {
+ "type": "conversation_part.list",
+ "conversation_parts": [
+ {
+ "type": "conversation_part",
+ "id": "37358610849",
+ "part_type": "timer_unsnooze",
+ "body": null,
+ "created_at": 1768032989,
+ "updated_at": 1768032989,
+ "notified_at": 1768032989,
+ "assigned_to": null,
+ "author": {
+ "id": "9608808",
+ "type": "bot",
+ "name": "Fin",
+ "email": "[email protected]",
+ "from_ai_agent": false,
+ "is_ai_answer": false
+ },
+ "attachments": [],
+ "external_id": null,
+ "redacted": false,
+ "metadata": {},
+ "email_message_metadata": null,
+ "state": "open",
+ "tags": [],
+ "event_details": {},
+ "app_package_code": null
+ }
+ ],
+ "total_count": 1
+ }
+ }
+ },
+ "links": {},
+ "id": "notif_2ef33b1d-0dab-4c99-be31-3dbc79a6e7d9",
+ "topic": "conversation.admin.unsnoozed",
+ "delivery_status": "pending",
+ "delivery_attempts": 1,
+ "delivered_at": 0,
+ "first_sent_at": 1768032990,
+ "created_at": 1768032989,
+ "self": null
+}
diff --git a/zerver/webhooks/intercom/fixtures/conversation_contact_attached.json b/zerver/webhooks/intercom/fixtures/conversation_contact_attached.json
new file mode 100644
index 00000000000..e458bcb63fc
--- /dev/null
+++ b/zerver/webhooks/intercom/fixtures/conversation_contact_attached.json
@@ -0,0 +1,179 @@
+{
+ "type": "notification_event",
+ "app_id": "abc123def",
+ "data": {
+ "type": "notification_event_data",
+ "item": {
+ "conversation": {
+ "parts": [
+ {
+ "id": 37358461336,
+ "app_id": 3239765,
+ "conversation_id": 215472621202693,
+ "body": "",
+ "created_at": "2026-01-10T08:10:14.000Z",
+ "updated_at": "2026-01-10T08:10:14.000Z",
+ "owner_id": 9608799,
+ "closer": false,
+ "admin_only": false,
+ "user_id": null,
+ "url": null,
+ "ua": null,
+ "emailed": false,
+ "markdown": true,
+ "assignee_id": null,
+ "opener": false,
+ "channel": -1,
+ "deleted": false,
+ "json_blocks": "[]",
+ "rule_id": null,
+ "data": "{\"added_by\":{\"type\":\"admin\",\"id\":9608799,\"label\":\"John\",\"name\":\"John Doe\",\"email\":\"[email protected]\"},\"participant\":{\"type\":\"user\",\"id\":\"6961cf78fb9d13be07871c78\",\"label\":\"Sample User\",\"name\":\"Sample User\",\"email\":\"[email protected]\"},\"previous_state\":\"state_open\",\"state\":\"state_open\",\"created_at_with_precision\":\"2026-01-10T08:10:14.903791+00:00\",\"admin\":{\"type\":\"admin\",\"id\":9608799,\"label\":\"John Doe\"}}",
+ "unauthenticated": null,
+ "facebook_message_id": null,
+ "client_assigned_uuid": null,
+ "external_source_id": null,
+ "identity_verified": null
+ }
+ ],
+ "options": {
+ "expand_for_notification": true
+ },
+ "model": {
+ "app_id": 3239765,
+ "id": 215472621202693,
+ "user_id": "696205460674dbb9050aa7fd",
+ "message_id": 3381828792,
+ "created_at": "2026-01-10T07:56:29.000Z",
+ "updated_at": "2026-01-10T08:10:14.000Z",
+ "company_id": "-1",
+ "message_version_id": null,
+ "message_variation_id": 0,
+ "message_type": "conversation",
+ "read": false,
+ "read_at": "2026-01-10T08:07:31.000Z",
+ "latest_user_visible_comment_at": "2026-01-10T08:10:14.000Z",
+ "latest_admin_visible_comment_at": "2026-01-10T08:10:14.000Z",
+ "first_opened_at": "2026-01-10T07:56:34.000Z",
+ "first_user_comment_at": "2026-01-10T08:07:30.000Z",
+ "message_subclass_type": 3,
+ "deleted": false,
+ "original_user_id": "-1",
+ "dismissed": false,
+ "delivery_state": "delivered",
+ "sent_at": "2026-01-10T07:56:29.000Z",
+ "initiator_id": null,
+ "initiator_type": null,
+ "initial_channel": 2,
+ "current_channel": 2
+ }
+ },
+ "contact": {
+ "type": "contact",
+ "id": "6961cf78fb9d13be07871c78",
+ "workspace_id": "abc123def",
+ "external_id": "22",
+ "role": "user",
+ "email": "[email protected]",
+ "phone": "",
+ "formatted_phone": null,
+ "name": "Sample User",
+ "avatar": null,
+ "owner_id": null,
+ "social_profiles": {
+ "type": "list",
+ "data": []
+ },
+ "has_hard_bounced": false,
+ "marked_email_as_spam": false,
+ "unsubscribed_from_emails": false,
+ "created_at": "2026-01-10T04:03:04.963+00:00",
+ "updated_at": "2026-01-10T06:13:31.483+00:00",
+ "signed_up_at": null,
+ "last_seen_at": null,
+ "last_replied_at": null,
+ "last_contacted_at": null,
+ "last_email_opened_at": null,
+ "last_email_clicked_at": null,
+ "language_override": null,
+ "browser": null,
+ "browser_version": null,
+ "browser_language": null,
+ "os": null,
+ "location": {
+ "type": "location",
+ "country": null,
+ "region": null,
+ "city": null,
+ "country_code": null,
+ "continent_code": null
+ },
+ "android_app_name": null,
+ "android_app_version": null,
+ "android_device": null,
+ "android_os_version": null,
+ "android_sdk_version": null,
+ "android_last_seen_at": null,
+ "ios_app_name": null,
+ "ios_app_version": null,
+ "ios_device": null,
+ "ios_os_version": null,
+ "ios_sdk_version": null,
+ "ios_last_seen_at": null,
+ "custom_attributes": {},
+ "tags": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961cf78fb9d13be07871c78/tags",
+ "total_count": 0,
+ "has_more": false
+ },
+ "notes": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961cf78fb9d13be07871c78/notes",
+ "total_count": 0,
+ "has_more": false
+ },
+ "companies": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961cf78fb9d13be07871c78/companies",
+ "total_count": 0,
+ "has_more": false
+ },
+ "opted_out_subscription_types": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961cf78fb9d13be07871c78/subscriptions",
+ "total_count": 0,
+ "has_more": false
+ },
+ "opted_in_subscription_types": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961cf78fb9d13be07871c78/subscriptions",
+ "total_count": 0,
+ "has_more": false
+ },
+ "utm_campaign": null,
+ "utm_content": null,
+ "utm_medium": null,
+ "utm_source": null,
+ "utm_term": null,
+ "referrer": null,
+ "sms_consent": false,
+ "unsubscribed_from_sms": true,
+ "enabled_push_messaging": null
+ }
+ }
+ },
+ "links": {},
+ "id": "notif_15048009-a4c5-472f-9055-a0e4d7c7a3bc",
+ "topic": "conversation.contact.attached",
+ "delivery_status": "pending",
+ "delivery_attempts": 1,
+ "delivered_at": 0,
+ "first_sent_at": 1768032615,
+ "created_at": 1768032615,
+ "self": null
+}
diff --git a/zerver/webhooks/intercom/fixtures/conversation_contact_detached.json b/zerver/webhooks/intercom/fixtures/conversation_contact_detached.json
new file mode 100644
index 00000000000..098df07b4fb
--- /dev/null
+++ b/zerver/webhooks/intercom/fixtures/conversation_contact_detached.json
@@ -0,0 +1,179 @@
+{
+ "type": "notification_event",
+ "app_id": "abc123def",
+ "data": {
+ "type": "notification_event_data",
+ "item": {
+ "conversation": {
+ "parts": [
+ {
+ "id": 37358485044,
+ "app_id": 3239765,
+ "conversation_id": 215472621202693,
+ "body": "",
+ "created_at": "2026-01-10T08:11:14.000Z",
+ "updated_at": "2026-01-10T08:11:14.000Z",
+ "owner_id": 9608799,
+ "closer": false,
+ "admin_only": false,
+ "user_id": null,
+ "url": null,
+ "ua": null,
+ "emailed": false,
+ "markdown": true,
+ "assignee_id": null,
+ "opener": false,
+ "channel": -1,
+ "deleted": false,
+ "json_blocks": "[]",
+ "rule_id": null,
+ "data": "{\"removed_by\":{\"type\":\"admin\",\"id\":9608799,\"label\":\"John\",\"name\":\"John Doe\",\"email\":\"[email protected]\"},\"participant\":{\"type\":\"user\",\"id\":\"6961cf78fb9d13be07871c78\",\"label\":\"Sample User\",\"name\":\"Sample User\",\"email\":\"[email protected]\"},\"previous_state\":\"state_open\",\"state\":\"state_open\",\"created_at_with_precision\":\"2026-01-10T08:11:14.481855+00:00\",\"admin\":{\"type\":\"admin\",\"id\":9608799,\"label\":\"John Doe\"}}",
+ "unauthenticated": null,
+ "facebook_message_id": null,
+ "client_assigned_uuid": null,
+ "external_source_id": null,
+ "identity_verified": null
+ }
+ ],
+ "options": {
+ "expand_for_notification": true
+ },
+ "model": {
+ "app_id": 3239765,
+ "id": 215472621202693,
+ "user_id": "696205460674dbb9050aa7fd",
+ "message_id": 3381828792,
+ "created_at": "2026-01-10T07:56:29.000Z",
+ "updated_at": "2026-01-10T08:11:14.000Z",
+ "company_id": "-1",
+ "message_version_id": null,
+ "message_variation_id": 0,
+ "message_type": "conversation",
+ "read": false,
+ "read_at": "2026-01-10T08:07:31.000Z",
+ "latest_user_visible_comment_at": "2026-01-10T08:11:14.000Z",
+ "latest_admin_visible_comment_at": "2026-01-10T08:11:14.000Z",
+ "first_opened_at": "2026-01-10T07:56:34.000Z",
+ "first_user_comment_at": "2026-01-10T08:07:30.000Z",
+ "message_subclass_type": 3,
+ "deleted": false,
+ "original_user_id": "-1",
+ "dismissed": false,
+ "delivery_state": "delivered",
+ "sent_at": "2026-01-10T07:56:29.000Z",
+ "initiator_id": null,
+ "initiator_type": null,
+ "initial_channel": 2,
+ "current_channel": 2
+ }
+ },
+ "contact": {
+ "type": "contact",
+ "id": "6961cf78fb9d13be07871c78",
+ "workspace_id": "abc123def",
+ "external_id": "22",
+ "role": "user",
+ "email": "[email protected]",
+ "phone": "",
+ "formatted_phone": null,
+ "name": "Sample User",
+ "avatar": null,
+ "owner_id": null,
+ "social_profiles": {
+ "type": "list",
+ "data": []
+ },
+ "has_hard_bounced": false,
+ "marked_email_as_spam": false,
+ "unsubscribed_from_emails": false,
+ "created_at": "2026-01-10T04:03:04.963+00:00",
+ "updated_at": "2026-01-10T08:10:31.654+00:00",
+ "signed_up_at": null,
+ "last_seen_at": null,
+ "last_replied_at": null,
+ "last_contacted_at": "2026-01-10T08:10:31.646+00:00",
+ "last_email_opened_at": null,
+ "last_email_clicked_at": null,
+ "language_override": null,
+ "browser": null,
+ "browser_version": null,
+ "browser_language": null,
+ "os": null,
+ "location": {
+ "type": "location",
+ "country": null,
+ "region": null,
+ "city": null,
+ "country_code": null,
+ "continent_code": null
+ },
+ "android_app_name": null,
+ "android_app_version": null,
+ "android_device": null,
+ "android_os_version": null,
+ "android_sdk_version": null,
+ "android_last_seen_at": null,
+ "ios_app_name": null,
+ "ios_app_version": null,
+ "ios_device": null,
+ "ios_os_version": null,
+ "ios_sdk_version": null,
+ "ios_last_seen_at": null,
+ "custom_attributes": {},
+ "tags": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961cf78fb9d13be07871c78/tags",
+ "total_count": 0,
+ "has_more": false
+ },
+ "notes": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961cf78fb9d13be07871c78/notes",
+ "total_count": 0,
+ "has_more": false
+ },
+ "companies": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961cf78fb9d13be07871c78/companies",
+ "total_count": 0,
+ "has_more": false
+ },
+ "opted_out_subscription_types": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961cf78fb9d13be07871c78/subscriptions",
+ "total_count": 0,
+ "has_more": false
+ },
+ "opted_in_subscription_types": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961cf78fb9d13be07871c78/subscriptions",
+ "total_count": 0,
+ "has_more": false
+ },
+ "utm_campaign": null,
+ "utm_content": null,
+ "utm_medium": null,
+ "utm_source": null,
+ "utm_term": null,
+ "referrer": null,
+ "sms_consent": false,
+ "unsubscribed_from_sms": true,
+ "enabled_push_messaging": null
+ }
+ }
+ },
+ "links": {},
+ "id": "notif_865f9d8d-0f38-45f4-95c9-495e2bc1c907",
+ "topic": "conversation.contact.detached",
+ "delivery_status": "pending",
+ "delivery_attempts": 1,
+ "delivered_at": 0,
+ "first_sent_at": 1768032674,
+ "created_at": 1768032674,
+ "self": null
+}
diff --git a/zerver/webhooks/intercom/fixtures/conversation_deleted.json b/zerver/webhooks/intercom/fixtures/conversation_deleted.json
new file mode 100644
index 00000000000..d3fcafb61b8
--- /dev/null
+++ b/zerver/webhooks/intercom/fixtures/conversation_deleted.json
@@ -0,0 +1,20 @@
+{
+ "type": "notification_event",
+ "app_id": "abc123def",
+ "data": {
+ "type": "notification_event_data",
+ "item": {
+ "type": "conversation",
+ "conversation_id": "215472621305755"
+ }
+ },
+ "links": {},
+ "id": "notif_d808d1ab-c203-42fb-9e66-d281c7d1f74d",
+ "topic": "conversation.deleted",
+ "delivery_status": "pending",
+ "delivery_attempts": 1,
+ "delivered_at": 0,
+ "first_sent_at": 1768112097,
+ "created_at": 1768112097,
+ "self": null
+}
diff --git a/zerver/webhooks/intercom/fixtures/conversation_operator_replied.json b/zerver/webhooks/intercom/fixtures/conversation_operator_replied.json
new file mode 100644
index 00000000000..fbb5187739d
--- /dev/null
+++ b/zerver/webhooks/intercom/fixtures/conversation_operator_replied.json
@@ -0,0 +1,151 @@
+{
+ "type": "notification_event",
+ "app_id": "abc123def",
+ "data": {
+ "type": "notification_event_data",
+ "item": {
+ "type": "conversation",
+ "id": "215472621202693",
+ "created_at": 1768031789,
+ "updated_at": 1768031793,
+ "waiting_since": 1768031789,
+ "snoozed_until": null,
+ "source": {
+ "type": "conversation",
+ "id": "3381828792",
+ "delivered_as": "customer_initiated",
+ "subject": "",
+ "body": "<p>helklo</p>",
+ "author": {
+ "type": "lead",
+ "id": "696205460674dbb9050aa7fd",
+ "name": null,
+ "email": ""
+ },
+ "attachments": [],
+ "url": "http://localhost:5500/test.html",
+ "redacted": false
+ },
+ "contacts": {
+ "type": "contact.list",
+ "contacts": [
+ {
+ "type": "contact",
+ "id": "696205460674dbb9050aa7fd",
+ "external_id": "5e68ece4-0ec8-4792-baac-02deba39e7fe"
+ }
+ ]
+ },
+ "first_contact_reply": {
+ "created_at": 1768031789,
+ "type": "conversation",
+ "url": "http://localhost:5500/test.html"
+ },
+ "admin_assignee_id": null,
+ "team_assignee_id": null,
+ "open": true,
+ "state": "open",
+ "read": false,
+ "tags": {
+ "type": "tag.list",
+ "tags": []
+ },
+ "priority": "not_priority",
+ "sla_applied": null,
+ "statistics": {
+ "type": "conversation_statistics",
+ "time_to_assignment": null,
+ "time_to_admin_reply": null,
+ "time_to_first_close": null,
+ "time_to_last_close": null,
+ "median_time_to_reply": null,
+ "first_contact_reply_at": "2026-01-10T07:56:29.000Z",
+ "first_assignment_at": null,
+ "first_admin_reply_at": null,
+ "first_close_at": null,
+ "last_assignment_at": null,
+ "last_assignment_admin_reply_at": null,
+ "last_contact_reply_at": "2026-01-10T07:56:29.000Z",
+ "last_admin_reply_at": null,
+ "last_close_at": null,
+ "last_closed_by_id": null,
+ "count_reopens": 0,
+ "count_assignments": 0,
+ "count_conversation_parts": 3,
+ "assigned_team_first_response_time": [],
+ "assigned_team_first_response_time_in_office_hours": [],
+ "handling_time": null
+ },
+ "conversation_rating": null,
+ "teammates": {
+ "type": "admin.list",
+ "admins": []
+ },
+ "title": "",
+ "custom_attributes": {
+ "Has attachments": false,
+ "Imported via standalone": false,
+ "Auto-translated": false,
+ "Fin AI Agent: Preview": false,
+ "Fin AI Agent: Image used in reply": false,
+ "Copilot used": false
+ },
+ "topics": {
+ "type": "topic.list",
+ "topics": [],
+ "total_count": 0
+ },
+ "ticket": null,
+ "linked_objects": {
+ "type": "list",
+ "data": [],
+ "total_count": 0,
+ "has_more": false
+ },
+ "ai_agent": null,
+ "ai_agent_participated": false,
+ "conversation_parts": {
+ "type": "conversation_part.list",
+ "conversation_parts": [
+ {
+ "type": "conversation_part",
+ "id": "37358121213",
+ "part_type": "channel_and_reply_time_expectation",
+ "body": "<p>shetty will reply as soon as they can.</p>",
+ "created_at": 1768031793,
+ "updated_at": 1768031793,
+ "notified_at": 1768031793,
+ "assigned_to": null,
+ "author": {
+ "id": "9608808",
+ "type": "bot",
+ "name": "Fin",
+ "email": "[email protected]",
+ "from_ai_agent": false,
+ "is_ai_answer": false
+ },
+ "attachments": [],
+ "external_id": null,
+ "redacted": false,
+ "metadata": {},
+ "email_message_metadata": null,
+ "state": "open",
+ "tags": [],
+ "event_details": {},
+ "app_package_code": null
+ }
+ ],
+ "total_count": 1
+ }
+ }
+ },
+ "links": {},
+ "id": "notif_9108e504-998b-4afb-afd2-405cff43b99f",
+ "topic": "conversation.operator.replied",
+ "delivery_status": "pending",
+ "delivery_attempts": 1,
+ "delivered_at": 0,
+ "first_sent_at": 1768031794,
+ "created_at": 1768031793,
+ "self": null
+}
diff --git a/zerver/webhooks/intercom/fixtures/conversation_part_redacted.json b/zerver/webhooks/intercom/fixtures/conversation_part_redacted.json
new file mode 100644
index 00000000000..e0ff5720c17
--- /dev/null
+++ b/zerver/webhooks/intercom/fixtures/conversation_part_redacted.json
@@ -0,0 +1,156 @@
+{
+ "type": "notification_event",
+ "app_id": "abc123def",
+ "data": {
+ "type": "notification_event_data",
+ "item": {
+ "type": "conversation",
+ "id": "215472621202693",
+ "created_at": 1768031789,
+ "updated_at": 1768033204,
+ "waiting_since": 1768032894,
+ "snoozed_until": null,
+ "source": {
+ "type": "conversation",
+ "id": "3381828792",
+ "delivered_as": "customer_initiated",
+ "subject": "",
+ "body": "<p>helklo</p>",
+ "author": {
+ "type": "lead",
+ "id": "696205460674dbb9050aa7fd",
+ "name": null,
+ "email": ""
+ },
+ "attachments": [],
+ "url": "http://localhost:5500/test.html",
+ "redacted": false
+ },
+ "contacts": {
+ "type": "contact.list",
+ "contacts": [
+ {
+ "type": "contact",
+ "id": "696205460674dbb9050aa7fd",
+ "external_id": "5e68ece4-0ec8-4792-baac-02deba39e7fe"
+ }
+ ]
+ },
+ "first_contact_reply": {
+ "created_at": 1768031789,
+ "type": "conversation",
+ "url": "http://localhost:5500/test.html"
+ },
+ "admin_assignee_id": 9608799,
+ "team_assignee_id": null,
+ "open": true,
+ "state": "open",
+ "read": true,
+ "tags": {
+ "type": "tag.list",
+ "tags": []
+ },
+ "priority": "not_priority",
+ "sla_applied": null,
+ "statistics": {
+ "type": "conversation_statistics",
+ "time_to_assignment": 211,
+ "time_to_admin_reply": 211,
+ "time_to_first_close": 1026,
+ "time_to_last_close": 1026,
+ "median_time_to_reply": 117,
+ "first_contact_reply_at": "2026-01-10T07:56:29.000Z",
+ "first_assignment_at": "2026-01-10T08:00:00.000Z",
+ "first_admin_reply_at": "2026-01-10T08:00:00.000Z",
+ "first_close_at": "2026-01-10T08:13:35.000Z",
+ "last_assignment_at": "2026-01-10T08:00:00.000Z",
+ "last_assignment_admin_reply_at": "2026-01-10T08:00:00.000Z",
+ "last_contact_reply_at": "2026-01-10T08:14:54.000Z",
+ "last_admin_reply_at": "2026-01-10T08:13:32.000Z",
+ "last_close_at": "2026-01-10T08:13:35.000Z",
+ "last_closed_by_id": 9608799,
+ "count_reopens": 1,
+ "count_assignments": 1,
+ "count_conversation_parts": 19,
+ "assigned_team_first_response_time": [],
+ "assigned_team_first_response_time_in_office_hours": [],
+ "handling_time": 865
+ },
+ "conversation_rating": null,
+ "teammates": {
+ "type": "admin.list",
+ "admins": [
+ {
+ "type": "admin",
+ "id": "9608799"
+ }
+ ]
+ },
+ "title": "",
+ "custom_attributes": {
+ "Has attachments": false,
+ "Imported via standalone": false,
+ "Auto-translated": false,
+ "Fin AI Agent: Preview": false,
+ "Fin AI Agent: Image used in reply": false,
+ "Copilot used": false
+ },
+ "topics": {
+ "type": "topic.list",
+ "topics": [],
+ "total_count": 0
+ },
+ "ticket": null,
+ "linked_objects": {
+ "type": "list",
+ "data": [],
+ "total_count": 0,
+ "has_more": false
+ },
+ "ai_agent": null,
+ "ai_agent_participated": false,
+ "conversation_parts": {
+ "type": "conversation_part.list",
+ "conversation_parts": [
+ {
+ "type": "conversation_part",
+ "id": "37358539897",
+ "part_type": "comment",
+ "body": "<p><i>This message was deleted</i></p>",
+ "created_at": 1768032812,
+ "updated_at": 1768033204,
+ "notified_at": 1768032812,
+ "assigned_to": null,
+ "author": {
+ "id": "9608799",
+ "type": "admin",
+ "name": "John Doe",
+ "email": "[email protected]",
+ "from_ai_agent": false,
+ "is_ai_answer": false
+ },
+ "attachments": [],
+ "external_id": null,
+ "redacted": true,
+ "metadata": {},
+ "email_message_metadata": null,
+ "state": "open",
+ "tags": [],
+ "event_details": {},
+ "app_package_code": null
+ }
+ ],
+ "total_count": 1
+ }
+ }
+ },
+ "links": {},
+ "id": "notif_574e80f7-1e3a-425d-a485-2fe8ddf0b6d9",
+ "topic": "conversation_part.redacted",
+ "delivery_status": "pending",
+ "delivery_attempts": 1,
+ "delivered_at": 0,
+ "first_sent_at": 1768033205,
+ "created_at": 1768033204,
+ "self": null
+}
diff --git a/zerver/webhooks/intercom/fixtures/conversation_part_tag_created.json b/zerver/webhooks/intercom/fixtures/conversation_part_tag_created.json
new file mode 100644
index 00000000000..40c1e14f492
--- /dev/null
+++ b/zerver/webhooks/intercom/fixtures/conversation_part_tag_created.json
@@ -0,0 +1,185 @@
+{
+ "type": "notification_event",
+ "app_id": "abc123def",
+ "data": {
+ "type": "notification_event_data",
+ "item": {
+ "type": "conversation_part_tag",
+ "created_at": 1768033257,
+ "conversation": {
+ "type": "conversation",
+ "id": "215472621202693",
+ "created_at": 1768031789,
+ "updated_at": 1768033257,
+ "waiting_since": 1768032894,
+ "snoozed_until": null,
+ "source": {
+ "type": "conversation",
+ "id": "3381828792",
+ "delivered_as": "customer_initiated",
+ "subject": "",
+ "body": "<p>helklo</p>",
+ "author": {
+ "type": "lead",
+ "id": "696205460674dbb9050aa7fd",
+ "name": null,
+ "email": ""
+ },
+ "attachments": [],
+ "url": "http://localhost:5500/test.html",
+ "redacted": false
+ },
+ "contacts": {
+ "type": "contact.list",
+ "contacts": [
+ {
+ "type": "contact",
+ "id": "696205460674dbb9050aa7fd",
+ "external_id": "5e68ece4-0ec8-4792-baac-02deba39e7fe"
+ }
+ ]
+ },
+ "first_contact_reply": {
+ "created_at": 1768031789,
+ "type": "conversation",
+ "url": "http://localhost:5500/test.html"
+ },
+ "admin_assignee_id": 9608799,
+ "team_assignee_id": null,
+ "open": true,
+ "state": "open",
+ "read": true,
+ "tags": {
+ "type": "tag.list",
+ "tags": [
+ {
+ "type": "tag",
+ "id": "12934044",
+ "name": "Feature Request",
+ "applied_at": 1768033257,
+ "applied_by": {
+ "type": "admin",
+ "id": "9608799"
+ }
+ }
+ ]
+ },
+ "priority": "not_priority",
+ "sla_applied": null,
+ "statistics": {
+ "type": "conversation_statistics",
+ "time_to_assignment": 211,
+ "time_to_admin_reply": 211,
+ "time_to_first_close": 1026,
+ "time_to_last_close": 1026,
+ "median_time_to_reply": 117,
+ "first_contact_reply_at": "2026-01-10T07:56:29.000Z",
+ "first_assignment_at": "2026-01-10T08:00:00.000Z",
+ "first_admin_reply_at": "2026-01-10T08:00:00.000Z",
+ "first_close_at": "2026-01-10T08:13:35.000Z",
+ "last_assignment_at": "2026-01-10T08:00:00.000Z",
+ "last_assignment_admin_reply_at": "2026-01-10T08:00:00.000Z",
+ "last_contact_reply_at": "2026-01-10T08:14:54.000Z",
+ "last_admin_reply_at": "2026-01-10T08:13:32.000Z",
+ "last_close_at": "2026-01-10T08:13:35.000Z",
+ "last_closed_by_id": 9608799,
+ "count_reopens": 1,
+ "count_assignments": 1,
+ "count_conversation_parts": 19,
+ "assigned_team_first_response_time": [],
+ "assigned_team_first_response_time_in_office_hours": [],
+ "handling_time": 865
+ },
+ "conversation_rating": null,
+ "teammates": {
+ "type": "admin.list",
+ "admins": [
+ {
+ "type": "admin",
+ "id": "9608799"
+ }
+ ]
+ },
+ "title": "",
+ "custom_attributes": {
+ "Has attachments": false,
+ "Imported via standalone": false,
+ "Auto-translated": false,
+ "Fin AI Agent: Preview": false,
+ "Fin AI Agent: Image used in reply": false,
+ "Copilot used": false
+ },
+ "topics": {
+ "type": "topic.list",
+ "topics": [],
+ "total_count": 0
+ },
+ "ticket": null,
+ "linked_objects": {
+ "type": "list",
+ "data": [],
+ "total_count": 0,
+ "has_more": false
+ },
+ "ai_agent": null,
+ "ai_agent_participated": false,
+ "conversation_parts": {
+ "type": "conversation_part.list",
+ "conversation_parts": [
+ {
+ "type": "conversation_part",
+ "id": "37358198341",
+ "part_type": "assignment",
+ "body": "<p class=\"no-margin\">aMSIJJO</p>",
+ "created_at": 1768032000,
+ "updated_at": 1768033257,
+ "notified_at": 1768032000,
+ "assigned_to": {
+ "type": "admin",
+ "id": "9608799"
+ },
+ "author": {
+ "id": "9608799",
+ "type": "admin",
+ "name": "John Doe",
+ "email": "[email protected]",
+ "from_ai_agent": false,
+ "is_ai_answer": false
+ },
+ "attachments": [],
+ "external_id": null,
+ "redacted": false,
+ "metadata": {},
+ "email_message_metadata": null,
+ "state": "open",
+ "tags": [
+ {
+ "type": "tag",
+ "id": "12934044",
+ "name": "Feature Request"
+ }
+ ],
+ "event_details": {},
+ "app_package_code": null
+ }
+ ],
+ "total_count": 1
+ }
+ },
+ "tag": {
+ "type": "tag",
+ "id": "12934044",
+ "name": "Feature Request"
+ }
+ }
+ },
+ "links": {},
+ "id": "notif_bb2d67b8-b0ab-480a-94df-b4fd81224e27",
+ "topic": "conversation_part.tag.created",
+ "delivery_status": "pending",
+ "delivery_attempts": 1,
+ "delivered_at": 0,
+ "first_sent_at": 1768033257,
+ "created_at": 1768033257,
+ "self": null
+}
diff --git a/zerver/webhooks/intercom/fixtures/conversation_priority_updated.json b/zerver/webhooks/intercom/fixtures/conversation_priority_updated.json
new file mode 100644
index 00000000000..b65da773924
--- /dev/null
+++ b/zerver/webhooks/intercom/fixtures/conversation_priority_updated.json
@@ -0,0 +1,156 @@
+{
+ "type": "notification_event",
+ "app_id": "abc123def",
+ "data": {
+ "type": "notification_event_data",
+ "item": {
+ "type": "conversation",
+ "id": "215472621202693",
+ "created_at": 1768031789,
+ "updated_at": 1768032534,
+ "waiting_since": 1768032450,
+ "snoozed_until": null,
+ "source": {
+ "type": "conversation",
+ "id": "3381828792",
+ "delivered_as": "customer_initiated",
+ "subject": "",
+ "body": "<p>helklo</p>",
+ "author": {
+ "type": "lead",
+ "id": "696205460674dbb9050aa7fd",
+ "name": null,
+ "email": ""
+ },
+ "attachments": [],
+ "url": "http://localhost:5500/test.html",
+ "redacted": false
+ },
+ "contacts": {
+ "type": "contact.list",
+ "contacts": [
+ {
+ "type": "contact",
+ "id": "696205460674dbb9050aa7fd",
+ "external_id": "5e68ece4-0ec8-4792-baac-02deba39e7fe"
+ }
+ ]
+ },
+ "first_contact_reply": {
+ "created_at": 1768031789,
+ "type": "conversation",
+ "url": "http://localhost:5500/test.html"
+ },
+ "admin_assignee_id": 9608799,
+ "team_assignee_id": null,
+ "open": true,
+ "state": "open",
+ "read": true,
+ "tags": {
+ "type": "tag.list",
+ "tags": []
+ },
+ "priority": "priority",
+ "sla_applied": null,
+ "statistics": {
+ "type": "conversation_statistics",
+ "time_to_assignment": 211,
+ "time_to_admin_reply": 211,
+ "time_to_first_close": null,
+ "time_to_last_close": null,
+ "median_time_to_reply": 211,
+ "first_contact_reply_at": "2026-01-10T07:56:29.000Z",
+ "first_assignment_at": "2026-01-10T08:00:00.000Z",
+ "first_admin_reply_at": "2026-01-10T08:00:00.000Z",
+ "first_close_at": null,
+ "last_assignment_at": "2026-01-10T08:00:00.000Z",
+ "last_assignment_admin_reply_at": "2026-01-10T08:00:00.000Z",
+ "last_contact_reply_at": "2026-01-10T08:07:30.000Z",
+ "last_admin_reply_at": "2026-01-10T08:00:00.000Z",
+ "last_close_at": null,
+ "last_closed_by_id": null,
+ "count_reopens": 0,
+ "count_assignments": 1,
+ "count_conversation_parts": 8,
+ "assigned_team_first_response_time": [],
+ "assigned_team_first_response_time_in_office_hours": [],
+ "handling_time": null
+ },
+ "conversation_rating": null,
+ "teammates": {
+ "type": "admin.list",
+ "admins": [
+ {
+ "type": "admin",
+ "id": "9608799"
+ }
+ ]
+ },
+ "title": "",
+ "custom_attributes": {
+ "Has attachments": false,
+ "Imported via standalone": false,
+ "Auto-translated": false,
+ "Fin AI Agent: Preview": false,
+ "Fin AI Agent: Image used in reply": false,
+ "Copilot used": false
+ },
+ "topics": {
+ "type": "topic.list",
+ "topics": [],
+ "total_count": 0
+ },
+ "ticket": null,
+ "linked_objects": {
+ "type": "list",
+ "data": [],
+ "total_count": 0,
+ "has_more": false
+ },
+ "ai_agent": null,
+ "ai_agent_participated": false,
+ "conversation_parts": {
+ "type": "conversation_part.list",
+ "conversation_parts": [
+ {
+ "type": "conversation_part",
+ "id": "37358429305",
+ "part_type": "priority_changed",
+ "body": null,
+ "created_at": 1768032534,
+ "updated_at": 1768032534,
+ "notified_at": 1768032534,
+ "assigned_to": null,
+ "author": {
+ "id": "9608799",
+ "type": "admin",
+ "name": "John Doe",
+ "email": "[email protected]",
+ "from_ai_agent": false,
+ "is_ai_answer": false
+ },
+ "attachments": [],
+ "external_id": null,
+ "redacted": false,
+ "metadata": {},
+ "email_message_metadata": null,
+ "state": "open",
+ "tags": [],
+ "event_details": {},
+ "app_package_code": null
+ }
+ ],
+ "total_count": 1
+ }
+ }
+ },
+ "links": {},
+ "id": "notif_92261e36-95a7-4a80-90ef-bda7b55287cf",
+ "topic": "conversation.priority.updated",
+ "delivery_status": "pending",
+ "delivery_attempts": 1,
+ "delivered_at": 0,
+ "first_sent_at": 1768032535,
+ "created_at": 1768032534,
+ "self": null
+}
diff --git a/zerver/webhooks/intercom/fixtures/conversation_read.json b/zerver/webhooks/intercom/fixtures/conversation_read.json
new file mode 100644
index 00000000000..a998f1805af
--- /dev/null
+++ b/zerver/webhooks/intercom/fixtures/conversation_read.json
@@ -0,0 +1,232 @@
+{
+ "type": "notification_event",
+ "app_id": "abc123def",
+ "data": {
+ "type": "notification_event_data",
+ "item": {
+ "type": "conversation",
+ "id": "215472621202693",
+ "created_at": 1768031789,
+ "updated_at": 1768031793,
+ "waiting_since": 1768031789,
+ "snoozed_until": null,
+ "source": {
+ "type": "conversation",
+ "id": "3381828792",
+ "delivered_as": "customer_initiated",
+ "subject": "",
+ "body": "<p>helklo</p>",
+ "author": {
+ "type": "lead",
+ "id": "696205460674dbb9050aa7fd",
+ "name": null,
+ "email": ""
+ },
+ "attachments": [],
+ "url": "http://localhost:5500/test.html",
+ "redacted": false
+ },
+ "contacts": {
+ "type": "contact.list",
+ "contacts": [
+ {
+ "type": "contact",
+ "id": "696205460674dbb9050aa7fd",
+ "external_id": "5e68ece4-0ec8-4792-baac-02deba39e7fe"
+ }
+ ]
+ },
+ "first_contact_reply": {
+ "created_at": 1768031789,
+ "type": "conversation",
+ "url": "http://localhost:5500/test.html"
+ },
+ "admin_assignee_id": null,
+ "team_assignee_id": null,
+ "open": true,
+ "state": "open",
+ "read": true,
+ "tags": {
+ "type": "tag.list",
+ "tags": []
+ },
+ "priority": "not_priority",
+ "sla_applied": null,
+ "statistics": {
+ "type": "conversation_statistics",
+ "time_to_assignment": null,
+ "time_to_admin_reply": null,
+ "time_to_first_close": null,
+ "time_to_last_close": null,
+ "median_time_to_reply": null,
+ "first_contact_reply_at": "2026-01-10T07:56:29.000Z",
+ "first_assignment_at": null,
+ "first_admin_reply_at": null,
+ "first_close_at": null,
+ "last_assignment_at": null,
+ "last_assignment_admin_reply_at": null,
+ "last_contact_reply_at": "2026-01-10T07:56:29.000Z",
+ "last_admin_reply_at": null,
+ "last_close_at": null,
+ "last_closed_by_id": null,
+ "count_reopens": 0,
+ "count_assignments": 0,
+ "count_conversation_parts": 5,
+ "assigned_team_first_response_time": [],
+ "assigned_team_first_response_time_in_office_hours": [],
+ "handling_time": null
+ },
+ "conversation_rating": null,
+ "teammates": {
+ "type": "admin.list",
+ "admins": []
+ },
+ "title": "",
+ "custom_attributes": {
+ "Has attachments": false,
+ "Imported via standalone": false,
+ "Auto-translated": false,
+ "Fin AI Agent: Preview": false,
+ "Fin AI Agent: Image used in reply": false,
+ "Copilot used": false
+ },
+ "topics": {
+ "type": "topic.list",
+ "topics": [],
+ "total_count": 0
+ },
+ "ticket": null,
+ "linked_objects": {
+ "type": "list",
+ "data": [],
+ "total_count": 0,
+ "has_more": false
+ },
+ "ai_agent": null,
+ "ai_agent_participated": false,
+ "conversation_parts": {
+ "type": "conversation_part.list",
+ "conversation_parts": [
+ {
+ "type": "conversation_part",
+ "id": "37358120248",
+ "part_type": "language_detection_details",
+ "body": null,
+ "created_at": 1768031790,
+ "updated_at": 1768031790,
+ "notified_at": 1768031790,
+ "assigned_to": null,
+ "author": {
+ "id": "9608808",
+ "type": "bot",
+ "name": "Fin",
+ "email": "[email protected]",
+ "from_ai_agent": false,
+ "is_ai_answer": false
+ },
+ "attachments": [],
+ "external_id": null,
+ "redacted": false,
+ "metadata": {},
+ "email_message_metadata": null,
+ "state": "open",
+ "tags": [],
+ "event_details": {},
+ "app_package_code": null
+ },
+ {
+ "type": "conversation_part",
+ "id": "37358121213",
+ "part_type": "channel_and_reply_time_expectation",
+ "body": "<p>shetty will reply as soon as they can.</p>",
+ "created_at": 1768031793,
+ "updated_at": 1768031793,
+ "notified_at": 1768031793,
+ "assigned_to": null,
+ "author": {
+ "id": "9608808",
+ "type": "bot",
+ "name": "Fin",
+ "email": "[email protected]",
+ "from_ai_agent": false,
+ "is_ai_answer": false
+ },
+ "attachments": [],
+ "external_id": null,
+ "redacted": false,
+ "metadata": {},
+ "email_message_metadata": null,
+ "state": "open",
+ "tags": [],
+ "event_details": {},
+ "app_package_code": null
+ },
+ {
+ "type": "conversation_part",
+ "id": "37358121359",
+ "part_type": "comment",
+ "body": "<p>Give the team a way to reach you:</p>",
+ "created_at": 1768031793,
+ "updated_at": 1768031793,
+ "notified_at": 1768031793,
+ "assigned_to": null,
+ "author": {
+ "id": "9608808",
+ "type": "bot",
+ "name": "Fin",
+ "email": "[email protected]",
+ "from_ai_agent": false,
+ "is_ai_answer": false
+ },
+ "attachments": [],
+ "external_id": null,
+ "redacted": false,
+ "metadata": {},
+ "email_message_metadata": null,
+ "state": "open",
+ "tags": [],
+ "event_details": {},
+ "app_package_code": null
+ },
+ {
+ "type": "conversation_part",
+ "id": "37358121434",
+ "part_type": "attribute_collector",
+ "body": null,
+ "created_at": 1768031793,
+ "updated_at": 1768031793,
+ "notified_at": 1768031793,
+ "assigned_to": null,
+ "author": {
+ "id": "9608808",
+ "type": "bot",
+ "name": "Fin",
+ "email": "[email protected]",
+ "from_ai_agent": false,
+ "is_ai_answer": false
+ },
+ "attachments": [],
+ "external_id": null,
+ "redacted": false,
+ "metadata": {},
+ "email_message_metadata": null,
+ "state": "open",
+ "tags": [],
+ "event_details": {},
+ "app_package_code": null
+ }
+ ],
+ "total_count": 4
+ }
+ }
+ },
+ "links": {},
+ "id": "notif_7fde0300-6bf1-4916-8475-75497db01d08",
+ "topic": "conversation.read",
+ "delivery_status": "pending",
+ "delivery_attempts": 1,
+ "delivered_at": 0,
+ "first_sent_at": 1768031794,
+ "created_at": 1768031794,
+ "self": null
+}
diff --git a/zerver/webhooks/intercom/fixtures/conversation_user_created.json b/zerver/webhooks/intercom/fixtures/conversation_user_created.json
new file mode 100644
index 00000000000..a372da22afe
--- /dev/null
+++ b/zerver/webhooks/intercom/fixtures/conversation_user_created.json
@@ -0,0 +1,123 @@
+{
+ "type": "notification_event",
+ "app_id": "abc123def",
+ "data": {
+ "type": "notification_event_data",
+ "item": {
+ "type": "conversation",
+ "id": "215472621202693",
+ "created_at": 1768031789,
+ "updated_at": 1768031789,
+ "waiting_since": 1768031789,
+ "snoozed_until": null,
+ "source": {
+ "type": "conversation",
+ "id": "3381828792",
+ "delivered_as": "customer_initiated",
+ "subject": "",
+ "body": "<p>helklo</p>",
+ "author": {
+ "type": "lead",
+ "id": "696205460674dbb9050aa7fd",
+ "name": null,
+ "email": ""
+ },
+ "attachments": [],
+ "url": "http://localhost:5500/test.html",
+ "redacted": false
+ },
+ "contacts": {
+ "type": "contact.list",
+ "contacts": [
+ {
+ "type": "contact",
+ "id": "696205460674dbb9050aa7fd",
+ "external_id": "5e68ece4-0ec8-4792-baac-02deba39e7fe"
+ }
+ ]
+ },
+ "first_contact_reply": {
+ "created_at": 1768031789,
+ "type": "conversation",
+ "url": "http://localhost:5500/test.html"
+ },
+ "admin_assignee_id": null,
+ "team_assignee_id": null,
+ "open": true,
+ "state": "open",
+ "read": true,
+ "tags": {
+ "type": "tag.list",
+ "tags": []
+ },
+ "priority": "not_priority",
+ "sla_applied": null,
+ "statistics": {
+ "type": "conversation_statistics",
+ "time_to_assignment": null,
+ "time_to_admin_reply": null,
+ "time_to_first_close": null,
+ "time_to_last_close": null,
+ "median_time_to_reply": null,
+ "first_contact_reply_at": null,
+ "first_assignment_at": null,
+ "first_admin_reply_at": null,
+ "first_close_at": null,
+ "last_assignment_at": null,
+ "last_assignment_admin_reply_at": null,
+ "last_contact_reply_at": null,
+ "last_admin_reply_at": null,
+ "last_close_at": null,
+ "last_closed_by_id": null,
+ "count_reopens": 0,
+ "count_assignments": 0,
+ "count_conversation_parts": 1,
+ "assigned_team_first_response_time": [],
+ "assigned_team_first_response_time_in_office_hours": [],
+ "handling_time": null
+ },
+ "conversation_rating": null,
+ "teammates": {
+ "type": "admin.list",
+ "admins": []
+ },
+ "title": "",
+ "custom_attributes": {
+ "Has attachments": false,
+ "Imported via standalone": false,
+ "Auto-translated": false,
+ "Fin AI Agent: Preview": false,
+ "Fin AI Agent: Image used in reply": false,
+ "Copilot used": false
+ },
+ "topics": {
+ "type": "topic.list",
+ "topics": [],
+ "total_count": 0
+ },
+ "ticket": null,
+ "linked_objects": {
+ "type": "list",
+ "data": [],
+ "total_count": 0,
+ "has_more": false
+ },
+ "ai_agent": null,
+ "ai_agent_participated": false,
+ "conversation_parts": {
+ "type": "conversation_part.list",
+ "conversation_parts": [],
+ "total_count": 0
+ }
+ }
+ },
+ "links": {},
+ "id": "notif_35acc575-8564-4c14-b9f2-c4980cf7828d",
+ "topic": "conversation.user.created",
+ "delivery_status": "pending",
+ "delivery_attempts": 1,
+ "delivered_at": 0,
+ "first_sent_at": 1768031790,
+ "created_at": 1768031790,
+ "self": null
+}
diff --git a/zerver/webhooks/intercom/fixtures/conversation_user_replied.json b/zerver/webhooks/intercom/fixtures/conversation_user_replied.json
new file mode 100644
index 00000000000..c7b95141aec
--- /dev/null
+++ b/zerver/webhooks/intercom/fixtures/conversation_user_replied.json
@@ -0,0 +1,156 @@
+{
+ "type": "notification_event",
+ "app_id": "abc123def",
+ "data": {
+ "type": "notification_event_data",
+ "item": {
+ "type": "conversation",
+ "id": "215472621202693",
+ "created_at": 1768031789,
+ "updated_at": 1768032450,
+ "waiting_since": 1768032450,
+ "snoozed_until": null,
+ "source": {
+ "type": "conversation",
+ "id": "3381828792",
+ "delivered_as": "customer_initiated",
+ "subject": "",
+ "body": "<p>helklo</p>",
+ "author": {
+ "type": "lead",
+ "id": "696205460674dbb9050aa7fd",
+ "name": null,
+ "email": ""
+ },
+ "attachments": [],
+ "url": "http://localhost:5500/test.html",
+ "redacted": false
+ },
+ "contacts": {
+ "type": "contact.list",
+ "contacts": [
+ {
+ "type": "contact",
+ "id": "696205460674dbb9050aa7fd",
+ "external_id": "5e68ece4-0ec8-4792-baac-02deba39e7fe"
+ }
+ ]
+ },
+ "first_contact_reply": {
+ "created_at": 1768031789,
+ "type": "conversation",
+ "url": "http://localhost:5500/test.html"
+ },
+ "admin_assignee_id": 9608799,
+ "team_assignee_id": null,
+ "open": true,
+ "state": "open",
+ "read": true,
+ "tags": {
+ "type": "tag.list",
+ "tags": []
+ },
+ "priority": "not_priority",
+ "sla_applied": null,
+ "statistics": {
+ "type": "conversation_statistics",
+ "time_to_assignment": 211,
+ "time_to_admin_reply": 211,
+ "time_to_first_close": null,
+ "time_to_last_close": null,
+ "median_time_to_reply": 211,
+ "first_contact_reply_at": "2026-01-10T07:56:29.000Z",
+ "first_assignment_at": "2026-01-10T08:00:00.000Z",
+ "first_admin_reply_at": "2026-01-10T08:00:00.000Z",
+ "first_close_at": null,
+ "last_assignment_at": "2026-01-10T08:00:00.000Z",
+ "last_assignment_admin_reply_at": "2026-01-10T08:00:00.000Z",
+ "last_contact_reply_at": "2026-01-10T08:07:30.000Z",
+ "last_admin_reply_at": "2026-01-10T08:00:00.000Z",
+ "last_close_at": null,
+ "last_closed_by_id": null,
+ "count_reopens": 0,
+ "count_assignments": 1,
+ "count_conversation_parts": 7,
+ "assigned_team_first_response_time": [],
+ "assigned_team_first_response_time_in_office_hours": [],
+ "handling_time": null
+ },
+ "conversation_rating": null,
+ "teammates": {
+ "type": "admin.list",
+ "admins": [
+ {
+ "type": "admin",
+ "id": "9608799"
+ }
+ ]
+ },
+ "title": "",
+ "custom_attributes": {
+ "Has attachments": false,
+ "Imported via standalone": false,
+ "Auto-translated": false,
+ "Fin AI Agent: Preview": false,
+ "Fin AI Agent: Image used in reply": false,
+ "Copilot used": false
+ },
+ "topics": {
+ "type": "topic.list",
+ "topics": [],
+ "total_count": 0
+ },
+ "ticket": null,
+ "linked_objects": {
+ "type": "list",
+ "data": [],
+ "total_count": 0,
+ "has_more": false
+ },
+ "ai_agent": null,
+ "ai_agent_participated": false,
+ "conversation_parts": {
+ "type": "conversation_part.list",
+ "conversation_parts": [
+ {
+ "type": "conversation_part",
+ "id": "37358396167",
+ "part_type": "comment",
+ "body": "<p>adwsdas</p>",
+ "created_at": 1768032450,
+ "updated_at": 1768032450,
+ "notified_at": 1768032450,
+ "assigned_to": null,
+ "author": {
+ "id": "696205460674dbb9050aa7fd",
+ "type": "user",
+ "name": null,
+ "email": "",
+ "from_ai_agent": false,
+ "is_ai_answer": false
+ },
+ "attachments": [],
+ "external_id": null,
+ "redacted": false,
+ "metadata": {},
+ "email_message_metadata": null,
+ "state": "open",
+ "tags": [],
+ "event_details": {},
+ "app_package_code": null
+ }
+ ],
+ "total_count": 1
+ }
+ }
+ },
+ "links": {},
+ "id": "notif_7de9f5f5-27b9-48eb-b4db-0dcfa626f2e2",
+ "topic": "conversation.user.replied",
+ "delivery_status": "pending",
+ "delivery_attempts": 1,
+ "delivered_at": 0,
+ "first_sent_at": 1768032452,
+ "created_at": 1768032452,
+ "self": null
+}
diff --git a/zerver/webhooks/intercom/view.py b/zerver/webhooks/intercom/view.py
index a4217d55688..8c4eabdb8bb 100644
--- a/zerver/webhooks/intercom/view.py
+++ b/zerver/webhooks/intercom/view.py
@@ -23,6 +23,10 @@ IGNORED_EVENTS = [
"contact.lead.signed_up",
"contact.unsubscribed_from_sms",
],
+ # Unable to invoke these events, likely restricted for trial accounts.
+ *[
+ "conversation.rating.added",
+ ],
]