Delete User API is called to delete a user from the system. The display name of the deleted user is replaced with “Deleted User”. This API can be called only by admin users.
Please note that this action is a hard delete, and all deleted data will be lost and cannot be recovered.
When deleting a user, you can specify that the user should be marked as deleted but the user’s data should remain unchanged, or you can specify that all personal data associated with the user should be deleted:
if the deleteAll
parameter is set to true, all personal data (i.e. profile, photos, images, and files), message channels, posts and comments of the user will be deleted.
the markMessageDeleted
parameter, when set to true, deletes all message channels and messages that the user has created
the hardDeletePost
parameter, if set to true, deletes all posts created by the user as well as the comments, reactions, child posts and child comments of the corresponding post
the hardDeleteComment
parameter, if set to true, deletes all comments and reactions of the user
Once a user has been deleted from the system, the account cannot be reactivated under any circumstances. In order to protect the user account data, no other user will be allowed to reactivate the account after it has been deleted by the user.
The user's system ID will still be stored in the database, but to protect the user's identity, the account's username will be replaced with the text "Deleted User". All deleted accounts will be marked as "Deleted Account".
If the user account is deleted, all conversation channels created by that user will be deleted immediately and no other user will be able to access those channels afterwards.
After the account is deleted, all messages for all channels and all attachments that created by the user are deleted and cannot be restored.
When a user is deleted, the channel members are updated in all channels where the user was a member, so that only active users are counted in the channels.
All the user's data, including profile, photos, videos, images, text, audio, video, attachments, files and anything else that the user has added to the system as a user will be permanently deleted from the system and cannot be recovered.
All posts created/shared by the deleted user will be deleted and all comments added by the deleted user will also be removed from all posts. No comments or sub-posts will be available after the user deletes the account.
All reactions and comments posted by the deleted user are detected and updated in the posts.
The status of the user's account is marked as "deleted" when queried and the user can no longer access it.
API response will be different based on the request and records match. The request may have successful response , or it may have bad request error, and it may respond as User not found. As the responses of API call are mentioned below.
{
"success":true
}
{ "status": "error",
"code": 400000,
"message": "User is already deleted"
}
{ "status": "error",
"code": 400400,
"message": "User Not Found."
}
Content-type | application/json |
---|---|
Path | Data field |
---|---|
Authorization
Bearer{{Admin Token}}
UserID
User public id