Skip to main content

Hello,

 

We are currently working on enhancing our incident management automation where we are trying to fetch all the open incidents available in the service however, I could see that the api is returning only the last 30 days of open incidents. We are using the api https://api.pagerduty.com/incidents.

 

Any suggestions how we can retrieve open incidents beyond 30 days.

 

Thanks in advance.

 

Regards,

Jagadish

Hey ​@Jagadish,

By default, the API only returns incidents from the last 30 days if you don’t specify any time range.

A couple of things to keep in mind that can help you fetch this data:

  • If you add the statusesu] parameter and set it to triggered and/or acknowledged, the API will return all incidents that are currently open.
  • The API paginates results, so you’ll get up to 100 incidents per page. Use the offset and limit parameters to page through all results if you have a lot of open incidents.
  • If you do want to filter by creation date, the API only allows a maximum window of 6 months between since and until. But for just getting all open incidents, you can leave those parameters out.

Make sure to take a look at the list incidents documentation that covers this setup and more. Let me know if you have any other questions or if you run into any issues with the API!

Have a nice day!


Reply