# 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:** 5

<div class="post-metadata">

### Author: ![aaronbauman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/aaronbauman/32/204191_2.png) [@aaronbauman](https://meta.discourse.org/u/aaronbauman)
#### Post date: [May 17, 2023, 4:44pm UTC](https://meta.discourse.org/t/change-username-through-api/82500/5 "2023-05-17T16:44:28Z")

</div>

from [How does one change a username via the API? - #2 by blake](https://meta.discourse.org/t/how-does-one-change-a-username-via-the-api/96118/2) :

> Try this endpoint instead:
> 
> ```plaintext
> curl -i -sS -X PUT "http://127.0.0.1:3000/u/blake/preferences/username.json" \
> -H "Content-Type: multipart/form-data;" \
> -F "api_key=a66d01fbe98cc51b2747d8bfe99f81d7adca18317fbf3c43aa20f340d8e25bfe" \
> -F "api_username=system" \
> -F "new_username=blake2"
> 
> ```
> 
> And it will output:
> 
> ```plaintext
> {"id":1,"username":"blake2"}
> 
> ```

---

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