# Change username through API?

**URL:** <https://meta.discourse.org/t/change-username-through-api/82500>\
**Category:** Development\
**Tags:** rest-api\
**Created:** [March 8, 2018, 10:32am UTC](https://meta.discourse.org/t/change-username-through-api/82500 "2018-03-08T10:32:17Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Raphael\_Haase\_NL](https://avatars.discourse-cdn.com/v4/letter/r/41988e/32.png) [@Raphael\_Haase\_NL](https://meta.discourse.org/u/Raphael_Haase_NL)\
**Post date:** [March 8, 2018, 10:32am UTC](https://meta.discourse.org/t/change-username-through-api/82500/1 "2018-03-08T10:32:17Z")

</div>

I would like to automatically change usernames through the API so they match the email address.  
Our community has the policy that the username must be firstname.infix.lastname for a user with the email address [firstname.infix.lastname@company.com](mailto:firstname.infix.lastname@company.com).  
So far I have been changing people’s usernames shortly after registration if they did not match the rule manually through the admin interface and would like to automate that through the API or similar.  
I did not find the call in the Discourse API docs - is it hidden somewhere how to rename a user?  
Is there an alternate way, i.e. could I somehow enforce that rule already at signup time?

---

_[View the full topic](https://meta.discourse.org/t/change-username-through-api/82500)._
