sessionstorage

get/auth/api/v1/sessionstorage/users/{user_id}/sessions

Fetch valid user sessions.

offsetint

Offset from which to start fetching objects

Default
0
limitint

Maximum number of objects to return

Default
50
sortdirstring

Sorting direction

Default
"ASC"
Enum
  • ASC
  • DESC
sortkeystring

Sorting key

Default
"expires"
Enum
  • id
  • user_id
  • source_id
  • parent_session_id
  • domain
  • username
  • remote_address
  • type
  • created
  • updated
  • expires
  • token_expires

Responses

Response examples

Successful response, returns valid user sessions.

{
  "count": 1,
  "items": [
    {
      "id": "5bf77342-221c-11ee-be56-0242ac120002",
      "user_id": "5bf77342-221c-11ee-be56-0242ac120002",
      "source_id": "5bf77342-221c-11ee-be56-0242ac120002",
      "parent_session_id": "",
      "domain": "privx-ui",
      "username": "alice",
      "remote_addr": "127.0.0.1",
      "user_agent": "Mozilla....",
      "type": "login",
      "created": "2022-01-01T09:17:16Z",
      "updated": "2022-01-01T09:17:16Z",
      "expires": "2022-01-01T09:17:16Z",
      "token_expires": "2022-01-01T09:17:16Z",
      "logged_out": false,
      "current": false
    }
  ]
}
get/auth/api/v1/sessionstorage/users/current/sessions

Fetch current users valid sessions.

offsetint

Offset from which to start fetching objects

Default
0
limitint

Maximum number of objects to return

Default
50
sortdirstring

Sorting direction

Default
"ASC"
Enum
  • ASC
  • DESC
sortkeystring

Sorting key

Default
"expires"
Enum
  • id
  • user_id
  • source_id
  • parent_session_id
  • domain
  • username
  • remote_address
  • type
  • created
  • updated
  • expires
  • token_expires

Responses

Response examples

Successful response, returns current users valid sessions.

{
  "count": 1,
  "items": [
    {
      "id": "5bf77342-221c-11ee-be56-0242ac120002",
      "user_id": "5bf77342-221c-11ee-be56-0242ac120002",
      "source_id": "5bf77342-221c-11ee-be56-0242ac120002",
      "parent_session_id": "",
      "domain": "privx-ui",
      "username": "alice",
      "remote_addr": "127.0.0.1",
      "user_agent": "Mozilla....",
      "type": "login",
      "created": "2022-01-01T09:17:16Z",
      "updated": "2022-01-01T09:17:16Z",
      "expires": "2022-01-01T09:17:16Z",
      "token_expires": "2022-01-01T09:17:16Z",
      "logged_out": false,
      "current": false
    }
  ]
}
get/auth/api/v1/sessionstorage/sources/{source_id}/sessions

Fetch valid source sessions.

offsetint

Offset from which to start fetching objects

Default
0
limitint

Maximum number of objects to return

Default
50
sortdirstring

Sorting direction

Default
"ASC"
Enum
  • ASC
  • DESC
sortkeystring

Sorting key

Default
"expires"
Enum
  • id
  • user_id
  • source_id
  • parent_session_id
  • domain
  • username
  • remote_address
  • type
  • created
  • updated
  • expires
  • token_expires

Responses

Response examples

Successful response, returns current users valid sessions.

{
  "count": 1,
  "items": [
    {
      "id": "5bf77342-221c-11ee-be56-0242ac120002",
      "user_id": "5bf77342-221c-11ee-be56-0242ac120002",
      "source_id": "5bf77342-221c-11ee-be56-0242ac120002",
      "parent_session_id": "",
      "domain": "privx-ui",
      "username": "alice",
      "remote_addr": "127.0.0.1",
      "user_agent": "Mozilla....",
      "type": "login",
      "created": "2022-01-01T09:17:16Z",
      "updated": "2022-01-01T09:17:16Z",
      "expires": "2022-01-01T09:17:16Z",
      "token_expires": "2022-01-01T09:17:16Z",
      "logged_out": false,
      "current": false
    }
  ]
}
post/auth/api/v1/sessionstorage/sessions/search

Search for sessions

keywordsstring

Keywords string which is separated by a comma

Example
"alice, 127.0.0.1, Mozilla/3.0"
user_idstring

The ID of the user the sessions belong to

Format
uuid
typestring

Type of session, login or sso

Example
"login"

Responses

Request examples

{
  "keywords": "alice, 127.0.0.1, Mozilla/3.0",
  "user_id": "5bf77342-221c-11ee-be56-0242ac120002",
  "type": "login"
}

Response examples

Successful response, returns valid sessions.

{
  "count": 1,
  "items": [
    {
      "id": "5bf77342-221c-11ee-be56-0242ac120002",
      "user_id": "5bf77342-221c-11ee-be56-0242ac120002",
      "source_id": "5bf77342-221c-11ee-be56-0242ac120002",
      "parent_session_id": "",
      "domain": "privx-ui",
      "username": "alice",
      "remote_addr": "127.0.0.1",
      "user_agent": "Mozilla....",
      "type": "login",
      "created": "2022-01-01T09:17:16Z",
      "updated": "2022-01-01T09:17:16Z",
      "expires": "2022-01-01T09:17:16Z",
      "token_expires": "2022-01-01T09:17:16Z",
      "logged_out": false,
      "current": false
    }
  ]
}
post/auth/api/v1/sessionstorage/sessions/{session_id}/terminate

Terminate signle session by ID

session_idstring

required

Session ID

Format
uuid

Responses

Response examples

Successful response.

Empty response

post/auth/api/v1/sessionstorage/users/{user_id}/sessions/terminate

Terminate all user sessions

user_idstring

required

User ID

Format
uuid

Responses

Response examples

Successful response.

Empty response

post/auth/api/v1/sessionstorage/users/current/sessions/{session_id}/terminate

Terminate currents user session by ID

session_idstring

required

Session ID

Format
uuid

Responses

Response examples

Successful response.

Empty response

post/auth/api/v1/sessionstorage/users/current/sessionpassword

Get session password

OAuth2 oauth

Required Scopes:

user

Get session password

All Scopes

  • admin · Admin scope - used for built-in SSH PrivX admin account
  • service · Microservice scope - used for communication between SSH PrivX microservices
  • user · Normal users
  • usersManage · Clients with users-manage scope
  • usersView · Clients with users-view scope
Flow Type:
authorization_code
Auth URL:
https://api.x.com/v1/auth/auth
Token URL:
https://api.x.com/v1/auth/auth

Responses

Response examples

Successful response.

{
  "password": "y~X4x4P%F)="
}

Was this page helpful?