Grafana Role API

The Role API from Grafana — 8 operation(s) for role.

Operations 2

PUT /access-control/roles/{roleUID} Grafana Update Role #
PUT /access-control/roles/{roleUID}/assignments Grafana Set Role Assignments #

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-role-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

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. See our Privacy Policy and Terms.

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

OpenAPI Specification

grafana-role-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Grafana Role API
  description: 'Grafana is an open-source analytics and visualization platform that helps you monitor and analyze data from various sources. It lets you create customizable dashboards with charts, graphs, and alerts to visualize metrics and logs in real-time. Commonly used for monitoring infrastructure, applications, and business metrics, Grafana connects to dozens of data sources like Prometheus, Elasticsearch, and cloud platforms, making it easier to understand system performance, troubleshoot issues, and track key indicators all in one place. '
  contact:
    name: Grafana Labs
    url: https://grafana.com
    email: hello@grafana.com
  version: 0.0.1
servers:
- url: http://{defaultHost}
  variables:
    defaultHost:
      default: www.example.com/api
- url: https://{defaultHost}
  variables:
    defaultHost:
      default: www.example.com/api
security:
- basic: []
- api_key: []
tags:
- name: Role
paths:
  /access-control/roles/{roleUID}:
    parameters: []
    put:
      tags:
      - Role
      summary: Grafana Update Role
      description: This API operation updates an existing role in Grafana's access control system by sending a PUT request to the endpoint with the role's unique identifier (roleUID) in the path. It allows administrators to modify role properties such as the role name, description, permissions, and other attributes associated with that specific role. The request requires the roleUID parameter to identify which role to update, and the request body contains the updated role configuration. This operation is typically used for managing custom roles and adjusting access permissions within Grafana's role-based access control (RBAC) system, enabling fine-grained control over user capabilities and resource access.
      operationId: updateRole
      parameters:
      - name: roleUID
        in: path
        description: ''
        required: true
        schema:
          type: string
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateRoleCommand'
        required: true
      responses:
        '200':
          description: (empty)
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RoleDTO'
        '400':
          description: BadRequestError is returned when the request is invalid and it cannot be processed.
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '403':
          description: ForbiddenError is returned if the user/token has insufficient permissions to access the requested resource.
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: NotFoundError is returned when the requested resource was not found.
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: InternalServerError is a general error indicating something went wrong internally.
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
      deprecated: false
      x-api-evangelist-processing:
        SplitPascalCaseOperationSummaries: true
        CaselCaseOperationIds: true
        WriteDescription: true
        ChooseTags: true
  /access-control/roles/{roleUID}/assignments:
    parameters: []
    put:
      tags:
      - Role
      summary: Grafana Set Role Assignments
      description: Updates the complete set of role assignments for a specific role identified by its UID in Grafana's access control system. This operation replaces all existing assignments with the new set provided in the request body, allowing administrators to define which users, teams, or service accounts are assigned to the role. The request requires the role's unique identifier in the URL path and accepts a payload containing the new assignments, typically including user IDs, team IDs, or service account IDs that should have this role. This is a privileged operation that requires appropriate permissions to manage role-based access control and is commonly used when restructuring team permissions or implementing access control changes across the Grafana instance.
      operationId: setRoleAssignments
      parameters:
      - name: roleUID
        in: path
        description: ''
        required: true
        schema:
          type: string
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SetRoleAssignmentsCommand'
        required: true
      responses:
        '200':
          description: (empty)
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RoleAssignmentsDTO'
        '403':
          description: ForbiddenError is returned if the user/token has insufficient permissions to access the requested resource.
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '404':
          description: NotFoundError is returned when the requested resource was not found.
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '500':
          description: InternalServerError is a general error indicating something went wrong internally.
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
      deprecated: false
      x-api-evangelist-processing:
        SplitPascalCaseOperationSummaries: true
        CaselCaseOperationIds: true
        WriteDescription: true
        ChooseTags: true
components:
  schemas:
    SetRoleAssignmentsCommand:
      title: SetRoleAssignmentsCommand
      type: object
      properties:
        service_accounts:
          type: array
          items:
            type: integer
            contentEncoding: int64
          description: ''
        teams:
          type: array
          items:
            type: integer
            contentEncoding: int64
          description: ''
        users:
          type: array
          items:
            type: integer
            contentEncoding: int64
          description: ''
    Permission:
      title: Permission
      type: object
      properties:
        action:
          type: string
        created:
          type: string
          contentEncoding: date-time
        scope:
          type: string
        updated:
          type: string
          contentEncoding: date-time
      description: Permission is the model for access control permissions
    RoleAssignmentsDTO:
      title: RoleAssignmentsDTO
      type: object
      properties:
        role_uid:
          type: string
        service_accounts:
          type: array
          items:
            type: integer
            contentEncoding: int64
          description: ''
        teams:
          type: array
          items:
            type: integer
            contentEncoding: int64
          description: ''
        users:
          type: array
          items:
            type: integer
            contentEncoding: int64
          description: ''
    ErrorResponseBody:
      title: ErrorResponseBody
      required:
      - message
      type: object
      properties:
        error:
          type: string
          description: Error An optional detailed description of the actual error. Only included if running in developer mode.
        message:
          type: string
          description: a human readable version of the error
        status:
          type: string
          description: 'Status An optional status to denote the cause of the error.


            For example, a 412 Precondition Failed error may include additional information of why that error happened.'
    UpdateRoleCommand:
      title: UpdateRoleCommand
      required:
      - description
      - displayName
      - group
      type: object
      properties:
        description:
          type: string
        displayName:
          type: string
        global:
          type: boolean
        group:
          type: string
        hidden:
          type: boolean
        name:
          type: string
        permissions:
          type: array
          items:
            $ref: '#/components/schemas/Permission'
          description: ''
        version:
          type: integer
          contentEncoding: int64
    RoleDTO:
      title: RoleDTO
      required:
      - created
      - description
      - displayName
      - group
      - name
      - uid
      - updated
      - version
      type: object
      properties:
        created:
          type: string
          contentEncoding: date-time
        delegatable:
          type: boolean
        description:
          type: string
        displayName:
          type: string
        global:
          type: boolean
        group:
          type: string
        hidden:
          type: boolean
        mapped:
          type: boolean
        name:
          type: string
        permissions:
          type: array
          items:
            $ref: '#/components/schemas/Permission'
          description: ''
        uid:
          type: string
        updated:
          type: string
          contentEncoding: date-time
        version:
          type: integer
          contentEncoding: int64
  securitySchemes:
    api_key:
      type: apiKey
      name: Authorization
      in: header
    basic:
      type: http
      scheme: basic