The Delete User API permanently removes users from the system. This is a powerful administrative function that should be used with extreme caution, as all data associated with the user will be permanently lost.
This action performs a hard delete and all deleted data will be lost permanently and cannot be recovered. Use this feature only when absolutely necessary.

Admin-Only Feature

User deletion can only be performed by admin users through the API or Console. Regular users cannot delete other users or themselves through the SDK.

API Parameters

The delete user operation accepts the following parameters to control what data gets deleted:
ParameterTypeRequiredDescription
userIdstringYesThe unique identifier of the user to delete
deleteAllbooleanNoDelete all personal data including profile, images, files, messages, posts, and comments
markMessageDeletedbooleanNoDelete all message channels and messages created by the user
hardDeletePostbooleanNoDelete posts, comments, reactions, and child content
hardDeleteCommentbooleanNoDelete all comments and reactions made by the user

Deletion Scope

Profile Data

User profile, photos, images, and files

Content Data

Messages, channels, posts, and comments

What Happens When a User is Deleted?

Implementation

User deletion is typically performed through the Admin Console or server-side API calls, not directly through client SDKs for security reasons. Please visit this page for detailed API usage.

Best Practices

Performance Considerations

Batch Processing: When deleting multiple users, process them in small batches (5-10 users) to avoid overwhelming the server and ensure better error handling.
Large Datasets: Users with extensive content (thousands of posts, messages, or files) may take longer to delete. Consider implementing progress indicators for better user experience.

Alternative Approaches

Consider these alternatives before permanent deletion:

User Suspension

Temporarily ban user access without data loss. Users can be unbanned later if needed.

Content Moderation

Remove problematic content while preserving the user account and other data.
When implementing user deletion, ensure compliance with applicable data protection regulations such as GDPR, CCPA, and other privacy laws in your jurisdiction.