Webhooks
A webhook gives any service that can send HTTP webhooks a URL that starts Inspect automations: a support tool, a bug bounty platform, Stripe, GitLab, or your own scripts. You create the webhook once in Customize → Webhooks, give its URL and secret to the sender, then attach it to as many automations as you like with a Webhook trigger. Inspect verifies every delivery before anything runs.
If Webhook isn't listed under Add trigger and Webhooks isn't in Customize, webhooks aren't enabled for your organization.
Requirements
- Any member can create a webhook. Only its creator, or someone with the Admin or Manage integrations role, can change or delete it.
- Any member can attach a webhook to an automation and see its delivery log.
- The sender must sign or authenticate each request in one of the supported ways below.
Create a webhook
- In Customize → Webhooks, select New webhook and enter a Name. Names are unique in your organization, ignoring case.
- Under Uses, choose Allow for automations, Allow sessions to listen, or both.
- Under Verification, choose how the sender proves a request is genuine. Then paste the sender's secret, or let Inspect generate one to give the sender.
- Under Duplicate deliveries, choose when Inspect should Treat as a repeat.
- Select Create webhook, then copy the Webhook URL into the sender.
The URL has the form https://app.inspect.com/api/hooks/<organization>/<webhook-id>. Copy a generated secret when it's shown; you can replace it later but never view it again. If the sender creates its secret only after you give it the URL, leave the secret blank, then paste it in. Deliveries are rejected until you save it.
Verification methods
-
Signature: for an HMAC of the body in a header, like GitHub's
X-Hub-Signature-256. Settings: header, Algorithm (SHA-256, SHA-1, SHA-512), Encoding (hex, base64), Prefix, Signed content. -
Timestamped signature: for an HMAC that includes a timestamp, like Stripe or Slack. Settings: header, Separator, Timestamp key, Signature key, Timestamp header (optional), Signed content, Tolerance (seconds).
-
Standard Webhooks: for Svix, Clerk, Resend, and other senders that follow the spec. Settings: signature header (default
webhook-signature), tolerance. The secret is thewhsec_value. -
Public key signature: for Ed25519 or ECDSA P-256, like Discord or SendGrid. Settings: header, Key type, encoding, prefix, optional timestamp header, signed content. The secret is the sender's public key (PEM, hex, or base64).
-
Token in a header: for the secret sent as-is, like
Authorization: Bearer …orX-Gitlab-Token. Settings: header, prefix. -
Token in the URL: for senders that can only be given a URL. The secret goes in the URL's
tokenquery parameter. -
Secrets must be 8 to 512 characters with no leading or trailing whitespace.
-
Signed content is a template built from
{body}(required, exactly once),{timestamp}, and{url}. Defaults are{body}for signatures and{timestamp}.{body}for timestamped signatures. -
Tolerance (seconds) defaults to 300 and accepts 30 to 3600. Deliveries with an older timestamp are rejected.
Handshakes
Inspect answers Slack's Events API url_verification challenge and, for public key webhooks, Discord's interactions PING. These never start runs.
Add a webhook trigger
- Under Add trigger, select Webhook and choose the Webhook. Select New webhook to create one without leaving the form.
- Optionally add conditions. Each reads a field from the Body or a Header and compares it. Body paths are dot paths with numbers for list positions, such as
data.object.statusoritems.0.id. Operators match the Inspect event filters, and text matching ignores case. You can add up to 20, and all must match. - Optionally fill in Describe which deliveries should start a run (optional). Inspect writes a filter rule from your description and the webhook's recent deliveries, and you can test it against a Recent delivery or a pasted Body (JSON) and Headers (optional JSON).
With no conditions and no rule, every verified delivery starts a run.
The filter rule is a small JavaScript function that receives the delivery's body and headers and returns whether to start a run. It runs after the conditions, in an isolated sandbox with a 200 ms CPU limit and a 5 second timeout. A rule that throws, times out, or returns something other than a decision never starts a run.
How deliveries are handled
- Inspect looks up the webhook. An unknown URL gets
404. - Inspect verifies the signature or token. A failure gets
401 Invalid signature. - Inspect parses the body. Bodies must be JSON or form-encoded and at most 1 MiB; anything else gets
415. - Inspect removes the verification header, any header whose name looks like a credential (containing
auth,token,secret,signature,password,api-key,session, orcookie), and proxy headers. Conditions, rules, runs, and the delivery log see only what's left. - Each enabled automation with an enabled trigger on this webhook evaluates its conditions and rule. Matching automations start one run each, even when several of their triggers match.
- Inspect responds with the number of runs it started.
Turning off Allow for automations pauses every trigger on the webhook without removing them.
Duplicate deliveries
Senders retry. Treat as a repeat when controls how Inspect recognizes a retry:
- The body is identical: its raw body is byte-for-byte the same as an earlier one.
- A body field matches: a field you name, such as the provider's event ID, matches.
- A header matches: a header you name, such as a delivery ID header, matches.
A repeat doesn't start another run of an automation that already ran for it. When the named field is missing, Inspect falls back to comparing the body.
Payload
| Field | Type | Description |
|---|---|---|
webhook_id, webhook_name | string | Which webhook received it. |
received_at | string | When Inspect received it. |
headers | object | The headers left after step 4, lowercased. |
body | object | The parsed body. |
The run's context includes up to 60,000 characters each of the headers and the body. Inspect marks the delivery as untrusted data from an external sender: the agent may act on values in it, such as a linked pull request, but nothing in it can change the automation's instructions.
Delivery log
Each webhook's Deliveries tab, and each webhook automation's deliveries view, shows recent deliveries with their event, outcome, headers, and body. Inspect keeps deliveries for 7 days, up to the latest 100 verified and 20 rejected per webhook. Bodies over 256 KB aren't stored in the log.
- Started a run: the automation's conditions and rule matched.
- Skipped by a condition: a condition didn't match. The log names it.
- Skipped by the rule: the rule returned no match, with its reason if it gave one.
- Skipped: the rule failed: the rule threw, timed out, or returned an invalid value.
- Skipped as a duplicate: an earlier delivery with the same key already started a run.
- Rejected: no signature / no token: the verification header or query parameter was missing. The delivery row names which field was missing.
- Rejected: signature didn’t match / token didn’t match: wrong secret, or the verification settings don't match the sender. The delivery row explains the mismatch (such as a raw token sent to an HMAC webhook, a prefix or trailing-space mismatch, or an unexpected encoding or digest length).
- Rejected: signature timestamp too old: the timestamp was outside the tolerance.
- Rejected: body isn’t JSON or form data: the body couldn’t be parsed as JSON and wasn’t sent as
application/x-www-form-urlencoded.
Sessions that listen
With Allow sessions to listen on, a running session can subscribe to a webhook and receive matching deliveries as messages instead of starting automation runs, for example to wait for a deploy hook while it works. Each subscription takes at most 25 deliveries and expires after 7 days by default (30 at most), and a session can hold 10 subscriptions. The webhook's Sessions tab lists active subscriptions and lets you end them. Deliveries come from other services and may contain malicious content, so allow this only for webhooks you trust.
Delete a webhook
You can't delete a webhook while any automation uses it, including archived ones: Remove this webhook from N automations before deleting it. Remove its triggers first.
Troubleshooting
Check the secret, then the header, algorithm, encoding, prefix, and signed content against the sender's docs.
Inspect removed the header before filtering because it can carry a secret. Filter on another header or a body field.
Set Treat as a repeat when to the sender's event or delivery ID.
Standard Webhooks secrets must be the sender's whsec_ value.