sessions
Creates, updates, deletes, gets or lists a sessions resource.
Overview
| Name | sessions |
| Type | Resource |
| Id | pagerduty.users.sessions |
Fields
The following fields are returned by SELECT queries:
- get
- list
The user's session requested.
| Name | Datatype | Description |
|---|---|---|
id | string | |
user_id | string | |
created_at | string (date-time) | The date/time the user session was first created. |
summary | string | The summary of the session |
type | string | The type of the session (browser, oauth) |
A list of the user's active sessions.
| Name | Datatype | Description |
|---|---|---|
id | string | |
user_id | string | |
created_at | string (date-time) | The date/time the user session was first created. |
summary | string | The summary of the session |
type | string | The type of the session (browser, oauth) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | id, 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 /> | |
list | select | id | <!-- 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 /> | |
delete | delete | id, 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_all | delete | 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 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.
| Name | Datatype | Description |
|---|---|---|
id | string | The ID of the resource. |
session_id | string | The session ID for the user. |
type | string | The session type for the user session ID. |
SELECT examples
- get
- list
<!-- 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
;
<!-- 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 />
SELECT
id,
user_id,
created_at,
summary,
type
FROM pagerduty.users.sessions
WHERE id = '{{ id }}' -- required
;
DELETE examples
- delete
- delete_all
<!-- 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
;
<!-- 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 />
DELETE FROM pagerduty.users.sessions
WHERE id = '{{ id }}' --required
;