> ## Documentation Index
> Fetch the complete documentation index at: https://docs.privy.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Revoking sessions

> Revoke all of a user's active sessions in your app via the REST API

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.

> [!NOTE]
>
> 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](https://docs.privy.io/user-management/users/managing-users/freezing-users.md).

**REST API**

Make a `POST` request to:

```sh theme={"system"}
https://api.privy.io/v1/users/<user-id>/sessions/revoke
```

Replace `<user-id>` with the user's Privy user ID.

### Request

**Authentication** `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.

**Headers** `Object`

**privy-app-id** `string` *required*

Your Privy app ID.

**Content-Type** `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:

```bash theme={"system"}
curl --request POST "https://api.privy.io/v1/users/<user-id>/sessions/revoke" \
-u "<your-privy-app-id>:<your-privy-app-secret>" \
-H "privy-app-id: <your-privy-app-id>" \
-H "Content-Type: application/json" \
-d '{}'
```

### Response

**Status Code** `number`

**200 OK**

All active sessions for the user in your app were successfully revoked. The request also
succeeds if the user has no active sessions.

**404 Not Found**

There is no user associated with the provided Privy user ID in your app.

A successful request returns:

```json theme={"system"}
{
  "success": true
}
```

**Dashboard**

To revoke a user's sessions from the Privy Dashboard, visit the [**Users** page](https://dashboard.privy.io/apps?page=users\&tab=all-users) for your application and select your desired user.

In the **User details** panel, open the **Security and access** tab. From here, you may revoke all of the user's active sessions.
