Skip to content
masterclassBuddyTech Buzz5 fresh blogs · 5:00 AM IST

Clerk · Module

sessions.revokeSession

Revokes a specific Clerk session by ID and signs the user out from its associated client. The operation returns the revoked Session.

How it works

This backend method revokes the session identified by the supplied ID. The associated client is signed out, and the asynchronous operation resolves to the revoked Session object.

Syntax

function revokeSession(sessionId: string): Promise<Session>

Parameters

NameTypeDescription
sessionIdstringThe ID of the session to revoke.

Returns

Promise<Session>

Key points

  • It invalidates the specific session identified by the argument.
  • The resolved value is the Session resource after revocation.
  • The required input is the target session's identifier.
  • Access the backend client according to the SDK integration in use.
  • The SDK delegates the operation to Clerk's Backend API.

Common mistakes

  • Revoking a session affects the client associated with that session, so the user is signed out there.

Example: Revoke a session

const sessionId = "sess_123";
const revokedSession = await clerkClient.sessions.revokeSession(sessionId);
console.log(revokedSession.id);

Pass the target session ID to the backend Clerk client and await the returned revoked Session object.

When to use it

Force logout

An administrator needs to force a user's particular device or browser session to end.

Contain a compromised session

A backend receives a security signal for one active session.

Interview questions

QHow do you revoke a Clerk session from a backend?

Call clerkClient.sessions.revokeSession(sessionId) with the session ID. The promise resolves to the revoked Session.

Follow-up: What does the operation target? It revokes one specific session rather than requiring a user-wide session operation.

QWhat are the parameter and return types?

The sessionId parameter is a string containing the ID of the session to revoke. The method returns Promise<Session>.

Follow-up: Why await it? The operation is asynchronous because the SDK performs a backend request before returning the resulting Session.

QWhat backend operation does this SDK method represent?

The SDK method wraps the Backend API endpoint POST /sessions/{session_id}/revoke. Use the SDK method when working through clerkClient.

Follow-up: What must be substituted into the endpoint path? Replace {session_id} with the target session's identifier.

  • clerkClient
  • Session
  • BAPI endpoint POST /sessions/{session_id}/revoke

Source: revokeSession() - Sessions | Clerk Docs. Checked 2026-10-15.