v0.1.0
OAS 3.1.0

FastAPI

Client Libraries

Clerk

Retrieve session details

Retrieve details of a session using the Clerk session ID.

Args:

  • session_id (str): The Clerk session ID.
  • env (str, optional): The environment for which to fetch the API key ('prod' or 'dev').

Returns:

  • ClerkSessionResponse: Session details including user_id, client_id, session status, and timestamps.
  • ClerkErrorResponse: Error response if the session is not found or the authorization fails.

The API key is fetched from environment variables based on the selected environment.

Path Parameters
  • session_id
    Type:string
    required
Responses
  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
Request Example forGET/clerk/clerk/session/{session_id}
curl '/clerk/clerk/session/{session_id}'
{
  "data": {
    "object": "…",
    "id": "…",
    "user_id": "…",
    "client_id": "…",
    "status": "…",
    "last_active_at": 1,
    "expire_at": 1,
    "abandon_at": 1,
    "created_at": 1,
    "updated_at": 1,
    "last_active_organization_id": "…",
    "latest_activity": {},
    "actor": {}
  },
  "timestamp": 1,
  "status": "…",
  "message": "…"
}

Public (Collapsed)

Models