In the Support category, Apoorva_Johari requests verification of admin rights for a Discourse API key, noting that current responses lack category group permissions and group member details. They seek confirmation of admin access, instructions on granting such rights, or alternative methods to retrieve this data for a specific report.
NateDhaliwal responds that API keys typically possess admin access if configured with the correct scopes, pointing to documentation and meta topics on the subject.
pfaffman suggests using the Data Explorer plugin as a more suitable alternative for generating reports. They clarify that API permissions mirror the user they are generated for, or can be set via granular scopes. To verify access, one should check if the endpoint works in a browser while logged in as the associated user. Additionally, pfaffman notes that only an admin can view specific scopes on the API key management page.
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:
Confirm whether the current API key has admin-level access.
If not, advise whether admin rights can be granted to this API key.
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.
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