Skip to main content

incidents

Creates, updates, deletes, gets or lists an incidents resource.

Overview

Nameincidents
TypeResource
Idpagerduty.incidents.incidents

Fields

The following fields are returned by SELECT queries:

The incident requested.

NameDatatypeDescription
idstring
acknowledgementsarrayList of all acknowledgements for this incident. This list will be empty if the Incident.status is resolved or triggered. If the include[]=acknowledgers query parameter is provided, the full user or service definitions will be returned for each acknowledgement entry.
alert_countsobject
alert_groupingobjectDescribes the alert grouping state of this incident. Will be null if the incident has no alerts.
assigned_viastringHow the current incident assignments were decided. Note that direct_assignment incidents will not escalate up the attached escalation_policy (escalation_policy, direct_assignment)
assignmentsarrayList of all assignments for this incident. This list will be empty if the Incident.status is resolved. Returns a user reference for each assignment. Full user definitions will be returned if the include[]=assignees query parameter is provided.
bodyobjectThe additional incident body details. Only returned if the include[]=body query parameter is provided.
conference_bridgeobjectThe conference bridge information attached to the incident. Only returned if the include[]=conference_bridge query parameter is provided.
created_atstring (date-time)The time the incident was first triggered. (example: 2019-12-01T20:00:00Z)
escalation_policyThe escalation policy attached to the service that the incident is on. If the include[]=escalation_policies query parameter is provided, the full escalation policy definition will be returned.
first_trigger_log_entryThe first log entry on the incident. The log entry will be of type TriggerLogEntry and will represent information about how the incident was triggered. If the include[]=first_trigger_log_entries query parameter is provided, the full log entry definition will be returned.
html_urlstring (url)a URL at which the entity is uniquely displayed in the Web app
incident_keystringThe incident's de-duplication key.
incident_numberintegerThe number of the incident. This is unique across your account.
incident_typeobjectThe incident type of the incident.
incidents_respondersarrayThe responders on the incident. Only returned if the account has access to the [responder requests](https:​//support.pagerduty.com/docs/add-responders) feature.
is_mergeablebooleanWhether the incident is mergeable. Only incidents that have alerts, or that are manually created can be merged.
last_status_change_atstring (date-time)The time the status of the incident last changed. If the incident is not currently acknowledged or resolved, this will be the incident's updated_at. (example: 2019-12-01T21:01:00Z)
last_status_change_byThe entity that last changed the status of the incident. If the include[]=agents query parameter is provided, the full user/service/integration definition will be returned.
pending_actionsarrayThe list of pending_actions on the incident. A pending_action object contains a type of action which can be escalate, unacknowledge, resolve or urgency_change. A pending_action object contains at, the time at which the action will take place. An urgency_change pending_action will contain to, the urgency that the incident will change to.
priorityobject
resolve_reasonobject
resolved_atstring (date-time)The time the incident became "resolved" or null if the incident is not resolved. (example: 2019-12-01T21:01:00Z)
responder_requestsarrayPrevious responder requests made on this incident. Only returned if the account has access to the [responder requests](https:​//support.pagerduty.com/docs/add-responders) feature.
selfstring (url)the API show URL at which the object is accessible
serviceThe service the incident is on. If the include[]=services query parameter is provided, the full service definition will be returned.
statusstringThe current status of the incident. (triggered, acknowledged, resolved)
summarystringA short-form, server-generated string that provides succinct, important information about an object suitable for primary labeling of an entity in a client. In many cases, this will be identical to name, though it is not intended to be an identifier.
teamsarrayThe teams involved in the incident’s lifecycle. If the include[]=teams query parameter is provided, the full team definitions will be returned.
titlestringA succinct description of the nature, symptoms, cause, or effect of the incident.
typestringA string that determines the schema of the object. This must be the standard name for the entity, suffixed by _reference if the object is a reference.
updated_atstring (date-time)The time the incident was last modified. (example: 2019-12-01T21:02:00Z)
urgencystringThe current urgency of the incident. (high, low)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectidinclude[]Show detailed information about an incident. Accepts either an incident id, or an incident number.<br /><br />An incident represents a problem or an issue that needs to be addressed and resolved.<br /><br />For more information see the [API Concepts Document](https:​//developer.pagerduty.com/api-reference/a47605517c19a-api-concepts#incidents)<br /><br />Scoped OAuth requires: incidents.read<br />
listselectlimit, offset, total, date_range, incident_key, service_ids[], team_ids[], user_ids[], urgencies[], time_zone, statuses[], sort_by, include[], since, untilList existing incidents.<br /><br />An incident represents a problem or an issue that needs to be addressed and resolved.<br /><br />For more information see the [API Concepts Document](https:​//developer.pagerduty.com/api-reference/a47605517c19a-api-concepts#incidents)<br /><br />Scoped OAuth requires: incidents.read<br />
createinsertincidentFromCreate an incident synchronously without a corresponding event from a monitoring service.<br /><br />An incident represents a problem or an issue that needs to be addressed and resolved.<br /><br />For more information see the [API Concepts Document](https:​//developer.pagerduty.com/api-reference/a47605517c19a-api-concepts#incidents)<br /><br />Scoped OAuth requires: incidents.write<br /><br />This API operation has operation specific rate limits. See the [Rate Limits](https:​//developer.pagerduty.com/docs/72d3b724589e3-rest-api-rate-limits) page for more information.<br />
updateupdateid, incidentFromAcknowledge, resolve, escalate or reassign an incident.<br /><br />An incident represents a problem or an issue that needs to be addressed and resolved.<br /><br />For more information see the [API Concepts Document](https:​//developer.pagerduty.com/api-reference/a47605517c19a-api-concepts#incidents)<br /><br />Scoped OAuth requires: incidents.write<br />
update_bulkexecincidentslimit, offset, total, FromAcknowledge, resolve, escalate or reassign one or more incidents.<br /><br />An incident represents a problem or an issue that needs to be addressed and resolved.<br /><br />A maximum of 250 incidents may be updated at a time. If more than this number of incidents are given, the API will respond with status 413 (Request Entity Too Large).<br /><br />For more information see the [API Concepts Document](https:​//developer.pagerduty.com/api-reference/a47605517c19a-api-concepts#incidents)<br /><br />Scoped OAuth requires: incidents.write<br /><br />This API operation has operation specific rate limits. See the [Rate Limits](https:​//developer.pagerduty.com/docs/72d3b724589e3-rest-api-rate-limits) page for more information.<br />
mergeexecid, source_incidentsFromMerge a list of source incidents into the target [incident](https:​//developer.pagerduty.com/api-reference/a47605517c19a-api-concepts#incidents).<br /><br />After the merge is performed the target incident will contain the source incidents' [alerts](https:​//developer.pagerduty.com/api-reference/a47605517c19a-api-concepts#alerts),<br />and the source incidents will be resolved.<br /><br />Only incidents that have alerts or incidents that were created manually in the UI can be merged.<br /><br />Open incidents cannot be merged into a resolved incident. The target incident must be open.<br /><br />An incident cannot have more than 1000 alerts. The server will return an error if merging the source incidents<br />will result in the target incident having more than 1000 alerts.<br /><br />Scoped OAuth requires: incidents.write<br />
snoozeexecidFromSnooze an incident.<br /><br />An incident represents a problem or an issue that needs to be addressed and resolved.<br /><br />For more information see the [API Concepts Document](https:​//developer.pagerduty.com/api-reference/a47605517c19a-api-concepts#incidents)<br /><br />Scoped OAuth requires: incidents.write<br /><br /><br />StackQL: call this method with the raw JSON body, for example EXEC incidents.incidents.snooze @id = '...' @@json='&#123;"duration": &lt;integer&gt;&#125;' - the duration attribute is integer-typed, which the EXEC parameter form does not accept.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
idstringThe ID of the resource.
Fromstring (email)The email address of a valid user associated with the account making the request.
date_rangestringWhen set to all, the since and until parameters and defaults are ignored.
incident_keystringIncident de-duplication key. Incidents with child alerts do not have an incident key; querying by incident key will return incidents whose alerts have alert_key matching the given incident key.
include[]stringArray of additional details to include.
limitintegerThe number of results per page.
offsetintegerOffset to start pagination search results.
service_ids[]arrayReturns only the incidents associated with the passed service(s). This expects one or more service IDs.
sincestringThe start of the date range over which you want to search. Maximum range is 6 months and default is 1 month.
sort_byarrayUsed to specify both the field you wish to sort the results on (incident_number/created_at/resolved_at/urgency), as well as the direction (asc/desc) of the results. The sort_by field and direction should be separated by a colon. A maximum of two fields can be included, separated by a comma. Sort direction defaults to ascending. The account must have the urgencies ability to sort by the urgency.
statuses[]stringReturn only incidents with the given statuses. To query multiple statuses, pass statuses&#91;&#93; more than once, for example: https:​//api.pagerduty.com/incidents?statuses&#91;&#93;=triggered&statuses[&#93;=acknowledged. (More status codes may be introduced in the future.)
team_ids[]arrayAn array of team IDs. Only results related to these teams will be returned. Account must have the teams ability to use this parameter.
time_zonestring (tzinfo)Time zone used to render timestamps and to interpret since/until values before filtering. Rendering defaults to UTC if omitted. since/until default to the account's time zone if omitted.
totalbooleanBy default the total field in pagination responses is set to null to provide the fastest possible response times. Set total to true for this field to be populated. See our [Pagination Docs](https:​//developer.pagerduty.com/docs/rest-api-v2/pagination/) for more information.
untilstringThe end of the date range over which you want to search. Maximum range is 6 months and default is 1 month.
urgencies[]stringArray of the urgencies of the incidents to be returned. Defaults to all urgencies. Account must have the urgencies ability to do this.
user_ids[]arrayReturns only the incidents currently assigned to the passed user(s). This expects one or more user IDs. Note: When using the assigned_to_user filter, you will only receive incidents with statuses of triggered or acknowledged. This is because resolved incidents are not assigned to any user.

SELECT examples

Show detailed information about an incident. Accepts either an incident id, or an incident number.<br /><br />An incident represents a problem or an issue that needs to be addressed and resolved.<br /><br />For more information see the [API Concepts Document](https:​//developer.pagerduty.com/api-reference/a47605517c19a-api-concepts#incidents)<br /><br />Scoped OAuth requires: incidents.read<br />

SELECT
id,
acknowledgements,
alert_counts,
alert_grouping,
assigned_via,
assignments,
body,
conference_bridge,
created_at,
escalation_policy,
first_trigger_log_entry,
html_url,
incident_key,
incident_number,
incident_type,
incidents_responders,
is_mergeable,
last_status_change_at,
last_status_change_by,
pending_actions,
priority,
resolve_reason,
resolved_at,
responder_requests,
self,
service,
status,
summary,
teams,
title,
type,
updated_at,
urgency
FROM pagerduty.incidents.incidents
WHERE id = '{{ id }}' -- required
AND include[] = '{{ include[] }}'
;

INSERT examples

Create an incident synchronously without a corresponding event from a monitoring service.<br /><br />An incident represents a problem or an issue that needs to be addressed and resolved.<br /><br />For more information see the [API Concepts Document](https:​//developer.pagerduty.com/api-reference/a47605517c19a-api-concepts#incidents)<br /><br />Scoped OAuth requires: incidents.write<br /><br />This API operation has operation specific rate limits. See the [Rate Limits](https:​//developer.pagerduty.com/docs/72d3b724589e3-rest-api-rate-limits) page for more information.<br />

INSERT INTO pagerduty.incidents.incidents (
incident,
"From"
)
SELECT
'{{ incident }}' /* required */,
'{{ From }}'
RETURNING
incident
;

UPDATE examples

Acknowledge, resolve, escalate or reassign an incident.<br /><br />An incident represents a problem or an issue that needs to be addressed and resolved.<br /><br />For more information see the [API Concepts Document](https:​//developer.pagerduty.com/api-reference/a47605517c19a-api-concepts#incidents)<br /><br />Scoped OAuth requires: incidents.write<br />

UPDATE pagerduty.incidents.incidents
SET
incident = '{{ incident }}'
WHERE
id = '{{ id }}' --required
AND incident = '{{ incident }}' --required
AND From = '{{ From}}'
RETURNING
incident;

Lifecycle Methods

Acknowledge, resolve, escalate or reassign one or more incidents.<br /><br />An incident represents a problem or an issue that needs to be addressed and resolved.<br /><br />A maximum of 250 incidents may be updated at a time. If more than this number of incidents are given, the API will respond with status 413 (Request Entity Too Large).<br /><br />For more information see the [API Concepts Document](https:​//developer.pagerduty.com/api-reference/a47605517c19a-api-concepts#incidents)<br /><br />Scoped OAuth requires: incidents.write<br /><br />This API operation has operation specific rate limits. See the [Rate Limits](https:​//developer.pagerduty.com/docs/72d3b724589e3-rest-api-rate-limits) page for more information.<br />

EXEC pagerduty.incidents.incidents.update_bulk
@limit='{{ limit }}',
@offset='{{ offset }}',
@total={{ total }},
@From='{{ From }}'
@@json=
'{
"incidents": "{{ incidents }}"
}'
;