How to get the API key from REST API or other scripts?

An example with curl using basic auth:

curl -X POST -H "Content-Type: application/json" -d '{
  "name": "mykey",
  "role": "Admin"
}' http://admin:youradminpassword@community.grafana.com/api/auth/keys
2 Likes