I have been reviewing the API documentation and can not seem to find how I can edit user information other than email and avatar. For example firstname, lastname, and more importantly custom fields.
Can someone please help.
Thank you.
The discussion revolves around updating custom fields using the Discourse API. hjalali initially sought help as they couldn’t find the relevant API documentation. Falco suggested using the “How to reverse engineer the Discourse API” guide to learn the API request.
hjalali and pfaffman agreed that this guide should be more prominently featured in the documentation.
JammyDodger shared a relevant topic on “How to change user fields with API”.
Canapin provided a detailed solution for updating custom fields using the API, involving inspecting the network request when updating a user profile field in the browser’s dev tools.
You can learn the API request for that using How to reverse engineer the Discourse API
This is at least twice in as many days that this has been the answer to a question. That link really needs to be at the top of the docs.
I agree, if there is a docs document it is kind of assumed it is complete and if not it would be good to mention it.
Is there any detailed solution yet for this topic @hjalali ?
Is this topic any help?
There is now a message on docs.discourse.org:
Note: For any endpoints not listed you can follow the reverse engineer the Discourse API guide to figure out how to use an API endpoint.
But we’ll try to update it from time to time to make it more complete.
@philipp96, did you have a look at Reverse engineer the Discourse API? Understanding how such an action is done is very easy. It’s a matter of seconds, literally, once you’ve learned how to do it. ![]()
For the custom field question:
Open the network tab of your dev tools in your browser.
Update a field in your user profile
Look at [your username].json in the “Name” section of the network tab (you can also filter by the string json)
Click the Payload tab on the right
All the data sent in the body of your request is written here:
It’s the same process for other requests.