# API / anonymize or delete

**URL:** https://meta.discourse.org/t/api-anonymize-or-delete/158704
**Category:** Development
**Tags:** rest-api
**Created:** [July 24, 2020, 4:20pm UTC](https://meta.discourse.org/t/api-anonymize-or-delete/158704 "2020-07-24T16:20:18Z")
**Posts on this page:** 1
**Showing post:** 5

<div class="post-metadata">

### Author: ![weallwegot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/weallwegot/32/124753_2.png) [@weallwegot](https://meta.discourse.org/u/weallwegot)
#### Post date: [April 27, 2021, 2:20am UTC](https://meta.discourse.org/t/api-anonymize-or-delete/158704/5 "2021-04-27T02:20:57Z")

</div>

The API endpoint for anonymizing:

**HTTP Method:** PUT  
**Endpoint:** [https://example-community.dev/admin/users/{id}/anonymize](https://example-community.dev/admin/users/%7Bid%7D/anonymize)

> [@Anonymize user - blank response from API on attempt?](https://meta.discourse.org/t/anonymize-user-blank-response-from-api-on-attempt/79144):
>
> Hi folks, I’m trying to hit the endpoint to anonymize a user in Discourse; I’ve got single sign-on between WordPress and Discourse set up, and when the user deletes their account on WordPress I want to anonymize them in Discourse. The endpoint is /admin/users/{id}/anonymize: put: description: | Anonymize a user tags: - Admin parameters: - name: id in: path required: true type: integer responses: '200': description: succesfully anonymized user …

* * *

you can use the call shown above to get the `{id}` value if you already know the email of the user you want to anonymize

> [@simon](#):
>
> ```plaintext
> curl -X GET "http://localhost:3000/admin/users/list/all.json?email=bob@example.com" \
> -H "Api-Key: $api_key" \
> -H "Api-Username: system"
> 
> ```

---

_[View the full topic](https://meta.discourse.org/t/api-anonymize-or-delete/158704)._
