Please take extreme care when deleting users. For security of user assets, Privy does not
delete the embedded wallet, and instead “soft deletes” it by disassociating it from the deleted
user and archiving the data. If the user still has access to their login method, their wallet can
be recovered after deletion. Reprovisioning a deleted wallet involves a support process, so please
take care to only delete users that you intend to delete.
- NodeJS
- NodeJS (server-auth)
- REST API
- Rust
- Dashboard
Use the This method will throw an error if the deletion operation failed (e.g. due to an invalid Privy ID).
PrivyClient’s delete method from the users() interface to delete a user. As a parameter, pass the user’s Privy ID as a string:Report incorrect code
Copy
Ask AI
await privy.users().delete('insert-user-id');
Complete Example
Report incorrect code
Copy
Ask AI
import { PrivyClient } from '@privy-io/node';
const privy = new PrivyClient({
appId: process.env.PRIVY_APP_ID,
appSecret: process.env.PRIVY_APP_SECRET
});
async function deletePrivyUser(id: string) {
try {
await privy.users().delete(id);
console.log(`User ${id} successfully deleted`);
return true;
} catch (error) {
console.error(`Failed to delete user: ${error.message}`);
return false;
}
}
The
@privy-io/server-auth library is deprecated. We recommend integrating @privy-io/node for
the latest features and support.PrivyClient’s deleteUser method to delete a user. As a parameter, pass the user’s Privy DID as a string:Report incorrect code
Copy
Ask AI
await privy.deleteUser('did:privy:XXXXXX');
Complete Example
Report incorrect code
Copy
Ask AI
import { PrivyClient } from '@privy-io/server-auth';
const privy = new PrivyClient(
process.env.PRIVY_APP_ID,
process.env.PRIVY_APP_SECRET
);
async function deletePrivyUser(did: string) {
try {
await privy.deleteUser(did);
console.log(`User ${did} successfully deleted`);
return true;
} catch (error) {
console.error(`Failed to delete user: ${error.message}`);
return false;
}
}
Make a Replace
DELETE request to:Report incorrect code
Copy
Ask AI
https://auth.privy.io/api/v1/users/<did>
<did> with your user’s Privy DID. It should have the format did:privy:XXXXXX.Request
Use your Privy app ID as the username and your Privy app secret as the password.
Example
Below is a sample cURL command for deleting the user object associated with a Privy DID:Report incorrect code
Copy
Ask AI
curl --request DELETE https://auth.privy.io/api/v1/users/<user-did> \
-u "<your-privy-app-id>:<your-privy-app-secret>" \
-H "privy-app-id: <your-privy-app-id>"
Response
Use the This method will return an error if the deletion operation failed (e.g. due to an invalid Privy ID).
PrivyClient’s delete method from the users() interface to delete a user. As a parameter, pass the user’s Privy ID as a string:Report incorrect code
Copy
Ask AI
use privy_rs::PrivyClient;
let client = PrivyClient::new(app_id, app_secret)?;
client.users().delete("insert-user-id").await?;
Complete Example
Report incorrect code
Copy
Ask AI
use privy_rs::PrivyClient;
async fn delete_privy_user(
client: &PrivyClient,
user_id: &str,
) -> Result<(), Box<dyn std::error::Error>> {
match client.users().delete(user_id).await {
Ok(_) => {
println!("User {} successfully deleted", user_id);
Ok(())
}
Err(error) => {
eprintln!("Failed to delete user: {}", error);
Err(error.into())
}
}
}
// Usage
let client = PrivyClient::new(app_id, app_secret)?;
delete_privy_user(&client, "cmf56qacr01qpl90brxql83lx").await?;
The Privy Dashboard provides a simple interface to delete users when necessary.
Steps to delete a user
- Log in to the Privy Dashboard
- Navigate to the Users page for your app
- Search for the user you wish to delete
- Click on the user to open the user drawer
- Scroll to the bottom of the user drawer
- Click the Delete User button
- Confirm the deletion in the confirmation dialog
This action cannot be undone. Once a user is deleted:
- If they log in again, they will get a new DID
- They will need to relink any accounts
- They will get a new embedded wallet address
- Any data associated with their previous DID will be inaccessible

