# Pagination problem when export IDR Detection Rules

**URL:** <https://discuss.rapid7.com/t/pagination-problem-when-export-idr-detection-rules/57338>\
**Category:** API\
**Created:** [July 16, 2026, 2:49pm UTC](https://discuss.rapid7.com/t/pagination-problem-when-export-idr-detection-rules/57338 "2026-07-16T14:49:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![craig\_wassel](https://discuss.rapid7.com/letter_avatar_proxy/v4/letter/c/5e9695/32.png) [@craig\_wassel](https://discuss.rapid7.com/u/craig_wassel)\
**Post date:** [July 16, 2026, 2:49pm UTC](https://discuss.rapid7.com/t/pagination-problem-when-export-idr-detection-rules/57338/1 "2026-07-16T14:49:29Z")

</div>

I am trying to get an export of IDR detection rules per the documentation here [[SIEM | © Rapid7](https://docs.rapid7.com/insightidr/api/detection-rules/#tag/Rule-Summary) ] because the web interface method does not export the workflow column.

However, I can’t get past a pagination problem. I only get the first 100 records returned, and in a never-ending loop.

Here is what I have:

_import os_

_import requests_

_import pandas as pd_

_# Configuration_

_API\_KEY = "My\_Org\_Key"_

_BASE\_URL = "[https://us.api.insight.rapid7.com/idr/v1/rules/summary](https://us.api.insight.rapid7.com/idr/v1/rules/summary)"_

_OUTPUT\_DIR = r"My\_Local\_Win\_Path"_

_PAGE\_SIZE = 100_

_# Create output directory if it doesn't exist_

_os.makedirs(OUTPUT\_DIR, exist\_ok=True)_

_headers = {_

```
*"X-Api-Key": API_KEY,*

*"Accept": "application/json"*

```

_}_

_page\_index = 0_

_while True:_

```
*params = {*

    *"item": \["workflows", "name", "PRIORITY_LEVEL"\],*

    *"size": PAGE_SIZE,*

    *"index": page_index*

*}*

*response = requests.get(*

    *BASE_URL,*

    *headers=headers,*

    *params=params*

*)*

*response.raise_for_status()*

*data = response.json()*

*# Adjust this based on the API response structure*

*records = data.get("data", \[\])*

*if not records:*

    *print(f"No more records found at index {page_index}.")*

    *break*

*# Save page to CSV*

*csv_file = os.path.join(*

    *OUTPUT_DIR,*

    *f"rules_summary_page\_{page_index}.csv"*

*)*

*pd.DataFrame(records).to_csv(csv_file, index=False)*

*print(f"Saved {len(records)} records to {csv_file}")*

*# Stop if fewer than PAGE_SIZE records returned*

*if len(records) < PAGE_SIZE:*

    *print("Last page reached.")*

    *break*

*page_index += 1*

```

Thanks,

Cw.

---

<div class="post-metadata">

**Author:** ![craig\_wassel](https://discuss.rapid7.com/letter_avatar_proxy/v4/letter/c/5e9695/32.png) [@craig\_wassel](https://discuss.rapid7.com/u/craig_wassel)\
**Post date:** [July 16, 2026, 9:49pm UTC](https://discuss.rapid7.com/t/pagination-problem-when-export-idr-detection-rules/57338/2 "2026-07-16T21:49:58Z")

</div>

For anyone looking for a possible web interface solution to this here is what I ended up doing. It is a few minutes of effort but works for me since I am only interested in “HIGH” and “CRITICAL” detections and I’ve spent way too many hours trying to get the API approach to work:

1. Navigate to the Rapid7 Detections Library web interface.
2. Open the browser developer tools (F12)
3. Open the "Network" tab
4. Create a filter to search for "rules"
5. Navigate through each page of rules and watch for the .json response to build
6. Open each .json response as it is created and copy/paste the contents to a .json text file.
7. Ask Copilot to create a .csv from the .json file
8. Ask Copilot to only include the following: name,rule action,priority\_level,description,event\_types,workflows

Hopefully someone finds this useful.

Cw.
