# Problem updating user custom\_fields created by a plugin

**URL:** https://meta.discourse.org/t/problem-updating-user-custom-fields-created-by-a-plugin/115344
**Category:** Development
**Created:** [4월 17, 2019, 8:04오후 UTC](https://meta.discourse.org/t/problem-updating-user-custom-fields-created-by-a-plugin/115344 "2019-04-17T20:04:46Z")
**Posts on this page:** 1
**Showing post:** 7

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [4월 17, 2019, 10:35오후 UTC](https://meta.discourse.org/t/problem-updating-user-custom-fields-created-by-a-plugin/115344/7 "2019-04-17T22:35:27Z")

</div>

Yes, the CSRF error would suggest a bad API key. The other issue you may be running into is that we added some protection for user custom fields back in September 2018. If you want to be able to edit them from the API, you now need to add something like

```plaintext
register_editable_user_custom_field :my_preference

```

in your plugin. You can find more details on that here: [Add a custom per-user setting in a plugin](https://meta.discourse.org/t/add-a-custom-per-user-setting-in-a-plugin/94048)

---

_[View the full topic](https://meta.discourse.org/t/problem-updating-user-custom-fields-created-by-a-plugin/115344)._
