Grafana Access Control API

The API can be used to create, update, get and list roles, and create or remove built-in role assignments. To use the API, you would need to enable fine-grained access control. This only available in Grafana Enterprise. The API does not currently work with an API Token. So in order to use these API endpoints you will have to use Basic auth.

GitHub OpenAPI
Pull this API's OpenAPI, operations, scores and pricing into your own code or AI agent with a free APIs.io key — sign in with GitHub, Google or LinkedIn. No form to fill in; signing in shares your email address with us (Privacy).
Business capability
Identity & Access Management BC-620.20

Operations 25

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

GET /access-control/roles List all roles · Get all roles #
Ask an LLM
“What roles exist in my Grafana organization?”
“Can I list only the roles I am allowed to assign?”
Tell an agent
List all roles.
List roles that I am allowed to delegate.
POST /access-control/roles Create a custom role · Create a new custom role #
Ask an LLM
“How do I create a custom role with its own set of permissions?”
“Can I create a role that inherits only a subset of my own permissions?”
Tell an agent
Create a role named {name} with permissions {permissions}.
Create a custom role {name} with display name {displayName}.
GET /access-control/roles/{roleUID} Get a role · Get a role #
Ask an LLM
“What permissions does a given role grant?”
“Can I look up a role by its UID?”
Tell an agent
Show role {roleUID}.
Get the permissions of role {roleUID}.
PUT /access-control/roles/{roleUID} Update a custom role · Update a custom role #
Ask an LLM
“How do I change the permissions of an existing custom role?”
“Can I rename a custom role I already created?”
Tell an agent
Update role {roleUID} to have permissions {permissions}.
Rename existing role {roleUID} to {displayName}.
DELETE /access-control/roles/{roleUID} Delete a custom role · Delete a custom role #
Ask an LLM
“How do I delete a custom role?”
“Can I force-delete a role that is still assigned?”
Tell an agent destructive · confirm first
Delete role {roleUID}.
Force-delete role {roleUID} with force {force}.
GET /access-control/roles/{roleUID}/assignments List who a role is assigned to · Get role assignments #
Ask an LLM
“Which users and teams hold a particular role?”
“Can I see role assignments without team sync?”
Tell an agent
Show assignments of role {roleUID}.
List who has role {roleUID} assigned.
PUT /access-control/roles/{roleUID}/assignments Replace a role's assignments · Set role assignments #
Ask an LLM
“How do I replace the users and teams assigned to a role?”
“Can I set role assignments for several teams at once?”
Tell an agent
Assign role {roleUID} to users {users}.
Replace the assignments of role {roleUID} with teams {teams}.
GET /access-control/status Check if fine-grained access control is on · Get status #
Ask an LLM
“Is fine-grained access control enabled in my Grafana instance?”
“How do I check the access control status?”
Tell an agent
Check the access control status.
Tell me whether fine-grained access control is enabled.
POST /access-control/teams/roles/search List roles assigned to several teams · List roles assigned to multiple teams #
Ask an LLM
“Which roles are directly assigned to a set of teams?”
“Can I find roles assigned to multiple teams at once?”
Tell an agent
List roles assigned to teams {teamIds}.
Show roles directly assigned to teams {teamIds} in org {orgId}.
GET /access-control/teams/{teamId}/roles List a team's roles · Get team roles #
Ask an LLM
“What roles does a particular team hold?”
“Can I see a team's role assignments in another organization?”
Tell an agent
List roles assigned to team {teamId}.
Show team {teamId}'s roles in org {targetOrgId}.
PUT /access-control/teams/{teamId}/roles Replace a team's roles · Update team role #
Ask an LLM
“How do I replace a team's roles with a new set?”
“Can I set several roles on a team at once?”
Tell an agent
Replace team {teamId}'s roles with {roleUids}.
Set team {teamId}'s roles to {roleUids} in org {targetOrgId}.
POST /access-control/teams/{teamId}/roles Add a role to a team · Add team role #
Ask an LLM
“How do I give a team an additional role?”
“Can I add one role to a team without replacing its others?”
Tell an agent
Add role {roleUid} to team {teamId}.
Give team {teamId} the {roleUid} role.
DELETE /access-control/teams/{teamId}/roles/{roleUID} Remove a role from a team · Remove team role #
Ask an LLM
“How do I take a role away from a team?”
“Can I revoke a single role from a team?”
Tell an agent destructive · confirm first
Remove role {roleUID} from team {teamId}.
Revoke team {teamId}'s {roleUID} role.
POST /access-control/users/roles/search List roles assigned to several users · List roles assigned to multiple users #
Ask an LLM
“Which roles are directly assigned to a set of users?”
“Can I find roles assigned to multiple users at once?”
Tell an agent
List roles assigned to users {userIds}.
Show roles directly assigned to users {userIds} in org {orgId}.
GET /access-control/users/{userId}/roles List a user's roles · List roles assigned to a user #
Ask an LLM
“What roles does a specific user hold?”
“Can I see a user's roles in another organization?”
Tell an agent
List roles assigned to user {userId}.
Show user {userId}'s roles in org {targetOrgId}.
PUT /access-control/users/{userId}/roles Replace a user's roles · Set user role assignments #
Ask an LLM
“How do I replace a user's roles with a new set?”
“Can I set several roles on a user at once?”
Tell an agent
Replace user {userId}'s roles with {roleUids}.
Set user {userId}'s roles to {roleUids} in org {targetOrgId}.
POST /access-control/users/{userId}/roles Assign a role to a user · Add a user role assignment #
Ask an LLM
“How do I give a user an additional role?”
“Can I add one role to a user without replacing their other roles?”
Tell an agent
Assign role {roleUid} to user {userId}.
Give user {userId} the {roleUid} role.
DELETE /access-control/users/{userId}/roles/{roleUID} Revoke a role from a user · Remove a user role assignment #
Ask an LLM
“How do I take a role away from a user?”
“Can I revoke a single role from a user?”
Tell an agent destructive · confirm first
Revoke role {roleUID} from user {userId}.
Remove user {userId}'s {roleUID} role.
GET /access-control/{resource}/description Describe a resource's access control · Get a description of a resource's access control properties #
Ask an LLM
“What access control properties does a given resource have?”
“Can I get a description of a resource's access control properties?”
Tell an agent
Describe the access control properties of {resource}.
Get the access control description for resource {resource}.
GET /access-control/{resource}/{resourceID} List a resource's permissions · Get permissions for a resource #
Ask an LLM
“Which permissions does a given resource grant?”
“Can I list the permissions for a specific dashboard or folder?”
Tell an agent
List permissions for {resource} {resourceID}.
Show what {resource} {resourceID} allows.
POST /access-control/{resource}/{resourceID} Assign permissions to a resource · Set resource permissions #
Ask an LLM
“How do I grant a user or team access to a specific dashboard or folder?”
“Can I set permissions on a data source for a built-in role?”
Tell an agent
Assign permissions {permissions} to {resource} {resourceID}.
Grant access to resource {resource} {resourceID} for a user or team.
POST /access-control/{resource}/{resourceID}/builtInRoles/{builtInRole} Assign permissions to a built-in role on a resource · Set resource permissions for a built-in role #
Ask an LLM
“Can I give a built-in role access to a dashboard through the API?”
“What's the way to attach a built-in role's permissions to a folder?”
Tell an agent
Assign built-in role {builtInRole} permissions on {resource} {resourceID}.
Set built-in role {builtInRole} access to resource {resource} {resourceID}.
POST /access-control/{resource}/{resourceID}/teams/{teamID} Assign permissions to a team on a resource · Set resource permissions for a team #
Ask an LLM
“How do I give a team access to a folder?”
“Can I set team-level permissions on a data source?”
Tell an agent
Assign team {teamID} permissions on {resource} {resourceID}.
Grant team {teamID} access to resource {resource} {resourceID}.
POST /access-control/{resource}/{resourceID}/users/{userID} Assign permissions to a user on a resource · Set resource permissions for a user #
Ask an LLM
“How do I give a specific user access to a dashboard?”
“Can I set a service account's permissions on a folder?”
Tell an agent
Assign user {userID} permissions on {resource} {resourceID}.
Grant user {userID} access to resource {resource} {resourceID}.
POST /admin/provisioning/access-control/reload Reload the access control configuration · You need to have a permission with action `provisioning:reload` with scope… #
Ask an LLM
“How do I reload the access control configuration after provisioning?”
“Can I force a provisioned access control reload?”
Tell an agent
Reload the access control configuration.
Trigger a provisioned access control reload.

Documentation

📖
Documentation
https://grafana.com/docs/grafana/latest/developers/http_api/
📖
Authentication
https://grafana.com/docs/grafana/latest/developers/http_api/authentication/
📖
Documentation
https://grafana.com/docs/grafana/latest/developers/http_api/dashboard/
📖
Documentation
https://grafana.com/docs/grafana/latest/developers/http_api/dashboard_versions/
📖
Documentation
https://grafana.com/docs/grafana/latest/developers/http_api/dashboard_permissions/
📖
Documentation
https://grafana.com/docs/grafana/latest/developers/http_api/dashboard_public/
📖
Documentation
https://grafana.com/docs/grafana/latest/developers/http_api/folder/
📖
Documentation
https://grafana.com/docs/grafana/latest/developers/http_api/folder_dashboard_search/
📖
Documentation
https://grafana.com/docs/grafana/latest/developers/http_api/folder_permissions/
📖
Documentation
https://grafana.com/docs/grafana/latest/developers/http_api/data_source/
📖
Documentation
https://grafana.com/docs/grafana/latest/developers/http_api/datasource_permissions/
📖
Documentation
https://grafana.com/docs/grafana/latest/developers/http_api/datasource_lbac_rules/
📖
Documentation
https://grafana.com/docs/grafana/latest/developers/http_api/alerting_provisioning/
📖
Documentation
https://grafana.com/docs/grafana/latest/developers/http_api/annotations/
📖
Documentation
https://grafana.com/docs/grafana/latest/developers/http_api/org/
📖
Documentation
https://grafana.com/docs/grafana/latest/developers/http_api/user/
📖
Documentation
https://grafana.com/docs/grafana/latest/developers/http_api/team/
📖
Documentation
https://grafana.com/docs/grafana/latest/developers/http_api/team_sync/
📖
Documentation
https://grafana.com/docs/grafana/latest/developers/http_api/preferences/
📖
Documentation
https://grafana.com/docs/grafana/latest/developers/http_api/access_control/
📖
Documentation
https://grafana.com/docs/grafana/latest/developers/http_api/serviceaccount/
📖
Documentation
https://grafana.com/docs/grafana/latest/developers/http_api/sso-settings/
📖
Documentation
https://grafana.com/docs/grafana/latest/developers/http_api/admin/
📖
Documentation
https://grafana.com/docs/grafana/latest/developers/http_api/licensing/
📖
Documentation
https://grafana.com/docs/grafana/latest/developers/http_api/reporting/
📖
Documentation
https://grafana.com/docs/grafana/latest/developers/http_api/query_and_resource_caching/
📖
Documentation
https://grafana.com/docs/grafana/latest/developers/http_api/library_element/
📖
Documentation
https://grafana.com/docs/grafana/latest/developers/http_api/correlations/
📖
Documentation
https://grafana.com/docs/grafana/latest/developers/http_api/snapshot/
📖
Documentation
https://grafana.com/docs/grafana/latest/developers/http_api/short_url/
📖
Documentation
https://grafana.com/docs/grafana/latest/developers/http_api/query_history/

Specifications

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/grafana-com:grafana-com-access-control-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

grafana-com-access-control-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  description: 'The Grafana backend exposes an HTTP API, the same API is used by the frontend to do

    everything from saving dashboards, creating users and updating data sources.'
  title: Grafana HTTP API. Access Control API
  contact:
    name: Grafana Labs
    url: https://grafana.com
    email: hello@grafana.com
  version: 0.0.1
servers:
- url: /api
security:
- basic: []
- api_key: []
tags:


# --- truncated at 32 KB (36 KB total) ---
# Full source: https://artifacts.apis.io/grafana-com/openapi/grafana-com-access-control-api-openapi.yml