Skip to main content

users

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

Overview

Nameusers
TypeResource
Idpagerduty.schedules.users

Fields

The following fields are returned by SELECT queries:

The users on the given schedule.

NameDatatypeDescription
idstring
namestringThe name of the user.
avatar_urlstring (url)The URL of the user's avatar.
colorstringThe schedule color.
contact_methodsarrayThe list of contact methods for the user.
created_via_ssobooleanIf true, the user was created via Single Sign-On (SSO).
descriptionstringThe user's bio.
emailstring (email)The user's email address.
html_urlstring (url)a URL at which the entity is uniquely displayed in the Web app
http_cal_urlstring (uri)iCal HTTP feed URL for this user's on-call shifts. Only returned on the GET /users/{id} detail endpoint: automatically when viewing your own profile with a user-level token, or when an account admin with can_update_user passes include[]=calendar_urls for another user. Not returned on list endpoints or with account-level read-only keys. Security: this URL is a bearer credential. Anyone with the URL can read the user's on-call calendar without further authentication. Rotate via POST /users/{id}/regenerate_private_url_key if it may have been exposed.
invitation_sentbooleanIf true, the user has an outstanding invitation.
job_titlestringThe user's title.
notification_rulesarrayThe list of notification rules for the user.
rolestringThe user role. Account must have the read_only_users ability to set a user as a read_only_user or a read_only_limited_user, and must have advanced permissions abilities to set a user as observer or restricted_access. (admin, limited_user, observer, owner, read_only_user, restricted_access, read_only_limited_user, user)
selfstring (url)the API show URL at which the object is accessible
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.
teamsarrayThe list of teams to which the user belongs. Account must have the teams ability to set this.
time_zonestring (tzinfo)The preferred time zone name. If null, the account's time zone will be used.
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.
web_cal_urlstring (uri)iCal webcal URL for this user's on-call shifts. Only returned on the GET /users/{id} detail endpoint: automatically when viewing your own profile with a user-level token, or when an account admin with can_update_user passes include[]=calendar_urls for another user. Not returned on list endpoints or with account-level read-only keys. Security: this URL is a bearer credential. Anyone with the URL can read the user's on-call calendar without further authentication. Rotate via POST /users/{id}/regenerate_private_url_key if it may have been exposed.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectidsince, untilList all of the users on call in a given schedule for a given time range.<br /><br />A Schedule determines the time periods that users are On-Call.<br /><br />For more information see the [API Concepts Document](https:​//developer.pagerduty.com/api-reference/a47605517c19a-api-concepts#schedules)<br /><br />Scoped OAuth requires: users.read<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 schedule. (example: P2LJD7G)
sincestring (date-time)The start of the date range over which you want to search.
untilstring (date-time)The end of the date range over which you want to search.

SELECT examples

List all of the users on call in a given schedule for a given time range.<br /><br />A Schedule determines the time periods that users are On-Call.<br /><br />For more information see the [API Concepts Document](https:​//developer.pagerduty.com/api-reference/a47605517c19a-api-concepts#schedules)<br /><br />Scoped OAuth requires: users.read<br />

SELECT
id,
name,
avatar_url,
color,
contact_methods,
created_via_sso,
description,
email,
html_url,
http_cal_url,
invitation_sent,
job_title,
notification_rules,
role,
self,
summary,
teams,
time_zone,
type,
web_cal_url
FROM pagerduty.schedules.users
WHERE id = '{{ id }}' -- required
AND since = '{{ since }}'
AND until = '{{ until }}'
;