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.
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.
Key facts
{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.
X-Hub-Signature HMAC-SHA1 of the JSON payload with the same secret, sent for compatibility and prefixed sha1=.
x-gitea-delivery, x-gitea-event, x-gitea-event-type, x-gitea-hook-installation-target-type, x-hub-signature, x-github-event 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 toapplication/jsonand 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 defaultEGRESS_MODE, public addresses are allowed and private ones must be inALLOWED_HOST_LIST.
Delivery behaviour
5 seconds by default DELIVER_TIMEOUT, which the instance admin can change Retries none documented Gitea's docs describe only manual Redelivery After a failure redeliver by hand records are deleted after 168 hours by default Duplicates new ID on redelivery X-Gitea-Delivery is per attempt, so key on what changed Known failure modes
From Hookdeck's Gitea guide →-
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 → -
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 → -
Redelivery repeats the event
Handle duplicates →X-Gitea-Deliveryis 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'safterSHA. -
Handlers fire for the wrong trigger
Choose and route events →X-Gitea-Eventcarries a group, so an issue assignment arrives asissues. Route onX-Gitea-Event-Type, then on the body'saction.
Gitea webhook best practices
- Set a secret and verify every signature. 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.
Form and
GETdeliveries sign the JSON payload rather than the bytes you receive, so a check of the raw body fails. - Respond inside the timeout. The default is 5 seconds. Return a 2xx and process the event from a queue.
- Redeliver after an outage. Gitea's docs describe no automatic retries, so check Recent Deliveries and redeliver failures before the instance cleans them up.
- Make handlers idempotent.
A redelivery gets a new
X-Gitea-Delivery, so key on what changed, such as a push'safterSHA. - Route on X-Gitea-Event-Type and subscribe narrowly.
X-Gitea-Eventcarries a group. Pick a custom event selection, and add a branch filter for ref events.
Common Gitea webhook events
Code
push | Commits pushed to a branch or tag |
create | Branch or tag created |
delete | Branch or tag deleted |
release | Release published, updated or deleted |
Pull requests and issues
pull_request | Pull request opened, closed, reopened, edited or deleted |
pull_request_review_approved | Review approves a pull request |
issues | Issue opened, closed, reopened, edited or deleted |
issue_comment | Issue comment created, edited or deleted |
CI
workflow_run | Gitea Actions workflow run changes status |
workflow_job | Gitea Actions workflow job changes status |
status | Commit status created or updated through the API |
Events by resource
| Resource | Events | Payloads |
|---|---|---|
pull_request | 10 | 0 |
repository | 8 | 0 |
issues | 5 | 0 |
workflow | 3 | 0 |
In this hub
| Webhook events → | Every covered Gitea event, with payloads where the registry has them. |
| MCP events → | How an agent subscribes to Gitea events as MCP events. |
| Verify signatures → | Signature facts, verification code and common failures. |
| Production guide → | Production problems, such as timeouts and retries, and how to handle them. |
| Agent skill → | Install the webhook skill in your coding agent. npx skills add hookdeck/webhook-skills --skill gitea-webhooks |
Stop losing Gitea events to a 5 second timeout.
Gitea's docs describe no automatic retries. Hookdeck Event Gateway accepts each Gitea delivery, verifies the signature on POST + application/json webhooks, queues events and retries to your service on your schedule.