Skip to main content

oauth_delegations

Creates, updates, deletes, gets or lists an oauth_delegations resource.

Overview

Nameoauth_delegations
TypeResource
Idpagerduty.users.oauth_delegations

Fields

The following fields are returned by SELECT queries:

Delegation retrieved successfully

NameDatatypeDescription
idstringThe unique identifier for the delegation (example: e53326c6-a713-409c-8f7e-ps1xczid)
client_idstringThe OAuth client ID (example: PagerDutyLogin)
created_atstring (date-time)When the delegation was created (ISO 8601 format) (example: 2025-10-30T15:45:02Z)
delegation_typestringThe type of delegation (web, mobile, integration) (example: web)
expires_atstring (date-time)When the delegation expires (ISO 8601 format) (example: 2025-12-29T15:45:02Z)
scopestringThe OAuth scopes granted (example: openid)
selfstring (uri)URL to retrieve this delegation in detail (example: https:​//api.pagerduty.com/users/PBGVC7B/oauth_delegations/e53326c6-a713-409c-8f7e-ps1xczid)
statusstringThe current status of the delegation (issued, revoked) (example: issued)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectid, delegation_idGet details about a specific OAuth delegation.<br /><br />This endpoint replaces the deprecated /users/&#123;id&#125;/sessions/&#123;session_id&#125; endpoint.<br /><br />Required OAuth Scope: For Scoped OAuth requests, this operation requires the oauth_delegations.read scope.<br /><br />Scoped OAuth requires: oauth_delegations.read<br />
listselectiddelegation_type, status, limit, cursorGet a list of OAuth delegations for a specific user.<br /><br />This endpoint replaces the deprecated /users/&#123;id&#125;/sessions endpoint.<br /><br />Required OAuth Scope: For Scoped OAuth requests, this operation requires the oauth_delegations.read scope.<br /><br />Scoped OAuth requires: oauth_delegations.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
delegation_idstringThe ID of the delegation.
idstringThe ID of the resource.
cursorstringOptional parameter used to request the "next" set of results from an API. The value provided here is most commonly obtained from the next_cursor field of the previous request. When no value is provided, the request starts at the beginning of the result set.
delegation_typestringThe type of OAuth delegations to filter on. Allowed values are 'mobile', 'web', and 'integration'. You can pass one or more types in, separated by commas (e.g., type=web,mobile).
limitintegerThe minimum of the limit parameter used in the request or the maximum request size of the API.
statusstringThe status of the delegations to return. Allowed values are 'issued' and 'revoked'. You can pass one or more statuses in, separated by commas (e.g., status=issued,revoked).

SELECT examples

Get details about a specific OAuth delegation.<br /><br />This endpoint replaces the deprecated /users/&#123;id&#125;/sessions/&#123;session_id&#125; endpoint.<br /><br />Required OAuth Scope: For Scoped OAuth requests, this operation requires the oauth_delegations.read scope.<br /><br />Scoped OAuth requires: oauth_delegations.read<br />

SELECT
id,
client_id,
created_at,
delegation_type,
expires_at,
scope,
self,
status
FROM pagerduty.users.oauth_delegations
WHERE id = '{{ id }}' -- required
AND delegation_id = '{{ delegation_id }}' -- required
;