# How does one change a username via the API?

**URL:** https://meta.discourse.org/t/how-does-one-change-a-username-via-the-api/96118
**Category:** Support
**Created:** [August 31, 2018, 9:05pm UTC](https://meta.discourse.org/t/how-does-one-change-a-username-via-the-api/96118 "2018-08-31T21:05:51Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![blake](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blake/32/157322_2.png) [@blake](https://meta.discourse.org/u/blake)
#### Post date: [August 31, 2018, 10:50pm UTC](https://meta.discourse.org/t/how-does-one-change-a-username-via-the-api/96118/2 "2018-08-31T22:50:38Z")

</div>

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/how-does-one-change-a-username-via-the-api/96118)._
