Skip to main content

notification_subscriptions

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

Overview

Namenotification_subscriptions
TypeResource
Idpagerduty.users.notification_subscriptions

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
subscribable_namestringThe name of the subscribable
subscriptionobjectAn object describing the relationship of a NotificationSubscriber and a NotificationSubscribable. (title: NotificationSubscription)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectidRetrieve a list of Notification Subscriptions the given User has.<br /><br /><!-- theme: warning --><br />> Users must be added through POST /users/&#123;id&#125;/notification_subscriptions to be returned from this endpoint.<br /><br />Scoped OAuth requires: subscribers.read<br />
createinsertid, subscribablesCreate new Notification Subscriptions for the given User.<br /><br />Scoped OAuth requires: subscribers.write<br />
unsubscribeexecid, subscribablesUnsubscribe the given User from Notifications on the matching Subscribable entities.<br /><br />Scoped OAuth requires: subscribers.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.

SELECT examples

Retrieve a list of Notification Subscriptions the given User has.<br /><br /><!-- theme: warning --><br />> Users must be added through POST /users/&#123;id&#125;/notification_subscriptions to be returned from this endpoint.<br /><br />Scoped OAuth requires: subscribers.read<br />

SELECT
subscribable_name,
subscription
FROM pagerduty.users.notification_subscriptions
WHERE id = '{{ id }}' -- required
;

INSERT examples

Create new Notification Subscriptions for the given User.<br /><br />Scoped OAuth requires: subscribers.write<br />

INSERT INTO pagerduty.users.notification_subscriptions (
subscribables,
id
)
SELECT
'{{ subscribables }}' /* required */,
'{{ id }}'
RETURNING
subscriptions
;

Lifecycle Methods

Unsubscribe the given User from Notifications on the matching Subscribable entities.<br /><br />Scoped OAuth requires: subscribers.write<br />

EXEC pagerduty.users.notification_subscriptions.unsubscribe
@id='{{ id }}' --required
@@json=
'{
"subscribables": "{{ subscribables }}"
}'
;