Why API_KEY access prompt permission is not enough?

Hi, everybody! When I use the API_KEY Grafana visit, the return of information is {“message”: “Permission denied”}, but I use the account password to get the data normally, although this can be used, I am sure to create API_KEY admin permission, The language used is python, wondering why this is? thank you very much!

use API_KEY:

image

use accout and password:

image

Hi,

From the documentation:

The Admin HTTP API does not currently work with an API Token. API Tokens are currently only linked to an organization and an organization role. They cannot be given the permission of server admin, only users can be given that permission. So in order to use these API calls you will have to use Basic Auth and the Grafana user must have the Grafana Admin permission. (The default admin user is called admin and has permission to use this API.)

Marcus

Thank you for your answer!