Webhook payload documentation #4545

Closed
opened 2025-11-02 05:54:13 -06:00 by GiteaMirror · 5 comments
Owner

Originally created by @JustAnotherArchivist on GitHub (Dec 24, 2019).

I am currently working on a custom notification system involving Gitea. The details of this setup aren't really relevant to the topic at hand; there'll be an HTTP server that takes events via webhooks and produces notifications to send elsewhere.

My problem: there's hardly any documentation on webhooks. The doc page merely lists the different hooks available (Gitea, Gogs, and a few proprietary chat platforms) and gives one example of a payload for push events plus PHP code to securely accept a message. Here's a list of things I'm missing:

  • Other event types (issue changes, PRs, etc.)
  • Which fields are available exactly, what are the data types and values, and which fields might be missing or have unexpected values depending on e.g. configuration or environment?
  • In which Gitea versions were the fields added, changed, or removed, so that I can determine which Gitea versions are compatible with my server?
  • What are the compatibility guarantees for future Gitea versions? Can I be reasonably sure that code written against current Gitea versions will work until the next major release (2.0)?
Originally created by @JustAnotherArchivist on GitHub (Dec 24, 2019). I am currently working on a custom notification system involving Gitea. The details of this setup aren't really relevant to the topic at hand; there'll be an HTTP server that takes events via webhooks and produces notifications to send elsewhere. My problem: there's hardly any documentation on webhooks. [The doc page](https://docs.gitea.io/en-us/webhooks/) merely lists the different hooks available (Gitea, Gogs, and a few proprietary chat platforms) and gives one example of a payload for push events plus PHP code to securely accept a message. Here's a list of things I'm missing: - [ ] Other event types (issue changes, PRs, etc.) - [ ] Which fields are available exactly, what are the data types and values, and which fields might be missing or have unexpected values depending on e.g. configuration or environment? - [ ] In which Gitea versions were the fields added, changed, or removed, so that I can determine which Gitea versions are compatible with my server? - [ ] What are the compatibility guarantees for future Gitea versions? Can I be reasonably sure that code written against current Gitea versions will work until the next major release (2.0)?
GiteaMirror added the issue/confirmedtype/docs labels 2025-11-02 05:54:13 -06:00
Author
Owner

@stale[bot] commented on GitHub (Feb 23, 2020):

This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.

@stale[bot] commented on GitHub (Feb 23, 2020): This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.
Author
Owner

@JustAnotherArchivist commented on GitHub (Feb 23, 2020):

Yes, this issue is still valid...

@JustAnotherArchivist commented on GitHub (Feb 23, 2020): Yes, this issue is still valid...
Author
Owner

@JustAnotherArchivist commented on GitHub (Apr 28, 2020):

Does any partial documentation on this exist in some obscure place I wasn't able to find, or would it have to be reconstructed from the commit history anyway? If so, it seems it shouldn't be very difficult to generate a documentation covering the first three points from the changes to modules/structs/hook.go. That file exists since commit 34eee25b (first released in 1.9.0), and it gets a bit messier before that due to a number of file moves/renames, but that should still be feasible; the structure of the file was the same ever since it was initially added in this repo in commit e378648c (before which it lived in the now obsolete and archived go-sdk repo, but that was all pre-1.0.0 and so probably doesn't really need to be documented). I could give that a shot.

@JustAnotherArchivist commented on GitHub (Apr 28, 2020): Does any partial documentation on this exist in some obscure place I wasn't able to find, or would it have to be reconstructed from the commit history anyway? If so, it seems it shouldn't be very difficult to generate a documentation covering the first three points from the changes to `modules/structs/hook.go`. That file exists since commit 34eee25b (first released in 1.9.0), and it gets a bit messier before that due to a number of file moves/renames, but that should still be feasible; the structure of the file was the same ever since it was initially added in this repo in commit e378648c (before which it lived in the now obsolete and archived go-sdk repo, but that was all pre-1.0.0 and so probably doesn't really need to be documented). I could give that a shot.
Author
Owner

@techknowlogick commented on GitHub (Apr 28, 2020):

https://github.com/drone/go-scm/tree/master/scm/driver/gitea provides examples that I refer to when looking into working with receiving webhooks

@techknowlogick commented on GitHub (Apr 28, 2020): https://github.com/drone/go-scm/tree/master/scm/driver/gitea provides examples that I refer to when looking into working with receiving webhooks
Author
Owner

@lunny commented on GitHub (Aug 2, 2024):

Duplicate of #21478

@lunny commented on GitHub (Aug 2, 2024): Duplicate of #21478
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#4545