Discourse is backed by a complete JSON api. Anything you can do on the site you can also do using the JSON api.
Many of the endpoints are properly documented in the discourse_api gem, however some endpoints lack documentation.
To determine how to do something with the JSON API here are some steps you can follow.
- Go to a topic and start editing a category:
- Open Chrome dev tools, switch to the Network tab, select XHR filter:
- Perform the operation
- Note that in some versions of Chrome, the “Form Data” will be located under the “Payload” tab
- Look at preview as well to figure out the results
- You now have all the info you need.
The endpoint is
Payload is passed using a
The parameter sent is:
Equipped with this information you can make your own calls using your favorite programming language. All you need to do is add your
Api-Key to the request headers. (See Discourse API Documentation for details about how to formulate a curl request to the Discourse API.)
API credentials can be generated from the Admin / API tab:
Last Reviewed by @AlexDev on 2022-06-03T00:00:00Z