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
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.
typestringThe type of object being created. (default: assignment_notification_rule)
urgencystringWhich incident urgency this rule is used for. Account must have the urgencies ability to have a low urgency notification rule.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_user_notification_ruleselectid, notification_rule_idAccept, Content-Type, include[]Get details about a user's notification rule.

Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account.

For more information see the API Concepts Document

Scoped OAuth requires: users:contact_methods.read
get_user_notification_rulesselectidAccept, Content-Type, include[], urgencyList notification rules of your PagerDuty user.

Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account.

For more information see the API Concepts Document

Scoped OAuth requires: users:contact_methods.read
create_user_notification_ruleinsertid, data__notification_ruleAccept, Content-TypeCreate a new notification rule.

Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account.

For more information see the API Concepts Document

Scoped OAuth requires: users:contact_methods.write
delete_user_notification_ruledeleteid, notification_rule_idAccept, Content-TypeRemove a user's notification rule.

Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account.

For more information see the API Concepts Document

Scoped OAuth requires: users:contact_methods.write
_get_user_notification_rulesexecidAccept, Content-Type, include[], urgencyList notification rules of your PagerDuty user.

Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account.

For more information see the API Concepts Document

Scoped OAuth requires: users:contact_methods.read
_get_user_notification_ruleexecid, notification_rule_idAccept, Content-Type, include[]Get details about a user's notification rule.

Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account.

For more information see the API Concepts Document

Scoped OAuth requires: users:contact_methods.read
update_user_notification_ruleexecid, notification_rule_id, notification_ruleAccept, Content-TypeUpdate a user's notification rule.

Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account.

For more information see the API Concepts Document

Scoped OAuth requires: users:contact_methods.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
idstringThe ID of the resource.
notification_rule_idstringThe notification rule ID on the user.
AcceptstringThe Accept header is used as a versioning header.
Content-Typestring
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.

Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account.

For more information see the API Concepts Document

Scoped OAuth requires: users:contact_methods.read

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 Accept = '{{ Accept }}'
AND Content-Type = '{{ Content-Type }}'
AND include[] = '{{ include[] }}'
;

INSERT examples

Create a new notification rule.

Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account.

For more information see the API Concepts Document

Scoped OAuth requires: users:contact_methods.write

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

DELETE examples

Remove a user's notification rule.

Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account.

For more information see the API Concepts Document

Scoped OAuth requires: users:contact_methods.write

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

Lifecycle Methods

List notification rules of your PagerDuty user.

Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account.

For more information see the API Concepts Document

Scoped OAuth requires: users:contact_methods.read

EXEC pagerduty.users.notification_rules._get_user_notification_rules 
@id='{{ id }}' --required,
@Accept='{{ Accept }}',
@Content-Type='{{ Content-Type }}',
@include[]='{{ include[] }}',
@urgency='{{ urgency }}'
;