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.
Example: recategorize a topic.
- Go to a topic and start editing a category:
- Open Chrome dev tools, switch to the Network tab, select XHR filter:
- Perform the operation
- 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 forumlate a curl reqest to the Discourse API.)
API credentials can be generated from the Admin / API tab:
: GitHub - discourse/discourse_api: Ruby API for Discourse2020-06-11T17:00:00Z