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.
alert_countsobject
assigned_viastringHow the current incident assignments were decided. Note that direct_assignment incidents will not escalate up the attached escalation_policy
assignmentsarrayList of all assignments for this incident. This list will be empty if the Incident.status is resolved.
bodyobject
conference_bridgeobject
created_atstring (date-time)The date/time the incident was first triggered.
escalation_policyobject
first_trigger_log_entryobject
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.
incidents_respondersarray
last_status_change_atstring (date-time)The time at which the status of the incident last changed.
last_status_change_byobjectThe agent (user, service or integration) that created or modified the Incident Log Entry.
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
responder_requestsarray
selfstring (url)the API show URL at which the object is accessible
serviceobject
statusstringThe current status of the incident.
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.
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.
urgencystringThe current urgency of the incident.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_incidentselectid, X-EARLY-ACCESSAccept, Content-Type, include[]Show detailed information about an incident. Accepts either an incident id, or an incident number.

An incident represents a problem or an issue that needs to be addressed and resolved.

For more information see the API Concepts Document

<!-- theme: warning -->
> ### Early Access
> The include[]=field_values part of this endpoint is in Early Access and may change at any time. You must pass in the X-EARLY-ACCESS header to access it.

Scoped OAuth requires: incidents.read
list_incidentsselectAccept, Content-Type, limit, offset, total, date_range, incident_key, service_ids[], team_ids[], user_ids[], urgencies[], time_zone, statuses[], sort_by, include[], since, untilList existing incidents.

An incident represents a problem or an issue that needs to be addressed and resolved.

For more information see the API Concepts Document

Scoped OAuth requires: incidents.read
create_incidentinsertFrom, data__incidentAccept, Content-TypeCreate an incident synchronously without a corresponding event from a monitoring service.

An incident represents a problem or an issue that needs to be addressed and resolved.

For more information see the API Concepts Document

Scoped OAuth requires: incidents.write
_list_incidentsexecAccept, Content-Type, limit, offset, total, date_range, incident_key, service_ids[], team_ids[], user_ids[], urgencies[], time_zone, statuses[], sort_by, include[], since, untilList existing incidents.

An incident represents a problem or an issue that needs to be addressed and resolved.

For more information see the API Concepts Document

Scoped OAuth requires: incidents.read
update_incidentsexecFrom, incidentsAccept, Content-Type, limit, offset, totalAcknowledge, resolve, escalate or reassign one or more incidents.

An incident represents a problem or an issue that needs to be addressed and resolved.

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).

Note: the manage incidents API endpoint is rate limited to 500 requests per minute.

For more information see the API Concepts Document

Scoped OAuth requires: incidents.write
_get_incidentexecid, X-EARLY-ACCESSAccept, Content-Type, include[]Show detailed information about an incident. Accepts either an incident id, or an incident number.

An incident represents a problem or an issue that needs to be addressed and resolved.

For more information see the API Concepts Document

<!-- theme: warning -->
> ### Early Access
> The include[]=field_values part of this endpoint is in Early Access and may change at any time. You must pass in the X-EARLY-ACCESS header to access it.

Scoped OAuth requires: incidents.read
update_incidentexecid, From, incidentAccept, Content-TypeAcknowledge, resolve, escalate or reassign an incident.

An incident represents a problem or an issue that needs to be addressed and resolved.

For more information see the API Concepts Document

Scoped OAuth requires: incidents.write
merge_incidentsexecid, From, source_incidentsAccept, Content-TypeMerge a list of source incidents into this incident.

An incident represents a problem or an issue that needs to be addressed and resolved.

For more information see the API Concepts Document

Scoped OAuth requires: incidents.write
create_incident_responder_requestexecid, From, requester_id, message, responder_request_targetsAccept, Content-TypeSend a new responder request for the specified incident.

An incident represents a problem or an issue that needs to be addressed and resolved.

For more information see the API Concepts Document

Scoped OAuth requires: incidents.write
create_incident_snoozeexecid, From, durationAccept, Content-TypeSnooze an incident.

An incident represents a problem or an issue that needs to be addressed and resolved.

For more information see the API Concepts Document

Scoped OAuth requires: incidents.write
create_incident_status_updateexecid, From, messageAccept, Content-TypeCreate a new status update for the specified incident. Optionally pass subject and html_message properties in the request body to override the email notification that gets sent.

An incident represents a problem or an issue that needs to be addressed and resolved.

For more information see the API Concepts Document

Scoped OAuth requires: incidents.write
remove_incident_notification_subscribersexecid, subscribersAcceptUnsubscribes the matching Subscribers from Incident Status Update Notifications.

Scoped OAuth requires: subscribers.write

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
Fromstring (email)The email address of a valid user associated with the account making the request.
X-EARLY-ACCESSstringThis header indicates that this API endpoint is UNDER CONSTRUCTION and may change at any time. You MUST pass in this header and the above value. Do not use this endpoint in production, as it may change!
idstringThe ID of the resource.
AcceptstringThe Accept header is used as a versioning header.
Content-Typestring
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[] more than once, for example: https://api.pagerduty.com/incidents?statuses[]=triggered&statuses[]=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 in which dates in the result will be rendered.
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 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.

An incident represents a problem or an issue that needs to be addressed and resolved.

For more information see the API Concepts Document

<!-- theme: warning -->
> ### Early Access
> The include[]=field_values part of this endpoint is in Early Access and may change at any time. You must pass in the X-EARLY-ACCESS header to access it.

Scoped OAuth requires: incidents.read

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

INSERT examples

Create an incident synchronously without a corresponding event from a monitoring service.

An incident represents a problem or an issue that needs to be addressed and resolved.

For more information see the API Concepts Document

Scoped OAuth requires: incidents.write

INSERT INTO pagerduty.incidents.incidents (
data__incident,
From,
Accept,
Content-Type
)
SELECT
'{{ incident }}' /* required */,
'{{ From }}',
'{{ Accept }}',
'{{ Content-Type }}'
RETURNING
incident
;

Lifecycle Methods

List existing incidents.

An incident represents a problem or an issue that needs to be addressed and resolved.

For more information see the API Concepts Document

Scoped OAuth requires: incidents.read

EXEC pagerduty.incidents.incidents._list_incidents 
@Accept='{{ Accept }}',
@Content-Type='{{ Content-Type }}',
@limit='{{ limit }}',
@offset='{{ offset }}',
@total={{ total }},
@date_range='{{ date_range }}',
@incident_key='{{ incident_key }}',
@service_ids[]='{{ service_ids[] }}',
@team_ids[]='{{ team_ids[] }}',
@user_ids[]='{{ user_ids[] }}',
@urgencies[]='{{ urgencies[] }}',
@time_zone='{{ time_zone }}',
@statuses[]='{{ statuses[] }}',
@sort_by='{{ sort_by }}',
@include[]='{{ include[] }}',
@since='{{ since }}',
@until='{{ until }}'
;