---
title: "GitHub Webhook Guide: Register, Verify and Handle Failures"
description: "GitHub webhooks automate actions when repository events occur. Register them, verify authenticity, and handle failures to keep integrations reliable."
url: https://www.activepieces.com/blog/github-webhook-guide-register-verify-and-handle-failures
updated: 2026-12-04
---

> Every page on www.activepieces.com is available as markdown: add `.md` to the URL, or send `Accept: text/markdown`. Site index: https://www.activepieces.com/llms.txt

# GitHub Webhook Guide: Register, Verify and Handle Failures

By Alex Kim · December 4, 2026 · 17 min read · Filed under [Automation tutorials](https://www.activepieces.com/blog/category/automation-tutorials)

**Summary**

GitHub webhooks need manual failure recovery because they offer no automatic retry, only a 10-second response time and 3-day redelivery window.

- Endpoints have 10 seconds to respond before delivery times out.
- Failed deliveries recover only within 3 days via the API.
- Personal authentication tokens rate-limit API calls to 5,000 per hour.

## Learn what GitHub webhooks send and cost

### What is a GitHub webhook?

A GitHub webhook is an HTTP POST that GitHub sends to a URL you control, such as a catch-all endpoint in a workflow tool like [Activepieces](https://www.activepieces.com), whenever a chosen event happens in a repository, organization or app.

![A small envelope-sized card of structured text travelling from a repository box to a catch-all endpoint machine in a…](https://ap-marketing-media.fra1.cdn.digitaloceanspaces.com/uploads/be5e8155-08db-4ef9-aecd-07dbb0ea6bdc/github-webhook-guide-register-verify-and-handle-9c789597.webp)

Receiving it costs nothing per delivery, and it needs no API key on your side.

The catch is operational: **GitHub doesn't retry a failed delivery, so a missed event stays missed until you recover it yourself.**

Everything below follows from that last point. The endpoint you register is a best-effort notification channel, not a queue.

> GitHub doesn't retry a failed delivery, so a missed event stays missed until you recover it yourself.

You can build on it, but only if you treat each delivery as a hint that you verify and reconcile against the API, not as a guaranteed record of what happened.

Your router must branch on two values, not one. GitHub names each event in lowercase with underscores, and sends that name in the `X-GitHub-Event` request header. The payload's `action` field then narrows it, so `pull_request` arrives with actions such as `opened` or `closed`.

![Activepieces workflow builder with the Send HTTP request step selected, showing its configuration panel with HTTP method…](https://ap-marketing-media.fra1.cdn.digitaloceanspaces.com/uploads/58352882-31ce-42ab-9b0f-c4a0fe866a5c/deepseek-r1-vs-v3-for-business-ai-2026-guide-scr-ae99964b.webp)

You'll meet five events first. The table shows when each fires, and which object the payload's key field identifies.

| Event | When GitHub fires it | What the key field identifies |
|---|---|---|
| `push` | Commits are pushed to a branch or tag | `ref`, the branch or tag that moved |
| `pull_request` | A pull request is opened, closed, edited, synchronized and so on | `pull_request`, the pull request object |
| `issues` | An issue is opened, edited, closed, labeled and so on | `issue`, the issue object |
| `workflow_run` | A GitHub Actions workflow run is requested, in progress or completed | `workflow_run`, the run object |
| `ping` | You create the webhook, or trigger a test delivery | `zen`, a random string, plus the `hook` configuration |

Before real traffic arrives, use `ping` to confirm your endpoint and signature check work, since it is the only one of these that carries no repository change. The next section covers the payload itself.

### GitHub webhook pricing and plan requirements

You are not charged per delivery, and the docs list no metering of webhook calls. Your cost is the infrastructure that hosts the receiver, plus the engineering time to make it reliable.

If you can manage the settings, you can register a repository or organization webhook. The permission you need is admin-level access to the target repository or organization, not a particular paid tier.

Because there's no key to issue, the credential that matters is the shared secret you set when registering the hook, which you use to verify each signature.

## Register GitHub webhooks via settings or API

You register a GitHub webhook either from the Webhooks page of the repository, organisation or GitHub App you want to watch, or with a `POST` to the REST API. In both cases the shared secret is set at the moment of creation.

### Registering in the settings screen

Open the repository, go to Settings, then Webhooks, and choose Add webhook. You supply a payload URL, a content type (choose `application/json` so your receiver parses one predictable format), the secret, and the events you want.

![A GitHub repository Settings Webhooks form: Add webhook button, payload URL field, content type set to application/json…](https://ap-marketing-media.fra1.cdn.digitaloceanspaces.com/uploads/c7ecad93-6005-465c-9577-491dfcfcaa15/github-webhook-guide-register-verify-and-handle-1805ae95.webp)

Select only the events you'll handle. Every extra event type is traffic your endpoint must accept within its time limit, and since GitHub doesn't retry failures, noise gives you more chances to drop something that matters.

To do the same through the API, call `POST /repos/{owner}/{repo}/hooks`. The token needs permission to manage repository webhooks: a classic personal access token needs the `admin:repo_hook` scope (or `repo`), and a fine-grained token needs read and write on the repository's Webhooks permission.

Prefer the fine-grained token, because a leaked classic token with `repo` reaches far more than hooks.

As of December 2026, this creates a hook for push events. Replace the owner, repository, URL and secret with your own values.

```bash
curl -X POST \
 -H "Accept: application/vnd.github+json" \
 -H "Authorization: Bearer $GITHUB_TOKEN" \
 -H "X-GitHub-Api-Version: 2022-11-28" \
 https://api.github.com/repos/OWNER/REPO/hooks \
 -d '{
 "name": "web",
 "active": true,
 "events": ["push"],
 "config": {
 "url": "https://example.com/github/webhook",
 "content_type": "json",
 "secret": "YOUR_SHARED_SECRET"
 }
 }'
```

Keep the hook's `id` from the `201 Created` response, since you'll need it to inspect recent deliveries or redeliver one by hand later.

### Repository, organisation or GitHub App webhooks

One repository is all a repository webhook sees. An organisation webhook, created under the organisation's settings or at `/orgs/{org}/hooks`, receives events from every repository in it, including ones created later, so your receiver must route by repository name.

If you register through a GitHub App, you get a single webhook URL, set in the app's configuration. It receives only events for the permissions you granted the app and the installations that accepted it. Choose the narrowest scope that covers your use case.

## GitHub webhook payload and headers

Before you trust anything in the body, read three headers. X-GitHub-Event names the event type, X-GitHub-Delivery identifies this one delivery, and X-Hub-Signature-256 carries the HMAC you verify. Every GitHub delivery is an HTTP POST with a JSON body plus those three.

Because a narrow scope on the hook means a narrow payload to parse, the headers are where the receiver starts. This is what each one does:

- X-GitHub-Event: the event name, such as `pull_request`. Route on it before you parse the body, so each event type reaches the handler that expects its shape.
- X-GitHub-Delivery: a unique ID per delivery. Store it and you can detect a duplicate, and you can match a delivery in your logs to the same entry in GitHub's recent-deliveries list.
- X-Hub-Signature-256: an HMAC-SHA256 of the raw body, keyed with your webhook secret. Compute it over the bytes as received, compare in constant time, and reject on mismatch. Re-serialising the JSON first will change the bytes and break the match.

Those three tell you whether to trust a request, where it goes and whether you've seen it before. The body then tells you what happened.

Trimmed to the essentials, a `pull_request` excerpt looks like this:

```json
{
 "action": "opened",
 "number": 42,
 "pull_request": {
 "title": "Fix retry handling",
 "state": "open",
 "user": { "login": "octocat" }
 },
 "repository": { "full_name": "octo-org/app" }
}
```

What separates an opened pull request from a closed or synchronized one is the `action` field. The `pull_request` event covers all of them, so branch on `action` as well as the header.

When an event is oversized, it isn't delivered with its full body, because GitHub caps the payload size. Treat the payload as a notification and fetch the current object from the API when you need the whole record.

Misspell an event name and nothing routes, silently, so match against the documentation rather than guessing.

GitHub names events in lowercase with underscores: `pull_request`, `push`, `issues`, `issue_comment`. The header carries that exact string. Each event has its own list of `action` values, and the events and payloads page in GitHub's webhook documentation is the reference for both.

You won't see volume on your GitHub invoice, because GitHub doesn't bill per delivery. Repository webhooks are available on the plans that give you repository settings access.

The cost that remains is yours: the server that receives the requests, and the API calls you spend reconciling missed ones.

## Verify the X-Hub-Signature-256 signature before trusting anything

Verify every delivery by recomputing an HMAC-SHA256 of the raw request body with your webhook secret and comparing it, in constant time, to the `X-Hub-Signature-256` header. Anything that doesn't match is rejected before it's parsed.

Between your handler and anyone who has found the URL stands one thing: the signature check. You still pay for the server that receives the requests, so it should also be the cheapest thing that server does.

Run the numbered sequence below in this order, because the signature covers exact bytes. Nothing may touch the body before it's hashed, and nothing untrusted may be parsed until the comparison passes.

1. Read the raw body bytes exactly as they arrived, before any framework middleware decodes them.
2. Compute the HMAC-SHA256 of those bytes, using the webhook secret as the key.
3. Prefix the hex digest with `sha256=` so it has the same shape as the header value.
4. Compare the two strings with a constant-time function, and reject with 401 on mismatch. Parse the JSON only after the comparison passes.

Take from this that a failed check costs you almost nothing and a skipped one costs you control of your own endpoint.

### Mistakes that make valid deliveries fail

When the body changes between GitHub and your hash, that's where most failures come from. A JSON middleware that parses and re-serialises the payload alters whitespace and key order, so the digest you compute is of different bytes and never matches.

If you hash a decoded string instead of the bytes, you get the same result when encoding differs.

Forgetting the `sha256=` prefix makes every comparison fail, and so does a secret with stray whitespace from an environment file. Using an ordinary equality operator instead of a constant-time one will pass tests but leaks timing information to an attacker.

| | Effort | Risk of error | On mismatch |
|---|---|---|---|
| Your own code | Low: a few lines, but you must capture the raw body | Highest: every mistake above is yours to make | Whatever you write, so return 401 explicitly |
| Octokit-style library | Lowest: one verify call | Low, provided you pass the raw body | Returns false or throws; you still map it to 401 |
| Gateway or automation platform | Low to configure, but depends on its options | Depends on the product; confirm it checks this header | Varies by product; confirm it rejects rather than forwards |

Choose a library when you can, and write your own only when you can test it against a real delivery.

## Handle GitHub webhook delivery failures and timeouts

You get **10 seconds to respond, no automatic retry**, and a three-day window in which to redeliver by hand or through the API, which means handlers that miss the window require manual recovery within three days. Testing against a real delivery shows you all three.

### GitHub webhook timeout, retries and redelivery

Other senders are stricter. [Shopify](https://shopify.dev/docs/apps/build/webhooks/troubleshoot) (a commerce platform) gives up after 5 seconds and Slack (a chat platform) after 3, per the [GitHub Docs on failed deliveries](https://docs.github.com/en/webhooks/using-webhooks/handling-failed-webhook-deliveries), so handlers on these platforms must respond almost instantly. The chart compares the three timeouts.

![How long webhook senders wait for a response](https://ap-marketing-media.fra1.cdn.digitaloceanspaces.com/uploads/4f5ffd58-ffd9-4482-984e-8ff4bbf21fe4/github-webhook-guide-register-verify-and-handle-de2f2f96.svg "Source: GitHub Docs")

GitHub's 10 seconds is the most generous, but a receiver that does real work inline can still miss it, so acknowledge quickly and do the work asynchronously.

So return 202 and queue the work. A missed delivery stays missed until you redeliver it from the delivery log or the API.

**Three days is all that is left**. It was 30 days in June 2021, and the [October 2023 changelog](https://github.blog/changelog/2023-10-17-webhook-delivery-logs-will-only-be-retained-for-3-days/) cut 27 days, leaving 3, so failures you don't catch immediately get buried forever.

An outage over a long weekend can therefore outlast your ability to replay it.

Run a sweep at least daily that lists recent deliveries, finds failures and redelivers them.

Once you redeliver or sweep, expect duplicates, and nothing orders events for you. Store each delivery ID (the `X-GitHub-Delivery` header) and skip repeats. For ordering, fetch current state from the API rather than trusting the payload's sequence.

![One identical envelope arriving at a desk for the third time, three matching copies in a tray, while a clerk holds a single…](https://ap-marketing-media.fra1.cdn.digitaloceanspaces.com/uploads/76a33af6-cfff-4b20-bbcf-a3bf72c747d4/github-webhook-guide-register-verify-and-handle-43c3f6e2.webp)

### API rate limits by tier when you call back

Calling back to reconcile spends API quota, and the quota depends on who is calling.

The chart shows the [REST API hourly limits](https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api): 60 unauthenticated, **5,000 for a personal token**, 12,500 at most for a GitHub App installation as it scales, and 15,000 for an app on Enterprise Cloud.

![GitHub REST API hourly limits by caller type](https://ap-marketing-media.fra1.cdn.digitaloceanspaces.com/uploads/c40089fe-244a-4562-9f48-60f678f79aca/github-webhook-guide-register-verify-and-handle-aa517c71.svg "Source: GitHub Docs")

Authenticate every call, because one sweep would exhaust the unauthenticated limit. For anything beyond a single repository, use an app. Figures as of December 2026.

Check the delivery log for the status your endpoint returned. A 4xx usually means your own code rejected the request, most often a signature check failing on a re-serialized body.

A 5xx or a timeout means the handler failed or was too slow, so move the work behind the queue and redeliver.

## Receive GitHub webhooks in Activepieces without writing an endpoint

To receive GitHub events without writing an endpoint, use Activepieces, an MIT-licensed open-source automation platform with **751 integrations counted from its monorepo**, meaning you can probably integrate with any service you're already using, through its GitHub integration, which starts a flow from GitHub events once your account is connected and lets you route those events to other integrations.

![Activepieces workflow builder showing a multi-step automation with the Send HTTP request step selected and its…](https://ap-marketing-media.fra1.cdn.digitaloceanspaces.com/uploads/9e36e973-de4a-435f-8912-12e666216b2d/self-host-mistral-ai-enterprise-deployment-guide-3f7fe28d.webp)

You can also receive them through its generic Webhook trigger when you want to point GitHub at a URL yourself. Neither changes GitHub's delivery behavior, so a failed delivery still isn't retried.

### GitHub trigger versus generic Webhook trigger

Connect your GitHub account and the GitHub integration starts a flow from GitHub events, which you can then route to other integrations. The free plan includes unlimited flows, so a trigger like this costs you no flow count.

The GitHub integration offers triggers for repository events such as a new pull request.

You pay for that convenience: you only get the events the integration exposes, and you depend on the connection's permissions to create hooks on that repository.

When the integration has no trigger for the event you need, use the generic Webhook trigger. It gives you a plain URL. You register it in GitHub yourself, choose any event GitHub can send, and handle the payload as raw JSON.

Check whether your flow verifies the `X-Hub-Signature-256` header, because the integration trigger's handling of it isn't something to assume. If the flow doesn't check it, anyone who learns the URL can start your flow.

![Activepieces workflow builder with HTTP request step selected and its settings panel open showing method, URL, headers, and…](https://ap-marketing-media.fra1.cdn.digitaloceanspaces.com/uploads/9e36e973-de4a-435f-8912-12e666216b2d/self-host-mistral-ai-enterprise-deployment-guide-3f7fe28d.webp)

### One workflow: pull request to Slack alert

Only the first one crosses a network you don't control.

Add a Slack step after the trigger and map the pull request title, author and link into the message text. That's the entire flow.

You can also skip the canvas: describe "post every new pull request to our team channel in Slack" in Activepieces' built-in chat and it publishes a live flow in your account, the same kind of flow you would have assembled by hand, with a run trace for each execution showing what the trigger received and what the Slack step did, under the same RBAC and audit logs as any other flow.

![Activepieces workflow builder showing a multi-step automation with an HTTP request step configuration panel open on the…](https://ap-marketing-media.fra1.cdn.digitaloceanspaces.com/uploads/a5180460-e385-4bee-8927-f2b3b0530b63/google-ads-api-access-levels-costs-and-setup-202-39596d54.webp)

MoneyGram, Moneypenny, Alan and FundingSocieties run Activepieces in production.

Because the trigger fires on delivery and nothing replays a missed one, a pull request opened while the flow was off or erroring never reaches Slack.

### When your own endpoint or the API is better

Write your own endpoint when you need to verify signatures under your control, acknowledge within GitHub's time limit before doing heavy work, or queue and redeliver on failure.

Use the GitHub API when you need a complete record, since polling or a periodic reconcile catches pull requests the webhook dropped.

For a Slack alert to a team channel, an occasional miss is tolerable. Billing, deployment or audit logic doesn't tolerate one.

## Monday checklist for a production GitHub webhook

Verify every payload, acknowledge it quickly, and reconcile against the GitHub API instead of trusting delivery. That is the safe receiver. A missed event is the failure that billing, deployment or audit logic can't absorb.

Take the order of work from the sequence below, and note that the last three steps, not the first five, are what make the receiver survive production, which means the first five steps don't determine survival.

1. Create a secret: a long random string stored in your secrets manager, not in the repository.
2. Register the webhook on a test repository, never first on a live one.
3. Confirm the ping event arrives and your endpoint answers it.
4. Verify the signature in the `X-Hub-Signature-256` header against the raw request body.
5. Return a 2xx response immediately and move the real work to a queue.
6. Store each `X-GitHub-Delivery` ID, so a redelivered event is recognised and not processed twice.
7. Schedule a sweep that lists recent deliveries and redelivers failures within GitHub's documented redelivery window.
8. Re-check the GitHub webhook documentation for changes since 2026-12-04.

![How long GitHub keeps webhook deliveries for redelivery](https://ap-marketing-media.fra1.cdn.digitaloceanspaces.com/uploads/050aff9d-c752-46ee-933f-0d45a706fe14/github-webhook-guide-register-verify-and-handle-7967b45a.svg "Source: GitHub Changelog (2023)")

Because GitHub, the service sending the events, doesn't retry a failed delivery on its own, steps six and seven are needed. Your sweep is the retry policy.

Subscribe only to the events your logic needs, since every extra subscription is another payload your receiver must verify and acknowledge. GitHub names events in lowercase, such as `push`, `pull_request`, `issues`, `release` and `ping`, and sends the name in the `X-GitHub-Event` header.

Before you schedule the rollout, confirm in GitHub's documentation that your account may create hooks, because plan and permission requirements differ between personal repositories and organisations. Registering a webhook carries no per-delivery charge that this article relies on.

## Frequently asked questions

Once you know your account may create hooks, a few small questions remain that the body leaves open:

- Does GitHub charge per delivery? No, webhooks carry no per-delivery fee, so cost comes only from the infrastructure that receives them.
- Should I use a smaller secret to keep things simple? No, use a long random string, because a short secret weakens the signature check you rely on.
- Must I handle the ping event? Only to return a success status, since GitHub sends it when the hook is created and it carries nothing to act on.

### Retries and local testing

Four further questions need more room.

Does GitHub retry a failed webhook delivery? No, GitHub doesn't retry automatically. A failed delivery stays failed until you redeliver it by hand from the hook's recent deliveries list or through the API. Plan for gaps by reconciling against the API on a schedule.

Can I test a GitHub webhook on localhost? Not directly, because GitHub must reach a public address. Put a tunnel in front of your local port and register its URL, then replay captured payloads from the recent deliveries list instead of pushing commits each time.

### Webhooks versus polling

Is a GitHub webhook better than polling the API? For timeliness, yes, since events arrive as they happen and you spend no requests asking.

For completeness, no, because a missed delivery is simply gone. Use the webhook as the fast path and the API as the check.

Polling alone is reasonable when you don't have a public endpoint.

### When GitHub shows success but nothing arrives

Why does GitHub show a delivery as successful but my app got nothing? A success mark means something at your URL answered with a success status, not that your handler processed the event.

A proxy, a wrong route or a handler that acknowledged and then failed in a queue all look the same from GitHub's side.

Read the response body in the delivery log, then check your own logs.

## Related reading

- [Stripe Webhook Setup: Register, Verify and Handle Events](https://www.activepieces.com/blog/stripe-webhook-setup-register-verify-and-handle-events)
- [Webhook Idempotency: How to Handle Duplicate Events (2026)](https://www.activepieces.com/blog/webhook-idempotency-how-to-handle-duplicate-events-2026)
- [What Is a Webhook? A Beginner's Guide](https://www.activepieces.com/blog/what-is-a-webhook-a-beginners-guide)

## References

- [GitHub Changelog](https://github.blog/changelog/2023-10-17-webhook-delivery-logs-will-only-be-retained-for-3-days/)
- [GitHub Docs](https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api)
- [GitHub Docs](https://docs.github.com/en/webhooks/using-webhooks/handling-failed-webhook-deliveries)
