subscriptions
Creates, updates, deletes, gets or lists a subscriptions resource.
Overview
| Name | subscriptions |
| Type | Resource |
| Id | pagerduty.status_pages.subscriptions |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
id | string | The ID of the Subscription. |
channel | string | The channel of the subscription. (webhook, email, slack) (title: SubscriptionChannel) |
contact | string | The subscriber's contact - email address, webhook URL, etc... |
self | string | The path in which the Subscription resource is accessible. |
status | string | The status of the Subscription. (active, pending, suspended) (title: SubscriptionStatus) |
status_page | object | Status Page |
subscribable_object | object | The subscribed entity for a given subscription. (title: SubscribableObject) |
type | string | A string that determines the schema of the object. |
| Name | Datatype | Description |
|---|---|---|
id | string | The ID of the Subscription. |
channel | string | The channel of the subscription. (webhook, email, slack) (title: SubscriptionChannel) |
contact | string | The subscriber's contact - email address, webhook URL, etc... |
self | string | The path in which the Subscription resource is accessible. |
status | string | The status of the Subscription. (active, pending, suspended) (title: SubscriptionStatus) |
status_page | object | Status Page |
subscribable_object | object | The subscribed entity for a given subscription. (title: SubscribableObject) |
type | string | A string that determines the schema of the object. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | id, subscription_id | Get a Subscription for a Status Page by Status Page ID and Subscription ID.<br /><br />Scoped OAuth requires: status_pages.read<br /> | |
list | select | id | status, channel | List Subscriptions for a Status Page by Status Page ID.<br /><br />Scoped OAuth requires: status_pages.read<br /> |
create | insert | id, subscription | Create a Subscription for a Status Page by Status Page ID.<br /><br />Scoped OAuth requires: status_pages.write<br /> | |
delete | delete | id, subscription_id | Delete 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.
| Name | Datatype | Description |
|---|---|---|
id | string | The ID of the resource. |
subscription_id | string | The ID of the Status Page subscription. |
channel | string | Filter by Subscription channel. |
status | string | Filter by Subscription status. |
SELECT examples
- get
- list
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
;
List Subscriptions for a Status Page by Status Page 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 status = '{{ status }}'
AND channel = '{{ channel }}'
;
INSERT examples
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: subscriptions
props:
- name: id
value: "{{ id }}"
description: Required parameter for the subscriptions resource.
- name: subscription
description: |
Request schema for creating a StatusPageSubscription.
value:
channel: "{{ channel }}"
contact: "{{ contact }}"
status_page:
id: "{{ id }}"
type: "{{ type }}"
subscribable_object:
id: "{{ id }}"
type: "{{ type }}"
type: "{{ type }}"
DELETE examples
- delete
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
;