# Gitea webhooks

Gitea webhooks are HTTP requests that a Gitea instance sends to your URL when repository, issue, pull request or Gitea Actions activity happens.

Agent skill: `npx skills add hookdeck/webhook-skills --skill gitea-webhooks` ([details](https://hookdeck.com/webhooks/gitea/skill))

> Independent reference generated from hookdeck/webhook-registry (commit ff7f882, 20 Nov 2026). [Gitea's official docs](https://docs.gitea.com/usage/repository/webhooks/).

[Overview](https://hookdeck.com/webhooks/gitea) · [Webhook events (26)](https://hookdeck.com/webhooks/gitea/events) · [MCP events](https://hookdeck.com/webhooks/gitea/mcp-events) · [Verify signatures](https://hookdeck.com/webhooks/gitea/verify) · [Production guide](https://hookdeck.com/webhooks/gitea/guide-duplicates-retries-timeouts) · [Agent skill](https://hookdeck.com/webhooks/gitea/skill)

## Key facts

| Fact | Value | Source |
|---|---|---|
| Signature header | `X-Gitea-Signature` Also sent: X-Hub-Signature-256, X-Gogs-Signature. | [Gitea docs](https://docs.gitea.com/usage/repository/webhooks/) |
| Scheme | `HMAC-SHA256` | [Gitea docs](https://docs.gitea.com/usage/repository/webhooks/) |
| Signed material | `{JSON payload}` The raw request body only for POST + application/json. A form delivery's body is payload=<url-encoded JSON> and a GET carries the payload in the query string, but both are still signed over the JSON, so neither signature matches the bytes received. Gitea's docs say "raw request body", which holds only for JSON POSTs. | [Gitea docs](https://docs.gitea.com/usage/repository/webhooks/) |
| How events are identified | `X-Gitea-Event-Type header, then the body's action field` | [Gitea docs](https://docs.gitea.com/usage/repository/webhooks/) |
| Body format | `JSON` Content type: application/json, application/x-www-form-urlencoded. | [Gitea docs](https://docs.gitea.com/usage/repository/webhooks/) |
| Legacy signature | `X-Hub-Signature` HMAC-SHA1 of the JSON payload with the same secret, sent for compatibility and prefixed sha1=. | [Gitea docs](https://docs.gitea.com/usage/repository/webhooks/) |
| Other headers | `x-gitea-delivery, x-gitea-event, x-gitea-event-type, x-gitea-hook-installation-target-type, x-hub-signature, x-github-event` | [Gitea docs](https://docs.gitea.com/usage/repository/webhooks/) |
| Envelope | `action, repository, sender` | [Gitea docs](https://docs.gitea.com/usage/repository/webhooks/) |
| Agent skill | `npx skills add hookdeck/webhook-skills --skill gitea-webhooks` | [Agent skill →](https://hookdeck.com/webhooks/gitea/skill) |

[Verify Gitea webhooks](https://hookdeck.com/webhooks/gitea/verify)

## How Gitea webhooks work

Webhooks push activity to your server as it happens, so you don't have to poll Gitea's API. You configure them per repository, organization, user or instance, and Gitea delivers them asynchronously over HTTP. A webhook of the generic Gitea type normally sends a `POST` with a GitHub-style JSON body: an `action` where one applies, the `repository`, the `sender` and the object that changed. The Slack, Discord and other chat types send service-specific bodies, which these pages don't cover.

`X-Gitea-Event-Type` names the exact trigger, such as `issue_assign`, and `X-Gitea-Event` names its group, `issues`. `X-Gitea-Delivery` is a UUID for the attempt. Gitea sends no payload version, and the events available depend on the release your instance runs.

## Setting up Gitea webhooks

- Create a webhook of the Gitea type at `/:username/:reponame/settings/hooks`. Organizations, users and system administration have equivalent pages, and admin default webhooks are copied into new repositories.
- Set HTTP Method to `POST`, POST Content Type to `application/json` and enter a Secret, because only that combination signs the bytes you receive.
- Click Test Delivery to send a synthetic `push`, which uses a generated fake commit if the repository has none. Recent Deliveries shows each request and response, and Redelivery replays an earlier delivery.
- Test locally with `npx hookdeck-cli listen 3000 gitea --path /webhooks/gitea`, then use its URL as the Target URL. In Gitea's default `EGRESS_MODE`, public addresses are allowed and private ones must be in `ALLOWED_HOST_LIST`.

## Delivery behaviour

- **Timeout:** 5 seconds by default. `DELIVER_TIMEOUT`, which the instance admin can change. [Guide](https://hookdeck.com/webhooks/gitea/guide-duplicates-retries-timeouts#timeouts)
- **Retries:** none documented. Gitea's docs describe only manual Redelivery. [Guide](https://hookdeck.com/webhooks/gitea/guide-duplicates-retries-timeouts#retries)
- **After a failure:** redeliver by hand. records are deleted after 168 hours by default. [Guide](https://hookdeck.com/webhooks/gitea/guide-duplicates-retries-timeouts#retries)
- **Duplicates:** new ID on redelivery. `X-Gitea-Delivery` is per attempt, so key on what changed. [Guide](https://hookdeck.com/webhooks/gitea/guide-duplicates-retries-timeouts#duplicates)

## Known failure modes

1. **Failed deliveries aren't sent again.** Gitea's docs describe no automatic retries, so a failed delivery waits for someone to click Redelivery. By default the instance deletes delivered records after 168 hours, so redeliver soon after an outage. [Retries and redelivery](https://hookdeck.com/webhooks/gitea/guide-duplicates-retries-timeouts#retries)
2. **Slow handlers fail the delivery.** Gitea's delivery timeout is 5 seconds by default, and only a 2xx counts as success. Return a 2xx straight away and process the event from a queue. [Handle timeouts](https://hookdeck.com/webhooks/gitea/guide-duplicates-retries-timeouts#timeouts)
3. **Redelivery repeats the event.** `X-Gitea-Delivery` is unique to each attempt, so a redelivery has a new value and won't match the original. Deduplicate on what changed, such as a push's `after` SHA. [Handle duplicates](https://hookdeck.com/webhooks/gitea/guide-duplicates-retries-timeouts#duplicates)
4. **Handlers fire for the wrong trigger.** `X-Gitea-Event` carries a group, so an issue assignment arrives as `issues`. Route on `X-Gitea-Event-Type`, then on the body's `action`. [Choose and route events](https://hookdeck.com/webhooks/gitea/guide-duplicates-retries-timeouts#choosing-events)

From [Hookdeck's Gitea guide](https://hookdeck.com/webhooks/gitea/guide-duplicates-retries-timeouts).

## Gitea webhook best practices

- **[Set a secret and verify every signature](https://hookdeck.com/webhooks/gitea/verify).** Without a secret, Gitea sends the signature headers with empty values, and anyone who finds your URL can send fake events to it.
- **[Use POST with application/json](https://hookdeck.com/webhooks/gitea/guide-duplicates-retries-timeouts#other-limits).** Form and `GET` deliveries sign the JSON payload rather than the bytes you receive, so a check of the raw body fails.
- **[Respond inside the timeout](https://hookdeck.com/webhooks/gitea/guide-duplicates-retries-timeouts#timeouts).** The default is 5 seconds. Return a 2xx and process the event from a queue.
- **[Redeliver after an outage](https://hookdeck.com/webhooks/gitea/guide-duplicates-retries-timeouts#retries).** Gitea's docs describe no automatic retries, so check Recent Deliveries and redeliver failures before the instance cleans them up.
- **[Make handlers idempotent](https://hookdeck.com/webhooks/gitea/guide-duplicates-retries-timeouts#duplicates).** A redelivery gets a new `X-Gitea-Delivery`, so key on what changed, such as a push's `after` SHA.
- **[Route on X-Gitea-Event-Type and subscribe narrowly](https://hookdeck.com/webhooks/gitea/guide-duplicates-retries-timeouts#choosing-events).** `X-Gitea-Event` carries a group. Pick a custom event selection, and add a branch filter for ref events.

## Common Gitea webhook events

### Code

- [push](https://hookdeck.com/webhooks/gitea/events#push): Commits pushed to a branch or tag
- [create](https://hookdeck.com/webhooks/gitea/events#create): Branch or tag created
- [delete](https://hookdeck.com/webhooks/gitea/events#delete): Branch or tag deleted
- [release](https://hookdeck.com/webhooks/gitea/events#release): Release published, updated or deleted

### Pull requests and issues

- [pull_request](https://hookdeck.com/webhooks/gitea/events#pull_request): Pull request opened, closed, reopened, edited or deleted
- [pull_request_review_approved](https://hookdeck.com/webhooks/gitea/events#pull_request_review_approved): Review approves a pull request
- [issues](https://hookdeck.com/webhooks/gitea/events#issues): Issue opened, closed, reopened, edited or deleted
- [issue_comment](https://hookdeck.com/webhooks/gitea/events#issue_comment): Issue comment created, edited or deleted

### CI

- [workflow_run](https://hookdeck.com/webhooks/gitea/events#workflow_run): Gitea Actions workflow run changes status
- [workflow_job](https://hookdeck.com/webhooks/gitea/events#workflow_job): Gitea Actions workflow job changes status
- [status](https://hookdeck.com/webhooks/gitea/events#status): Commit status created or updated through the API

## Events by resource

| Resource | Events | Payloads |
|---|---|---|
| [pull_request](https://hookdeck.com/webhooks/gitea/events#resource-pull-request) | 10 | 0 |
| [repository](https://hookdeck.com/webhooks/gitea/events#resource-repository) | 8 | 0 |
| [issues](https://hookdeck.com/webhooks/gitea/events#resource-issues) | 5 | 0 |
| [workflow](https://hookdeck.com/webhooks/gitea/events#resource-workflow) | 3 | 0 |

[All 26 events](https://hookdeck.com/webhooks/gitea/events)

## In this hub

- [Webhook events](https://hookdeck.com/webhooks/gitea/events): Every covered Gitea event, with payloads where the registry has them.
- [MCP events](https://hookdeck.com/webhooks/gitea/mcp-events): How an agent subscribes to Gitea events as MCP events.
- [Verify signatures](https://hookdeck.com/webhooks/gitea/verify): Signature facts, verification code and common failures.
- [Production guide](https://hookdeck.com/webhooks/gitea/guide-duplicates-retries-timeouts): Production problems, such as timeouts and retries, and how to handle them.
- [Agent skill](https://hookdeck.com/webhooks/gitea/skill): Install the webhook skill in your coding agent. `npx skills add hookdeck/webhook-skills --skill gitea-webhooks`
---

Not affiliated with Gitea. Facts are compiled from public sources and linked inline. [View as JSON](https://hookdeck.com/webhooks/gitea.json) · [Report a correction](https://hookdeck.com/contact)
