Query incidents for a given escalation policy

Hello

I want to query incidents already created for a given escalation policy using API. When I submit a query as

curl --request POST --url https://api.pagerduty.com/analytics/metrics/incidents/all --header ‘accept: application/vnd.pagerduty+json;version=2’ --header ‘authorization: Token token=zzzz’ --header ‘content-type: application/json’ --header ‘x-early-access: analytics-v2’ --data ‘{“filters”:{“created_at_start”:“2020-12-01T00:00:00-05:00”,“created_at_end”:“2020-12-20T00:00:00Z”,“escalation_policy”:“yyyyy”}}’

I get an error as

{“error”:“filters.invalid_parameter_key: escalation_policy”}

Please let me what is the correct field name to use for escalation policy.

Regards
John

When I removed the escalation policy from the list, it returned metrics such as, how many incidents were created in this time intervals.

What is the API to query list of incidents created during this time interval and for a given escalation policy ?

I am looking for following fields:

incident ID
summary
created at
acknowledged at
resolved at
acknowledged by
resolved by
status
severity
service

Regards
John

Hello John,

Thanks for reaching out on our community page. Can you write in directly to the support team on support@pagerduty.com with the EP ID and the last 4 digits of the API key you are using? We will take it privately from there.

John

You’ll want to use the main /incidents API to get this kind of data.