Skip to main content

notification_rules

Creates, updates, deletes, gets or lists a notification_rules resource.

Overview

Namenotification_rules
TypeResource
Idpagerduty.users.notification_rules

Fields

The following fields are returned by SELECT queries:

The user's notification rule requested.

NameDatatypeDescription
idstring
contact_methodobject(opaque JSON object)
html_urlstring (url)a URL at which the entity is uniquely displayed in the Web app
selfstring (url)the API show URL at which the object is accessible
start_delay_in_minutesintegerThe delay before firing the rule, in minutes.
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.
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.
urgencystringWhich incident urgency this rule is used for. Account must have the urgencies ability to have a low urgency notification rule. (high, low)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectid, notification_rule_idinclude[]Get details about a user's notification rule.<br /><br />Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account.<br /><br />For more information see the [API Concepts Document](https:​//developer.pagerduty.com/api-reference/a47605517c19a-api-concepts#users)<br /><br />Scoped OAuth requires: users:contact_methods.read<br />
listselectidinclude[], urgencyList notification rules of your PagerDuty user.<br /><br />Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account.<br /><br />For more information see the [API Concepts Document](https:​//developer.pagerduty.com/api-reference/a47605517c19a-api-concepts#users)<br /><br />Scoped OAuth requires: users:contact_methods.read<br />
createinsertid, notification_ruleCreate a new notification rule.<br /><br />Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account.<br /><br />For more information see the [API Concepts Document](https:​//developer.pagerduty.com/api-reference/a47605517c19a-api-concepts#users)<br /><br />Scoped OAuth requires: users:contact_methods.write<br />
updateupdateid, notification_rule_id, notification_ruleUpdate a user's notification rule.<br /><br />Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account.<br /><br />For more information see the [API Concepts Document](https:​//developer.pagerduty.com/api-reference/a47605517c19a-api-concepts#users)<br /><br />Scoped OAuth requires: users:contact_methods.write<br />
deletedeleteid, notification_rule_idRemove a user's notification rule.<br /><br />Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account.<br /><br />For more information see the [API Concepts Document](https:​//developer.pagerduty.com/api-reference/a47605517c19a-api-concepts#users)<br /><br />Scoped OAuth requires: users:contact_methods.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
idstringThe ID of the resource.
notification_rule_idstringThe notification rule ID on the user.
include[]stringArray of additional details to include.
urgencystringThe incident urgency for which the notification rules are applied. If not specified, defaults to high.

SELECT examples

Get details about a user's notification rule.<br /><br />Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account.<br /><br />For more information see the [API Concepts Document](https:​//developer.pagerduty.com/api-reference/a47605517c19a-api-concepts#users)<br /><br />Scoped OAuth requires: users:contact_methods.read<br />

SELECT
id,
contact_method,
html_url,
self,
start_delay_in_minutes,
summary,
type,
urgency
FROM pagerduty.users.notification_rules
WHERE id = '{{ id }}' -- required
AND notification_rule_id = '{{ notification_rule_id }}' -- required
AND include[] = '{{ include[] }}'
;

INSERT examples

Create a new notification rule.<br /><br />Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account.<br /><br />For more information see the [API Concepts Document](https:​//developer.pagerduty.com/api-reference/a47605517c19a-api-concepts#users)<br /><br />Scoped OAuth requires: users:contact_methods.write<br />

INSERT INTO pagerduty.users.notification_rules (
notification_rule,
id
)
SELECT
'{{ notification_rule }}' /* required */,
'{{ id }}'
RETURNING
notification_rule
;

UPDATE examples

Update a user's notification rule.<br /><br />Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account.<br /><br />For more information see the [API Concepts Document](https:​//developer.pagerduty.com/api-reference/a47605517c19a-api-concepts#users)<br /><br />Scoped OAuth requires: users:contact_methods.write<br />

UPDATE pagerduty.users.notification_rules
SET
notification_rule = '{{ notification_rule }}'
WHERE
id = '{{ id }}' --required
AND notification_rule_id = '{{ notification_rule_id }}' --required
AND notification_rule = '{{ notification_rule }}' --required
RETURNING
notification_rule;

DELETE examples

Remove a user's notification rule.<br /><br />Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account.<br /><br />For more information see the [API Concepts Document](https:​//developer.pagerduty.com/api-reference/a47605517c19a-api-concepts#users)<br /><br />Scoped OAuth requires: users:contact_methods.write<br />

DELETE FROM pagerduty.users.notification_rules
WHERE id = '{{ id }}' --required
AND notification_rule_id = '{{ notification_rule_id }}' --required
;