Get Session | ZITADEL Docs

Get Session

Retrieve a session by its ID. Returns all information about the session, including the factors that were verified, the metadata, user agent information and possible expiration date. The session token is required unless either of the following conditions is met:

Required permissions:

GET

/v2/sessions/{session_id}

Path Parameters

session_id*session_id

The unique identifier of the session to be retrieved.

Query Parameters

sessionToken?session_token

The current token of the session, previously returned on the create / update request. The token is required unless either of the following conditions is met:

Response Body

200 application/json

cURL

curl -X GET "https://example.com/v2/sessions/string"

200

{
  "session": {
    "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"
  }
}