# Clarification on Delete User API endpoint

**URL:** <https://forum.social.plus/t/clarification-on-delete-user-api-endpoint/1457>\
**Category:** General\
**Created:** [September 13, 2024, 9:37am UTC](https://forum.social.plus/t/clarification-on-delete-user-api-endpoint/1457 "2024-09-13T09:37:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Baz](https://avatars.discourse-cdn.com/v4/letter/b/c4cdca/32.png) [@Baz](https://forum.social.plus/u/Baz)\
**Post date:** [September 13, 2024, 9:37am UTC](https://forum.social.plus/t/clarification-on-delete-user-api-endpoint/1457/1 "2024-09-13T09:37:27Z")

</div>

Hi,

I’m seeking some clarification on the [Delete User API](https://api-docs.amity.co/#/User/delete_api_v4_users__userId_) endpoint, as it appears to work differently in practise than what is stated in the documentation.

The [Delete User](https://docs.amity.co/amity-sdk/core-concepts/user/delete-user) article also covers the same information as the Swagger docs. They state:

- 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.

When I set the `deleteAll` parameter to true when deleting a user, I am seeing different behaviour to what should be happening:

- The deleted user’s posts are removed, but their comments and replies are still visible (and their display name is now shown as “Deleted user”)
- Additionally, when a new user joins the community after the user has been deleted, they can see the posts and comments that the deleted user made - the very same posts that existing users cannot see any more!!

Please can you clarify what flags I should be using to completely remove a user from Amity?

We need to do this when anonymising users due to GDPR regulations.

Kind regards

---

<div class="post-metadata">

**Author:** ![SocialPlus\_Support](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/socialplus_support/32/798_2.png) [@SocialPlus\_Support](https://forum.social.plus/u/SocialPlus_Support)\
**Post date:** [September 13, 2024, 12:28pm UTC](https://forum.social.plus/t/clarification-on-delete-user-api-endpoint/1457/2 "2024-09-13T12:28:44Z")

</div>

Hello @Baz, After running tests, we’ve confirmed that the delete user API is functioning properly. All relevant data, such as posts and comments, were deleted and are no longer returned in API responses.

To assist in troubleshooting, please forward your full cURLs to our support team at: [support.asc@amity.co](mailto:support.asc@amity.co).

---

<div class="post-metadata">

**Author:** ![Baz](https://avatars.discourse-cdn.com/v4/letter/b/c4cdca/32.png) [@Baz](https://forum.social.plus/u/Baz)\
**Post date:** [September 13, 2024, 1:13pm UTC](https://forum.social.plus/t/clarification-on-delete-user-api-endpoint/1457/3 "2024-09-13T13:13:57Z")

</div>

Hi, thanks for looking into this for me.

However, while the users appear to be deleted when looking in the Amity console, the posts and comments still appear in the frontend.

We are using the Amity UI Kit, if that helps. Are there any issues with the UI Kit displaying deleted posts and / or comments?

Kind regards,

Baz

---

<div class="post-metadata">

**Author:** ![SocialPlus\_Support](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/socialplus_support/32/798_2.png) [@SocialPlus\_Support](https://forum.social.plus/u/SocialPlus_Support)\
**Post date:** [September 13, 2024, 2:54pm UTC](https://forum.social.plus/t/clarification-on-delete-user-api-endpoint/1457/4 "2024-09-13T14:54:50Z")

</div>

Hello, you can adjust the filter to exclude deleted posts/comments.

> - `includeDeleted` - Deletion filter. When the boolean is set to `true`, it retrieves both deleted and non-deleted posts. Conversely, when set to `false`, only non-deleted posts are returned. The default state of the boolean is `false`. Additionally, it excludes all deleted posts (both soft and hard deleted posts) not owned by the logged-in user. Community moderators have visibility of soft-deleted posts in the community feed, while self-users can see their own soft-deleted posts in their user feed.

**Query posts** : [Query Post | Amity Docs](https://docs.amity.co/amity-sdk/social/posts/query-post)  
**Query comments** : [https://docs.amity.co/amity-sdk/social/comments/query-comment](https://docs.amity.co/amity-sdk/social/comments/query-comment)
