Skip to main content

alerts

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

Overview

Namealerts
TypeResource
Idpagerduty.incidents.alerts

Fields

The following fields are returned by SELECT queries:

The alert requested.

NameDatatypeDescription
idstring
alert_keystringThe alert's de-duplication key.
bodyobjectA JSON object containing data describing the alert. (title: Body)
created_atstring (date-time)The date/time the alert was first triggered.
first_trigger_log_entryobject(opaque JSON object)
html_urlstring (url)a URL at which the entity is uniquely displayed in the Web app
incidentobject(opaque JSON object)
integrationobject(opaque JSON object)
selfstring (url)the API show URL at which the object is accessible
serviceobject(opaque JSON object)
severitystringThe magnitude of the problem as reported by the monitoring tool. (info, warning, error, critical)
statusstringThe current status of the alert. (triggered, 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.
suppressedbooleanWhether or not an alert is suppressed. Suppressed alerts are not created with a parent 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.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectid, alert_idShow detailed information about an alert. Accepts an alert id.<br /><br />An incident represents a problem or an issue that needs to be addressed and resolved.<br /><br />When a service sends an event to PagerDuty, an alert and corresponding incident is triggered in PagerDuty.<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 />
listselectidlimit, offset, total, alert_key, statuses[], sort_by, include[]List alerts for the specified 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.read<br />
updateupdateid, alert_id, alertFromResolve an alert or associate an alert with a new parent incident.<br /><br />An incident represents a problem or an issue that needs to be addressed and resolved.<br /><br />When a service sends an event to PagerDuty, an alert and corresponding incident is triggered in PagerDuty.<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_bulkexecid, alertslimit, offset, total, FromResolve multiple alerts or associate them with different incidents.<br /><br />An incident represents a problem or an issue that needs to be addressed and resolved. An alert represents a digital signal that was emitted to PagerDuty by the monitoring systems that detected or identified the issue.<br /><br />A maximum of 250 alerts may be updated at a time. If more than this number of alerts 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 />

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
alert_idstringThe id of the alert to retrieve.
idstringThe ID of the resource.
Fromstring (email)The email address of a valid user associated with the account making the request.
alert_keystringAlert de-duplication key.
include[]stringArray of additional details to include.
limitintegerThe number of results per page.
offsetintegerOffset to start pagination search results.
sort_bystringUsed to specify both the field you wish to sort the results on (created_at/resolved_at), 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.
statuses[]stringReturn only alerts with the given statuses. (More status codes may be introduced in the future.)
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.

SELECT examples

Show detailed information about an alert. Accepts an alert id.<br /><br />An incident represents a problem or an issue that needs to be addressed and resolved.<br /><br />When a service sends an event to PagerDuty, an alert and corresponding incident is triggered in PagerDuty.<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,
alert_key,
body,
created_at,
first_trigger_log_entry,
html_url,
incident,
integration,
self,
service,
severity,
status,
summary,
suppressed,
type
FROM pagerduty.incidents.alerts
WHERE id = '{{ id }}' -- required
AND alert_id = '{{ alert_id }}' -- required
;

UPDATE examples

Resolve an alert or associate an alert with a new parent incident.<br /><br />An incident represents a problem or an issue that needs to be addressed and resolved.<br /><br />When a service sends an event to PagerDuty, an alert and corresponding incident is triggered in PagerDuty.<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.alerts
SET
alert = '{{ alert }}'
WHERE
id = '{{ id }}' --required
AND alert_id = '{{ alert_id }}' --required
AND alert = '{{ alert }}' --required
AND From = '{{ From}}'
RETURNING
alert;

Lifecycle Methods

Resolve multiple alerts or associate them with different incidents.<br /><br />An incident represents a problem or an issue that needs to be addressed and resolved. An alert represents a digital signal that was emitted to PagerDuty by the monitoring systems that detected or identified the issue.<br /><br />A maximum of 250 alerts may be updated at a time. If more than this number of alerts 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 />

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