Skip to content

Webhooks

Webhooks push HTTP callbacks to an external address when events occur in a repository. With the API you can create, query, update, and delete repository webhooks, and trigger a test delivery to verify that the address is reachable.

Objects

Object Description Related endpoint
Webhook Callback URL, event types, secret, and enabled status List repository webhooks
Test delivery Send a test request to the configured address to verify connectivity Test whether a webhook is sent successfully

Identification

  • A repository is identified by owner + repo, and a webhook by id.
  • The path segment is hooks, not webhooks.

Common tasks

Notes

  • The path segment is hooks (not webhooks); building the path from the document title returns a 404.
  • The test delivery path ends with the plural tests, and the method must be POST.
  • Updates use PATCH and submit only the fields to change; after changing the callback URL or secret, it is recommended to run a test delivery first.
  • Organization-level and enterprise-level webhooks are not part of this group; this group covers the repository level only.

Endpoint list

This module contains 6 endpoints.

# Endpoint Method and path Description
1 List repository webhooks GET /api/v5/repos/{owner}/{repo}/hooks This endpoint lists the webhooks configured for the specified repository, returning the ID, triggered event types, active status, and creation time of each webhook…
2 Create repository webhooks POST /api/v5/repos/{owner}/{repo}/hooks This endpoint creates webhooks for the specified repository. You can set the remote HTTP URL that receives events, the request password, and the encryption type, and configure Pu…
3 Get a single repository webhook GET /api/v5/repos/{owner}/{repo}/hooks/{id} This endpoint retrieves the configuration details of a single webhook in the specified repository, including the callback URL, subscribed event types, the result of the most recent push, and the active…
4 Update a repository webhook PATCH /api/v5/repos/{owner}/{repo}/hooks/{id} This endpoint updates a webhook in the specified repository. You can change its remote notification URL, encryption type, and request password, and configure the triggers for each event type…
5 Delete a repository webhook DELETE /api/v5/repos/{owner}/{repo}/hooks/{id} This endpoint deletes a webhook in the specified repository. It locates the target by the address path of the namespace that owns the repository, the repository path, and the webhook ID…
6 Test whether a webhook is sent successfully POST /api/v5/repos/{owner}/{repo}/hooks/{id}/tests This endpoint tests whether the webhook of the specified repository is sent successfully. By triggering a test request, it helps developers verify the webhook configuration and the callback URL…

Markdown source: View on AtomGit·Content from the open-source project gitcode-dev/atomgit-api-doc