Webhook Types
Discord Webhooks
Send rich embeds to Discord channels with file information
HTTP Webhooks
Send JSON payloads to custom HTTP endpoints
Discord Webhooks
Discord webhooks send rich embed messages to Discord channels with customizable content and formatting.Configuration
Configure Discord webhooks in your database:Setting Up Discord Webhooks
Create Discord Webhook
In your Discord server, go to Server Settings > Integrations > Webhooks and create a new webhook.
Configure in Zipline
Set the webhook URL in your database configuration, either globally or per-event.
Embed Customization
You can customize Discord embeds using template variables: Available Variables:{user.username}- Username of the uploader{user.id}- User ID{file.name}- File name{file.size}- File size{file.type}- MIME type{link.raw}- Direct file URL{url.destination}- Shortened URL destination{url.code}- Short URL code
Discord Webhook Payload
The webhook sends a payload to Discord:Implementation Reference
The Discord webhook implementation can be found atsrc/lib/webhooks/discord.ts:114:
HTTP Webhooks
HTTP webhooks send JSON payloads to custom HTTP endpoints, allowing integration with any service.Configuration
Webhook Events
File Upload Event
When a file is uploaded, Zipline sends:URL Shorten Event
When a URL is shortened:Security Considerations
The implementation atsrc/lib/webhooks/http.ts:7 sanitizes data:
Custom Headers
All HTTP webhooks include these headers:Content-Type: application/jsonx-zipline-webhook: truex-zipline-webhook-type: uploadorshorten
Example Integrations
Slack Integration
Convert the webhook payload for Slack:Database Logging
Log all uploads to your database:Troubleshooting
Webhooks Not Firing
- Check that the webhook URL is configured correctly
- Verify the feature is enabled in your database
- Check server logs for error messages
- Test the webhook URL manually with curl
Discord Embed Not Showing
- Ensure the embed JSON is valid
- Check that color values are valid hex strings
- Verify template variables are spelled correctly
- Make sure the webhook URL has permission to post embeds
HTTP Webhook Failures
- Verify your endpoint is publicly accessible
- Check that your endpoint returns a 2xx status code
- Look for timeout issues (webhooks have a timeout)
- Ensure your endpoint accepts
application/json