Reputation: 1316
I am trying to create new user using grafana HTTP rest api:
I am doing HTTP post to https://adminTest:adminTest@grafanaUrl:8086/api/admin/users
with body:
{
"name":"User",
"email":"[email protected]",
"login":"user",
"password":"userpassword"
}
However i get:
{
"message": "Permission denied"
}
What are the right steps to create user with HTTP api? The adminTest
account is admin account in grafana,
Upvotes: 0
Views: 1869
Reputation: 1305
To use the HTTP Admin API, a user has to be a Grafana server admin. The term Grafana admin can therefore be a bit misleading.
To make a user a Grafana server admin, you have to be one yourself. From the docs:
To assign or remove Grafana administrator privileges:
- Sign in to Grafana as a server administrator.
- Hover your cursor over the Server Admin (shield) icon until a menu appears, and click Users.
- Click a user.
- In the Grafana Admin section, click Change.
- Click Yes or No, depending on whether or not you want this user to have the Grafana server administrator role.
- Click Change.
Upvotes: 3