Skip to Content
ZITADEL Docs
APIsCore ResourcesV2Session

List sessions

Searches for sessions matching the given query. You can search by session ID, user ID, creation date, creator, user agent or expiration date.

Required permissions:

  • session.read
  • no permission required to search for own sessions
POST
/v2/sessions/search

Request Body

application/json
  1. body
query?

List limitations and ordering.

queries?array<|||||>

The criteria to be used when searching for sessions. Multiple queries will be combined with a logical AND.

sortingColumn?sorting_column

The column to be used for sorting the sessions.

Value in"SESSION_FIELD_NAME_UNSPECIFIED""SESSION_FIELD_NAME_CREATION_DATE"

Response Body

Success

application/json
  1. response
details?

Contains details about the response, such as the total number of sessions.

sessions?array<>

The sessions matching the search query. There might be more sessions available than returned in this response. Use the details field to see if there are more sessions available and to get the total count of sessions matching the query.

Example Request
curl -X POST 'https://example.com/v2/sessions/search' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response200
{  "details": {    "totalResult": 0,    "processedSequence": 0,    "timestamp": "2023-01-15T01:30:15.01Z"  },  "sessions": [    {      "id": "string",      "creationDate": "2023-01-15T01:30:15.01Z",      "changeDate": "2023-01-15T01:30:15.01Z",      "sequence": 0,      "factors": {        "user": {          "verifiedAt": "2023-01-15T01:30:15.01Z",          "id": "string",          "loginName": "string",          "displayName": "string",          "organizationId": "string"        },        "password": {          "verifiedAt": "2023-01-15T01:30:15.01Z"        },        "webAuthN": {          "verifiedAt": "2023-01-15T01:30:15.01Z",          "userVerified": true        },        "intent": {          "verifiedAt": "2023-01-15T01:30:15.01Z"        },        "totp": {          "verifiedAt": "2023-01-15T01:30:15.01Z"        },        "otpSms": {          "verifiedAt": "2023-01-15T01:30:15.01Z"        },        "otpEmail": {          "verifiedAt": "2023-01-15T01:30:15.01Z"        },        "recoveryCode": {          "verifiedAt": "2023-01-15T01:30:15.01Z"        }      },      "metadata": {        "property1": "string",        "property2": "string"      },      "userAgent": {        "fingerprintId": "string",        "ip": "string",        "description": "string",        "header": {          "property1": {            "values": [              "string"            ]          },          "property2": {            "values": [              "string"            ]          }        }      },      "expirationDate": "2023-01-15T01:30:15.01Z"    }  ]}

Was this page helpful?