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.

26 events covered

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

Signature header
X-Gitea-Signature

Also sent: X-Hub-Signature-256, X-Gogs-Signature.

Scheme
HMAC-SHA256
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.

How events are identified
X-Gitea-Event-Type header, then the body's action field
Body format
JSON

Content type: application/json, application/x-www-form-urlencoded.

Legacy signature
X-Hub-Signature

HMAC-SHA1 of the JSON payload with the same secret, sent for compatibility and prefixed sha1=.

Other headers
x-gitea-delivery, x-gitea-event, x-gitea-event-type, x-gitea-hook-installation-target-type, x-hub-signature, x-github-event
Envelope
action, repository, sender
Agent skill
npx skills add hookdeck/webhook-skills --skill gitea-webhooks

Verify Gitea webhooks →

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

  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 →
  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 →
  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 →
  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 →

Gitea webhook best practices

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

pull_request · _assign · _label · _milestone +6

10 0
repository

create · delete · fork · push +4

8 0
issues

issues · issue_assign · issue_label · issue_milestone +1

5 0
workflow

status · _run · _job

3 0

All 26 events →

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.

Not affiliated with Gitea. Facts are compiled from public sources and linked inline.