Webhook Setup Documentation¶
This document describes how to configure webhooks for real-time data synchronization in Dev Health Ops.
GitHub Configuration¶
- Go to your repository or organization Settings.
- Select Webhooks from the sidebar.
- Click Add webhook.
- Set Payload URL to
https://your-dev-health-instance.com/api/v1/webhooks/github. - Set Content type to
application/json. - Enter a Secret (must match
GITHUB_WEBHOOK_SECRETenvironment variable). - Select Let me select individual events:
- Pushes
- Pull requests
- Issues
- Deployments
- Workflow runs
- Click Add webhook.
GitLab Configuration¶
- Go to your project or group Settings > Webhooks.
- Set URL to
https://your-dev-health-instance.com/api/v1/webhooks/gitlab. - Set Secret token (must match
GITLAB_WEBHOOK_TOKENenvironment variable). - Under Trigger, select:
- Push events
- Tag push events
- Merge request events
- Issue events
- Pipeline events
- Job events
- Click Add webhook.
Jira Configuration¶
- Log in as a Jira Administrator.
- Go to System > Webhooks.
- Click Create a Webhook.
- Set URL to
https://your-dev-health-instance.com/api/v1/webhooks/jira. - (Optional) Add
?secret=your_secretto the URL ifJIRA_WEBHOOK_SECRETis configured. - Under Events, select:
- Issue: created, updated, deleted.
- Click Create.
Environment Variables¶
Ensure the following variables are set in your deployment environment:
| Variable | Description |
|---|---|
GITHUB_WEBHOOK_SECRET |
HMAC secret for GitHub signature validation |
GITLAB_WEBHOOK_TOKEN |
Token for GitLab X-Gitlab-Token validation |
JIRA_WEBHOOK_SECRET |
Optional secret for Jira validation |
STRIPE_WEBHOOK_SECRET |
Stripe webhook signing secret (SaaS billing) |
REDIS_URL |
Required for webhook delivery idempotency |
Stripe Configuration (SaaS Billing)¶
Stripe webhooks are used for real-time subscription management in SaaS deployments. When a customer subscribes, upgrades, downgrades, or cancels, Stripe sends events directly to dev-health-ops.
- Go to your Stripe Dashboard > Developers > Webhooks.
- Click Add endpoint.
- Set Endpoint URL to
https://your-dev-health-instance.com/api/v1/billing/webhooks/stripe. - Under Events to send, select:
checkout.session.completedcustomer.subscription.createdcustomer.subscription.updatedcustomer.subscription.deletedinvoice.createdinvoice.updatedinvoice.finalizedinvoice.paidinvoice.payment_failedinvoice.voidedcharge.refundedcharge.refund.updated- Click Add endpoint.
- Copy the Signing secret and set it as
STRIPE_WEBHOOK_SECRETin your environment.
Billing Endpoints¶
| Endpoint | Method | Description |
|---|---|---|
/api/v1/billing/webhooks/stripe |
POST | Receives Stripe webhook events |
/api/v1/billing/checkout |
POST | Creates a Stripe Checkout Session (auth required) |
/api/v1/billing/portal |
POST | Creates a Stripe Customer Portal session (auth required) |
/api/v1/billing/entitlements/{org_id} |
GET | Returns current tier, features, and limits for an org |
Required Environment Variables (Billing)¶
| Variable | Description |
|---|---|
STRIPE_SECRET_KEY |
Stripe API secret key |
STRIPE_WEBHOOK_SECRET |
Webhook signing secret from step 6 above |
STRIPE_PRICE_ID_TEAM |
Stripe Price ID for the Team tier product |
STRIPE_PRICE_ID_ENTERPRISE |
Stripe Price ID for the Enterprise tier product |
LICENSE_PRIVATE_KEY |
Ed25519 private key for signing JWT licenses (base64-encoded) |
Note: Stripe webhooks are only relevant for SaaS deployments. Self-hosted deployments use offline Ed25519 license keys and do not require Stripe configuration.
Email Notifications¶
When billing events are processed, the webhook handler sends email notifications to the organization owner:
| Stripe Event | Email Sent | Recipient |
|---|---|---|
invoice.paid |
Invoice receipt | Org owner |
invoice.payment_failed |
Payment failed alert | Org owner |
customer.subscription.updated |
Subscription changed (only if tier changed) | Org owner |
customer.subscription.deleted |
Subscription cancelled | Org owner |
Email delivery failures are logged but never prevent the webhook from returning a successful response. See Email Setup for provider configuration and troubleshooting.
For full local/CI/ops guidance (Stripe CLI forwarding, replay/retry, reconciliation, and test cards), see the Stripe Billing Runbook.