Grafana Element API

The Element API from Grafana — 4 operation(s) for element.

Operations 3

GET /library-elements/name/{library_element_name} Grafana Get Library Element By Name #
GET /library-elements/{library_element_uid} Grafana Get Library Element By UID #
PATCH /library-elements/{library_element_uid} Grafana Update Library Element #

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-element-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-element-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Grafana Element 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: Element
paths:
  /library-elements/name/{library_element_name}:
    parameters: []
    get:
      tags:
      - Element
      summary: Grafana Get Library Element By Name
      description: Gets a library element with the specified name from Grafana's library elements collection. This endpoint retrieves a single library element by providing its unique name as a path parameter. Library elements in Grafana are reusable components like panels or data sources that can be shared across multiple dashboards. The operation returns the complete library element object including its configuration, metadata, and any associated properties. This is useful when you need to reference or reuse a specific library element in your dashboard configurations or when you want to retrieve details about a named library element without knowing its numeric ID.
      operationId: getLibraryElementByName
      parameters:
      - name: library_element_name
        in: path
        description: ''
        required: true
        schema:
          type: string
      responses:
        '200':
          description: (empty)
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LibraryElementArrayResponseisaresponsestructforanarrayofLibraryElementDTO.'
        '401':
          description: UnauthorizedError is returned when the request is not authenticated.
          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
  /library-elements/{library_element_uid}:
    parameters: []
    get:
      tags:
      - Element
      summary: Grafana Get Library Element By UID
      description: This API operation retrieves a specific library element from Grafana using its unique identifier (UID). Library elements in Grafana are reusable components such as panels or variables that can be shared across multiple dashboards. By making a GET request to this endpoint with a library element's UID, users can fetch the complete configuration and metadata of that particular library element, including its type, name, model definition, and any associated properties. This is useful when you need to inspect, reference, or programmatically work with shared dashboard components in your Grafana instance.
      operationId: getLibraryElementByUID
      parameters:
      - name: library_element_uid
        in: path
        description: ''
        required: true
        schema:
          type: string
      responses:
        '200':
          description: (empty)
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LibraryElementResponseisaresponsestructforLibraryElementDTO.'
        '401':
          description: UnauthorizedError is returned when the request is not authenticated.
          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
    patch:
      tags:
      - Element
      summary: Grafana Update Library Element
      description: This API operation allows you to update an existing library element in Grafana by specifying its unique identifier (UID) in the request path. Using the PATCH HTTP method, you can modify specific properties of the library element without needing to provide the complete resource definition. Library elements in Grafana are reusable components such as panels or data sources that can be shared across multiple dashboards, and this endpoint enables you to make incremental changes to these shared resources. The operation requires the library element's UID to identify which element to update, and accepts a request body containing the fields you wish to modify. This is particularly useful for making quick updates to shared dashboard components without affecting their references in existing dashboards, maintaining consistency across your Grafana instance while allowing for flexible modifications to library element properties like name, description, model, or other configurable attributes.
      operationId: updateLibraryElement
      parameters:
      - name: library_element_uid
        in: path
        description: ''
        required: true
        schema:
          type: string
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchLibraryElementCommand'
        required: true
      responses:
        '200':
          description: (empty)
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LibraryElementResponseisaresponsestructforLibraryElementDTO.'
        '400':
          description: BadRequestError is returned when the request is invalid and it cannot be processed.
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseBody'
        '401':
          description: UnauthorizedError is returned when the request is not authenticated.
          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'
        '412':
          description: PreconditionFailedError
          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:
    LibraryElementDTOisthefrontendDTOforentities.:
      title: LibraryElementDTOisthefrontendDTOforentities.
      type: object
      properties:
        description:
          type: string
        folderId:
          type: integer
          description: 'Deprecated: use FolderUID instead'
          contentEncoding: int64
        folderUid:
          type: string
        id:
          type: integer
          contentEncoding: int64
        kind:
          type: integer
          contentEncoding: int64
        meta:
          $ref: '#/components/schemas/LibraryElementDTOMetaisthemetainformationforLibraryElementDTO.'
        model:
          type: object
        name:
          type: string
        orgId:
          type: integer
          contentEncoding: int64
        schemaVersion:
          type: integer
          contentEncoding: int64
        type:
          type: string
        uid:
          type: string
        version:
          type: integer
          contentEncoding: int64
    LibraryElementArrayResponseisaresponsestructforanarrayofLibraryElementDTO.:
      title: LibraryElementArrayResponseisaresponsestructforanarrayofLibraryElementDTO.
      type: object
      properties:
        result:
          type: array
          items:
            $ref: '#/components/schemas/LibraryElementDTOisthefrontendDTOforentities.'
          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.'
    LibraryElementDTOMetaUser:
      title: LibraryElementDTOMetaUser
      type: object
      properties:
        avatarUrl:
          type: string
        id:
          type: integer
          contentEncoding: int64
        name:
          type: string
    LibraryElementDTOMetaisthemetainformationforLibraryElementDTO.:
      title: LibraryElementDTOMetaisthemetainformationforLibraryElementDTO.
      type: object
      properties:
        connectedDashboards:
          type: integer
          contentEncoding: int64
        created:
          type: string
          contentEncoding: date-time
        createdBy:
          $ref: '#/components/schemas/LibraryElementDTOMetaUser'
        folderName:
          type: string
        folderUid:
          type: string
        updated:
          type: string
          contentEncoding: date-time
        updatedBy:
          $ref: '#/components/schemas/LibraryElementDTOMetaUser'
    LibraryElementResponseisaresponsestructforLibraryElementDTO.:
      title: LibraryElementResponseisaresponsestructforLibraryElementDTO.
      type: object
      properties:
        result:
          $ref: '#/components/schemas/LibraryElementDTOisthefrontendDTOforentities.'
    PatchLibraryElementCommand:
      title: PatchLibraryElementCommand
      type: object
      properties:
        folderId:
          type: integer
          description: 'ID of the folder where the library element is stored.


            Deprecated: use FolderUID instead'
          contentEncoding: int64
        folderUid:
          type: string
          description: UID of the folder where the library element is stored.
        kind:
          allOf:
          - $ref: '#/components/schemas/Kind'
          - description: 'Kind of element to create, Use 1 for library panels or 2 for c.

              Description:

              1 - library panels'
        model:
          type: object
          description: The JSON model for the library element.
        name:
          type: string
          description: Name of the library element.
        uid:
          type: string
        version:
          type: integer
          description: Version of the library element you are updating.
          contentEncoding: int64
      description: PatchLibraryElementCommand is the command for patching a LibraryElement
    Kind:
      title: Kind
      const: 1
      type: integer
      description: 'Kind of element to create, Use 1 for library panels or 2 for c.

        Description:

        1 - library panels'
  securitySchemes:
    api_key:
      type: apiKey
      name: Authorization
      in: header
    basic:
      type: http
      scheme: basic