> For the complete documentation index, see [llms.txt](https://docs.looplookup.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.looplookup.com/lookup-api/bulk-lookup/webhooks.md).

# Callbacks

To start receiving callbacks/webhook events for bulk requests, you need to pass the set-up webhook URL in the [dashboard](https://dashboard.looplookup.com/).&#x20;

Our backend will send POST requests to your server with the JSON body. Your server should return a **200 status code**. Any other status code will be considered a failed webhook delivery. Our service will retry a webhook later (up to 30 times) with an increasing delay until you return a response with a status code 200. The first 10 retries are every 30 seconds, the next 10 retries are every 3 mins, and the last 10 retries are every 15 mins. After 30 retries, we will stop sending notifications.

If you're receiving a callback/webhook, it's important to respond as quickly as possible so you don't accidentally run over a timeout limit - `15 seconds`. We recommend that your apps defer processing until after the response has been sent. It means returning a response with status code 200, and only then starting to process the JSON the service sent you.

{% hint style="info" %}
If, for some reason, a webhook is retried, it will contain the same ID as in the first attempt. You can use `webhook_id` as a unique identifier to avoid cases of double processing of each result.
{% endhint %}

### Response format&#x20;

The JOSN will be the same as in a [single lookup request result](https://docs.looplookup.com/lookup-api/send-message.md#results-example).

### Headers

These headers will be included in any webhook POST request.

<table><thead><tr><th width="342">Key</th><th width="405.01476014760146">Value</th></tr></thead><tbody><tr><td><strong>Content-Type</strong></td><td>application/json</td></tr><tr><td><strong>User-Agent</strong></td><td>LoopServer</td></tr><tr><td><strong>Connection</strong></td><td>close</td></tr></tbody></table>

### Best Practices

#### Authorization

You can configure the authorization header used for webhook requests via the dashboard. Your server should verify the validity of the authorization header for every event. This will help you make sure that a webhook was sent from our service.

{% hint style="warning" %}
**IP Whitelisting**

Right now, the webhook IP range is variable so we don't recommend hardcode IP of our server. To authenticate requests you can add an authorization token to the webhook that you can then verify on your server.
{% endhint %}

#### Response Duration

If your server doesn't finish the response within 15-20s, our backend will disconnect. We then retry up to 30 times. We recommend that apps respond quickly and defer processing until after the response has been sent.

If you use services like `ngrok`, to prevent abuse, the timeout for webhooks will be around 5 seconds.
