Skip to main content
Privy allows you to revoke all of a user’s active sessions in your app via their Privy user ID. Revoking sessions invalidates the user’s ability to refresh their access token, causing a forced log-out. Users must reauthenticate in order to continue using your app. When a user’s session is revoked, their user ID, linked accounts, and wallets remain unchanged.
If your server verifies access tokens itself, it will keep accepting tokens from revoked sessions until they expire, because the verification only checks the token’s signature and expiry.Revoking sessions does not prevent the user from logging in again. To temporarily block a user’s access, freeze the user.
Make a POST request to:
Replace <user-id> with the user’s Privy user ID.

Request

Basic Auth
Use your Privy app ID as the username and your Privy app secret as the password. Make this request from your server to keep your app secret secure.
Object
string
required
Your Privy app ID.
string
required
Set to application/json.
Send an empty JSON body ({}).

Example

Below is a sample cURL command for revoking all active sessions for a user associated with a Privy user ID:

Response

number
All active sessions for the user in your app were successfully revoked. The request also succeeds if the user has no active sessions.
There is no user associated with the provided Privy user ID in your app.
A successful request returns: