ZitadelDocs

Query sessions

Returns the sessions of a project, paginated with a cursor. Sessions of every lifecycle state are returned; each carries its `state`. Requires `session.read` permission.

POST
/sessions/query

Returns the sessions of a project, paginated with a cursor. Sessions of every lifecycle state are returned; each carries its state. Requires session.read permission.

Authorization

oauth2 session.read
headerAuthorizationBearer <token>

Scope: session.read

Query Parameters

project_id*string

The unique identifier of the project

Match^[a-zA-Z0-9_-]+$

Request Body

Request to query the sessions of a project.

application/json
  1. body

Request to query the sessions of a project.

limit?limit
Range1 <= value <= 100
Default20
page_token?|

Token to retrieve the next page of results.

sorting?
filter?array<>

Filter criteria for querying sessions.

Response Body

The list of sessions was returned successfully

application/json
  1. response

Paginated list of sessions.

sessions*array<>
next_page_token?|

Token to pass as page_token in the next request to fetch the following page. Absent when there are no more results.

curl -X POST 'https://example.com/sessions/query?project_id=string' \  -H 'Content-Type: application/json' \  -d '{}'
{  "sessions": [    {      "session_id": "string",      "project_id": "string",      "state": "building",      "user_id": "string",      "user": {        "user_id": "string",        "identifier": "string",        "identifier_property": "string",        "display": "string"      },      "factors": [        {          "method": "identifier",          "verified_at": "2019-08-24T14:15:22Z",          "payload": {            "method": "identifier",            "user_id": "string"          }        }      ],      "assurance_levels": [        "string"      ],      "metadata": {},      "user_agent": {        "fingerprint": "string",        "ip": "string"      },      "created_at": "2019-08-24T14:15:22Z",      "expires_at": "2019-08-24T14:15:22Z"    }  ],  "next_page_token": "string"}