Grafana Convert Prometheus API

The convert_prometheus API from Grafana — 6 operation(s) for convert_prometheus.

GitHub OpenAPI

Operations 14

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 /convert/api/prom/rules List Cortex Prometheus alert rules · Gets all Grafana-managed alert rules that were imported from… #
Ask an LLM
“Which alert rules did I import from a Cortex Prometheus source?”
“Can I see all Cortex Prometheus rule groups in one namespace?”
Tell an agent
List all Cortex Prometheus alert rules.
Show every rule group imported from a Cortex Prometheus source.
POST /convert/api/prom/rules Convert Cortex Prometheus rule groups · Converts the submitted rule groups into Grafana-Managed Rules #
Ask an LLM
“How do I convert a batch of Cortex Prometheus rule groups into Grafana-managed rules?”
“Can I import several Cortex Prometheus rule groups at once?”
Tell an agent
Convert these Cortex Prometheus rule groups into Grafana-managed rules.
Import a batch of Cortex Prometheus rule groups.
GET /convert/api/prom/rules/{NamespaceTitle} Get Cortex alert rules imported from Prometheus · Gets Grafana-managed alert rules that were imported from Prometheus-compatible… #
Ask an LLM
“Can I read Cortex alert rules from a Prometheus-compatible import namespace?”
“What are the alerting rules in a Cortex namespace that came from Prometheus?”
Tell an agent
Get the Cortex alert rules in namespace {namespace}.
Show the imported Prometheus rules in Cortex namespace {namespace}.
POST /convert/api/prom/rules/{NamespaceTitle} Convert a Cortex rule group to Grafana rules · Converts a Prometheus rule group into a Grafana rule group and creates or… #
Ask an LLM
“How do I push a Cortex rule group into Grafana alerting?”
“Can I pause recording rules when importing a Cortex group?”
Tell an agent
Convert Cortex rule group {name} to a Grafana rule group in {namespace} with interval {interval}.
Import Cortex namespace {namespace} rules {name} paused, recording: {pause_recording}.
DELETE /convert/api/prom/rules/{NamespaceTitle} Delete a Cortex Prometheus rule namespace · Deletes all rule groups that were imported from Prometheus-compatible sources… #
Ask an LLM
“How do I delete all Cortex Prometheus rules in a namespace?”
“Can I remove a Cortex Prometheus namespace and its rule groups?”
Tell an agent destructive · confirm first
Delete the Cortex Prometheus rules in namespace {NamespaceTitle}.
Remove every Cortex Prometheus rule group from {NamespaceTitle}.
GET /convert/api/prom/rules/{NamespaceTitle}/{Group} Get a Cortex Prometheus rule group · Gets a single rule group in Prometheus-compatible format if it was imported… #
Ask an LLM
“Can I read a Cortex Prometheus rule group in Prometheus format?”
“What does one Cortex Prometheus rule group contain?”
Tell an agent
Show Cortex Prometheus rule group {Group} in namespace {NamespaceTitle}.
Get the Prometheus-compatible rules in group {Group} of {NamespaceTitle}.
DELETE /convert/api/prom/rules/{NamespaceTitle}/{Group} Delete a Cortex Prometheus rule group · Deletes a specific rule group if it was imported from a Prometheus-compatible… #
Ask an LLM
“How do I delete one Cortex Prometheus rule group?”
“Can I remove a Cortex Prometheus group I imported?”
Tell an agent destructive · confirm first
Delete Cortex Prometheus rule group {Group} from {NamespaceTitle}.
Remove the imported Cortex Prometheus group {Group} in {NamespaceTitle}.
GET /convert/prometheus/config/v1/rules List all Grafana alert rules from Prometheus imports · Gets all Grafana-managed alert rules that were imported from… #
Ask an LLM
“Which alert rules did I import from Prometheus?”
“Can I list every Prometheus-imported rule group?”
Tell an agent
List all Prometheus-imported alert rules.
Show every Grafana-managed rule group from Prometheus.
POST /convert/prometheus/config/v1/rules Convert Prometheus rule groups to Grafana rules · Converts the submitted rule groups into Grafana-Managed Rules #
Ask an LLM
“How do I bulk import Prometheus rule groups into Grafana?”
“Can I convert Prometheus rule groups to Grafana alerting?”
Tell an agent
Convert Prometheus rule groups to Grafana alerting rules.
Bulk import these Prometheus rule groups into Grafana.
GET /convert/prometheus/config/v1/rules/{NamespaceTitle} Get Prometheus rule groups imported into Grafana · Gets Grafana-managed alert rules that were imported from Prometheus-compatible… #
Ask an LLM
“Can I list the Prometheus rule groups kept in Grafana?”
“What does a Grafana namespace look like when it imported from Prometheus?”
Tell an agent
Get the Prometheus rule groups in Grafana namespace {namespace}.
Show all Grafana-managed rules from Prometheus namespace {namespace}.
POST /convert/prometheus/config/v1/rules/{NamespaceTitle} Convert a Prometheus rule group to a Grafana rule group · Converts a Prometheus rule group into a Grafana rule group and creates or… #
Ask an LLM
“How do I import one Prometheus rule group into Grafana?”
“Can I set a notification group and pause alert rules on import?”
Tell an agent
Convert Prometheus group {name} to a Grafana rule group in {namespace} with interval {interval}.
Import Prometheus namespace {namespace} rule group {name} with notification settings {settings}.
DELETE /convert/prometheus/config/v1/rules/{NamespaceTitle} Delete Prometheus-imported rule groups · Deletes all rule groups that were imported from Prometheus-compatible sources… #
Ask an LLM
“Can I delete all Grafana rules from one Prometheus-imported namespace?”
“How do I remove a Prometheus namespace of rules from Grafana?”
Tell an agent destructive · confirm first
Delete the Prometheus-imported rule groups in namespace {namespace}.
Remove Grafana's copy of Prometheus namespace {namespace}.
GET /convert/prometheus/config/v1/rules/{NamespaceTitle}/{Group} Get one Prometheus rule group in Grafana · Gets a single rule group in Prometheus-compatible format if it was imported… #
Ask an LLM
“Can I read a single Prometheus rule group as Prometheus would have sent it?”
“What does one Grafana-managed rule group export back to Prometheus look like?”
Tell an agent
Get Prometheus rule group {group} from namespace {namespace}.
Show Grafana's imported Prometheus group {group} in {namespace}.
DELETE /convert/prometheus/config/v1/rules/{NamespaceTitle}/{Group} Delete one Prometheus rule group · Deletes a specific rule group if it was imported from a Prometheus-compatible… #
Ask an LLM
“Can I delete a single Grafana rule group that came from Prometheus?”
“How do I remove one Prometheus-imported rule group?”
Tell an agent destructive · confirm first
Delete Prometheus rule group {group} from namespace {namespace}.
Remove Grafana's copy of Prometheus group {group} in {namespace}.

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-convert-prometheus-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-convert-prometheus-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. Convert Prometheus 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:
- name: convert_prometheus
paths:
  /convert/api/prom/rules:
    get:
      tags:
      - convert_prometheus
      summary: Gets all Grafana-managed alert rules that were imported from…
      operationId: RouteConvertPrometheusCortexGetRules
      responses:
        '200':
          description: PrometheusNamespace
          content:
            application/yaml:
              schema:
                $ref: '#/components/schemas/PrometheusNamespace'
        '403':
          description: ForbiddenError
          content:
            application/yaml:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
        '404':
          description: NotFound
          content:
            application/yaml:
              schema:
                $ref: '#/components/schemas/NotFound'
    post:
      tags:
      - convert_prometheus
      summary: Converts the submitted rule groups into Grafana-Managed Rules
      operationId: RouteConvertPrometheusCortexPostRuleGroups
      responses:
        '202':
          description: ConvertPrometheusResponse
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConvertPrometheusResponse'
        '403':
          description: ForbiddenError
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
  /convert/api/prom/rules/{NamespaceTitle}:
    get:
      tags:
      - convert_prometheus
      summary: Gets Grafana-managed alert rules that were imported from Prometheus-compatible…
      operationId: RouteConvertPrometheusCortexGetNamespace
      parameters:
      - name: NamespaceTitle
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: PrometheusNamespace
          content:
            application/yaml:
              schema:
                $ref: '#/components/schemas/PrometheusNamespace'
        '403':
          description: ForbiddenError
          content:
            application/yaml:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
        '404':
          description: NotFound
          content:
            application/yaml:
              schema:
                $ref: '#/components/schemas/NotFound'
    post:
      description: 'If the group already exists and was not imported from a Prometheus-compatible source initially,

        it will not be replaced and an error will be returned.'
      tags:
      - convert_prometheus
      summary: Converts a Prometheus rule group into a Grafana rule group and creates or…
      operationId: RouteConvertPrometheusCortexPostRuleGroup
      parameters:
      - name: NamespaceTitle
        in: path
        required: true
        schema:
          type: string
      - name: x-grafana-alerting-datasource-uid
        in: header
        schema:
          type: string
      - name: x-grafana-alerting-recording-rules-paused
        in: header
        schema:
          type: boolean
      - name: x-grafana-alerting-alert-rules-paused
        in: header
        schema:
          type: boolean
      - name: x-grafana-alerting-target-datasource-uid
        in: header
        schema:
          type: string
      - name: x-grafana-alerting-folder-uid
        in: header
        schema:
          type: string
      - name: x-grafana-alerting-notification-settings
        in: header
        schema:
          type: string
      responses:
        '202':
          description: ConvertPrometheusResponse
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConvertPrometheusResponse'
        '403':
          description: ForbiddenError
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
      x-raw-request: 'true'
      requestBody:
        content:
          application/yaml:
            schema:
              $ref: '#/components/schemas/PrometheusRuleGroup'
    delete:
      tags:
      - convert_prometheus
      summary: Deletes all rule groups that were imported from Prometheus-compatible sources…
      operationId: RouteConvertPrometheusCortexDeleteNamespace
      parameters:
      - name: NamespaceTitle
        in: path
        required: true
        schema:
          type: string
      responses:
        '202':
          description: ConvertPrometheusResponse
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConvertPrometheusResponse'
        '403':
          description: ForbiddenError
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
  /convert/api/prom/rules/{NamespaceTitle}/{Group}:
    get:
      tags:
      - convert_prometheus
      summary: Gets a single rule group in Prometheus-compatible format if it was imported…
      operationId: RouteConvertPrometheusCortexGetRuleGroup
      parameters:
      - name: NamespaceTitle
        in: path
        required: true
        schema:
          type: string
      - name: Group
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: PrometheusRuleGroup
          content:
            application/yaml:
              schema:
                $ref: '#/components/schemas/PrometheusRuleGroup'
        '403':
          description: ForbiddenError
          content:
            application/yaml:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
        '404':
          description: NotFound
          content:
            application/yaml:
              schema:
                $ref: '#/components/schemas/NotFound'
    delete:
      tags:
      - convert_prometheus
      summary: Deletes a specific rule group if it was imported from a Prometheus-compatible…
      operationId: RouteConvertPrometheusCortexDeleteRuleGroup
      parameters:
      - name: NamespaceTitle
        in: path
        required: true
        schema:
          type: string
      - name: Group
        in: path
        required: true
        schema:
          type: string
      responses:
        '202':
          description: ConvertPrometheusResponse
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConvertPrometheusResponse'
        '403':
          description: ForbiddenError
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
  /convert/prometheus/config/v1/rules:
    get:
      tags:
      - convert_prometheus
      summary: Gets all Grafana-managed alert rules that were imported from…
      operationId: RouteConvertPrometheusGetRules
      responses:
        '200':
          description: PrometheusNamespace
          content:
            application/yaml:
              schema:
                $ref: '#/components/schemas/PrometheusNamespace'
        '403':
          description: ForbiddenError
          content:
            application/yaml:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
        '404':
          description: NotFound
          content:
            application/yaml:
              schema:
                $ref: '#/components/schemas/NotFound'
    post:
      tags:
      - convert_prometheus
      summary: Converts the submitted rule groups into Grafana-Managed Rules
      operationId: RouteConvertPrometheusPostRuleGroups
      responses:
        '202':
          description: ConvertPrometheusResponse
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConvertPrometheusResponse'
        '403':
          description: ForbiddenError
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
  /convert/prometheus/config/v1/rules/{NamespaceTitle}:
    get:
      tags:
      - convert_prometheus
      summary: Gets Grafana-managed alert rules that were imported from Prometheus-compatible…
      operationId: RouteConvertPrometheusGetNamespace
      parameters:
      - name: NamespaceTitle
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: PrometheusNamespace
          content:
            application/yaml:
              schema:
                $ref: '#/components/schemas/PrometheusNamespace'
        '403':
          description: ForbiddenError
          content:
            application/yaml:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
        '404':
          description: NotFound
          content:
            application/yaml:
              schema:
                $ref: '#/components/schemas/NotFound'
    post:
      description: 'If the group already exists and was not imported from a Prometheus-compatible source initially,

        it will not be replaced and an error will be returned.'
      tags:
      - convert_prometheus
      summary: Converts a Prometheus rule group into a Grafana rule group and creates or…
      operationId: RouteConvertPrometheusPostRuleGroup
      parameters:
      - name: NamespaceTitle
        in: path
        required: true
        schema:
          type: string
      - name: x-grafana-alerting-datasource-uid
        in: header
        schema:
          type: string
      - name: x-grafana-alerting-recording-rules-paused
        in: header
        schema:
          type: boolean
      - name: x-grafana-alerting-alert-rules-paused
        in: header
        schema:
          type: boolean
      - name: x-grafana-alerting-target-datasource-uid
        in: header
        schema:
          type: string
      - name: x-grafana-alerting-folder-uid
        in: header
        schema:
          type: string
      - name: x-grafana-alerting-notification-settings
        in: header
        schema:
          type: string
      responses:
        '202':
          description: ConvertPrometheusResponse
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConvertPrometheusResponse'
        '403':
          description: ForbiddenError
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
      x-raw-request: 'true'
      requestBody:
        content:
          application/yaml:
            schema:
              $ref: '#/components/schemas/PrometheusRuleGroup'
    delete:
      tags:
      - convert_prometheus
      summary: Deletes all rule groups that were imported from Prometheus-compatible sources…
      operationId: RouteConvertPrometheusDeleteNamespace
      parameters:
      - name: NamespaceTitle
        in: path
        required: true
        schema:
          type: string
      responses:
        '202':
          description: ConvertPrometheusResponse
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConvertPrometheusResponse'
        '403':
          description: ForbiddenError
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
  /convert/prometheus/config/v1/rules/{NamespaceTitle}/{Group}:
    get:
      tags:
      - convert_prometheus
      summary: Gets a single rule group in Prometheus-compatible format if it was imported…
      operationId: RouteConvertPrometheusGetRuleGroup
      parameters:
      - name: NamespaceTitle
        in: path
        required: true
        schema:
          type: string
      - name: Group
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: PrometheusRuleGroup
          content:
            application/yaml:
              schema:
                $ref: '#/components/schemas/PrometheusRuleGroup'
        '403':
          description: ForbiddenError
          content:
            application/yaml:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
        '404':
          description: NotFound
          content:
            application/yaml:
              schema:
                $ref: '#/components/schemas/NotFound'
    delete:
      tags:
      - convert_prometheus
      summary: Deletes a specific rule group if it was imported from a Prometheus-compatible…
      operationId: RouteConvertPrometheusDeleteRuleGroup
      parameters:
      - name: NamespaceTitle
        in: path
        required: true
        schema:
          type: string
      - name: Group
        in: path
        required: true
        schema:
          type: string
      responses:
        '202':
          description: ConvertPrometheusResponse
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConvertPrometheusResponse'
        '403':
          description: ForbiddenError
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
components:
  schemas:
    PrometheusRule:
      type: object
      properties:
        alert:
          type: string
        annotations:
          type: object
          additionalProperties:
            type: string
        expr:
          type: string
        for:
          type: string
        keep_firing_for:
          type: string
        labels:
          type: object
          additionalProperties:
            type: string
        record:
          type: string
    ForbiddenError:
      type: object
      properties:
        body:
          $ref: '#/components/schemas/PublicError'
    NotFound:
      type: object
    PublicError:
      description: 'PublicError is derived from Error and only contains information

        available to the end user.'
      type: object
      properties:
        extra:
          type: object
          additionalProperties: {}
        message:
          type: string
        messageId:
          type: string
        statusCode:
          type: integer
          format: int64
    PrometheusRuleGroup:
      type: object
      properties:
        interval:
          $ref: '#/components/schemas/Duration'
        labels:
          type: object
          additionalProperties:
            type: string
        limit:
          type: integer
          format: int64
        name:
          type: string
        query_offset:
          type: string
        rules:
          type: array
          items:
            $ref: '#/components/schemas/PrometheusRule'
    Duration:
      description: 'A Duration represents the elapsed time between two instants

        as an int64 nanosecond count. The representation limits the

        largest representable duration to approximately 290 years.'
      type: integer
      format: int64
    PrometheusNamespace:
      type: object
      properties:
        Body:
          description: 'in: body'
          type: object
          additionalProperties:
            type: array
            items:
              $ref: '#/components/schemas/PrometheusRuleGroup'
    ConvertPrometheusResponse:
      type: object
      properties:
        error:
          type: string
        errorType:
          type: string
        status:
          type: string
  securitySchemes:
    api_key:
      type: apiKey
      name: Authorization
      in: header
    basic:
      type: http
      scheme: basic
x-provenance:
  method: harvested
  publisher: Grafana
  source: https://raw.githubusercontent.com/grafana/grafana/main/public/api-merged.json
  note: split by refine-openapis from the provider's own published document, verified by fetch (openapi/_original/*.fetch.json);
    stamped by stamp-openapi-provenance.py (roadmap#793)