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

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_user_sessionselectid, type, session_idAccept, Content-TypeGet details about a user's session.

Beginning November 2021, user sessions no longer includes newly issued OAuth tokens.

Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account.

For more information see the API Concepts Document

Scoped OAuth requires: users:sessions.read
get_user_sessionsselectidAccept, Content-TypeList active sessions of a PagerDuty user.

Beginning November 2021, active sessions no longer includes newly issued OAuth tokens.

Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account.

For more information see the API Concepts Document

Scoped OAuth requires: users:sessions.read
delete_user_sessiondeleteid, type, session_idAccept, Content-TypeDelete a user's session.

Beginning November 2021, user sessions no longer includes newly issued OAuth tokens.

Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account.

For more information see the API Concepts Document

Scoped OAuth requires: users:sessions.write
delete_user_sessionsdeleteidAccept, Content-TypeDelete all user sessions.

Beginning November 2021, user sessions no longer includes newly issued OAuth tokens.

Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account.

For more information see the API Concepts Document

Scoped OAuth requires: users:sessions.write
_get_user_sessionsexecidAccept, Content-TypeList active sessions of a PagerDuty user.

Beginning November 2021, active sessions no longer includes newly issued OAuth tokens.

Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account.

For more information see the API Concepts Document

Scoped OAuth requires: users:sessions.read
_get_user_sessionexecid, type, session_idAccept, Content-TypeGet details about a user's session.

Beginning November 2021, user sessions no longer includes newly issued OAuth tokens.

Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account.

For more information see the API Concepts Document

Scoped OAuth requires: users:sessions.read

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.
AcceptstringThe Accept header is used as a versioning header.
Content-Typestring

SELECT examples

Get details about a user's session.

Beginning November 2021, user sessions no longer includes newly issued OAuth tokens.

Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account.

For more information see the API Concepts Document

Scoped OAuth requires: users:sessions.read

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
AND Accept = '{{ Accept }}'
AND Content-Type = '{{ Content-Type }}'
;

DELETE examples

Delete a user's session.

Beginning November 2021, user sessions no longer includes newly issued OAuth tokens.

Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account.

For more information see the API Concepts Document

Scoped OAuth requires: users:sessions.write

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

Lifecycle Methods

List active sessions of a PagerDuty user.

Beginning November 2021, active sessions no longer includes newly issued OAuth tokens.

Users are members of a PagerDuty account that have the ability to interact with Incidents and other data on the account.

For more information see the API Concepts Document

Scoped OAuth requires: users:sessions.read

EXEC pagerduty.users.sessions._get_user_sessions 
@id='{{ id }}' --required,
@Accept='{{ Accept }}',
@Content-Type='{{ Content-Type }}'
;