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 contact events.

sathwikshetty33c4c5a004daf8
diff --git a/zerver/webhooks/intercom/fixtures/contact_archived.json b/zerver/webhooks/intercom/fixtures/contact_archived.json
new file mode 100644
index 00000000000..d58986ce371
--- /dev/null
+++ b/zerver/webhooks/intercom/fixtures/contact_archived.json
@@ -0,0 +1,22 @@
+{
+ "type": "notification_event",
+ "app_id": "abc123def",
+ "data": {
+ "type": "notification_event_data",
+ "item": {
+ "id": "6961cf78fb9d13be07871c78",
+ "external_id": "22",
+ "type": "contact",
+ "archived": true
+ }
+ },
+ "links": {},
+ "id": "notif_72d7d36b-5c4b-4a5b-811c-9c985d5b104e",
+ "topic": "contact.archived",
+ "delivery_status": "pending",
+ "delivery_attempts": 1,
+ "delivered_at": 0,
+ "first_sent_at": 1768019637,
+ "created_at": 1768019637,
+ "self": null
+}
diff --git a/zerver/webhooks/intercom/fixtures/contact_deleted.json b/zerver/webhooks/intercom/fixtures/contact_deleted.json
new file mode 100644
index 00000000000..adae0d7ad87
--- /dev/null
+++ b/zerver/webhooks/intercom/fixtures/contact_deleted.json
@@ -0,0 +1,22 @@
+{
+ "type": "notification_event",
+ "app_id": "abc123def",
+ "data": {
+ "type": "notification_event_data",
+ "item": {
+ "id": "696122fb2591e0cadd20073a",
+ "external_id": "1",
+ "type": "contact",
+ "deleted": true
+ }
+ },
+ "links": {},
+ "id": "notif_d997a8b0-19f8-47df-b203-b7e8424a2029",
+ "topic": "contact.deleted",
+ "delivery_status": "pending",
+ "delivery_attempts": 1,
+ "delivered_at": 0,
+ "first_sent_at": 1768019870,
+ "created_at": 1768019869,
+ "self": null
+}
diff --git a/zerver/webhooks/intercom/fixtures/contact_email_updated.json b/zerver/webhooks/intercom/fixtures/contact_email_updated.json
new file mode 100644
index 00000000000..612a59d8630
--- /dev/null
+++ b/zerver/webhooks/intercom/fixtures/contact_email_updated.json
@@ -0,0 +1,119 @@
+{
+ "type": "notification_event",
+ "app_id": "abc123def",
+ "data": {
+ "type": "notification_event_data",
+ "item": {
+ "type": "contact",
+ "id": "6961d43b372591e999b3ea56",
+ "workspace_id": "abc123def",
+ "external_id": "55",
+ "role": "user",
+ "email": "[email protected]",
+ "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:23:23.215+00:00",
+ "updated_at": "2026-01-10T04:39:55.000Z",
+ "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/6961d43b372591e999b3ea56/tags",
+ "total_count": 0,
+ "has_more": false
+ },
+ "notes": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961d43b372591e999b3ea56/notes",
+ "total_count": 0,
+ "has_more": false
+ },
+ "companies": {
+ "type": "list",
+ "data": [
+ {
+ "id": "6961d37afb9d13c23f871b6d",
+ "type": "company",
+ "url": "/companies/6961d37afb9d13c23f871b6d"
+ }
+ ],
+ "url": "/contacts/6961d43b372591e999b3ea56/companies",
+ "total_count": 1,
+ "has_more": false
+ },
+ "opted_out_subscription_types": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961d43b372591e999b3ea56/subscriptions",
+ "total_count": 0,
+ "has_more": false
+ },
+ "opted_in_subscription_types": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961d43b372591e999b3ea56/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": false,
+ "enabled_push_messaging": null
+ }
+ },
+ "links": {},
+ "id": "notif_75d5b08f-0305-4e0a-8902-81099d3342a1",
+ "topic": "contact.email.updated",
+ "delivery_status": "pending",
+ "delivery_attempts": 1,
+ "delivered_at": 0,
+ "first_sent_at": 1768019995,
+ "created_at": 1768019995,
+ "self": null
+}
diff --git a/zerver/webhooks/intercom/fixtures/contact_lead_added_email.json b/zerver/webhooks/intercom/fixtures/contact_lead_added_email.json
new file mode 100644
index 00000000000..a26086d08e2
--- /dev/null
+++ b/zerver/webhooks/intercom/fixtures/contact_lead_added_email.json
@@ -0,0 +1,113 @@
+{
+ "type": "notification_event",
+ "app_id": "abc123def",
+ "data": {
+ "type": "notification_event_data",
+ "item": {
+ "type": "contact",
+ "id": "6961d897719c606240178da8",
+ "workspace_id": "abc123def",
+ "external_id": "c3ca7689-a3c1-4a05-b81d-6cdf995cea85",
+ "role": "lead",
+ "email": "[email protected]",
+ "phone": null,
+ "name": "shuuuuz",
+ "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:41:59.251+00:00",
+ "updated_at": "2026-01-10T04:44:57.195+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/6961d897719c606240178da8/tags",
+ "total_count": 0,
+ "has_more": false
+ },
+ "notes": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961d897719c606240178da8/notes",
+ "total_count": 0,
+ "has_more": false
+ },
+ "companies": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961d897719c606240178da8/companies",
+ "total_count": 0,
+ "has_more": false
+ },
+ "opted_out_subscription_types": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961d897719c606240178da8/subscriptions",
+ "total_count": 0,
+ "has_more": false
+ },
+ "opted_in_subscription_types": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961d897719c606240178da8/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": false,
+ "enabled_push_messaging": null
+ }
+ },
+ "links": {},
+ "id": "notif_b9e7a094-9cfc-474d-a733-2aa022962128",
+ "topic": "contact.lead.added_email",
+ "delivery_status": "pending",
+ "delivery_attempts": 1,
+ "delivered_at": 0,
+ "first_sent_at": 1768020297,
+ "created_at": 1768020297,
+ "self": null
+}
diff --git a/zerver/webhooks/intercom/fixtures/contact_lead_created.json b/zerver/webhooks/intercom/fixtures/contact_lead_created.json
new file mode 100644
index 00000000000..cbf3c27e356
--- /dev/null
+++ b/zerver/webhooks/intercom/fixtures/contact_lead_created.json
@@ -0,0 +1,113 @@
+{
+ "type": "notification_event",
+ "app_id": "abc123def",
+ "data": {
+ "type": "notification_event_data",
+ "item": {
+ "type": "contact",
+ "id": "6961d897719c606240178da8",
+ "workspace_id": "abc123def",
+ "external_id": "c3ca7689-a3c1-4a05-b81d-6cdf995cea85",
+ "role": "lead",
+ "email": "[email protected]",
+ "phone": null,
+ "name": "shuuuuz",
+ "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:41:59.251+00:00",
+ "updated_at": "2026-01-10T04:41:59.249+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/6961d897719c606240178da8/tags",
+ "total_count": 0,
+ "has_more": false
+ },
+ "notes": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961d897719c606240178da8/notes",
+ "total_count": 0,
+ "has_more": false
+ },
+ "companies": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961d897719c606240178da8/companies",
+ "total_count": 0,
+ "has_more": false
+ },
+ "opted_out_subscription_types": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961d897719c606240178da8/subscriptions",
+ "total_count": 0,
+ "has_more": false
+ },
+ "opted_in_subscription_types": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961d897719c606240178da8/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": false,
+ "enabled_push_messaging": null
+ }
+ },
+ "links": {},
+ "id": "notif_204d32ad-f47a-4276-8074-e5ce789d2987",
+ "topic": "contact.lead.created",
+ "delivery_status": "pending",
+ "delivery_attempts": 1,
+ "delivered_at": 0,
+ "first_sent_at": 1768020119,
+ "created_at": 1768020119,
+ "self": null
+}
diff --git a/zerver/webhooks/intercom/fixtures/contact_lead_tag_created.json b/zerver/webhooks/intercom/fixtures/contact_lead_tag_created.json
new file mode 100644
index 00000000000..87896205364
--- /dev/null
+++ b/zerver/webhooks/intercom/fixtures/contact_lead_tag_created.json
@@ -0,0 +1,127 @@
+{
+ "type": "notification_event",
+ "app_id": "abc123def",
+ "data": {
+ "type": "notification_event_data",
+ "item": {
+ "type": "contact_tag",
+ "tag": {
+ "type": "tag",
+ "id": "12934044",
+ "name": "Feature Request"
+ },
+ "contact": {
+ "type": "contact",
+ "id": "6961d897719c606240178da8",
+ "workspace_id": "abc123def",
+ "external_id": "c3ca7689-a3c1-4a05-b81d-6cdf995cea85",
+ "role": "lead",
+ "email": "[email protected]",
+ "phone": null,
+ "name": "shuuuuz",
+ "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:41:59.251+00:00",
+ "updated_at": "2026-01-10T04:49:07.847+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": [
+ {
+ "id": "12934044",
+ "type": "tag",
+ "url": "/tags/12934044"
+ }
+ ],
+ "url": "/contacts/6961d897719c606240178da8/tags",
+ "total_count": 1,
+ "has_more": false
+ },
+ "notes": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961d897719c606240178da8/notes",
+ "total_count": 0,
+ "has_more": false
+ },
+ "companies": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961d897719c606240178da8/companies",
+ "total_count": 0,
+ "has_more": false
+ },
+ "opted_out_subscription_types": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961d897719c606240178da8/subscriptions",
+ "total_count": 0,
+ "has_more": false
+ },
+ "opted_in_subscription_types": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961d897719c606240178da8/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": false,
+ "enabled_push_messaging": null
+ }
+ }
+ },
+ "links": {},
+ "id": "notif_723cd050-01bf-487f-b32d-c2bd0f618a4d",
+ "topic": "contact.lead.tag.created",
+ "delivery_status": "pending",
+ "delivery_attempts": 1,
+ "delivered_at": 0,
+ "first_sent_at": 1768020547,
+ "created_at": 1768020547,
+ "self": null
+}
diff --git a/zerver/webhooks/intercom/fixtures/contact_lead_tag_deleted.json b/zerver/webhooks/intercom/fixtures/contact_lead_tag_deleted.json
new file mode 100644
index 00000000000..199ee915971
--- /dev/null
+++ b/zerver/webhooks/intercom/fixtures/contact_lead_tag_deleted.json
@@ -0,0 +1,121 @@
+{
+ "type": "notification_event",
+ "app_id": "abc123def",
+ "data": {
+ "type": "notification_event_data",
+ "item": {
+ "type": "contact_tag",
+ "tag": {
+ "type": "tag",
+ "id": "12934044",
+ "name": "Feature Request"
+ },
+ "contact": {
+ "type": "contact",
+ "id": "6961d897719c606240178da8",
+ "workspace_id": "abc123def",
+ "external_id": "c3ca7689-a3c1-4a05-b81d-6cdf995cea85",
+ "role": "lead",
+ "email": "[email protected]",
+ "phone": null,
+ "name": "shuuuuz",
+ "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:41:59.251+00:00",
+ "updated_at": "2026-01-10T04:53:41.545+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/6961d897719c606240178da8/tags",
+ "total_count": 0,
+ "has_more": false
+ },
+ "notes": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961d897719c606240178da8/notes",
+ "total_count": 0,
+ "has_more": false
+ },
+ "companies": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961d897719c606240178da8/companies",
+ "total_count": 0,
+ "has_more": false
+ },
+ "opted_out_subscription_types": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961d897719c606240178da8/subscriptions",
+ "total_count": 0,
+ "has_more": false
+ },
+ "opted_in_subscription_types": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961d897719c606240178da8/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": false,
+ "enabled_push_messaging": null
+ }
+ }
+ },
+ "links": {},
+ "id": "notif_34ba62b3-b000-4e0e-9eb7-9a34d4222755",
+ "topic": "contact.lead.tag.deleted",
+ "delivery_status": "pending",
+ "delivery_attempts": 1,
+ "delivered_at": 0,
+ "first_sent_at": 1768020822,
+ "created_at": 1768020821,
+ "self": null
+}
diff --git a/zerver/webhooks/intercom/fixtures/contact_lead_updated.json b/zerver/webhooks/intercom/fixtures/contact_lead_updated.json
new file mode 100644
index 00000000000..41ac15e8f62
--- /dev/null
+++ b/zerver/webhooks/intercom/fixtures/contact_lead_updated.json
@@ -0,0 +1,119 @@
+{
+ "type": "notification_event",
+ "app_id": "abc123def",
+ "data": {
+ "type": "notification_event_data",
+ "item": {
+ "type": "contact",
+ "id": "6961d897719c606240178da8",
+ "workspace_id": "abc123def",
+ "external_id": "c3ca7689-a3c1-4a05-b81d-6cdf995cea85",
+ "role": "lead",
+ "email": "[email protected]",
+ "phone": null,
+ "name": "shuuuuzdvgzs",
+ "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:41:59.251+00:00",
+ "updated_at": "2026-01-10T04:55:06.766+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/6961d897719c606240178da8/tags",
+ "total_count": 0,
+ "has_more": false
+ },
+ "notes": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961d897719c606240178da8/notes",
+ "total_count": 0,
+ "has_more": false
+ },
+ "companies": {
+ "type": "list",
+ "data": [
+ {
+ "id": "6961db94d8da12993c3c1dcc",
+ "type": "company",
+ "url": "/companies/6961db94d8da12993c3c1dcc"
+ }
+ ],
+ "url": "/contacts/6961d897719c606240178da8/companies",
+ "total_count": 1,
+ "has_more": false
+ },
+ "opted_out_subscription_types": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961d897719c606240178da8/subscriptions",
+ "total_count": 0,
+ "has_more": false
+ },
+ "opted_in_subscription_types": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961d897719c606240178da8/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": false,
+ "enabled_push_messaging": null
+ }
+ },
+ "links": {},
+ "id": "notif_6f57ad57-a792-484b-8e3a-28c20c586305",
+ "topic": "contact.lead.updated",
+ "delivery_status": "pending",
+ "delivery_attempts": 1,
+ "delivered_at": 0,
+ "first_sent_at": 1768020906,
+ "created_at": 1768020906,
+ "self": null
+}
diff --git a/zerver/webhooks/intercom/fixtures/contact_subscribed.json b/zerver/webhooks/intercom/fixtures/contact_subscribed.json
new file mode 100644
index 00000000000..ec035173f45
--- /dev/null
+++ b/zerver/webhooks/intercom/fixtures/contact_subscribed.json
@@ -0,0 +1,121 @@
+{
+ "type": "notification_event",
+ "app_id": "abc123def",
+ "data": {
+ "type": "notification_event_data",
+ "item": {
+ "type": "contact_subscribe",
+ "contact": {
+ "type": "contact",
+ "id": "6961e1e6d1965062ce6434d1",
+ "workspace_id": "abc123def",
+ "external_id": "333",
+ "role": "user",
+ "email": "[email protected]",
+ "phone": null,
+ "name": "wqr",
+ "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-10T05:21:42.099+00:00",
+ "updated_at": "2026-01-10T05:22:22.657+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/6961e1e6d1965062ce6434d1/tags",
+ "total_count": 0,
+ "has_more": false
+ },
+ "notes": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961e1e6d1965062ce6434d1/notes",
+ "total_count": 0,
+ "has_more": false
+ },
+ "companies": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961e1e6d1965062ce6434d1/companies",
+ "total_count": 0,
+ "has_more": false
+ },
+ "opted_out_subscription_types": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961e1e6d1965062ce6434d1/subscriptions",
+ "total_count": 0,
+ "has_more": false
+ },
+ "opted_in_subscription_types": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961e1e6d1965062ce6434d1/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": false,
+ "enabled_push_messaging": null
+ },
+ "subscription_types": {
+ "type": "list",
+ "data": []
+ },
+ "created_at": 1768022542
+ }
+ },
+ "links": {},
+ "id": "notif_0020db82-b78c-4d5b-910b-5ba8de5e71de",
+ "topic": "contact.subscribed",
+ "delivery_status": "pending",
+ "delivery_attempts": 1,
+ "delivered_at": 0,
+ "first_sent_at": 1768022542,
+ "created_at": 1768022542,
+ "self": null
+}
diff --git a/zerver/webhooks/intercom/fixtures/contact_unarchived.json b/zerver/webhooks/intercom/fixtures/contact_unarchived.json
new file mode 100644
index 00000000000..831be2c4391
--- /dev/null
+++ b/zerver/webhooks/intercom/fixtures/contact_unarchived.json
@@ -0,0 +1,113 @@
+{
+ "type": "notification_event",
+ "app_id": "abc123def",
+ "data": {
+ "type": "notification_event_data",
+ "item": {
+ "type": "contact",
+ "id": "6961cf78fb9d13be07871c78",
+ "workspace_id": "abc123def",
+ "external_id": "22",
+ "role": "user",
+ "email": "[email protected]",
+ "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-10T05:20:30.118+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": false,
+ "enabled_push_messaging": null
+ }
+ },
+ "links": {},
+ "id": "notif_6e7bea45-2a72-4829-8dd5-61b3e8d49f87",
+ "topic": "contact.unarchived",
+ "delivery_status": "pending",
+ "delivery_attempts": 1,
+ "delivered_at": 0,
+ "first_sent_at": 1768022430,
+ "created_at": 1768022430,
+ "self": null
+}
diff --git a/zerver/webhooks/intercom/fixtures/contact_unsubscribed.json b/zerver/webhooks/intercom/fixtures/contact_unsubscribed.json
new file mode 100644
index 00000000000..10ee15ffe92
--- /dev/null
+++ b/zerver/webhooks/intercom/fixtures/contact_unsubscribed.json
@@ -0,0 +1,121 @@
+{
+ "type": "notification_event",
+ "app_id": "abc123def",
+ "data": {
+ "type": "notification_event_data",
+ "item": {
+ "type": "contact_unsubscribe",
+ "contact": {
+ "type": "contact",
+ "id": "6961e1e6d1965062ce6434d1",
+ "workspace_id": "abc123def",
+ "external_id": "333",
+ "role": "user",
+ "email": "[email protected]",
+ "phone": null,
+ "name": "wqr",
+ "avatar": null,
+ "owner_id": null,
+ "social_profiles": {
+ "type": "list",
+ "data": []
+ },
+ "has_hard_bounced": false,
+ "marked_email_as_spam": false,
+ "unsubscribed_from_emails": true,
+ "created_at": "2026-01-10T05:21:42.099+00:00",
+ "updated_at": "2026-01-10T05:21:48.255+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/6961e1e6d1965062ce6434d1/tags",
+ "total_count": 0,
+ "has_more": false
+ },
+ "notes": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961e1e6d1965062ce6434d1/notes",
+ "total_count": 0,
+ "has_more": false
+ },
+ "companies": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961e1e6d1965062ce6434d1/companies",
+ "total_count": 0,
+ "has_more": false
+ },
+ "opted_out_subscription_types": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961e1e6d1965062ce6434d1/subscriptions",
+ "total_count": 0,
+ "has_more": false
+ },
+ "opted_in_subscription_types": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961e1e6d1965062ce6434d1/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": false,
+ "enabled_push_messaging": null
+ },
+ "subscription_types": {
+ "type": "list",
+ "data": []
+ },
+ "created_at": 1768022508
+ }
+ },
+ "links": {},
+ "id": "notif_809e06ce-cdf2-4f03-87d8-c99574b66ee2",
+ "topic": "contact.unsubscribed",
+ "delivery_status": "pending",
+ "delivery_attempts": 1,
+ "delivered_at": 0,
+ "first_sent_at": 1768022508,
+ "created_at": 1768022508,
+ "self": null
+}
diff --git a/zerver/webhooks/intercom/fixtures/contact_user_created.json b/zerver/webhooks/intercom/fixtures/contact_user_created.json
new file mode 100644
index 00000000000..c61646a0e20
--- /dev/null
+++ b/zerver/webhooks/intercom/fixtures/contact_user_created.json
@@ -0,0 +1,113 @@
+{
+ "type": "notification_event",
+ "app_id": "abc123def",
+ "data": {
+ "type": "notification_event_data",
+ "item": {
+ "type": "contact",
+ "id": "6961d4041c1e12de4c5499cc",
+ "workspace_id": "abc123def",
+ "external_id": "24",
+ "role": "user",
+ "email": "[email protected]",
+ "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:22:28.240+00:00",
+ "updated_at": "2026-01-10T04:22:28.238+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/6961d4041c1e12de4c5499cc/tags",
+ "total_count": 0,
+ "has_more": false
+ },
+ "notes": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961d4041c1e12de4c5499cc/notes",
+ "total_count": 0,
+ "has_more": false
+ },
+ "companies": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961d4041c1e12de4c5499cc/companies",
+ "total_count": 0,
+ "has_more": false
+ },
+ "opted_out_subscription_types": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961d4041c1e12de4c5499cc/subscriptions",
+ "total_count": 0,
+ "has_more": false
+ },
+ "opted_in_subscription_types": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961d4041c1e12de4c5499cc/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": false,
+ "enabled_push_messaging": null
+ }
+ },
+ "links": {},
+ "id": "notif_c47f7aeb-bdeb-4d35-8fc7-eb945334fdad",
+ "topic": "contact.user.created",
+ "delivery_status": "pending",
+ "delivery_attempts": 1,
+ "delivered_at": 0,
+ "first_sent_at": 1768018948,
+ "created_at": 1768018948,
+ "self": null
+}
diff --git a/zerver/webhooks/intercom/fixtures/contact_user_tag_created.json b/zerver/webhooks/intercom/fixtures/contact_user_tag_created.json
new file mode 100644
index 00000000000..6ff208aa7e2
--- /dev/null
+++ b/zerver/webhooks/intercom/fixtures/contact_user_tag_created.json
@@ -0,0 +1,132 @@
+{
+ "type": "notification_event",
+ "app_id": "abc123def",
+ "data": {
+ "type": "notification_event_data",
+ "item": {
+ "type": "contact_tag",
+ "tag": {
+ "type": "tag",
+ "id": "12934044",
+ "name": "Feature Request"
+ },
+ "contact": {
+ "type": "contact",
+ "id": "6961f1c19b981fb5a0b90afb",
+ "workspace_id": "u7iknh8e",
+ "external_id": null,
+ "role": "user",
+ "email": "[email protected]",
+ "phone": null,
+ "name": "Merge User Fixture",
+ "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-10T06:29:21.953+00:00",
+ "updated_at": "2026-01-12T15:23:19.730+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": [
+ {
+ "id": "12986331",
+ "type": "tag",
+ "url": "/tags/12986331"
+ },
+ {
+ "id": "12934044",
+ "type": "tag",
+ "url": "/tags/12934044"
+ }
+ ],
+ "url": "/contacts/6961f1c19b981fb5a0b90afb/tags",
+ "total_count": 2,
+ "has_more": false
+ },
+ "notes": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961f1c19b981fb5a0b90afb/notes",
+ "total_count": 0,
+ "has_more": false
+ },
+ "companies": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961f1c19b981fb5a0b90afb/companies",
+ "total_count": 0,
+ "has_more": false
+ },
+ "opted_out_subscription_types": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961f1c19b981fb5a0b90afb/subscriptions",
+ "total_count": 0,
+ "has_more": false
+ },
+ "opted_in_subscription_types": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961f1c19b981fb5a0b90afb/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": false,
+ "enabled_push_messaging": null
+ }
+ }
+ },
+ "links": {},
+ "id": "notif_2be5716c-6ecd-4852-b6b2-3e66b0e3ede3",
+ "topic": "contact.user.tag.created",
+ "delivery_status": "pending",
+ "delivery_attempts": 1,
+ "delivered_at": 0,
+ "first_sent_at": 1768231400,
+ "created_at": 1768231399,
+ "self": null
+}
diff --git a/zerver/webhooks/intercom/fixtures/contact_user_tag_deleted.json b/zerver/webhooks/intercom/fixtures/contact_user_tag_deleted.json
new file mode 100644
index 00000000000..ae6b5ee8550
--- /dev/null
+++ b/zerver/webhooks/intercom/fixtures/contact_user_tag_deleted.json
@@ -0,0 +1,127 @@
+{
+ "type": "notification_event",
+ "app_id": "abc123def",
+ "data": {
+ "type": "notification_event_data",
+ "item": {
+ "type": "contact_tag",
+ "tag": {
+ "type": "tag",
+ "id": "12934044",
+ "name": "Feature Request"
+ },
+ "contact": {
+ "type": "contact",
+ "id": "6961d4041c1e12de4c5499cc",
+ "workspace_id": "abc123def",
+ "external_id": "24",
+ "role": "user",
+ "email": "[email protected]",
+ "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:22:28.240+00:00",
+ "updated_at": "2026-01-10T04:50:56.449+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/6961d4041c1e12de4c5499cc/tags",
+ "total_count": 0,
+ "has_more": false
+ },
+ "notes": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961d4041c1e12de4c5499cc/notes",
+ "total_count": 0,
+ "has_more": false
+ },
+ "companies": {
+ "type": "list",
+ "data": [
+ {
+ "id": "6961d37afb9d13c23f871b6d",
+ "type": "company",
+ "url": "/companies/6961d37afb9d13c23f871b6d"
+ }
+ ],
+ "url": "/contacts/6961d4041c1e12de4c5499cc/companies",
+ "total_count": 1,
+ "has_more": false
+ },
+ "opted_out_subscription_types": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961d4041c1e12de4c5499cc/subscriptions",
+ "total_count": 0,
+ "has_more": false
+ },
+ "opted_in_subscription_types": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961d4041c1e12de4c5499cc/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": false,
+ "enabled_push_messaging": null
+ }
+ }
+ },
+ "links": {},
+ "id": "notif_58f7a078-b8b6-401a-8912-628a5675e813",
+ "topic": "contact.user.tag.deleted",
+ "delivery_status": "pending",
+ "delivery_attempts": 1,
+ "delivered_at": 0,
+ "first_sent_at": 1768020656,
+ "created_at": 1768020656,
+ "self": null
+}
diff --git a/zerver/webhooks/intercom/fixtures/contact_user_updated.json b/zerver/webhooks/intercom/fixtures/contact_user_updated.json
new file mode 100644
index 00000000000..dd9ba16621a
--- /dev/null
+++ b/zerver/webhooks/intercom/fixtures/contact_user_updated.json
@@ -0,0 +1,119 @@
+{
+ "type": "notification_event",
+ "app_id": "abc123def",
+ "data": {
+ "type": "notification_event_data",
+ "item": {
+ "type": "contact",
+ "id": "6961d43b372591e999b3ea56",
+ "workspace_id": "abc123def",
+ "external_id": "55",
+ "role": "user",
+ "email": "[email protected]",
+ "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:23:23.215+00:00",
+ "updated_at": "2026-01-10T04:39:55.465+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/6961d43b372591e999b3ea56/tags",
+ "total_count": 0,
+ "has_more": false
+ },
+ "notes": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961d43b372591e999b3ea56/notes",
+ "total_count": 0,
+ "has_more": false
+ },
+ "companies": {
+ "type": "list",
+ "data": [
+ {
+ "id": "6961d37afb9d13c23f871b6d",
+ "type": "company",
+ "url": "/companies/6961d37afb9d13c23f871b6d"
+ }
+ ],
+ "url": "/contacts/6961d43b372591e999b3ea56/companies",
+ "total_count": 1,
+ "has_more": false
+ },
+ "opted_out_subscription_types": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961d43b372591e999b3ea56/subscriptions",
+ "total_count": 0,
+ "has_more": false
+ },
+ "opted_in_subscription_types": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961d43b372591e999b3ea56/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": false,
+ "enabled_push_messaging": null
+ }
+ },
+ "links": {},
+ "id": "notif_3a00d3fc-6fb0-400c-b089-ab44f0c9c28a",
+ "topic": "contact.user.updated",
+ "delivery_status": "pending",
+ "delivery_attempts": 1,
+ "delivered_at": 0,
+ "first_sent_at": 1768019995,
+ "created_at": 1768019995,
+ "self": null
+}
diff --git a/zerver/webhooks/intercom/fixtures/contacts_merged.json b/zerver/webhooks/intercom/fixtures/contacts_merged.json
new file mode 100644
index 00000000000..ab4974bf049
--- /dev/null
+++ b/zerver/webhooks/intercom/fixtures/contacts_merged.json
@@ -0,0 +1,113 @@
+{
+ "type": "notification_event",
+ "app_id": "abc123def",
+ "data": {
+ "type": "notification_event_data",
+ "item": {
+ "type": "contact",
+ "id": "6961f1c19b981fb5a0b90afb",
+ "workspace_id": "abc123def",
+ "external_id": null,
+ "role": "user",
+ "email": "[email protected]",
+ "phone": null,
+ "name": "Merge User Fixture",
+ "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-10T06:29:21.953+00:00",
+ "updated_at": "2026-01-10T06:30:59.735+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/6961f1c19b981fb5a0b90afb/tags",
+ "total_count": 0,
+ "has_more": false
+ },
+ "notes": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961f1c19b981fb5a0b90afb/notes",
+ "total_count": 0,
+ "has_more": false
+ },
+ "companies": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961f1c19b981fb5a0b90afb/companies",
+ "total_count": 0,
+ "has_more": false
+ },
+ "opted_out_subscription_types": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961f1c19b981fb5a0b90afb/subscriptions",
+ "total_count": 0,
+ "has_more": false
+ },
+ "opted_in_subscription_types": {
+ "type": "list",
+ "data": [],
+ "url": "/contacts/6961f1c19b981fb5a0b90afb/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": false,
+ "enabled_push_messaging": null
+ }
+ },
+ "links": {},
+ "id": "notif_37175b28-db5f-4aa5-848a-7fbf18b0d043",
+ "topic": "contact.merged",
+ "delivery_status": "pending",
+ "delivery_attempts": 1,
+ "delivered_at": 0,
+ "first_sent_at": 1768026660,
+ "created_at": 1768026659,
+ "self": null
+}
diff --git a/zerver/webhooks/intercom/fixtures/granular_subscribe.json b/zerver/webhooks/intercom/fixtures/granular_subscribe.json
new file mode 100644
index 00000000000..c717291aea6
--- /dev/null
+++ b/zerver/webhooks/intercom/fixtures/granular_subscribe.json
@@ -0,0 +1,149 @@
+{
+ "type": "notification_event",
+ "app_id": "abc123def",
+ "data": {
+ "type": "notification_event_data",
+ "item": {
+ "type": "granular_subscribe",
+ "contact": {
+ "type": "contact",
+ "id": "6961cf78fb9d13be07871c78",
+ "workspace_id": "abc123def",
+ "external_id": "22",
+ "role": "user",
+ "email": "[email protected]",
+ "phone": "+1 555-123-4567",
+ "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-10T05:38:04.931+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": [
+ {
+ "id": "1943066",
+ "type": "subscription",
+ "url": "/subscription_types/1943066"
+ }
+ ],
+ "url": "/contacts/6961cf78fb9d13be07871c78/subscriptions",
+ "total_count": 1,
+ "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
+ },
+ "subscription_types": {
+ "type": "list",
+ "data": [
+ {
+ "type": "subscription",
+ "id": "1943066",
+ "state": "live",
+ "consent_type": "opt_in",
+ "default_translation": {
+ "name": "Announcements",
+ "description": "Offers, product and feature announcements",
+ "locale": "en"
+ },
+ "translations": [
+ {
+ "name": "Announcements",
+ "description": "Offers, product and feature announcements",
+ "locale": "en"
+ }
+ ],
+ "content_types": [
+ "email"
+ ]
+ }
+ ]
+ },
+ "created_at": 1768023485
+ }
+ },
+ "links": {},
+ "id": "notif_64f6393f-9f58-4129-a38b-e70a08931524",
+ "topic": "granular.subscribe",
+ "delivery_status": "pending",
+ "delivery_attempts": 1,
+ "delivered_at": 0,
+ "first_sent_at": 1768023485,
+ "created_at": 1768023484,
+ "self": null
+}
diff --git a/zerver/webhooks/intercom/fixtures/granular_unsubscribe.json b/zerver/webhooks/intercom/fixtures/granular_unsubscribe.json
new file mode 100644
index 00000000000..d2403d2e368
--- /dev/null
+++ b/zerver/webhooks/intercom/fixtures/granular_unsubscribe.json
@@ -0,0 +1,143 @@
+{
+ "type": "notification_event",
+ "app_id": "abc123def",
+ "data": {
+ "type": "notification_event_data",
+ "item": {
+ "type": "granular_unsubscribe",
+ "contact": {
+ "type": "contact",
+ "id": "6961cf78fb9d13be07871c78",
+ "workspace_id": "abc123def",
+ "external_id": "22",
+ "role": "user",
+ "email": "[email protected]",
+ "phone": "+1 555-123-4567",
+ "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-10T05:38:55.859+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
+ },
+ "subscription_types": {
+ "type": "list",
+ "data": [
+ {
+ "type": "subscription",
+ "id": "1943066",
+ "state": "live",
+ "consent_type": "opt_in",
+ "default_translation": {
+ "name": "Announcements",
+ "description": "Offers, product and feature announcements",
+ "locale": "en"
+ },
+ "translations": [
+ {
+ "name": "Announcements",
+ "description": "Offers, product and feature announcements",
+ "locale": "en"
+ }
+ ],
+ "content_types": [
+ "email"
+ ]
+ }
+ ]
+ },
+ "created_at": 1768023535
+ }
+ },
+ "links": {},
+ "id": "notif_a3a150c7-585b-4141-9674-77331b5e047a",
+ "topic": "granular.unsubscribe",
+ "delivery_status": "pending",
+ "delivery_attempts": 1,
+ "delivered_at": 0,
+ "first_sent_at": 1768023536,
+ "created_at": 1768023535,
+ "self": null
+}
diff --git a/zerver/webhooks/intercom/fixtures/visitor_signed_up.json b/zerver/webhooks/intercom/fixtures/visitor_signed_up.json
new file mode 100644
index 00000000000..7eb2eb3e3b6
--- /dev/null
+++ b/zerver/webhooks/intercom/fixtures/visitor_signed_up.json
@@ -0,0 +1,79 @@
+{
+ "type": "notification_event",
+ "app_id": "abc123def",
+ "data": {
+ "type": "notification_event_data",
+ "item": {
+ "type": "user",
+ "id": "6961e6de046e053d93e4da0b",
+ "user_id": "fixture-user-1",
+ "anonymous": false,
+ "email": "[email protected]",
+ "phone": null,
+ "name": "Fixture User 1",
+ "pseudonym": "Pink Lightbulb from Bengaluru",
+ "avatar": {
+ "type": "avatar",
+ "image_url": null
+ },
+ "app_id": "abc123def",
+ "companies": {
+ "type": "company.list",
+ "companies": []
+ },
+ "location_data": {
+ "type": "location_data",
+ "city_name": "Bengaluru",
+ "continent_code": "AS",
+ "country_name": "India",
+ "postal_code": "562130",
+ "region_name": "Karnataka",
+ "timezone": "Asia/Kolkata",
+ "country_code": "IND",
+ "latitude": null,
+ "longitude": null
+ },
+ "last_request_at": "2026-01-10T05:42:57.457+00:00",
+ "created_at": "2026-01-10T05:42:55.079+00:00",
+ "remote_created_at": "2026-01-10T05:42:57.490+00:00",
+ "signed_up_at": "2026-01-10T05:42:57.490+00:00",
+ "updated_at": "2026-01-10T05:42:57.000Z",
+ "session_count": 1,
+ "social_profiles": {
+ "type": "social_profile.list",
+ "social_profiles": []
+ },
+ "owner_id": null,
+ "unsubscribed_from_emails": false,
+ "marked_email_as_spam": false,
+ "has_hard_bounced": false,
+ "tags": {
+ "type": "tag.list",
+ "tags": []
+ },
+ "segments": {
+ "type": "segment.list",
+ "segments": []
+ },
+ "custom_attributes": {},
+ "referrer": "http://localhost:5500/",
+ "utm_campaign": null,
+ "utm_content": null,
+ "utm_medium": null,
+ "utm_source": null,
+ "utm_term": null,
+ "do_not_track": null,
+ "last_seen_ip": null,
+ "user_agent_data": null
+ }
+ },
+ "links": {},
+ "id": "notif_36beafa3-1a76-43cd-a971-0e39c2f487bd",
+ "topic": "visitor.signed_up",
+ "delivery_status": "pending",
+ "delivery_attempts": 1,
+ "delivered_at": 0,
+ "first_sent_at": 1768023785,
+ "created_at": 1768023777,
+ "self": null
+}
diff --git a/zerver/webhooks/intercom/view.py b/zerver/webhooks/intercom/view.py
index 9ca2db7fa7d..a4217d55688 100644
--- a/zerver/webhooks/intercom/view.py
+++ b/zerver/webhooks/intercom/view.py
@@ -17,6 +17,15 @@ def get_ping_message(payload: WildValue) -> tuple[str, str]:
return (topic_name, body)
+IGNORED_EVENTS = [
+ # Can only be invoked by SMS from registered US or Canadian numbers.
+ *[
+ "contact.lead.signed_up",
+ "contact.unsubscribed_from_sms",
+ ],
+]
+
+
EVENT_TO_FUNCTION_MAPPER: dict[str, Callable[[WildValue], tuple[str, str]]] = {
"ping": get_ping_message
}
@@ -35,6 +44,8 @@ def api_intercom_webhook(
payload: JsonBodyPayload[WildValue],
) -> HttpResponse:
event_type = payload["topic"].tame(check_string)
+ if event_type in IGNORED_EVENTS:
+ return json_success(request) # nocoverage
handler = EVENT_TO_FUNCTION_MAPPER.get(event_type)
if handler is None: