0

I have created few Grafana users using curl command. Here is the command i used.

curl -XPOST -H "Content-Type: application/json" -d '{
  "name":"user1@graf.com",
  "email":"user1@graf.com",
  "password":"userpassword",
  "role": "Admin"
}' http://admin:admin@grafana01.default.svc.cluster.local:3000/api/admin/users

Now i want to change the role from Admin to Viewer. How can i do that?. is there any other way I can try this out?. Any help is appreciated?

shiak
  • 1
  • 1

1 Answers1

0

To update the role to viewer for instance you can do this:

curl -XPATCH -H "Content-Type: application/json" -d '{
  "role":"Viewer"
}' http://admin:admin@grafana01.default.svc.cluster.local:3000/api/orgs/:orgId/users/:userId

Be sure to use the right orgId and userId

Have a look at https://github.com/grafana/grafana/issues/11945

EDIT: I edited my previous (and wrong) answer.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129