# Contributing to the Discourse API documentation

**URL:** https://meta.discourse.org/t/contributing-to-the-discourse-api-documentation/56693
**Category:** Contributing
**Tags:** rest-api, how-to
**Created:** [February 1, 2017, 5:22am UTC](https://meta.discourse.org/t/contributing-to-the-discourse-api-documentation/56693 "2017-02-01T05:22:51Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Discourse](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/discourse/32/148734_2.png) [@Discourse](https://meta.discourse.org/u/Discourse)
#### Post date: [February 1, 2017, 5:22am UTC](https://meta.discourse.org/t/contributing-to-the-discourse-api-documentation/56693/1 "2017-02-01T05:22:51Z")

</div>

> 🔖 This is a guide for contributing to the official Discourse API documentation.
> 
> 🙋 Required user level: Developer
> 
> ⚙ Console access required

Do you want to contribute to the official API documentation at [https://docs.discourse.org](https://docs.discourse.org)? This guide will explain step by step how to do it.

## Summary

This documentation will guide you through the following steps:

- Setting up prerequisites.
- Cloning the Discourse API documentation repository.
- Editing the API documentation files.
- Viewing your changes locally.
- Creating a pull request.

## Prerequisites

You must have a Discourse development installation. If you don’t have one, follow the guide that suits your environment in [these topics](https://meta.discourse.org/tags/c/documentation/10/dev-install).

## Cloning the Discourse API docs repository

Assuming your Discourse development installation is inside your home directory `~/`, proceed with the following steps to clone the repository:

1. From your home directory, clone the repository at [https://github.com/discourse/discourse\_api\_docs](https://github.com/discourse/discourse_api_docs):

2. You should now have the `discourse` and `discourse_api_docs` folders side by side:

## Editing the API documentation files

You must edit the documentation directly from `~/discourse/spec/requests/api/`.

- See the folder on GitHub: [discourse/spec/requests/api at main · discourse/discourse · GitHub](https://github.com/discourse/discourse/tree/main/spec/requests/api)

Plugin API documentation can also be contributed via spec files located in `plugins/*/spec/requests/api/`.

After editing the documentation files, run the following command from `~/discourse/`:

```bash
bin/rake rswag:specs:swaggerize && cp openapi/openapi.yaml ~/discourse_api_docs/openapi.yml

```

The documentation will be generated using [rswag](https://github.com/rswag/rswag) and copied into `~/discourse_api_docs/`.

Then, convert the YAML file to JSON from `~/discourse_api_docs/`:

```bash
npm install
node tojson.js

```

## Viewing your changes locally

To view your updated documentation, follow these steps:

1. From `~/discourse_api_docs/`, run:

2. Browse to [http://localhost:3001](http://localhost:3001) to see the updated documentation.

## Creating a pull request

Once you verify that everything looks good, create a pull request from the **discourse/discourse** repository (_not_ the Discourse API Docs repository).

💡 The `discourse_api_docs` repository is automatically updated daily via a GitHub Actions workflow that regenerates the OpenAPI spec from the latest Discourse core specs. You do not need to submit a separate PR to that repository.

## Common issues and solutions

### Reporting errors in Discourse API documentation

If you encounter issues or errors in the Discourse API documentation, please report them on the [Discourse Meta forum](https://meta.discourse.org) - you can follow the [bug report guide](https://meta.discourse.org/t/creating-bug-reports-for-discourse-on-meta/33070) to help you do this effectively.

## Additional resources

- [Topics tagged dev-install](https://meta.discourse.org/tags/c/documentation/10/dev-install)
- [Discourse GitHub Repository](https://github.com/discourse/discourse)

> Last edited by @hugh 2024-06-11T05:08:16Z
> 
> > **Check document**
> >
> > Perform check on document:

---

<div class="post-metadata">

### Author: ![srinivas.chilukuri](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/srinivas.chilukuri/32/341708_2.png) [@srinivas.chilukuri](https://meta.discourse.org/u/srinivas.chilukuri)
#### Post date: [November 16, 2023, 3:45am UTC](https://meta.discourse.org/t/contributing-to-the-discourse-api-documentation/56693/2 "2023-11-16T03:45:48Z")

</div>

How to report errors in discourse api documentation

Github repo for api documentation does not issues tab activated

 ![image](https://global.discourse-cdn.com/meta/original/4X/d/2/f/d2fcd804f469a607a7bda0ce888b74edc77b7cf1.png)

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [November 16, 2023, 6:35am UTC](https://meta.discourse.org/t/contributing-to-the-discourse-api-documentation/56693/3 "2023-11-16T06:35:03Z")

</div>

Hello and welcome @srinivas.chilukuri 🙂

You can report them on here. 👍 What seems to be the isssue?

---

<div class="post-metadata">

### Author: ![srinivas.chilukuri](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/srinivas.chilukuri/32/341708_2.png) [@srinivas.chilukuri](https://meta.discourse.org/u/srinivas.chilukuri)
#### Post date: [November 16, 2023, 7:43am UTC](https://meta.discourse.org/t/contributing-to-the-discourse-api-documentation/56693/4 "2023-11-16T07:43:57Z")

</div>

Reference : [Discourse API Documentation Get a Group](https://docs.discourse.org/#tag/Groups/operation/getGroup)

**Actions: Groups/ Get a Group**

- In documentation path parameter is shown as id ,when queried the path doesn’t exist
- When reverse engineered same query via discourse UI the path parameter is group `name` and same works via API Key

 ![image](https://global.discourse-cdn.com/meta/original/4X/6/e/8/6e8875e955dbf50a61bdac620458a93761a6cea0.png)

---

<div class="post-metadata">

### Author: ![blake](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blake/32/157322_2.png) [@blake](https://meta.discourse.org/u/blake)
#### Post date: [April 2, 2024, 8:27pm UTC](https://meta.discourse.org/t/contributing-to-the-discourse-api-documentation/56693/5 "2024-04-02T20:27:01Z")

</div>

3 posts were split to a new topic: [Document basic-info api endpoint](https://meta.discourse.org/t/document-basic-info-api-endpoint/302109)
