---
title: Webhook
slug: valueserp/batches-api/batches/webhook
docTags: 
createdAt: 2024-08-03T11:00:15.050Z
---

# Webhook

When a Batch has its `notification_webhook` property set VALUE SERP will make an `HTTP POST` to this URL when the Batch completes and a new [Result Set](https://docs.trajectdata.com/valueserp/batches-api/results/list) is available.

:::hint{type="info"}
Note that if no Webhook URL is supplied in the Batch's `notification_webhook` property VALUE SERP will fallback to using the Webhook URL defined on your account [profile](https://app.valueserp.com/profile).
:::

:::hint{type="info"}
Note that the webhook has a timeout of 5 seconds, your app should ingest the webhook HTTP POST within this timeout. If your app takes longer than 5 seconds to respond the API will terminate the HTTP POST. If a timeout or error occurs, we will retry up to 5 times with exponential backoff (increasing delays between each attempt). If all 5 attempts fail, we will send an email notification of the failure (up to one per 24 hours).
:::

The body of the Webhook `POST` contains details of the Batch along with download links for the Result Set. Note that the presence of the `json` and `csv` download links in the response JSON depends on whether the Batch has the  `notification_as_json` ,  `notification_as_jsonlines`  and  `notification_as_csv` properties set.

Here's an example of the body of the Webhook  `POST` :

```json
{
  "request_info": {
    "success": true,
    "type": "batch_resultset_completed"
  },
  "batch": {
    "id": "9E867FAA",
    "name": "My Second Batch"
  },
  "result_set": {
    "id": 4,
    "started_at": "2020-01-01T00:00:00.000Z",
    "ended_at": "2020-01-01T00:00:10.000Z",
    "searches_completed": 1,
    "searches_failed": 0,
    "download_links": {
      "json": {
        "pages": [
          "https://results.valueserp.com/Batch_Results_9E867FAA_4_Page_1.json"
        ],
        "all_pages": "https://results.valueserp.com/Batch_Results_9E867FAA_4_All_Pages.zip"
      },
      "csv": {
        "pages": [
          "https://results.valueserp.com/Batch_Results_9E867FAA_4_Page_1_246f6e2e561c90958384aa76e455e2bc95ad3a01.csv"
        ],
        "all_pages": "https://results.valueserp.com/Batch_Results_9E867FAA_4_All_Pages_246f6e2e561c90958384aa76e455e2bc95ad3a01.csv"
      }
    }
  }
}
```

***

**Next Steps**
     [List Searches](https://docs.trajectdata.com/valueserp/batches-api/searches/list)
     [List Result Sets](https://docs.trajectdata.com/valueserp/batches-api/results/list)
     [Resending a Webhook](https://docs.trajectdata.com/valueserp/batches-api/results/resend-webhook)
