Skip to main content
Cloud has the newest features. Some may not be in a release yet; the newest release is Identity & Access Management 7.3.0.

Session management API

Download OpenAPI (YAML)Version v1

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
ScopeDescription
internal_loginGrant permission for an authenticated user for self session management.
internal_session_viewGrant permissions to list seeion info.
internal_session_deleteGrant 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

CodeDescriptionSchema
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

CodeDescriptionSchema
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

NameInTypeRequiredDescription
session-idpathstringYes

ID of the session.

Responses

CodeDescriptionSchema
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

NameInTypeRequiredDescription
user-idpathstringYes

ID of the user.

Responses

CodeDescriptionSchema
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

NameInTypeRequiredDescription
user-idpathstringYes

ID of the user.

Responses

CodeDescriptionSchema
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

NameInTypeRequiredDescription
user-idpathstringYes

ID of the user.

session-idpathstringYes

ID of the session.

Responses

CodeDescriptionSchema
204

No Content

400

Invalid input request

Error
401

Unauthorized

500

Internal Server Error

Error

Schemas​

Application​

Type: object

4 properties
NameTypeRequiredDescription
idstringYes

Unique ID of the application.

subjectstringYes

Username of the logged in user for the application.

appNamestringYes

Name of the application.

appIdstringYes

ID of the application.

Session​

Type: object

6 properties
NameTypeRequiredDescription
applicationsarray of Application

List of applications in the session.

userAgentstring

User agent of the session.

ipstring

IP address of the session.

loginTimestring

Login time of the session.

lastAccessTimestring

Last access time of the session.

idstring

ID of the session.

Sessions​

Type: object

2 properties
NameTypeRequiredDescription
userIdstring
sessionsarray of Session

List of active sessions.

Error​

Type: object

4 properties
NameTypeRequiredDescription
codestringYes
messagestringYes
descriptionstring
traceIdstring

Was this page helpful?