Handling webhooks
A Webhook event is considered successfully delivered when the corresponding URL endpoint responds with an HTTP status code of 200 within 5 seconds. If the criteria is not met, Method will reattempt 4 more times with each new attempt being delayed according to an exponential backoff algorithm, where the delay period between each attempt exponentially increases.Automatic disabling
Method will automatically disable a Webhook under either of the following conditions:- Consecutive failures: If a Webhook delivery fails 5 times consecutively (after all retry attempts), the Webhook will be disabled.
- High failure rate: If 40% or more of Webhook deliveries fail within a rolling 24-hour period, the Webhook will be disabled.
status will be set to disabled and an error will be
set on the Webhook object with details about the failure. No further events will be
delivered until the Webhook is reactivated.
To reactivate a disabled Webhook, use the Update a Webhook
endpoint to set its status back to active. Before reactivating, ensure the underlying
issue has been resolved to prevent the Webhook from being disabled again.
Authentication
Webhook Request Validation
Webhook Request Validation
We use the
auth_token and hmac_secret you provide to enable webhook authentication.
There are 2 ways to authenticate an incoming request.2. HMAC Verification
2. HMAC Verification
If you provide an The timestamp is always included in the
hmac_secret when registering your webhook, Method will include a method-webhook-signature header in every request. This is an HMAC-SHA256 digest created using the hmac_secret as the shared secret, and computed over the string timestamp:payload, where timestamp is the value from the method-webhook-timestamp (UNIX timestamp in seconds) header (which is always included, even if no hmac_secret is provided) and payload is the raw request body.
Checking for the timestamp freshness (5 min window) is optional, but recommended.method-webhook-timestamp header, even if no hmac_secret is provided.Example: Minimal Express Server for Verifying Webhooks
Example: Minimal Express Server for Verifying Webhooks