Mapping Webhook Routing Rules to Your API Contract
When a provider sends a webhook, it directs an HTTP request to a configured URL. Providers and intermediaries use routing rules to…
When you read a webhook provider's documentation, you need to find out which events trigger an HTTP request, where the provider sends that request, and what the provider does when no rule matches or a delivery fails. A webhook is an HTTP request that a provider sends to notify another service about an event. The provider's documentation defines the rules for when it sends that request and where it delivers it.
Every provider writes its own rules. HTTP standards define how requests and responses work, yet they set no common standard for how webhook providers filter events, pick destinations, or handle unmatched callbacks. As you read the docs, work through the provider's rules in order: check whether the event qualifies for delivery, see which rule applies, and find out what the provider does when a rule matches, when nothing matches, or when the HTTP exchange fails.
A provider sends a callback only when an event meets all of its conditions. First, check whether you subscribed the webhook to the relevant event or trigger, because a subscription tells the provider which kinds of events you want. Next, check any filters that narrow those events further, such as the event type, the specific entity involved, or a field inside the event payload.
Jira Cloud's webhook documentation shows how narrow these filters can be. You select event types and can optionally limit issue events with JQL, Jira's query language, but JQL applies only to some event types. If you leave the JQL query empty, Jira matches issues across all projects, and certain sprint and project-version events ignore the filter fields altogether. Even if you include a filter field in your registration request, the provider may not apply it to every event.
Sinch Conversation API documentation draws a similar line between trigger subscriptions and routing rules. Sinch evaluates routing rules only for subscribed triggers. The routing feature is also marked open beta, and Sinch limits sender_id_filters to SMS and MMS during that beta. Whenever a provider documents a scope or version limit like this, treat it as part of the rule and verify which events or channels it covers.
Providers use the word filter for several different decisions. Read each rule to see what the provider actually inspects, whether that is an event name, the object the event belongs to, a field in the payload, or a destination URL. Knowing what the rule checks tells you what it controls.
In Sinch's open-beta routing rules, the provider inspects callback attributes such as the channel, sender ID, message text, or delivery status, and then picks a target URL for that rule. When a rule matches a delivery status of FAILED, Sinch chooses the destination based on the event's content rather than the URL path itself.
Other providers use rules for different jobs. Twilio's Webhook Rules inspect the destination URL to decide which settings to apply, whereas Jira's JQL filter decides which issue events qualify in the first place. Each mechanism answers a different question: whether an event qualifies, which destination receives it, or which settings the provider attaches. Keep those questions separate when you map webhook rules to an API contract, as covered in routing rules and API contracts.
When a provider matches URLs, check the exact matching syntax and precedence rules in its docs. Familiar URL conventions often mislead you about how a specific provider compares paths.
Twilio documents three match types: exact URL, URL prefix, and default. Twilio normalizes URLs before comparing them, yet the scheme still matters and a trailing slash changes the result. Twilio also preserves path capitalization, so /hook does not match /Hook. A literal asterisk does not act as a wildcard, and any prefix path must end with a slash.
Precedence matters just as much as syntax. Twilio evaluates exact matches first, then prefix matches, and falls back to the default rule last. Within a match type, the longest matching rule wins. When several rules seem to fit, trace them against this documented order instead of assuming the first rule in the list wins.
Other providers order rules differently. Sinch evaluates rules in their listed order and stops at the first match, sending the callback to that rule's target. Check the docs for an explicit statement on whether the provider stops after one match or sends the callback to every matching destination, because one provider's rule order tells you nothing about another's.
Providers also differ in what they do when an event matches no rule. Look in the docs for an explicit fallback rule, a default destination, an instruction to discard the event, or a note explaining what happens when no setting applies.
In Sinch's routing contract, fallback_behavior controls whether Sinch sends an unmatched callback to the webhook's default target or discards it. The documented default is FALLBACK_TO_DEFAULT. An unsubscribed trigger is a separate case, because Sinch never runs the routing rules if you did not subscribe to that trigger.
Twilio handles unmatched URLs with a default rule. When no rule matches, Twilio still sends the webhook, with no Setting applied. That differs from Sinch's option to drop an unmatched callback. Because HTTP standards set no general fallback policy, you have to rely on each provider's documentation to know what happens.
When a provider mentions an "error endpoint," check which of three things it actually means: a destination for error notifications, a route chosen because an event carries a failure status, or a backup destination used after an HTTP delivery fails.
In the MHHS DIP programme's Webhook URL Configuration Guide, an Error URL receives error messages, such as when sending fails, while an Egress URL receives regular messages. The guide scopes both URLs to a message channel and a DIP ID. Those labels belong to that programme's configuration rather than a general webhook standard.
Sinch's example of routing a FAILED delivery report to an /errors target illustrates a different pattern. Here, Sinch selects the /errors route because of the event's business status. That example alone does not tell you what Sinch does if the /errors URL itself fails to accept the request. For more on these distinctions, see routing failed webhooks to an error endpoint.
An HTTP delivery failure is a separate issue altogether. RFC 9110 defines HTTP request and response semantics, including status-code classes, yet it does not dictate how each provider defines a successful webhook delivery. GitHub, for instance, expects your receiver to return a 2xx status and marks a delivery as failed when it gets a 4xx or 5xx response, as noted in its webhook troubleshooting documentation. That delivery result tells you how the HTTP exchange ended. It does not tell you which event rule matched or whether the provider will try another endpoint.
Give Vroni a GitHub issue, bug report, spec, or rough idea. It reads the repo, plans the change, writes code, runs checks, and works toward a review-ready pull request.
Take a look at vroni.com