Documentation Index
Fetch the complete documentation index at: https://mintlify.com/zitadel/zitadel/llms.txt
Use this file to discover all available pages before exploring further.
Searches for sessions matching the given query. You can search by session ID, user ID, creation date, creator, user agent, or expiration date.
HTTP Request
Permissions
Requires session.read permission, or no permission if searching for your own sessions.
Request Body
List limitations and ordering.Number of results to skip.
Maximum number of results to return.
Sort order: true for ascending, false for descending.
Array of search criteria. Multiple queries are combined with AND logic.Search for sessions with specific IDs.List of session IDs to search for.
Search for sessions of a specific user.ID of the user whose sessions to find.
Search based on session creation date.The date to compare against.
Comparison method: EQUALS, GREATER_THAN, LESS_THAN.
Search for sessions created by a specific user.ID of the creator. If empty, uses the calling user’s ID.
Search based on user agent information.Fingerprint ID of the user agent. Set empty to use the user agent from the current call.
Search based on session expiration date.The date to compare against.
Comparison method: EQUALS, GREATER_THAN, LESS_THAN.
The column to sort by. Options:
SESSION_FIELD_NAME_CREATION_DATE (default)
Response
Information about the search results.Total number of sessions matching the query.
The sequence number processed.
Array of sessions matching the query.Unique identifier of the session.
When the session was created.
When the session was last updated.
The sequence number of the session.
Verification factors that have been checked.User verification factor.When the user was verified.
ID of the organization the user belongs to.
Password verification factor.When the password was verified.
WebAuthN verification factor.When WebAuthN was verified.
Whether user presence was verified.
Custom metadata stored on the session.
Information about the user agent that created the session.
When the session will automatically expire (if set).
Example Request
curl -X POST 'https://api.zitadel.cloud/v2/sessions/search' \
-H 'Authorization: Bearer <TOKEN>' \
-H 'Content-Type: application/json' \
-d '{
"query": {
"limit": 10,
"asc": false
},
"queries": [
{
"user_id_query": {
"id": "d654e6ba-70a3-48ef-a95d-37c8d8a7901a"
}
}
],
"sorting_column": "SESSION_FIELD_NAME_CREATION_DATE"
}'
Example Response
{
"details": {
"total_result": "3",
"processed_sequence": "12345",
"view_timestamp": "2024-03-15T10:30:00.000Z"
},
"sessions": [
{
"id": "222430354126975533",
"creation_date": "2024-03-15T09:00:00.000Z",
"change_date": "2024-03-15T09:15:00.000Z",
"sequence": "5",
"factors": {
"user": {
"verified_at": "2024-03-15T09:00:00.000Z",
"id": "d654e6ba-70a3-48ef-a95d-37c8d8a7901a",
"login_name": "user@example.com",
"display_name": "John Doe",
"organization_id": "69629023906488334"
},
"password": {
"verified_at": "2024-03-15T09:00:00.000Z"
},
"totp": {
"verified_at": "2024-03-15T09:15:00.000Z"
}
},
"metadata": {},
"user_agent": {
"ip": "192.168.1.100",
"description": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)"
},
"expiration_date": "2024-03-15T17:00:00.000Z"
}
]
}
Notes
- Multiple queries are combined with AND logic
- Results are paginated - use
offset and limit for pagination
- The
details.total_result field shows the total number of matching sessions
- Sessions can be filtered by multiple criteria simultaneously