Skip to main content
The Webhooks API allows you to create and manage webhooks that receive HTTP callbacks when events occur in your repositories.

Overview

Webhooks send POST requests to your specified URL when events like pushes, pull requests, or issues occur. Use webhooks to:
  • Trigger CI/CD pipelines
  • Update external systems
  • Send notifications to chat platforms
  • Sync data with other services

Events

Webhooks can subscribe to the following events:

Endpoints

List Webhooks

List all webhooks for a repository. Requires write permission.
Response:

Get Webhook

Get a specific webhook. Requires write permission.

Create Webhook

Create a new webhook. Requires admin permission.
Example:

Update Webhook

Update an existing webhook. Requires admin permission.
Example:

Delete Webhook

Delete a webhook. Requires admin permission.
Response:

Test Webhook

Send a test ping to the webhook. Requires admin permission.
Response:
Example:

Webhook Payloads

Common Fields

All webhook payloads include:

Push Event

Pull Request Event

Issue Event


Signature Verification

If you set a secret, wit signs webhook payloads using HMAC-SHA256.

Headers

Verifying Signatures


Error Handling


Usage Examples

Setting Up CI Webhooks

Slack Notifications

React Management Component


Best Practices

Security

  1. Always use HTTPS URLs for webhook endpoints
  2. Set a secret and verify signatures
  3. Validate the event type before processing
  4. Use unique delivery IDs to prevent replay attacks

Reliability

  1. Respond quickly (within 10 seconds) to avoid timeouts
  2. Process asynchronously for heavy operations
  3. Implement idempotency to handle duplicate deliveries
  4. Log delivery IDs for debugging