v4

latestOpenAPI 3.1.1Apache 2.02026-07-31107278570.4 KB
Sessions

Get session details

Retrieves comprehensive details for a specific user session including authentication status, device information, and expiration timelines. Use this endpoint to fetch current session metadata for security audits, session validation, or to display session information in user account management interfaces. Returns all session properties including the user ID, authenticated organizations, device details with browser/OS information, IP address and geolocation, and all relevant timestamps (creation, last activity, idle expiration, absolute expiration, and actual expiration if applicable).

get/api/v1/sessions/{session_id}

Path parameters

session_idstring required

Unique identifier for the session. Must start with 'ses_' prefix.

Response

Successfully retrieved session details

absolute_expires_atstring date-time

Hard expiration timestamp for the session regardless of user activity. The session will be forcibly terminated at this time. This represents the maximum session lifetime from creation.

authenticated_organizationsstring[]

List of organization IDs that have been authenticated for this user within the current session. Contains all organizations where the user has successfully completed SSO or authentication.

created_atstring date-time

Timestamp indicating when the session was created. This is set once at session creation and remains constant throughout the session lifetime.

expired_atstring date-time

Timestamp when the session was terminated. Null if the session is still active. Set when the session expires due to reaching idle_expires_at or absolute_expires_at timeout, or when administratively revoked. Not set for user-initiated logout (see logout_at instead).

idle_expires_atstring date-time

Projected expiration timestamp if the session remains idle without user activity. This timestamp is recalculated with each user activity. Session will be automatically terminated at this time if no activity occurs.

last_active_atstring date-time

Timestamp of the most recent user activity detected in this session. Updated on each API request or user interaction. Used to determine if a session has exceeded the idle timeout threshold.

logout_atstring date-time

Timestamp when the user explicitly logged out from the session. Null if the user has not logged out. When set, indicates the session ended due to explicit user logout rather than timeout.

organization_idstring

Organization ID for the user's most recently active organization within this session. This represents the primary organization context for the current session.

session_idstring

Unique identifier for the session. System-generated read-only field used to reference this session.

statusstring

Current operational status of the session. Possible values: 'active' (session is valid and requests are allowed), 'expired' (session terminated due to idle or absolute timeout), 'revoked' (session was administratively revoked), 'logout' (user explicitly logged out). Use this to determine if the session can be used for new requests.

updated_atstring date-time

Timestamp indicating when the session was last updated. Updated whenever session state changes such as organization context changes or metadata updates.

user_idstring

Unique identifier for the user who owns and is authenticated within this session.

Example response

{
  "absolute_expires_at": "2025-01-22T10:30:00Z",
  "authenticated_clients": [
    {
      "client_id": "skc_1234567890",
      "organization_id": "org_1234567890"
    }
  ],
  "authenticated_organizations": [
    "org_123",
    "org_456"
  ],
  "created_at": "2025-01-15T10:30:00Z",
  "device": {
    "browser": "Chrome",
    "browser_version": "120.0.0.0",
    "device_type": "desktop",
    "ip": "192.0.2.1",
    "location": {
      "city": "San Francisco",
      "latitude": "37.7749",
      "longitude": "-122.4194",
      "region": "United States",
      "region_subdivision": "CA"
    },
    "os": "macOS",
    "os_version": "14.2",
    "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
  },
  "expired_at": "2025-01-15T12:00:00Z",
  "idle_expires_at": "2025-01-15T11:30:00Z",
  "last_active_at": "2025-01-15T10:55:30Z",
  "logout_at": "2025-01-15T14:00:00Z",
  "organization_id": "org_1234567890123456",
  "session_id": "ses_1234567890123456",
  "status": "active",
  "updated_at": "2025-01-15T10:45:00Z",
  "user_id": "usr_1234567890123456"
}