Discourse is backed by a complete JSON api. Anything you can do on the site you can also do using the JSON api.
The API is documented at docs.discourse.org. You can also use the discourse_api Ruby gem as a client library. However, not every endpoint is documented.
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 the Fetch/XHR filter:
- Perform the operation
- The request data will be shown 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
https://try.discourse.org/t/online-learning/108.json -
Payload is passed using a
PUT -
The parameter sent is:
category_id: 5
Equipped with this information you can make your own calls using your favorite programming language. All you need to do is add your Api-Username and Api-Key to the request headers. (See Discourse REST API Documentation for details about how to formulate a curl request to the Discourse API.)
API credentials can be generated from the admin panel at /admin/api/keys:



