Clerk Sessions API

The Session object is an abstraction over an HTTP session. It models the period of information exchange between a user and the server. Sessions are created when a user successfully goes through the sign in or sign up flows.

Business capability
Identity & Access Management BC-620.20

Operations 19

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

GET /sessions List sessions for a user or client · List All Sessions #
Ask an LLM
“Which sessions does a given user currently have in Clerk?”
“Can I filter the backend session list to only active or revoked sessions?”
Tell an agent
List the sessions for user {user_id}.
Show sessions with status {status} for client {client_id}.
POST /sessions Create a test session for a user · Create a New Active Session #
Ask an LLM
“How do I create an active session for a user in a test instance?”
“Can I start a backend session for a user with an active organization already set?”
Tell an agent
Create a testing session for user {user_id}.
Start a test session for user {user_id} with organization {active_organization_id} active.
GET /sessions/{session_id} Retrieve a session by ID from the backend · Retrieve a Session #
Ask an LLM
“How do I look up the details of a session from my backend using its ID?”
“What status and user does a given session ID belong to on the server side?”
Tell an agent
Retrieve session {session_id} with the backend API.
Show the server-side details of session {session_id}.
POST /sessions/{session_id}/refresh Refresh a session with an expired token · Refresh a Session #
Ask an LLM
“How do I get a new session token when the old one has expired, using the refresh token?”
“What happens when refreshing a session fails validation, does it fall back to handshake?”
Tell an agent
Refresh session {session_id} using expired token {expired_token} and refresh token {refresh_token} from origin {request_origin}.
Refresh session {session_id} with expired token {expired_token}, refresh token {refresh_token}, origin {request_origin}, format {format}.
POST /sessions/{session_id}/revoke Revoke a user's session · Revoke a Session #
Ask an LLM
“How do I force a user to sign in again by revoking their session from the backend?”
“Does a revoked session still show up with its client in multi-session mode?”
Tell an agent destructive · confirm first
Revoke session {session_id}.
Sign the user out by revoking backend session {session_id}.
POST /sessions/{session_id}/tokens Mint a session JWT from the backend · Create a Session Token #
Ask an LLM
“How do I generate a session JWT for a session from my server?”
“Can I set a custom lifetime in seconds on a backend-issued session token?”
Tell an agent
Create a session token for session {session_id} from the backend.
Issue a session JWT for {session_id} that expires in {expires_in_seconds} seconds.
POST /sessions/{session_id}/tokens/{template_name} Mint a backend session JWT from a template · Create a Session Token from a JWT Template #
Ask an LLM
“How do I create a JWT for a session using one of my instance's JWT templates on the server?”
“Can a template-based token from the backend have its own expiry in seconds?”
Tell an agent
Create a JWT for session {session_id} using template {template_name} from the backend.
Issue a {template_name} template token for session {session_id} valid for {expires_in_seconds} seconds.
DELETE /v1/client/sessions Remove all sessions from the current client · Remove Client's Sessions #
Ask an LLM
“How do I clear every session on the current browser client but keep the __client cookie?”
“Can I sign out all sessions on this device without dropping the client cookie?”
Tell an agent destructive · confirm first
Remove all sessions from the current client and keep its cookie.
Clear every session on this browser client.
GET /v1/client/sessions/{session_id} Get a session on the current client · Get Session #
Ask an LLM
“How do I read one session belonging to the signed-in browser client?”
“What does the frontend API return for a single session ID on this client?”
Tell an agent
Get session {session_id} from the current client.
Show client session {session_id} via the frontend API.
POST /v1/client/sessions/{session_id}/touch Set the active session on the client · Touch Session #
Ask an LLM
“How do I switch which session is active on a multi-session client?”
“Can I change the active organization when I touch a session?”
Tell an agent
Make session {session_id} the active session on this client.
Touch session {session_id} and switch its active organization to {active_organization_id}.
POST /v1/client/sessions/{session_id}/end End a session on the current client · End Session #
Ask an LLM
“How do I sign a user out of one session from the browser by marking it ended?”
“Can I end a single session without removing the other sessions on the client?”
Tell an agent destructive · confirm first
End session {session_id} on this client.
Mark client session {session_id} as ended.
POST /v1/client/sessions/{session_id}/remove Delete a session from the current client · Remove Session #
Ask an LLM
“How do I delete a session entirely from the browser client instead of just ending it?”
“Is there a way to remove one session from a multi-session client?”
Tell an agent destructive · confirm first
Remove session {session_id} from the current client.
Delete client session {session_id}.
POST /v1/client/sessions/{session_id}/tokens Get a session JWT from the frontend client · Create Session Token #
Ask an LLM
“How do I fetch a fresh session JWT for the signed-in user from the browser?”
“Can the frontend token request pin a specific organization into the JWT?”
Tell an agent
Create a frontend session token for session {session_id}.
Get a client session JWT for {session_id} scoped to organization {organization_id}.
POST /v1/client/sessions/{session_id}/tokens/{template_name} Get a templated JWT from the frontend client · Create Session Token with JWT Template #
Ask an LLM
“How do I get a JWT shaped by a JWT template for the signed-in user in the browser?”
“Which endpoint gives the frontend a custom template token for a third-party service?”
Tell an agent
Get a {template_name} template JWT for client session {session_id}.
From the browser, mint a token for session {session_id} with JWT template {template_name}.
POST /v1/client/sessions/{session_id}/verify Start step-up reverification on a session · Start a New Session Reverification #
Ask an LLM
“How do I ask a signed-in user to re-verify before a sensitive action?”
“What happens if I request second-factor reverification but the user has no second factor?”
Tell an agent
Start reverification at level {level} for session {session_id}.
Require session {session_id} to reverify with level {level}.
POST /v1/client/sessions/{session_id}/verify/prepare_first_factor Send a first-factor reverification code · Prepare Session Reverification First Factor #
Ask an LLM
“How do I email or text a one-time code to a user during session reverification?”
“Which first-factor strategies can I prepare when reverifying a session?”
Tell an agent
Prepare first-factor reverification for session {session_id} using strategy {strategy}.
Send a reverification code to email address {email_address_id} for session {session_id}.
POST /v1/client/sessions/{session_id}/verify/attempt_first_factor Submit a first-factor reverification attempt · Attempt Session Reverification First Factor #
Ask an LLM
“How do I check the code or password a user entered to reverify their session?”
“Can a user reverify their session with a passkey instead of a code?”
Tell an agent
Attempt first-factor reverification on session {session_id} with strategy {strategy} and code {code}.
Reverify session {session_id} using the {strategy} strategy.
POST /v1/client/sessions/{session_id}/verify/prepare_second_factor Send a second-factor reverification code · Prepare Session Reverification Second Factor #
Ask an LLM
“How do I trigger the second factor, such as an SMS code, while reverifying a session?”
“Which phone number receives the code when preparing second-factor reverification?”
Tell an agent
Prepare second-factor reverification for session {session_id}.
Send a second-factor code to phone {phone_number_id} for session {session_id}.
POST /v1/client/sessions/{session_id}/verify/attempt_second_factor Submit a second-factor reverification code · Attempt Session Reverification Second Factor #
Ask an LLM
“How do I finish reverification by checking the user's second-factor code?”
“Does the second-factor reverification attempt need the prepare step first?”
Tell an agent
Attempt second-factor reverification on session {session_id} with code {code}.
Complete the second factor for session {session_id} using strategy {strategy}.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/clerk-com:clerk-com-sessions-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

clerk-com-sessions-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Clerk Com Sessions API
  termsOfService: https://clerk.com/terms
  x-logo:
    url: https://clerk.com/_next/image?url=%2Fimages%2Fclerk-logo.svg&w=96&q=75
    altText: Clerk docs
    href: https://clerk.com/docs
  version: '1.0'
  description: 'Operations tagged Sessions across 2 of this provider''s published API definitions: clerk-backend-api-openapi.yml, clerk-frontend-api-openapi.yml. Each path carries the servers of the definition it was published in.'
servers:
- url: https://api.clerk.com/v1
- url: https://{domain}.clerk.accounts.dev
  variables:
    domain:
      default: example-destined-camel-13
      description: Your Development Instance Frontend API Domain.
tags:


# --- truncated at 32 KB (90 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/clerk-com/refs/heads/main/openapi/clerk-com-sessions-api-openapi.yml