alerts
Creates, updates, deletes, gets or lists an alerts resource.
Overview
| Name | alerts |
| Type | Resource |
| Id | pagerduty.incidents.alerts |
Fields
The following fields are returned by SELECT queries:
- get
- list
The alert requested.
| Name | Datatype | Description |
|---|---|---|
id | string | |
alert_key | string | The alert's de-duplication key. |
body | object | A JSON object containing data describing the alert. (title: Body) |
created_at | string (date-time) | The date/time the alert was first triggered. |
first_trigger_log_entry | object | (opaque JSON object) |
html_url | string (url) | a URL at which the entity is uniquely displayed in the Web app |
incident | object | (opaque JSON object) |
integration | object | (opaque JSON object) |
self | string (url) | the API show URL at which the object is accessible |
service | object | (opaque JSON object) |
severity | string | The magnitude of the problem as reported by the monitoring tool. (info, warning, error, critical) |
status | string | The current status of the alert. (triggered, resolved) |
summary | string | A 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. |
suppressed | boolean | Whether or not an alert is suppressed. Suppressed alerts are not created with a parent incident. |
type | string | A 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. |
A paginated array of the incident's alerts.
| Name | Datatype | Description |
|---|---|---|
id | string | |
alert_key | string | The alert's de-duplication key. |
body | object | A JSON object containing data describing the alert. (title: Body) |
created_at | string (date-time) | The date/time the alert was first triggered. |
first_trigger_log_entry | object | (opaque JSON object) |
html_url | string (url) | a URL at which the entity is uniquely displayed in the Web app |
incident | object | (opaque JSON object) |
integration | object | (opaque JSON object) |
self | string (url) | the API show URL at which the object is accessible |
service | object | (opaque JSON object) |
severity | string | The magnitude of the problem as reported by the monitoring tool. (info, warning, error, critical) |
status | string | The current status of the alert. (triggered, resolved) |
summary | string | A 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. |
suppressed | boolean | Whether or not an alert is suppressed. Suppressed alerts are not created with a parent incident. |
type | string | A 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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | id, alert_id | 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 /> | |
list | select | id | limit, 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 /> |
update | update | id, alert_id, alert | From | 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_bulk | exec | id, alerts | limit, offset, total, From | 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 /> |
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.
| Name | Datatype | Description |
|---|---|---|
alert_id | string | The id of the alert to retrieve. |
id | string | The ID of the resource. |
From | string (email) | The email address of a valid user associated with the account making the request. |
alert_key | string | Alert de-duplication key. |
include[] | string | Array of additional details to include. |
limit | integer | The number of results per page. |
offset | integer | Offset to start pagination search results. |
sort_by | string | Used 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[] | string | Return only alerts with the given statuses. (More status codes may be introduced in the future.) |
total | boolean | By 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
- get
- list
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
;
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 />
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 limit = '{{ limit }}'
AND offset = '{{ offset }}'
AND total = '{{ total }}'
AND alert_key = '{{ alert_key }}'
AND statuses[] = '{{ statuses[] }}'
AND sort_by = '{{ sort_by }}'
AND include[] = '{{ include[] }}'
;
UPDATE examples
- update
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
- update_bulk
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 }}"
}'
;