Session management API
Base URL: https://api.asgardeo.io/t/<ORGANIZATION_NAME>/api/users/v1
The WSO2 Identity Platform - User Session Management API (version v1).
Download the OpenAPI definition (YAML)
Security schemes
OAuth2: oauth2
clientCredentials flow, token URL https://api.asgardeo.io/t/{org-name}/oauth2/token
3 scopes
| Scope | Description |
|---|---|
internal_login | Grant permission for an authenticated user for self session management. |
internal_session_view | Grant permissions to list seeion info. |
internal_session_delete | Grant permissions to delete sessions. |
me
Session management operations for the authenticated user.
Get active sessions
GET /me/sessions
A user can have multiple active sessions. This endpoint is used to retrieve information of all the active sessions of the authenticated user.
Scope required:internal_login
Responses
| Code | Description | Schema |
|---|---|---|
200 | Successfully retrieved session information | Sessions |
401 | Unauthorized | |
403 | Resource Forbidden | |
404 | Resource Not Found | |
500 | Internal Server Error | Error |
Terminate all sessions
DEL /me/sessions
A user has multiple active sessions. This endpoint is used to terminate all the active sessions of the authenticated user.
Scope required: internal_login
Responses
| Code | Description | Schema |
|---|---|---|
204 | No Content | |
400 | Invalid input request | Error |
401 | Unauthorized | |
403 | Resource Forbidden | |
500 | Internal Server Error | Error |
Terminate a session
DEL /me/sessions/{session-id}
A user has multiple active sessions. This API terminates a specific session of the authenticated user identified by the session-id.
Scope required: internal_login
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
session-id | path | string | Yes | ID of the session. |
Responses
| Code | Description | Schema |
|---|---|---|
204 | No Content | |
400 | Invalid input request | Error |
401 | Unauthorized | |
403 | Resource Forbidden | |
500 | Internal Server Error | Error |
admin
Operations available for privileged users, to be invoked on behalf of another user.
Get active sessions
GET /{user-id}/sessions
Retrieves information related to the active sessions of a user identified by the user-id.
Scope required: internal_session_view
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
user-id | path | string | Yes | ID of the user. |
Responses
| Code | Description | Schema |
|---|---|---|
200 | Successfully retrieved session information. | Sessions |
400 | Invalid input request | Error |
401 | Unauthorized | |
403 | Resource Forbidden | |
404 | Resource Not Found | |
500 | Internal Server Error | Error |
Terminate all sessions
DEL /{user-id}/sessions
Delete all the sessions of a user identified by the user-id.
Scope required: internal_session_delete
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
user-id | path | string | Yes | ID of the user. |
Responses
| Code | Description | Schema |
|---|---|---|
204 | No Content | |
400 | Invalid input request | Error |
401 | Unauthorized | |
500 | Internal Server Error | Error |
Terminate a session
DEL /{user-id}/sessions/{session-id}
Terminate a specific session of a user identified by the session-id.
Scope required: internal_session_delete
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
user-id | path | string | Yes | ID of the user. |
session-id | path | string | Yes | ID of the session. |
Responses
| Code | Description | Schema |
|---|---|---|
204 | No Content | |
400 | Invalid input request | Error |
401 | Unauthorized | |
500 | Internal Server Error | Error |
Schemas
Application
Type: object
4 properties
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Unique ID of the application. |
subject | string | Yes | Username of the logged in user for the application. |
appName | string | Yes | Name of the application. |
appId | string | Yes | ID of the application. |
Session
Type: object
6 properties
| Name | Type | Required | Description |
|---|---|---|---|
applications | array of Application | List of applications in the session. | |
userAgent | string | User agent of the session. | |
ip | string | IP address of the session. | |
loginTime | string | Login time of the session. | |
lastAccessTime | string | Last access time of the session. | |
id | string | ID of the session. |
Sessions
Type: object
2 properties
| Name | Type | Required | Description |
|---|---|---|---|
userId | string | ||
sessions | array of Session | List of active sessions. |
Error
Type: object
4 properties
| Name | Type | Required | Description |
|---|---|---|---|
code | string | Yes | |
message | string | Yes | |
description | string | ||
traceId | string |
Was this page helpful?