Grafana:change the role of an existing user

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


> Blockquote

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

> Blockquote

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?

Thanks
shak

It should be possible to edit this under shield/users

Thanks. i wanted to edit using curl command. how can it achieve that?

i had a look with wireshark how it works from te UI.
I can change the email address with:

curl -XPUT -H “Content-Type: application/json” -d ‘{
id":9,“email”:"userY6MD@graf.com
}’ http://admin:xxxxxxxxx@192.168.1.154:3000/api/users/9

So no “admin” in HTTP call at the end.

The userid (in this case 9) you get when you create the user.

Did not get all the users + id’s with curl. In wireshark i see:

role is changed with a “form”, did not try this but probably possible with curl.

Hope you get a bit further with this,
I am not a grafana specialist, just using it for a couple of days. So maybe there is a easier way :).

success