The Stytch Session object contains all of the information about a user's session; when it was started, when it expires, which authentication factors were validated, e.g. password, OAuth, OTP, etc. Read more about Stytch Sessions and how they work in our Sessions guide.
Session object
Fields
Provided attributes to help with fraud detection. These values are pulled and passed into Stytch endpoints by your application.
The IP address of the client.
The user agent of the client.
An array of different authentication factors that comprise a Session.
The timestamp when the factor was initially authenticated.
The method that was used to deliver the authentication factor. The possible values are: email. sms whatsapp embedded oauth_google: All OAuth providers are in this pattern, e.g. oauth_microsoft, oauth_figma, etc. knowledge: For passwords. webauthn_registration: For WebAuthn or Passkeys. authenticator_app: For normal TOTP flow. recovery_code: For TOTP recovery codes. crypto_wallet biometric: For Native Mobile Biometrics. imported_auth0: For a zero downtime migrated session from Auth0. impersonation oauth_access_token_exchange: For OAuth access token exchange in our Connected Apps product.
The timestamp when the factor was last authenticated.
Information about the email factor, if one is present.
The email address of the User.
The globally unique UUID of the User's email address.
Information about the phone number factor, if one is present.
The phone number of the User.
The globally unique UUID of the User's phone number.
Information about the OAuth factor, if one is present. Note that OAuth factors are in this pattern, e.g. google_oauth_factor, microsoft_oauth_factor, etc.
The globally unique UUID of the User's email.
The globally unique UUID of the User's OAuth registration.
The user's unique identifier from the Identity Provider, e.g. Google, Apple, etc.
The type of authentication factor. The possible values are: magic_link otp: SMS or WhatsApp. email_otp oauth password signature_challenge Native Mobile Biometrics. webauthn: WebAuthn or Passkeys. totp crypto_wallet recovery_codes: For sessions in a TOTP recovery state. impersonated imported: For imported, zero downtime migrated sessions from a third party provider.
The timestamp when the factor was last updated.
Information about the impersonated factor, if one is present.
The email address of the impersonator.
For impersonated sessions initiated via the Stytch Dashboard, the impersonator_id will be the impersonator's Stytch Dashboard member_id.
A custom claims map for the Session being authenticated. Claims will be included on the Session object and in the JWT. iss, sub, aud, exp, nbf, iat, jti are reserved claims. Total custom claims size cannot exceed four kilobytes.
The timestamp when the Session will expire. Once a session is expired, it is no longer valid and Stytch will return a 404 error if it is authenticated.
The timestamp when the Session was last accessed. A session is considered accessed when it is authenticated with the Stytch API, local JWT authentication will not iterate this value.
A unique identifier for a specific Session.
The timestamp when the Session started.
The unique ID of a specific User. You may use an external_id here if one is set for the user.
{
"session": {
"attributes": {
"ip_address": "",
"user_agent": ""
},
"authentication_factors": [
{
"created_at": "2025-01-09T07:41:52Z",
"delivery_method": "email",
"email_factor": {
"email_address": "sandbox@stytch.com",
"email_id": "email-test-81bf03a8-86e1-4d95-bd44-bb3495224953"
},
"last_authenticated_at": "2025-01-09T07:41:52Z",
"updated_at": "2025-01-09T07:41:52Z",
"type": "magic_link"
},
{
"created_at": "2025-01-09T08:41:52Z",
"delivery_method": "knowledge",
"last_authenticated_at": "2025-01-09T08:41:52Z",
"type": "password",
"updated_at": "2025-01-09T08:41:52Z"
}
],
"custom_claims": {
"claim1": "value1",
"claim2": "value2"
},
"expires_at": "2025-04-22T08:00:00Z",
"last_accessed_at": "2025-04-22T07:41:52Z",
"started_at": "2025-04-22T07:00:00Z",
"session_id": "session-test-fe6c042b-6286-479f-8a4f-b046a6c46509",
"user_id": "user-test-16d9ba61-97a1-4ba4-9720-b03761dc50c6"
}
}