---
name: intercom-webhooks-events
description: 'Implement Intercom webhook handling and data event tracking.

  Use when setting up webhook endpoints, processing Intercom notifications,

  or submitting custom data events for contact activity tracking.

  Trigger with phrases like "intercom webhook", "intercom events",

  "intercom webhook signature", "handle intercom events", "intercom data events",

  "track intercom events".'
allowed-tools: Read, Write, Edit, Bash(curl:*)
version: 1.6.0
license: MIT
author: Jeremy Longshore <jeremy@intentsolutions.io>
tags:
  - saas
  - support
  - messaging
  - intercom
compatibility: Designed for Claude Code
title: intercom-webhooks-events
canonical_url: https://skilld.dev/gh/jeremylongshore/tons-of-skills-marketplace/intercom-webhooks-events
last_updated: 2026-10-07T06:06:28.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> Supporting files, fetch one when the Skill refers to it: [references/data-events.md](https://skilld.dev/api/skills-raw/jeremylongshore/tons-of-skills-marketplace/intercom-webhooks-events/references/data-events.md), [references/incoming-webhooks.md](https://skilld.dev/api/skills-raw/jeremylongshore/tons-of-skills-marketplace/intercom-webhooks-events/references/incoming-webhooks.md), [references/webhook-topics.md](https://skilld.dev/api/skills-raw/jeremylongshore/tons-of-skills-marketplace/intercom-webhooks-events/references/webhook-topics.md).
>
> If the user asked to install this Skill, run `npx skilld install jeremylongshore/tons-of-skills-marketplace/intercom-webhooks-events`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/intercom-webhooks-events`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/jeremylongshore/tons-of-skills-marketplace/intercom-webhooks-events) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/intercom-webhooks-events`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/intercom-webhooks-events --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/intercom-webhooks-events --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# Intercom Webhooks & Events

## Overview

Handle incoming Intercom webhooks (notifications) with signature verification and implement outbound data event tracking via the Events API. Incoming webhooks push conversation and contact changes to your endpoint; outbound data events push custom activity into Intercom for segmentation and messaging.

The full, copy-ready code lives in `references/`; this file walks the workflow at a high level so you can follow it start to finish, then drill in for depth.

## Prerequisites

- HTTPS endpoint accessible from internet
- Webhook secret from Intercom Developer Hub
- Access token from Intercom Developer Hub (for outbound data events)
- `intercom-client` SDK installed
- Redis or database for idempotency (recommended)

## Authentication

Two distinct credentials, both issued from the Intercom Developer Hub and read from environment variables — never hard-code them:

- **Incoming webhooks** are verified with `INTERCOM_WEBHOOK_SECRET`. Intercom signs every delivery with HMAC-SHA1 in the `X-Hub-Signature` header; you recompute the digest over the **raw** request body and compare with `crypto.timingSafeEqual`. Reject any request that fails or is missing the header.
- **Outbound data events** authenticate with a bearer `INTERCOM_ACCESS_TOKEN` passed to `IntercomClient`.

## Instructions

Read the relevant reference file, then use Write/Edit to scaffold the handler into the target project.

1. **Build the signed endpoint.** Create an Express route that captures the **raw** body (`express.raw`), verifies the `X-Hub-Signature` HMAC-SHA1 digest against `INTERCOM_WEBHOOK_SECRET`, and returns `200` within 5 seconds — Intercom treats a slower response as a failure. Respond first, process after. See [incoming webhooks walkthrough](https://skilld.dev/api/skills-raw/jeremylongshore/tons-of-skills-marketplace/intercom-webhooks-events/references/incoming-webhooks.md) Step 1.
2. **Model the payload.** Every delivery is a `notification_event` envelope carrying `topic`, `id`, and `data.item` (the changed resource). Type it so the router is safe. See [incoming webhooks walkthrough](https://skilld.dev/api/skills-raw/jeremylongshore/tons-of-skills-marketplace/intercom-webhooks-events/references/incoming-webhooks.md) Step 2.
3. **Route by topic.** Dispatch on `notification.topic` through a handler map; log and no-op unknown topics rather than throwing. Pick topics from the [topics reference](https://skilld.dev/api/skills-raw/jeremylongshore/tons-of-skills-marketplace/intercom-webhooks-events/references/webhook-topics.md). See [incoming webhooks walkthrough](https://skilld.dev/api/skills-raw/jeremylongshore/tons-of-skills-marketplace/intercom-webhooks-events/references/incoming-webhooks.md) Step 3.
4. **Add idempotency.** Intercom retries a failed delivery once after ~1 minute. Guard each `notification.id` with a Redis `SET NX` lock so retries never double-process; release the lock on failure to allow a genuine retry. See [incoming webhooks walkthrough](https://skilld.dev/api/skills-raw/jeremylongshore/tons-of-skills-marketplace/intercom-webhooks-events/references/incoming-webhooks.md) Step 4.
5. **Track outbound events.** Submit custom activity with `client.dataEvents.create` using a past-tense `verb-noun` `eventName`, a Unix `createdAt`, the contact's external `userId`, and optional `metadata`. See [data events walkthrough](https://skilld.dev/api/skills-raw/jeremylongshore/tons-of-skills-marketplace/intercom-webhooks-events/references/data-events.md) Step 5.
6. **Submit in bulk when needed.** There is no batch events endpoint — throttle individual `dataEvents.create` calls (e.g. a short delay every 50) and tally succeeded/failed. See [data events walkthrough](https://skilld.dev/api/skills-raw/jeremylongshore/tons-of-skills-marketplace/intercom-webhooks-events/references/data-events.md) Step 6.

## Output

A working integration produces:

- A signed `/webhooks/intercom` endpoint that returns `200 {"received": true}` on valid deliveries and `401` on missing/invalid signatures.
- Per-topic handler execution logged as `Processed <topic>: <id>`, with unknown topics logged and skipped.
- Idempotent processing — duplicate `notification.id` deliveries are skipped with `Duplicate webhook skipped: <id>`.
- Outbound `dataEvents.create` calls that appear on the contact's Intercom timeline; bulk runs return `{ succeeded, failed }` counts.

## Error Handling

| Issue | Cause | Solution |
|-------|-------|----------|
| Invalid signature | Secret mismatch | Verify secret matches Developer Hub |
| Timeout (5s) | Slow processing | Queue events, respond immediately |
| Duplicate events | Retry delivery | Implement idempotency with Redis |
| Missing topic handler | New topic added | Log unhandled topics, add handler |
| Event rejected (422) | Invalid user_id or event_name | Verify contact exists, use verb-noun naming |

## Examples

**Verify a signature and respond fast** (skeleton — full version in [incoming webhooks](https://skilld.dev/api/skills-raw/jeremylongshore/tons-of-skills-marketplace/intercom-webhooks-events/references/incoming-webhooks.md)):

```typescript
const expected = "sha1=" + crypto
  .createHmac("sha1", process.env.INTERCOM_WEBHOOK_SECRET!)
  .update(req.body)              // raw Buffer, not parsed JSON
  .digest("hex");
if (!crypto.timingSafeEqual(Buffer.from(signature), Buffer.from(expected))) {
  return res.status(401).json({ error: "Invalid signature" });
}
res.status(200).json({ received: true });   // respond within 5s, then process async
```

**Track a custom data event** (full version in [data events](https://skilld.dev/api/skills-raw/jeremylongshore/tons-of-skills-marketplace/intercom-webhooks-events/references/data-events.md)):

```typescript
await client.dataEvents.create({
  eventName: "completed-onboarding",         // past-tense verb-noun
  createdAt: Math.floor(Date.now() / 1000),
  userId: "user-12345",                      // contact's external ID
  metadata: { steps_completed: 5, plan: "pro" },
});
```

More: [incoming webhooks](https://skilld.dev/api/skills-raw/jeremylongshore/tons-of-skills-marketplace/intercom-webhooks-events/references/incoming-webhooks.md) · [data events](https://skilld.dev/api/skills-raw/jeremylongshore/tons-of-skills-marketplace/intercom-webhooks-events/references/data-events.md) · [webhook topics](https://skilld.dev/api/skills-raw/jeremylongshore/tons-of-skills-marketplace/intercom-webhooks-events/references/webhook-topics.md).

## Resources

- [Webhook Setup](https://developers.intercom.com/docs/webhooks/setting-up-webhooks)
- [Webhook Topics](https://developers.intercom.com/docs/references/webhooks/webhook-models)
- [Webhook Notifications](https://developers.intercom.com/docs/webhooks/webhook-notifications)
- [Data Events API](https://developers.intercom.com/docs/references/rest-api/api.intercom.io/data-events)

## Next Steps

For performance optimization once the webhook endpoint and event pipeline are live, see the `intercom-performance-tuning` skill to profile throughput and tune rate limits.
