Skip to content

Generic Webhook โ€‹

Send JSON payloads to any HTTP endpoint. This adapter is designed for custom integrations with services like Ntfy, Gotify, PagerDuty, Uptime Kuma, and any other service that accepts HTTP requests.

Overview โ€‹

  • ๐ŸŒ Universal โ€” Works with any HTTP endpoint that accepts JSON
  • ๐Ÿ“ Custom Templates โ€” Define your own payload structure with placeholders
  • ๐Ÿ”‘ Authentication โ€” Support for Authorization headers (Bearer tokens, API keys)
  • โš™๏ธ Flexible โ€” Configurable HTTP method, Content-Type, and custom headers

Configuration โ€‹

FieldDescriptionDefaultRequired
Webhook URLTarget HTTP endpoint URLโ€”โœ…
HTTP MethodPOST, PUT, or PATCHPOSTโŒ
Content-TypeContent-Type header valueapplication/jsonโŒ
AuthorizationAuthorization header valueโ€”โŒ
Custom HeadersAdditional headers (one per line, Key: Value)โ€”โŒ
Payload TemplateCustom JSON template with placeholdersโ€”โŒ

Setup Guide โ€‹

1. Identify Your Endpoint โ€‹

Determine the HTTP endpoint and authentication method of your target service. Common examples:

ServiceEndpointAuth
Ntfyhttps://ntfy.sh/your-topicNone or Bearer token
Gotifyhttps://gotify.example.com/messageApp token in URL or header
PagerDutyhttps://events.pagerduty.com/v2/enqueueRouting key in payload
Uptime Kumahttps://uptime.example.com/api/push/...Token in URL
Custom APIYour endpointAs needed

2. Configure in DBackup โ€‹

  1. Go to Notifications in the sidebar
  2. Click Add Notification
  3. Select Generic Webhook
  4. Enter the webhook URL
  5. (Optional) Configure method, headers, and authentication
  6. (Optional) Create a custom payload template
  7. Click Test to verify
  8. Save

Default Payload โ€‹

When no custom template is set, DBackup sends the following JSON payload:

json
{
  "title": "Backup Successful",
  "message": "Job 'Production MySQL' completed successfully",
  "success": true,
  "color": "#00ff00",
  "timestamp": "2026-02-20T14:30:00.000Z",
  "eventType": "backup_success",
  "fields": [
    { "name": "Job", "value": "Production MySQL", "inline": true },
    { "name": "Duration", "value": "2m 30s", "inline": true },
    { "name": "Size", "value": "45.2 MB", "inline": true }
  ]
}

Custom Payload Templates โ€‹

Use placeholders to create your own payload structure. Available variables:

VariableDescriptionExample
Event titleBackup Successful
Summary messageJob 'Production' completed
Boolean (as string)true or false
Status hex color#00ff00
ISO 8601 timestamp2026-02-20T14:30:00.000Z
Event type identifierbackup_success
JSON array of fields[{"name":"Job","value":"Prod"}]

Template Examples โ€‹

Ntfy
json
{
  "topic": "dbackup",
  "title": "{{title}}",
  "message": "{{message}}",
  "priority": 3
}
Gotify
json
{
  "title": "{{title}}",
  "message": "{{message}}",
  "priority": 5
}

Set Authorization to Bearer YOUR_APP_TOKEN.

PagerDuty
json
{
  "routing_key": "YOUR_ROUTING_KEY",
  "event_action": "trigger",
  "payload": {
    "summary": "{{title}}: {{message}}",
    "severity": "critical",
    "source": "dbackup"
  }
}
Uptime Kuma (Push)

No template needed โ€” just use the push URL as the webhook URL:

https://uptime.example.com/api/push/YOUR_PUSH_TOKEN?status=up&msg={{message}}
Simple Text Payload
json
{
  "text": "[{{title}}] {{message}}"
}

Authentication โ€‹

Bearer Token โ€‹

Set the Authorization field to:

Bearer your-api-token-here

API Key Header โ€‹

Use Custom Headers for non-standard authentication:

X-API-Key: your-api-key-here

Basic Auth โ€‹

Set the Authorization field to:

Basic base64-encoded-credentials

Generate with: echo -n "user:password" | base64

Custom Headers โ€‹

Add one header per line in Key: Value format:

X-Custom-Header: my-value
X-Source: dbackup
Accept: application/json

Troubleshooting โ€‹

Connection Refused โ€‹

Webhook returned 0: Connection refused

Solutions:

  1. Verify the URL is correct and the service is running
  2. Check firewall rules allow outbound connections from DBackup
  3. If self-hosted, ensure the service is accessible from DBackup's network

Authentication Failed โ€‹

Webhook returned 401: Unauthorized

Solutions:

  1. Verify the Authorization header value
  2. Check if the API key or token has expired
  3. Ensure the token has the required permissions

Invalid Payload โ€‹

Webhook returned 400: Bad Request

Solutions:

  1. Verify your custom template is valid JSON
  2. Check the target service's expected payload format
  3. Ensure Content-Type matches what the service expects

Template Variables Not Replaced โ€‹

If you see literal in the payload:

  1. Check for typos in variable names
  2. Only the documented variables are supported
  3. Variable names are case-sensitive

Best Practices โ€‹

  1. Start without a template โ€” Test with the default payload first, then customize
  2. Use HTTPS โ€” Always prefer encrypted connections
  3. Rotate tokens regularly โ€” Update API keys for the receiving service periodically
  4. Test after changes โ€” Always use the Test button after modifying configuration
  5. Keep templates simple โ€” Complex templates are harder to debug
  6. Document your integrations โ€” Note which services receive notifications and why

Released under the GNU General Public License. | Privacy ยท Legal Notice