Understand how webhooks work
Understand how webhooks work
When using asynchronous requests, the Unlocker API processes jobs in the background.Instead of polling for results, you can configure a webhook. A webhook is an HTTP endpoint that Bright Data calls when your job is completed.The flow looks like this:
- Send async request
- Receive
response_id - Bright Data processes the request
- Bright Data sends a notification to your
webhook_url - Use the
response_idto retrieve the result
Prerequisites
Prerequisites
Send an async request with webhook
Add the
webhook_url parameter to your request:cURL
Replace
<API_KEY>, <unlocker-zone-name>, <webhook-url-id> with your actual values.Receive webhook notification
Once the request is processed, Bright Data sends a POST request to your If you’re using webhook.site, you can inspect the incoming request, including payload fields and headers (e.g.,
webhook_url.user-agent).Retrieve the result using response_id
Use the Then inspect the output:The file will contain the full response, including headers and body.
response_id from the webhook to fetch the actual result:Optional Attach custom data to webhook
You can include custom metadata using The
webhook_data. When using webhook_method as POST, this data will be sent in the request body of the webhook notification.webhook_data field is returned unchanged in the webhook notification. This allows you to attach identifiers such as job IDs or metadata, making it easier to map responses to your internal workflows.