Skip to content
briefkastencloud

Sentry

Internal-integration webhooks for issues, errors and alerts, verified with Sentry-Hook-Signature.

Set it up

  1. In Sentry, open Settings → Developer Settings → Custom Integrations → Create New Integration → Internal Integration.
  2. Webhook URL: the source's hook URL. Turn on Alert Rule Action for issue and metric alerts, and under Webhooks the resources you want: issue, error.
  3. Sentry shows a Client Secret. Pass it when you add the source:
briefkasten source add sentry --project acme-shop --secret <client secret>

Signature

Sentry signs the raw body with HMAC-SHA256 and the client secret, lowercase hex, in Sentry-Hook-Signature. The resource is in Sentry-Hook-Resource, the delivery's id in Request-ID. Sentry also sends Sentry-Hook-Timestamp, but the signature does not cover it, so briefkasten does not rely on it.

Events

The event name is Sentry's resource and action, and the body is the delivery as Sentry posted it (action, installation, data, actor):

EventWhenTarget
issue.created, issue.resolved, issue.assigned, issue.archived, issue.unresolvedan issue changedissue:<issue id>
error.createdan error event came inissue:<issue id>
event_alert.triggeredan issue alert rule firedissue:<issue id>
metric_alert.critical, metric_alert.warning, metric_alert.resolveda metric alert changed statealert_rule:<rule id>

Every event about one Sentry issue has the same target, so a subscriber can follow it. Other resources (installation, comment, seer, …) are verified and acknowledged, and make no event.

issue.createdA new issue was createdevent issue.createdtarget issue:5813940217
{
  "action": "created",
  "installation": {
    "uuid": "7a9c1e3b-5d7f-4b1d-8f3a-5c7e9b1d3f5a"
  },
  "data": {
    "issue": {
      "url": "https://sentry.io/api/0/organizations/acme/issues/5813940217/",
      "web_url": "https://acme.sentry.io/issues/5813940217/",
      "project_url": "https://acme.sentry.io/issues/?project=4508123",
      "id": "5813940217",
      "shortId": "ACME-SHOP-3F",
      "title": "TypeError: Cannot read properties of undefined (reading 'stamp')",
      "culprit": "sort-office/route.ts in sortLetters",
      "permalink": "https://acme.sentry.io/issues/5813940217/",
      "level": "error",
      "platform": "javascript",
      "project": {
        "id": "4508123",
        "name": "acme-shop",
        "slug": "acme-shop",
        "platform": "javascript"
      },
      "type": "error",
      "issueType": "error",
      "issueCategory": "error",
      "priority": "high",
      "count": "1",
      "userCount": 1,
      "assignedTo": null,
      "status": "unresolved",
      "substatus": "new",
      "statusDetails": {},
      "firstSeen": "2026-12-04T12:00:00.000Z",
      "lastSeen": "2026-12-04T12:00:00.000Z"
    }
  },
  "actor": {
    "type": "application",
    "id": "sentry",
    "name": "Sentry"
  }
}
issue.resolvedSomebody resolved an issueevent issue.resolvedtarget issue:5813940217
{
  "action": "resolved",
  "installation": {
    "uuid": "7a9c1e3b-5d7f-4b1d-8f3a-5c7e9b1d3f5a"
  },
  "data": {
    "issue": {
      "url": "https://sentry.io/api/0/organizations/acme/issues/5813940217/",
      "web_url": "https://acme.sentry.io/issues/5813940217/",
      "project_url": "https://acme.sentry.io/issues/?project=4508123",
      "id": "5813940217",
      "shortId": "ACME-SHOP-3F",
      "title": "TypeError: Cannot read properties of undefined (reading 'stamp')",
      "culprit": "sort-office/route.ts in sortLetters",
      "permalink": "https://acme.sentry.io/issues/5813940217/",
      "level": "error",
      "platform": "javascript",
      "project": {
        "id": "4508123",
        "name": "acme-shop",
        "slug": "acme-shop",
        "platform": "javascript"
      },
      "type": "error",
      "issueType": "error",
      "issueCategory": "error",
      "priority": "high",
      "count": "1",
      "userCount": 1,
      "assignedTo": null,
      "status": "resolved",
      "substatus": null,
      "statusDetails": {
        "inNextRelease": true
      },
      "lastSeen": "2026-12-04T12:00:00.000Z"
    }
  },
  "actor": {
    "type": "user",
    "id": "2817364",
    "name": "Alex Example"
  }
}
issue.assignedAn issue was assigned to somebodyevent issue.assignedtarget issue:5813940217
{
  "action": "assigned",
  "installation": {
    "uuid": "7a9c1e3b-5d7f-4b1d-8f3a-5c7e9b1d3f5a"
  },
  "data": {
    "issue": {
      "url": "https://sentry.io/api/0/organizations/acme/issues/5813940217/",
      "web_url": "https://acme.sentry.io/issues/5813940217/",
      "project_url": "https://acme.sentry.io/issues/?project=4508123",
      "id": "5813940217",
      "shortId": "ACME-SHOP-3F",
      "title": "TypeError: Cannot read properties of undefined (reading 'stamp')",
      "culprit": "sort-office/route.ts in sortLetters",
      "permalink": "https://acme.sentry.io/issues/5813940217/",
      "level": "error",
      "platform": "javascript",
      "project": {
        "id": "4508123",
        "name": "acme-shop",
        "slug": "acme-shop",
        "platform": "javascript"
      },
      "type": "error",
      "issueType": "error",
      "issueCategory": "error",
      "priority": "high",
      "count": "1",
      "userCount": 1,
      "assignedTo": {
        "type": "user",
        "id": "2817364",
        "name": "Alex Example",
        "email": "alex@example.com"
      },
      "status": "unresolved",
      "substatus": "ongoing",
      "lastSeen": "2026-12-04T12:00:00.000Z"
    }
  },
  "actor": {
    "type": "user",
    "id": "2817364",
    "name": "Alex Example"
  }
}
error.createdAn error event was receivedevent error.createdtarget issue:5813940217
{
  "action": "created",
  "installation": {
    "uuid": "7a9c1e3b-5d7f-4b1d-8f3a-5c7e9b1d3f5a"
  },
  "data": {
    "error": {
      "event_id": "c3e5a7c9e1b34d5f8a1c3e5a7c9e1b3d",
      "issue_id": "5813940217",
      "project": 4508123,
      "title": "TypeError: Cannot read properties of undefined (reading 'stamp')",
      "culprit": "sort-office/route.ts in sortLetters",
      "level": "error",
      "platform": "javascript",
      "datetime": "2026-12-04T12:00:00.000Z",
      "environment": "production",
      "release": "acme-shop@1.4.0",
      "url": "https://sentry.io/api/0/projects/acme/acme-shop/events/c3e5a7c9e1b34d5f8a1c3e5a7c9e1b3d/",
      "web_url": "https://acme.sentry.io/issues/5813940217/events/c3e5a7c9e1b34d5f8a1c3e5a7c9e1b3d/",
      "issue_url": "https://sentry.io/api/0/issues/5813940217/"
    }
  },
  "actor": {
    "type": "application",
    "id": "sentry",
    "name": "Sentry"
  }
}
event_alert.triggeredAn issue alert rule firedevent event_alert.triggeredtarget issue:5813940217
{
  "action": "triggered",
  "installation": {
    "uuid": "7a9c1e3b-5d7f-4b1d-8f3a-5c7e9b1d3f5a"
  },
  "data": {
    "event": {
      "event_id": "c3e5a7c9e1b34d5f8a1c3e5a7c9e1b3d",
      "issue_id": "5813940217",
      "project": 4508123,
      "title": "TypeError: Cannot read properties of undefined (reading 'stamp')",
      "culprit": "sort-office/route.ts in sortLetters",
      "level": "error",
      "platform": "javascript",
      "datetime": "2026-12-04T12:00:00.000Z",
      "environment": "production",
      "release": "acme-shop@1.4.0",
      "url": "https://sentry.io/api/0/projects/acme/acme-shop/events/c3e5a7c9e1b34d5f8a1c3e5a7c9e1b3d/",
      "web_url": "https://acme.sentry.io/issues/5813940217/events/c3e5a7c9e1b34d5f8a1c3e5a7c9e1b3d/",
      "issue_url": "https://sentry.io/api/0/issues/5813940217/"
    },
    "triggered_rule": "More than 10 errors in 5 minutes"
  },
  "actor": {
    "type": "application",
    "id": "sentry",
    "name": "Sentry"
  }
}
metric_alert.criticalA metric alert went criticalevent metric_alert.criticaltarget alert_rule:7
{
  "action": "critical",
  "installation": {
    "uuid": "7a9c1e3b-5d7f-4b1d-8f3a-5c7e9b1d3f5a"
  },
  "data": {
    "description_text": "1000 events in the last 10 minutes\nFilter: level:error",
    "description_title": "Critical: Checkout errors",
    "metric_alert": {
      "alert_rule": {
        "id": "7",
        "name": "Checkout errors",
        "aggregate": "count()",
        "dataset": "events",
        "query": "level:error",
        "time_window": 10,
        "projects": [
          "acme-shop"
        ],
        "triggers": []
      },
      "date_closed": null,
      "date_created": "2026-12-04T12:00:00.000Z",
      "date_detected": "2026-12-04T12:00:00.000Z",
      "date_started": "2026-12-04T12:00:00.000Z",
      "id": "4",
      "identifier": "4",
      "projects": [
        "acme-shop"
      ],
      "status": 1,
      "title": "Checkout errors"
    },
    "web_url": "https://acme.sentry.io/alerts/rules/details/7/"
  },
  "actor": {
    "type": "application",
    "id": "sentry",
    "name": "Sentry"
  }
}
metric_alert.resolvedA metric alert resolvedevent metric_alert.resolvedtarget alert_rule:7
{
  "action": "resolved",
  "installation": {
    "uuid": "7a9c1e3b-5d7f-4b1d-8f3a-5c7e9b1d3f5a"
  },
  "data": {
    "description_text": "1000 events in the last 10 minutes\nFilter: level:error",
    "description_title": "Resolved: Checkout errors",
    "metric_alert": {
      "alert_rule": {
        "id": "7",
        "name": "Checkout errors",
        "aggregate": "count()",
        "dataset": "events",
        "query": "level:error",
        "time_window": 10,
        "projects": [
          "acme-shop"
        ],
        "triggers": []
      },
      "date_closed": "2026-12-04T12:00:00.000Z",
      "date_created": "2026-12-04T12:00:00.000Z",
      "date_detected": "2026-12-04T12:00:00.000Z",
      "date_started": "2026-12-04T12:00:00.000Z",
      "id": "4",
      "identifier": "4",
      "projects": [
        "acme-shop"
      ],
      "status": 2,
      "title": "Checkout errors"
    },
    "web_url": "https://acme.sentry.io/alerts/rules/details/7/"
  },
  "actor": {
    "type": "application",
    "id": "sentry",
    "name": "Sentry"
  }
}

Options

None.

In your app

import { sentry } from "@briefkasten/adapter-sentry";

const hooks = briefkasten({
  sources: { sentry: sentry({ secret: process.env.SENTRY_CLIENT_SECRET }) },
});

hooks.on("sentry:issue.created", async (event) => {
  console.log(event.body.data.issue.title);
});