oauth_delegations
Creates, updates, deletes, gets or lists an oauth_delegations resource.
Overview
| Name | oauth_delegations |
| Type | Resource |
| Id | pagerduty.users.oauth_delegations |
Fields
The following fields are returned by SELECT queries:
- get
- list
Delegation retrieved successfully
| Name | Datatype | Description |
|---|---|---|
id | string | The unique identifier for the delegation (example: e53326c6-a713-409c-8f7e-ps1xczid) |
client_id | string | The OAuth client ID (example: PagerDutyLogin) |
created_at | string (date-time) | When the delegation was created (ISO 8601 format) (example: 2025-10-30T15:45:02Z) |
delegation_type | string | The type of delegation (web, mobile, integration) (example: web) |
expires_at | string (date-time) | When the delegation expires (ISO 8601 format) (example: 2025-12-29T15:45:02Z) |
scope | string | The OAuth scopes granted (example: openid) |
self | string (uri) | URL to retrieve this delegation in detail (example: https://api.pagerduty.com/users/PBGVC7B/oauth_delegations/e53326c6-a713-409c-8f7e-ps1xczid) |
status | string | The current status of the delegation (issued, revoked) (example: issued) |
Delegations retrieved sucessfully
| Name | Datatype | Description |
|---|---|---|
id | string | The unique identifier for the delegation (example: e53326c6-a713-409c-8f7e-ps1xczid) |
client_id | string | The OAuth client ID (example: PagerDutyLogin) |
created_at | string (date-time) | When the delegation was created (ISO 8601 format) (example: 2025-10-30T15:45:02Z) |
delegation_type | string | The type of delegation (web, mobile, integration) (example: web) |
expires_at | string (date-time) | When the delegation expires (ISO 8601 format) (example: 2025-12-29T15:45:02Z) |
scope | string | The OAuth scopes granted (example: openid) |
self | string (uri) | URL to retrieve this delegation in detail (example: https://api.pagerduty.com/users/PBGVC7B/oauth_delegations/e53326c6-a713-409c-8f7e-ps1xczid) |
status | string | The current status of the delegation (issued, revoked) (example: issued) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | id, delegation_id | Get details about a specific OAuth delegation.<br /><br />This endpoint replaces the deprecated /users/{id}/sessions/{session_id} 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 /> | |
list | select | id | delegation_type, status, limit, cursor | Get a list of OAuth delegations for a specific user.<br /><br />This endpoint replaces the deprecated /users/{id}/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.
| Name | Datatype | Description |
|---|---|---|
delegation_id | string | The ID of the delegation. |
id | string | The ID of the resource. |
cursor | string | Optional 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_type | string | The 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). |
limit | integer | The minimum of the limit parameter used in the request or the maximum request size of the API. |
status | string | The 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
- list
Get details about a specific OAuth delegation.<br /><br />This endpoint replaces the deprecated /users/{id}/sessions/{session_id} 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
;
Get a list of OAuth delegations for a specific user.<br /><br />This endpoint replaces the deprecated /users/{id}/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 />
SELECT
id,
client_id,
created_at,
delegation_type,
expires_at,
scope,
self,
status
FROM pagerduty.users.oauth_delegations
WHERE id = '{{ id }}' -- required
AND delegation_type = '{{ delegation_type }}'
AND status = '{{ status }}'
AND limit = '{{ limit }}'
AND cursor = '{{ cursor }}'
;