# How to change user fields with API

**URL:** https://meta.discourse.org/t/how-to-change-user-fields-with-api/147999
**Category:** Development
**Tags:** rest-api
**Created:** [April 14, 2020, 7:16pm UTC](https://meta.discourse.org/t/how-to-change-user-fields-with-api/147999 "2020-04-14T19:16:27Z")
**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: [April 14, 2020, 9:33pm UTC](https://meta.discourse.org/t/how-to-change-user-fields-with-api/147999/2 "2020-04-14T21:33:11Z")

</div>

You can create a user with custom fields via the API by passing in `user_fields[1]` like this:

```plaintext
curl -i -sS -X POST "http://localhost:3000/users" \
-H "Content-Type: multipart/form-data;" \
-H "Api-Key: d19b5a38ed13745f4c5..." \
-H "Api-Username: system" \
-F "name=cbbc7188c201b59ebc06" \
-F "username=cbbc7188c201b59ebc06" \
-F "email=cbbc7188c201b59ebc06@example.com" \
-F "password=b6629ed30b4bc3de32ce452d171540b0" \
-F "active=true" \
-F "approved=true" \
-F "user_fields[1]=a874d830b60" \
-F "user_fields[2]=732418b131b"

```

 ![image](https://global.discourse-cdn.com/meta/original/3X/7/e/7e574b3a09d83ec3a5c4feff321c93504e5b3325.png)

And you can update them by sending a PUT request to `/u/<username>.json`

 ![image](https://global.discourse-cdn.com/meta/original/3X/4/b/4b36e80e484716d3038479083c846771807413b2.png)

---

_[View the full topic](https://meta.discourse.org/t/how-to-change-user-fields-with-api/147999)._
