Skip to main content

subscriptions

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

Overview

Namesubscriptions
TypeResource
Idpagerduty.status_pages.subscriptions

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe ID of the Subscription.
channelstringThe channel of the subscription. (webhook, email, slack) (title: SubscriptionChannel)
contactstringThe subscriber's contact - email address, webhook URL, etc...
selfstringThe path in which the Subscription resource is accessible.
statusstringThe status of the Subscription. (active, pending, suspended) (title: SubscriptionStatus)
status_pageobjectStatus Page
subscribable_objectobjectThe subscribed entity for a given subscription. (title: SubscribableObject)
typestringA string that determines the schema of the object.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectid, subscription_idGet a Subscription for a Status Page by Status Page ID and Subscription ID.<br /><br />Scoped OAuth requires: status_pages.read<br />
listselectidstatus, channelList Subscriptions for a Status Page by Status Page ID.<br /><br />Scoped OAuth requires: status_pages.read<br />
createinsertid, subscriptionCreate a Subscription for a Status Page by Status Page ID.<br /><br />Scoped OAuth requires: status_pages.write<br />
deletedeleteid, subscription_idDelete a Subscription for a Status Page by Status Page ID and Subscription ID.<br /><br />Scoped OAuth requires: status_pages.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.
subscription_idstringThe ID of the Status Page subscription.
channelstringFilter by Subscription channel.
statusstringFilter by Subscription status.

SELECT examples

Get a Subscription for a Status Page by Status Page ID and Subscription ID.<br /><br />Scoped OAuth requires: status_pages.read<br />

SELECT
id,
channel,
contact,
self,
status,
status_page,
subscribable_object,
type
FROM pagerduty.status_pages.subscriptions
WHERE id = '{{ id }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

INSERT examples

Create a Subscription for a Status Page by Status Page ID.<br /><br />Scoped OAuth requires: status_pages.write<br />

INSERT INTO pagerduty.status_pages.subscriptions (
subscription,
id
)
SELECT
'{{ subscription }}' /* required */,
'{{ id }}'
RETURNING
subscription
;

DELETE examples

Delete a Subscription for a Status Page by Status Page ID and Subscription ID.<br /><br />Scoped OAuth requires: status_pages.write<br />

DELETE FROM pagerduty.status_pages.subscriptions
WHERE id = '{{ id }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;