POST /analytics/metrics/incidents/services

Provides aggregated metrics for incidents aggregated into units of time by service.

Example metrics include Seconds to Resolve, Seconds to Engage, Snoozed Seconds, and Sleep Hour Interruptions. Metric definitions can be found in our Knowledge Base. Data can be aggregated by day, week or month in addition to by service, or provided just as a collection of aggregates for each service in the dataset for the entire period. If a unit is provided, each row in the returned dataset will include a 'range_start' timestamp.

Note: Analytics data is updated periodically. It takes up to 24 hours before new incidents appear in the Analytics API.

Scoped OAuth requires: analytics.read

Servers

Request headers

Name Type Required Description
Accept String Yes

The Accept header is used as a versioning header.

Default value: "application/vnd.pagerduty+json;version=2"

Content-Type String Yes

Possible values:

  • "application/json"

Default value: "application/json"

Request body fields

Name Type Required Description
filters Object No

Accepts a set of filters to apply to the Incidents before aggregating. Any incidents that do not match the included filters will be omitted from the results.

filters.urgency String No

Any incidents whose urgency does not match the provided string will be omitted from the results.

Possible values:

  • "high"
  • "low"
filters.major Boolean No

A boolean flag including whether results should contain only major incidents, or exclude major incidents. If no value is provided all incidents will be included.

filters.priority_ids[] Array No

An array of priority IDs. Only incidents with these priorities will be included in the results. If omitted, all priorities will be included in the results.

filters.created_at_end String No

Accepts an ISO8601 DateTime string. Any incidents with a created_at greater than or equal to this value will be omitted from the results. The maximum supported time range in conjunction with created_at_start is one year.

filters.escalation_policy_ids[] Array No

An array of escalation policy IDs. Only incidents related to these escalation policies will be included in the results. If omitted, all escalation policies the requestor has access to will be included in the results.

filters.service_ids[] Array No

An array of service IDs. Only incidents related to these services will be included in the results. If omitted, all services the requestor has access to will be included in the results.

filters.min_ackowledgements Integer No

An integer that sets the requirement for the minimum number of acknowledgements to occur on an incident. For example, setting this to 1 will return only incidents that have at least 1 acknowledgement. If no value is provided, all incidents will be included.

filters.min_timeout_escalations Integer No

An integer that sets the requirement for the minimum number of timeout escalations to occur on an incident. For example, setting this to 1 will return only incidents that have at least 1 timeout escalation. If no value is provided, all incidents will be included.

filters.pd_advance_used Boolean No

If true, only incidents where PD Advance was used will be included in the results, and vice versa. If omitted, all incidents will be included.

filters.team_ids[] Array No

An array of team IDs. Only incidents related to these teams will be included in the results. If omitted, all teams the requestor has access to will be included in the results.

filters.created_at_start String No

Accepts an ISO8601 DateTime string. Any incidents with a created_at less than this value will be omitted from the results. The maximum supported time range in conjunction with created_at_end is one year.

filters.priority_names[] Array No

An array of user-defined priority names. Only incidents with these priorities will be included in the results. If omitted, all priorities will be included in the results.

filters.min_manual_escalations Integer No

An integer that sets the requirement for the minimum number of manual escalations to occur on an incident. For example, setting this to 1 will return only incidents that have at least 1 manual escalation. If no value is provided, all incidents will be included.

time_zone String No

The time zone to use for the results and grouping. Must be in tzdata format. See list of accepted values here.

order String No

The order in which the results were sorted; asc for ascending, desc for descending.

Possible values:

  • "desc"
  • "asc"
aggregate_unit String No

The time unit to aggregate metrics by. If no value is provided, the metrics will be aggregated for the entire period.

Possible values:

  • "month"
  • "day"
  • "week"
order_by String No

The column that was used for ordering the results.

How to start integrating

  1. Add HTTP Task to your workflow definition.
  2. Search for the API you want to integrate with and click on the name.
    • This loads the API reference documentation and prepares the Http request settings.
  3. Click Test request to test run your request to the API and see the API's response.