Skip to main content

contact_methods

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

Overview

Namecontact_methods
TypeResource
Idpagerduty.users.contact_methods

Fields

The following fields are returned by SELECT queries:

The user's contact method requested.

NameDatatypeDescription
idstring
addressstringThe "address" to deliver to: email, phone number, etc., depending on the type.
blacklistedbooleanIf true, this phone has been blacklisted by PagerDuty and no messages will be sent to it.
country_codeintegerThe 1-to-3 digit country calling code.
created_atstring (date-time)Time at which the contact method was created.
device_typestringThe type of device. (android, ios)
enabledbooleanIf true, this phone is capable of receiving notifications.
html_urlstring (url)a URL at which the entity is uniquely displayed in the Web app
labelstringThe label (e.g., "Work", "Mobile", etc.).
selfstring (url)the API show URL at which the object is accessible
send_short_emailbooleanSend an abbreviated email message instead of the standard email output. Useful for email-to-SMS gateways and email based pagers.
soundsarray
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.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectid, contact_method_idGet details about a User's contact method.<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 />
listselectidList contact methods 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, contact_methodCreate a new contact method for the 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.write<br />
updateupdateid, contact_method_id, contact_methodUpdate a User's contact method.<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, contact_method_idRemove a user's contact method.<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
contact_method_idstringThe contact method ID on the user.
idstringThe ID of the resource.

SELECT examples

Get details about a User's contact method.<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,
address,
blacklisted,
country_code,
created_at,
device_type,
enabled,
html_url,
label,
self,
send_short_email,
sounds,
summary,
type
FROM pagerduty.users.contact_methods
WHERE id = '{{ id }}' -- required
AND contact_method_id = '{{ contact_method_id }}' -- required
;

INSERT examples

Create a new contact method for the 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.write<br />

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

UPDATE examples

Update a User's contact method.<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.contact_methods
SET
contact_method = '{{ contact_method }}'
WHERE
id = '{{ id }}' --required
AND contact_method_id = '{{ contact_method_id }}' --required
AND contact_method = '{{ contact_method }}' --required
RETURNING
contact_method;

DELETE examples

Remove a user's contact method.<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.contact_methods
WHERE id = '{{ id }}' --required
AND contact_method_id = '{{ contact_method_id }}' --required
;