Routes
Routes connect sources to destinations, optionally applying transforms and filters.
Overview
A route defines:
- Which source it listens to
- Which destinations receive the webhook
- What transforms to apply (optional)
- What filters to use (optional)
Source ──▶ Route ──▶ [Transform] ──▶ [Filter] ──▶ DestinationsCreating a Route
Required Fields
| Field | Description |
|---|---|
name | Human-readable name |
sourceId | The source to listen to |
destinationIds | Array of destination IDs |
Optional Fields
| Field | Description |
|---|---|
description | Optional description |
transformId | Transform to apply |
filterId | Filter to evaluate |
enabled | Whether the route is active (default: true) |
Example: Creating a Route
Basic Route
curl -X POST https://api.webhookrelay.com/api/organizations/{orgId}/routes \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "GitHub to Slack",
"sourceId": "src_abc123",
"destinationIds": ["dst_xyz789"]
}'Route with Transform
curl -X POST https://api.webhookrelay.com/api/organizations/{orgId}/routes \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "GitHub to Slack (Formatted)",
"sourceId": "src_abc123",
"destinationIds": ["dst_xyz789"],
"transformId": "tfm_format123"
}'Route with Filter
curl -X POST https://api.webhookrelay.com/api/organizations/{orgId}/routes \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "GitHub Push Only",
"sourceId": "src_abc123",
"destinationIds": ["dst_xyz789"],
"filterId": "flt_pushonly456"
}'Multiple Destinations
A single route can deliver to multiple destinations simultaneously:
{
"name": "GitHub to Multiple",
"sourceId": "src_abc123",
"destinationIds": [
"dst_slack",
"dst_discord",
"dst_database"
]
}All destinations receive the same payload (after transforms are applied).
Route Processing Order
When a webhook arrives:
- Source receives webhook
- Signature verification (if configured on source)
- Find matching routes for the source
- For each enabled route:
- Apply transform (if configured)
- Evaluate filter (if configured)
- If filter passes (or no filter): Queue delivery to destinations
- Deliver to destinations asynchronously
Managing Routes
List Routes
curl https://api.webhookrelay.com/api/organizations/{orgId}/routes \
-H "Authorization: Bearer YOUR_TOKEN"Get Route Details
curl https://api.webhookrelay.com/api/organizations/{orgId}/routes/{routeId} \
-H "Authorization: Bearer YOUR_TOKEN"Update Route
curl -X PATCH https://api.webhookrelay.com/api/organizations/{orgId}/routes/{routeId} \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"enabled": false
}'Delete Route
curl -X DELETE https://api.webhookrelay.com/api/organizations/{orgId}/routes/{routeId} \
-H "Authorization: Bearer YOUR_TOKEN"Common Patterns
Fan-out
One source to many destinations:
GitHub Source ──▶ Route ──┬──▶ Slack
├──▶ Discord
├──▶ Database
└──▶ AnalyticsContent-based Routing
Multiple routes from one source with different filters:
GitHub Source ──▶ Route (push filter) ──▶ CI/CD
──▶ Route (PR filter) ──▶ Review System
──▶ Route (issue filter) ──▶ Issue TrackerTransform Pipeline
Apply different transforms for different destinations:
Stripe Source ──▶ Route (Slack transform) ──▶ Slack
──▶ Route (DB transform) ──▶ DatabaseBest Practices
Name routes descriptively: Include source and destination in the name (e.g., "GitHub to Slack")
Use filters wisely: Filter early to reduce unnecessary deliveries
Test before enabling: Use the Testing page to verify transforms and filters work correctly
Monitor route health: Check the analytics for success rates per route
Disable instead of delete: When troubleshooting, disable routes instead of deleting them
Troubleshooting
Webhooks not being delivered
- Verify the route is enabled
- Check if the source is enabled
- Verify destination(s) are enabled
- Check if a filter is blocking events
- Review transform for errors
Duplicate deliveries
- Check if multiple routes are configured for the same source/destination pair
- Verify your application handles idempotency