My API key does not seem to have the permissions to create a user. So, I edited etc/grafana/provisioning/access-control/sample.yaml
# ---
# # config file version
apiVersion: 2
# <list> list of roles to insert/update/delete
roles:
# <string, required> name of the role you want to create or update. Required.
- name: 'custom:users:writer'
# <string> uid of the role. Has to be unique for all orgs.
uid: customuserswriter1
# <string> description of the role, informative purpose only.
description: 'Create, read, write users'
# <int> version of the role, Grafana will update the role when increased.
version: 2
# <int> org id. Defaults to Grafana's default if not specified.
orgId: 1
# <list> list of the permissions granted by this role.
permissions:
# <string, required> action allowed.
- action: 'users:read'
#<string> scope it applies to.
scope: 'global.users:*'
- action: 'users:write'
scope: 'global.users:*'
- action: 'users:create'
After this, I sent a request to this endpoint:
curl -X POST https://<admin>:<admin-pwd>@<my-host>/api/admin/provisioning/access-control/reload
-H "Accept: application/json"
-H "Content-Type: application/json"
here is the response:
{"message":"Not found"}
Others work for example:
curl -X POST https://<admin>:<admin-pwd>@<my-host>/api/admin/provisioning/notifications/reload
-H "Accept: application/json"
-H "Content-Type: application/json"
{"message":"Notifications config reloaded"}
What am I doing incorrectly? Docs are very confusing, to be honest. This section: Admin HTTP API | Grafana documentation really needs an update. It never mentions what to do if things go wrong.