Skip to main content

I get different results that I do not understand depending on how I call the api endpoint.


incidents_endpoint = url + f’/incidents?limit=20000’

-> 14 incidents


incidents_endpoint = url + f’/incidents?date_range=all’

-> 9 incidents, different than the first 14


incdents_enpoint = url + f’/incidents?date_range=all&limit=2000’

-> 100 incidents


How can I get all the incidents? (I have over 300, can’t ever seem to get more than 100). Is there some pagination? How does that work?

Hello @owen brand.


Quickly looking at your example queries and results I’m also confused. The REST API queries defaults to incidents for the last 6 months unless you specify since and until dates, or set date_range=all which will get ALL results - I believe this is what you want.



One thing to be aware though is that the query may fail if there are too many results - this limit is not documented so I would recommend you to run different queries for set intervals (e.g. 1 year duration) and work on the results.



Also, the REST APIs include pagination for performance reasons. By default it returns 25 incidents only. If you want to increase that number you can set it in the limit parameter.


You can understand if there are more incidents left to query by looking at the more property in the body of the response. I recommend that you set the total parameter to true to understand how many incidents you have in total and then use the limit and offset to get the results from different “pages”. Go here for details on how to use pagination.


But once again, the examples you show above don’t really make sense to me. And I was unable to reproduce them on my environment. Read the information I sent above and retry it. If you still struggle with getting the results you want let me know.


Another point to add here is, if the reason why you are querying the entire incident dataset is for analytics purposes, then you may want to take a look at the analytics endpoint of the REST API. It has time range constraints which are documented (You can only go back in time on the last three years and you can get the analytics data for all the incidents, services or teams up to one year).


Many thanks for your thorough reply. I am having some success now that I found the pagination mechanism.


Reply