Skip to content

Webhooks

Webhooks allow BadgerPanel to send real-time HTTP notifications to external services when specific events occur. Use webhooks to integrate with Discord, Slack, monitoring tools, or custom applications.

Supported Webhook Types

BadgerPanel supports three webhook types:

  • Discord -- Sends formatted embed messages to a Discord channel via a Discord webhook URL. Messages include event details, colors, and timestamps in Discord's expected format.
  • Slack -- Sends structured messages to a Slack channel via a Slack Incoming Webhook URL. Messages use Slack's Block Kit format.
  • Custom HTTP -- Sends a JSON payload to any HTTP endpoint. The payload includes the event type, timestamp, and event-specific data. Use this for custom integrations or third-party services.

Creating a Webhook

  1. Navigate to Admin > Webhooks and click Create Webhook.
  2. Fill in the webhook details:
    • Name -- A descriptive name for this webhook (e.g., "Discord Alerts", "Billing Notifications").
    • Type -- Select discord, slack, or custom.
    • URL -- The destination URL.
      • For Discord: the full webhook URL from your Discord channel's integration settings.
      • For Slack: the Incoming Webhook URL from your Slack app configuration.
      • For Custom: any HTTPS endpoint that accepts POST requests.
    • Secret -- An optional shared secret for custom webhooks. When set, BadgerPanel includes an HMAC-SHA256 signature in the X-Webhook-Signature header so your endpoint can verify authenticity.
    • Enabled -- Toggle the webhook on or off.
  3. Select the Events to subscribe to (see below).
  4. Click Save.

Event Filtering

Each webhook can subscribe to a specific set of events. Events are organized into categories:

CategoryEvents
Serversserver.created, server.deleted, server.suspended, server.unsuspended, server.started, server.stopped, server.install_completed, server.install_failed
Usersuser.created, user.deleted, user.suspended
Nodesnode.online, node.offline, node.error, node.maintenance
Billingorder.created, order.paid, invoice.paid, invoice.overdue, service.suspended, service.terminated
Supportticket.created, ticket.replied, ticket.closed

Select only the events relevant to each webhook to avoid unnecessary traffic. You can update the subscribed events at any time from the webhook detail page.

Testing a Webhook

After creating a webhook, use the Test button on the webhook detail page. This sends a test event to the configured URL so you can verify that the endpoint is reachable and the message format is correct. The test payload includes a test event type with sample data.

Webhook Delivery

When a subscribed event occurs, BadgerPanel constructs the appropriate payload and sends an HTTP POST request to the webhook URL. The request includes:

  • Content-Type: application/json
  • User-Agent: BadgerPanel-Webhook/1.0
  • X-Webhook-Event: The event type (e.g., server.created)
  • X-Webhook-Signature: HMAC-SHA256 signature (custom webhooks with a secret only)

If the endpoint returns a non-2xx status code, the delivery is marked as failed. BadgerPanel retries failed deliveries up to three times with exponential backoff.

Webhook Logs

Each webhook maintains a delivery log. View it from the webhook detail page. Each log entry shows:

  • Event -- The event type that triggered the delivery.
  • Status -- The HTTP status code returned by the endpoint, or an error message if the request failed.
  • Triggered At -- The timestamp of the delivery attempt.
  • Response Time -- How long the endpoint took to respond.

Use the logs to diagnose delivery failures and verify that events are being processed correctly.

Editing and Deleting Webhooks

To edit a webhook, navigate to Admin > Webhooks > [webhook] and modify any field. To delete a webhook, click Delete on the webhook detail page. Deleting a webhook removes it and all its delivery logs permanently.

BadgerPanel Documentation