> Documentation index for AI agents: https://docs.pagerduty.com/llms.txt

# Get a user's session

`GET https://api.pagerduty.com/users/{id}/sessions/{type}/{session_id}`

**Deprecated.**

<!-- theme: warning -->
> ### Deprecated
> This endpoint is deprecated, please use the [Get OAuth Delegation endpoint](https://docs.pagerduty.com/developer/api/reference/rest/users/get-user-delegation) instead.
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](https://docs.pagerduty.com/developer/api-concepts#users)

Scoped OAuth requires: `users:sessions.read`

## Authorization

- **api_key** (apiKey) — `Authorization` header. The API Key with format `Token token=<API_KEY>`

## Path parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | The ID of the resource. |
| `type` | string | yes | The session type for the user session ID. |
| `session_id` | string | yes | The session ID for the user. |

## Header parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Accept` | string | yes | The `Accept` header is used as a versioning header. Default: `application/vnd.pagerduty+json;version=2`. |

## Response 200

The user's session requested.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `user_session` | object | yes |  |
| `user_session.id` | string | yes | Read-only. |
| `user_session.user_id` | string | yes | Read-only. |
| `user_session.created_at` | string (date-time) | yes | The date/time the user session was first created. Read-only. |
| `user_session.type` | string | yes | The type of the session. Read-only. One of: `browser`, `oauth`. |
| `user_session.summary` | string | yes | The summary of the session. Read-only. |

Example: Response Example

```json
{
  "user_session": {
    "id": "PXPGF42",
    "user_id": "PXPGF42",
    "created_at": "2018-10-06T21:30:42Z",
    "summary": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36",
    "type": "browser"
  }
}
```

## Response 400

Caller provided invalid arguments. Please review the response for error details. Retrying with the same arguments will *not* work.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Read-only. |
| `error.message` | string |  | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

## Response 401

Caller did not supply credentials or did not provide the correct credentials.
If you are using an API key, it may be invalid or your Authorization header may be malformed.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Read-only. |
| `error.message` | string |  | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

## Response 403

Caller is not authorized to view the requested resource.
While your authentication is valid, the authenticated user or token does not have permission to perform this action.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Read-only. |
| `error.message` | string |  | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

## Response 404

The requested resource was not found.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Read-only. |
| `error.message` | string |  | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

## Response 429

Too many requests have been made, the rate limit has been reached.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Read-only. |
| `error.message` | string |  | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

## Developer Agreement

Your access to and use of the PagerDuty Developer Services is governed by the [PagerDuty Developer Agreement](https://docs.pagerduty.com/developer/pagerduty-developer-agreement).
