Implement webhooks
Most Middesk operations are asynchronous: for example, business verification continues after the initial API request. Webhooks allow you to receive notifications when important activity occurs, such as:
- Business verification status changes (for example, from
pendingtoin_review) - New information is discovered through ongoing monitoring
- Order or Monitor updates occur
Without webhooks, you need to poll the API repeatedly to check for changes. Webhooks eliminate this overhead and ensure you never miss important events.
Register a webhook endpoint
To receive webhooks, provide Middesk with a URL endpoint that accepts HTTP POST requests.
You can register webhook URLs in two ways:
- Use the API through the Webhooks API to create and manage endpoints programmatically
- Use the Dashboard under Settings > Webhooks
Note that you must create separate webhook endpoints for sandbox and Production requests.
The webhook endpoint has two requirements:
- It must be a publicly available URL (see the IP lists below to restrict access to only Middesk).
- The endpoint must return a
2xxstatus code to indicate receipt of the webhook notification.
Webhook payload structure
Middesk sends webhooks as HTTP POST requests with an Event object in the request body.
Each Event object includes:
The X-Correlation-Id header contains the external_id if one was provided, otherwise it contains the primary object ID. This allows easy mapping when only headers are available.
Event types
Middesk sends webhook notifications for the following event types:
Core events
Monitor events
When you monitor specific event types, Middesk sends webhooks for these events:
Retry behavior
If a webhook delivery fails, Middesk automatically retries up to 10 times over approximately 3 days:
- Initial delivery attempt.
- If failed, retry after 1-30 seconds.
- Subsequent retries use exponential backoff.
- Final retry occurs ~3 days after the initial attempt.
A delivery is considered successful when your endpoint returns a 2xx HTTP status code.
Webhook IP addresses
Middesk sends webhook requests from these IP addresses:
35.239.59.10235.192.63.74104.198.38.1
Use these addresses to configure firewall rules or IP allowlists for your webhook endpoint.
Webhooks and Policies
If Policies is enabled, Middesk doesn’t send business.updated notifications when the business enters the in_review stage. Instead, Middesk sends a business.updated webhook with the relevant result only after evaluating the Policy rules.
The following are the various status values that a Business can have with Policies enabled: