Skip to main content

sessions

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

Overview

Namesessions
TypeResource
Idpagerduty.users.sessions

Fields

The following fields are returned by SELECT queries:

The user's session requested.

NameDatatypeDescription
idstring
user_idstring
created_atstring (date-time)The date/time the user session was first created.
summarystringThe summary of the session
typestringThe type of the session (browser, oauth)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectid, type, session_id<!-- theme: warning --><br />> ### Deprecated<br />> This endpoint is deprecated, please use the [Get OAuth Delegation endpoint](https:​//developer.pagerduty.com/api-reference//e3c7cd550aa2b-get-a-user-oauth-delegation) instead.<br />Get details about a user's session.<br /><br />Beginning November 2021, user sessions no longer includes newly issued OAuth tokens.<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:sessions.read<br />
listselectid<!-- theme: warning --><br />> ### Deprecated<br />> This endpoint is deprecated, please use the [List OAuth Delegations endpoint](https:​//developer.pagerduty.com/api-reference/fc03ba9dffd1f-list-user-oauth-delegations) instead.<br /><br />List active sessions of a PagerDuty user.<br /><br />Beginning November 2021, active sessions no longer includes newly issued OAuth tokens.<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:sessions.read<br />
deletedeleteid, type, session_id<!-- theme: warning --><br />> ### Deprecated<br />> This endpoint is deprecated as OAuth token revocation is now synchronous. Please use the [DELETE /oauth_delegations endpoint](https:​//developer.pagerduty.com/api-reference/ad1161db75db1-delete-all-o-auth-delegations) instead.<br /><br />Delete a user's session.<br /><br />Beginning November 2021, user sessions no longer includes newly issued OAuth tokens.<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:sessions.write<br />
delete_alldeleteid<!-- theme: warning --><br />> ### Deprecated<br />> This endpoint is deprecated as OAuth token revocation is now synchronous. Please use the [DELETE /oauth_delegations endpoint](https:​//developer.pagerduty.com/api-reference/ad1161db75db1-delete-all-o-auth-delegations) instead.<br /><br />Delete all user sessions.<br /><br />Beginning November 2021, user sessions no longer includes newly issued OAuth tokens.<br /><br />If you are interested in deleting mobile app sessions, refer to the Delete OAuth Delegations endpoint.<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:sessions.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
idstringThe ID of the resource.
session_idstringThe session ID for the user.
typestringThe session type for the user session ID.

SELECT examples

<!-- theme: warning --><br />> ### Deprecated<br />> This endpoint is deprecated, please use the [Get OAuth Delegation endpoint](https:​//developer.pagerduty.com/api-reference//e3c7cd550aa2b-get-a-user-oauth-delegation) instead.<br />Get details about a user's session.<br /><br />Beginning November 2021, user sessions no longer includes newly issued OAuth tokens.<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:sessions.read<br />

SELECT
id,
user_id,
created_at,
summary,
type
FROM pagerduty.users.sessions
WHERE id = '{{ id }}' -- required
AND type = '{{ type }}' -- required
AND session_id = '{{ session_id }}' -- required
;

DELETE examples

<!-- theme: warning --><br />> ### Deprecated<br />> This endpoint is deprecated as OAuth token revocation is now synchronous. Please use the [DELETE /oauth_delegations endpoint](https:​//developer.pagerduty.com/api-reference/ad1161db75db1-delete-all-o-auth-delegations) instead.<br /><br />Delete a user's session.<br /><br />Beginning November 2021, user sessions no longer includes newly issued OAuth tokens.<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:sessions.write<br />

DELETE FROM pagerduty.users.sessions
WHERE id = '{{ id }}' --required
AND type = '{{ type }}' --required
AND session_id = '{{ session_id }}' --required
;