Custom Webhooks
Receive real-time HTTP payloads when events occur in your repositories, deployments, or CI/CD pipelines. Configure endpoints, secure with HMAC, and automate your workflow.
📡 Overview
.git webhooks allow your applications or third-party services to subscribe to repository events. When a triggered event occurs, .git sends a `POST` request to your configured endpoint with a JSON payload containing event metadata.
Webhooks are ideal for:
- Triggering external CI/CD pipelines or build servers
- Sending notifications to Slack, Discord, or Microsoft Teams
- Syncing deployment status to monitoring dashboards
- Automating infrastructure provisioning on branch creation
⚡ Quick Setup
Create a webhook endpoint in three steps:
Alternatively, configure webhooks directly from your project dashboard under Settings → Integrations → Webhooks.
📦 Payload Format
All webhook payloads follow a consistent envelope structure:
The data object varies by event type. See the Event Reference for exact schemas.
🔔 Trigger Events
| Event | Description | Frequency |
|---|---|---|
| push | Code committed to a tracked branch | On commit |
| deploy.start | Deployment pipeline initiated | On trigger |
| deploy.success | Production deployment completed | On finish |
| deploy.fail | Deployment failed or rolled back | On error |
| review.created | New pull/merge request opened | On creation |
| review.approved | Review passed CI checks | On approval |
🔒 Security & Signatures
Always verify webhook payloads to prevent spoofing. .git signs every request using HMAC-SHA256 with your configured secret.
Verifying Signatures (Node.js)
Headers sent with every request:
X-Git-Signature: HMAC-SHA256 hash of the payloadX-Git-Event: The event type (e.g.,push)X-Git-Delivery: Unique webhook delivery IDX-Git-Timestamp: Unix epoch timestamp
🔄 Retry Policy
.git guarantees at-least-once delivery. If your endpoint doesn't respond with a 2xx status within 10 seconds, we retry using exponential backoff:
- Attempt 1: Immediately
- Attempt 2: 5 minutes later
- Attempt 3: 30 minutes later
- Attempt 4: 2 hours later
- Attempt 5: 6 hours later
After 5 failed attempts, the webhook is marked as disabled and you'll receive an alert. Failed payloads are retained for 7 days and can be manually resent from the dashboard.
❓ FAQ
branch_filter parameter in your webhook config. Accepts exact names or glob patterns (e.g., main, release/*, feat-*). Events from non-matching branches won't trigger a payload.
Paused. Paused webhooks retain all configuration but skip delivery until re-enabled. Paused state resets automatically after 14 days of inactivity.
🛠 Troubleshooting
Common issues and resolutions:
- 403 Forbidden: Ensure your secret matches exactly. Case-sensitive. Check for trailing whitespace.
- Timeout (504): Your endpoint must respond within 10s. Offload heavy processing to a queue (Redis, SQS, BullMQ).
- Duplicate payloads: Webhooks are at-least-once. Implement idempotency using the
X-Git-Deliveryheader. - Certificate errors: Self-signed certs are not accepted. Use Let's Encrypt or enterprise CA certificates.