Request to Verify Admin Rights for Discourse API Key

Hi Team,

I am currently working on an integration that requires access to certain Discourse API endpoints, specifically those that expose category group permissions and group member details (including user email information where permitted).

At the moment, the API responses I am receiving do not include group permission details for categories, which suggests that the API key I am using may not have admin-level privileges.

Could you please help with the following:

  1. Confirm whether the current API key has admin-level access.

  2. If not, advise whether admin rights can be granted to this API key.

  3. If granting admin access is not possible, please let me know if there is an alternative approach or endpoint that can be used to retrieve:

    • Category group permissions

    • Group member details including email addresses (where allowed)

This access is required to generate a report of posts from the last 7 days for categories associated with a specific moderator group, along with the corresponding group member details.

Please let me know if you need any additional information from my side.

Thank you for your support.

IIRC API keys have admin access, if you scope it correctly. See Admin - docs.discourse.org.

If what you want is a report, why not use the data explorer plugin? It’s designed to generate things that very much resemble reports. You can allow members of a certain group to access a given query.

The API key will have the permissions for the user that it’s generated for, by default, or you can apply granular scopes. If you can access the endpoint you want in your browser logged in as whatever user, then you can see that the user has access and that it’s an issue with your API key.

An admin can visit the page for that API key and see what scopes are assigned to it. No one else can. From the API keys page you can click any key and see its scopes: /admin/api/keys/22

3 Likes