---
title: Webhook
slug: rainforestapi/collections-api/collections/webhook
docTags: 
createdAt: 2024-07-30T12:48:41.125Z
---

# Webhook

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

:::hint{type="info"}
Note that if no Webhook URL is supplied in the Collection's `notification_webhook` property Rainforest API will fallback to using the Webhook URL defined on your account [profile](https://app.rainforestapi.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 Collection 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 Collection 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": "collection_resultset_completed"
  },
  "collection": {
    "id": "9E867FAA",
    "name": "My Second Collection"
  },
  "result_set": {
    "id": 4,
    "started_at": "2020-01-01T00:00:00.000Z",
    "ended_at": "2020-01-01T00:00:10.000Z",
    "requests_completed": 1,
    "requests_failed": 0,
    "download_links": {
      "json": {
        "pages": [
          "https://results.rainforestapi.com/Collection_Results_9E867FAA_4_Page_1.json"
        ],
        "all_pages": "https://results.rainforestapi.com/Collection_Results_9E867FAA_4_All_Pages.zip"
      },
      "csv": {
        "pages": [
          "https://results.rainforestapi.com/Collection_Results_9E867FAA_4_Page_1_246f6e2e561c90958384aa76e455e2bc95ad3a01.csv"
        ],
        "all_pages": "https://results.rainforestapi.com/Collection_Results_9E867FAA_4_All_Pages_246f6e2e561c90958384aa76e455e2bc95ad3a01.csv"
      }
    }
  }
}
```

***

**Next Steps**
     [List Requests](https://docs.trajectdata.com/rainforestapi/collections-api/requests/list)
     [List Result Sets](https://docs.trajectdata.com/rainforestapi/collections-api/results/list)
     [Resending a Webhook](https://docs.trajectdata.com/rainforestapi/collections-api/results/resend-webhook)
