openapi: 3.0.3
info:
title: Grafana HTTP Access Routes API
description: The Grafana HTTP API provides programmatic access to Grafana's core functionality including dashboards, data sources, alerts, users, organizations, folders, annotations, and teams. Authentication is handled via API keys, basic auth, or OAuth tokens passed in the Authorization header.
version: 11.0.0
contact:
name: Grafana Labs
url: https://grafana.com
license:
name: AGPL-3.0
url: https://www.gnu.org/licenses/agpl-3.0.html
servers:
- url: https://{instance}.grafana.net/api
description: Grafana Cloud
variables:
instance:
default: your-instance
- url: http://localhost:3000/api
description: Local Grafana instance
security:
- BearerAuth: []
- BasicAuth: []
- ApiKeyAuth: []
tags:
- name: Routes
paths:
/convert/api/prom/rules:
parameters: []
get:
tags:
- Routes
summary: Grafana Route Convert Prometheus Cortex Get Rules
description: This API operation retrieves Prometheus or Cortex alerting and recording rules from a configured data source and converts them into Grafana's unified alerting format. It acts as a migration utility that fetches existing Prometheus-compatible rules and transforms them so they can be imported or managed within Grafana's alerting system, enabling users to consolidate their monitoring rules into Grafana's native rule structure while maintaining compatibility with Prometheus-style rule definitions.
operationId: routeConvertPrometheusCortexGetRules
parameters: []
responses:
'200':
description: PrometheusNamespace
headers: {}
content:
application/yaml:
schema:
contentMediaType: application/yaml
'403':
description: ForbiddenError
headers: {}
content:
application/yaml:
schema:
contentMediaType: application/yaml
'404':
description: NotFound
headers: {}
content:
application/yaml:
schema:
contentMediaType: application/yaml
deprecated: false
x-api-evangelist-processing:
SplitPascalCaseOperationSummaries: true
CaselCaseOperationIds: true
WriteDescription: true
ChooseTags: true
post:
tags:
- Routes
summary: Grafana Route Convert Prometheus Cortex Post Rule Groups
description: This API operation converts Prometheus or Cortex rule group configurations into Grafana's native format by accepting a POST request to the /convert/api/prom/rules endpoint. It enables users to migrate their existing Prometheus-style alerting and recording rules from Prometheus or Cortex deployments into Grafana, facilitating the transition between monitoring systems while preserving rule logic and structure. The endpoint processes the submitted rule groups and transforms them into a format compatible with Grafana's alerting engine, streamlining the configuration migration process and reducing manual conversion efforts.
operationId: routeConvertPrometheusCortexPostRuleGroups
parameters:
- name: Content-Type
in: header
description: ''
required: true
schema:
const: application/json
type: string
responses:
'202':
description: ConvertPrometheusResponse
headers: {}
content:
application/json:
schema:
$ref: '#/components/schemas/ConvertPrometheusResponse'
'403':
description: ForbiddenError
headers: {}
content:
application/json:
schema:
$ref: '#/components/schemas/ForbiddenError'
deprecated: false
x-api-evangelist-processing:
SplitPascalCaseOperationSummaries: true
CaselCaseOperationIds: true
WriteDescription: true
ChooseTags: true
/convert/api/prom/rules/{NamespaceTitle}:
parameters: []
get:
tags:
- Routes
summary: Grafana Route Convert Prometheus Cortex Get Namespace
description: This API operation retrieves and converts Prometheus or Cortex rule configurations from a specific namespace in Grafana. By making a GET request to the endpoint with a namespace title parameter, it fetches the alerting and recording rules defined within that namespace and converts them into a format compatible with Grafana's unified alerting system. This is particularly useful when migrating from Prometheus-style alerting rules to Grafana's native alerting framework, allowing users to maintain their existing rule configurations while leveraging Grafana's enhanced alerting capabilities and management features.
operationId: routeConvertPrometheusCortexGetNamespace
parameters:
- name: NamespaceTitle
in: path
description: ''
required: true
schema:
type: string
responses:
'200':
description: PrometheusNamespace
headers: {}
content:
application/yaml:
schema:
contentMediaType: application/yaml
'403':
description: ForbiddenError
headers: {}
content:
application/yaml:
schema:
contentMediaType: application/yaml
'404':
description: NotFound
headers: {}
content:
application/yaml:
schema:
contentMediaType: application/yaml
deprecated: false
x-api-evangelist-processing:
SplitPascalCaseOperationSummaries: true
CaselCaseOperationIds: true
WriteDescription: true
ChooseTags: true
post:
tags:
- Routes
summary: Grafana Route Convert Prometheus Cortex Post Rule Group
description: The Grafana API operation POST /convert/api/prom/rules/{NamespaceTitle} converts and creates a Prometheus or Cortex rule group within a specified namespace. This endpoint accepts Prometheus-style rule definitions and transforms them into Grafana's native alert rule format, allowing users to migrate their existing Prometheus alerting and recording rules into Grafana's unified alerting system. The {NamespaceTitle} parameter identifies the target namespace where the converted rule group will be stored, enabling organized management of alert rules across different teams or services within Grafana.
operationId: routeConvertPrometheusCortexPostRuleGroup
parameters:
- name: NamespaceTitle
in: path
description: ''
required: true
schema:
type: string
- name: x-grafana-alerting-datasource-uid
in: header
description: ''
schema:
type: string
- name: x-grafana-alerting-recording-rules-paused
in: header
description: ''
schema:
type: boolean
- name: x-grafana-alerting-alert-rules-paused
in: header
description: ''
schema:
type: boolean
- name: x-grafana-alerting-target-datasource-uid
in: header
description: ''
schema:
type: string
- name: x-grafana-alerting-folder-uid
in: header
description: ''
schema:
type: string
- name: x-grafana-alerting-notification-settings
in: header
description: ''
schema:
type: string
requestBody:
description: ''
content:
application/yaml:
schema:
$ref: '#/components/schemas/PrometheusRuleGroup'
required: false
responses:
'202':
description: ConvertPrometheusResponse
headers: {}
content:
application/json:
schema:
$ref: '#/components/schemas/ConvertPrometheusResponse'
'403':
description: ForbiddenError
headers: {}
content:
application/json:
schema:
$ref: '#/components/schemas/ForbiddenError'
deprecated: false
x-api-evangelist-processing:
SplitPascalCaseOperationSummaries: true
CaselCaseOperationIds: true
WriteDescription: true
ChooseTags: true
delete:
tags:
- Routes
summary: Grafana Route Convert Prometheus Cortex Delete Namespace
description: This API operation deletes a specific Prometheus or Cortex rule namespace within Grafana's conversion or migration layer. By sending a DELETE request to the endpoint with a namespace title parameter, users can remove an entire namespace and its associated alert rules or recording rules that were previously converted or imported from Prometheus/Cortex format. This is useful during cleanup operations, when reorganizing rule structures, or when removing legacy configurations that have been migrated to Grafana's native rule format.
operationId: routeConvertPrometheusCortexDeleteNamespace
parameters:
- name: NamespaceTitle
in: path
description: ''
required: true
schema:
type: string
responses:
'202':
description: ConvertPrometheusResponse
headers: {}
content:
application/json:
schema:
$ref: '#/components/schemas/ConvertPrometheusResponse'
'403':
description: ForbiddenError
headers: {}
content:
application/json:
schema:
$ref: '#/components/schemas/ForbiddenError'
deprecated: false
x-api-evangelist-processing:
SplitPascalCaseOperationSummaries: true
CaselCaseOperationIds: true
WriteDescription: true
ChooseTags: true
/convert/api/prom/rules/{NamespaceTitle}/{Group}:
parameters: []
get:
tags:
- Routes
summary: Grafana Route Convert Prometheus Cortex Get Rule Group
description: 'This API operation retrieves a specific Prometheus rule group from a designated namespace in Grafana''s Cortex ruler service. The endpoint accepts two path parameters: NamespaceTitle which identifies the namespace containing the rule group, and Group which specifies the name of the rule group to retrieve. When called, it returns the configuration and rules defined within that particular rule group, allowing users to view and manage their Prometheus alerting and recording rules that have been converted or stored in the Cortex format within Grafana''s unified alerting system.'
operationId: routeConvertPrometheusCortexGetRuleGroup
parameters:
- name: NamespaceTitle
in: path
description: ''
required: true
schema:
type: string
- name: Group
in: path
description: ''
required: true
schema:
type: string
responses:
'200':
description: PrometheusRuleGroup
headers: {}
content:
application/yaml:
schema:
contentMediaType: application/yaml
'403':
description: ForbiddenError
headers: {}
content:
application/yaml:
schema:
contentMediaType: application/yaml
'404':
description: NotFound
headers: {}
content:
application/yaml:
schema:
contentMediaType: application/yaml
deprecated: false
x-api-evangelist-processing:
SplitPascalCaseOperationSummaries: true
CaselCaseOperationIds: true
WriteDescription: true
ChooseTags: true
delete:
tags:
- Routes
summary: Grafana Route Convert Prometheus Cortex Delete Rule Group
description: This API operation is used to delete a specific Prometheus rule group within Grafana's Cortex-based alerting system. It targets a rule group identified by both its namespace title and group name through the URL path parameters. When called with the DELETE HTTP method, it removes the entire rule group configuration from the specified namespace, effectively eliminating all alert and recording rules contained within that group from the Prometheus-compatible rules engine in Grafana.
operationId: routeConvertPrometheusCortexDeleteRuleGroup
parameters:
- name: NamespaceTitle
in: path
description: ''
required: true
schema:
type: string
- name: Group
in: path
description: ''
required: true
schema:
type: string
responses:
'202':
description: ConvertPrometheusResponse
headers: {}
content:
application/json:
schema:
$ref: '#/components/schemas/ConvertPrometheusResponse'
'403':
description: ForbiddenError
headers: {}
content:
application/json:
schema:
$ref: '#/components/schemas/ForbiddenError'
deprecated: false
x-api-evangelist-processing:
SplitPascalCaseOperationSummaries: true
CaselCaseOperationIds: true
WriteDescription: true
ChooseTags: true
/convert/prometheus/config/v1/rules:
parameters: []
get:
tags:
- Routes
summary: Grafana Route Convert Prometheus Get Rules
description: This API operation retrieves Prometheus alerting and recording rules from a Grafana instance and converts them into a standardized configuration format. When a GET request is made to the /convert/prometheus/config/v1/rules endpoint, it fetches the existing Prometheus-style rules configured within Grafana and transforms them into a version 1 configuration schema, making it easier to migrate, backup, or integrate these rules with other systems or Prometheus instances. This is particularly useful for administrators who need to export their Grafana-managed Prometheus rules or maintain consistency across multiple monitoring environments.
operationId: routeConvertPrometheusGetRules
parameters: []
responses:
'200':
description: PrometheusNamespace
headers: {}
content:
application/yaml:
schema:
contentMediaType: application/yaml
'403':
description: ForbiddenError
headers: {}
content:
application/yaml:
schema:
contentMediaType: application/yaml
'404':
description: NotFound
headers: {}
content:
application/yaml:
schema:
contentMediaType: application/yaml
deprecated: false
x-api-evangelist-processing:
SplitPascalCaseOperationSummaries: true
CaselCaseOperationIds: true
WriteDescription: true
ChooseTags: true
post:
tags:
- Routes
summary: Grafana Route Convert Prometheus Post Rule Groups
description: This API operation converts Prometheus rule group configurations to Grafana's format via a POST request to the /convert/prometheus/config/v1/rules endpoint. It accepts Prometheus-formatted rule groups as input and transforms them into a compatible format that can be used within Grafana's alerting and recording rule system, facilitating migration or integration between Prometheus and Grafana monitoring setups.
operationId: routeConvertPrometheusPostRuleGroups
parameters:
- name: Content-Type
in: header
description: ''
required: true
schema:
const: application/json
type: string
responses:
'202':
description: ConvertPrometheusResponse
headers: {}
content:
application/json:
schema:
$ref: '#/components/schemas/ConvertPrometheusResponse'
'403':
description: ForbiddenError
headers: {}
content:
application/json:
schema:
$ref: '#/components/schemas/ForbiddenError'
deprecated: false
x-api-evangelist-processing:
SplitPascalCaseOperationSummaries: true
CaselCaseOperationIds: true
WriteDescription: true
ChooseTags: true
/convert/prometheus/config/v1/rules/{NamespaceTitle}:
parameters: []
get:
tags:
- Routes
summary: Grafana Route Convert Prometheus Get Namespace
description: This API operation retrieves and converts Prometheus alerting and recording rules from a specific namespace within Grafana. By making a GET request to the endpoint with a specified namespace title, it fetches the Prometheus rule configuration for that namespace and converts it into a format compatible with Grafana's alerting system. This is particularly useful when migrating from Prometheus-based alerting to Grafana's unified alerting system, allowing users to import existing Prometheus rule definitions while maintaining their organizational structure by namespace. The operation returns the converted rule configuration that can then be used within Grafana's alert management interface.
operationId: routeConvertPrometheusGetNamespace
parameters:
- name: NamespaceTitle
in: path
description: ''
required: true
schema:
type: string
responses:
'200':
description: PrometheusNamespace
headers: {}
content:
application/yaml:
schema:
contentMediaType: application/yaml
'403':
description: ForbiddenError
headers: {}
content:
application/yaml:
schema:
contentMediaType: application/yaml
'404':
description: NotFound
headers: {}
content:
application/yaml:
schema:
contentMediaType: application/yaml
deprecated: false
x-api-evangelist-processing:
SplitPascalCaseOperationSummaries: true
CaselCaseOperationIds: true
WriteDescription: true
ChooseTags: true
post:
tags:
- Routes
summary: Grafana Route Convert Prometheus Post Rule Group
description: This API operation converts Prometheus rule group configurations to Grafana's native format by accepting a POST request to the endpoint /convert/prometheus/config/v1/rules/{NamespaceTitle}, where {NamespaceTitle} represents the target namespace for the rule group. It takes Prometheus-formatted alerting and recording rules as input and transforms them into Grafana-compatible rule configurations, facilitating migration or integration between Prometheus and Grafana alerting systems. The operation allows users to seamlessly transfer their existing Prometheus rule definitions into Grafana without manual reconfiguration, preserving the rule logic, labels, annotations, and evaluation intervals while adapting them to Grafana's rule management structure.
operationId: routeConvertPrometheusPostRuleGroup
parameters:
- name: NamespaceTitle
in: path
description: ''
required: true
schema:
type: string
- name: x-grafana-alerting-datasource-uid
in: header
description: ''
schema:
type: string
- name: x-grafana-alerting-recording-rules-paused
in: header
description: ''
schema:
type: boolean
- name: x-grafana-alerting-alert-rules-paused
in: header
description: ''
schema:
type: boolean
- name: x-grafana-alerting-target-datasource-uid
in: header
description: ''
schema:
type: string
- name: x-grafana-alerting-folder-uid
in: header
description: ''
schema:
type: string
- name: x-grafana-alerting-notification-settings
in: header
description: ''
schema:
type: string
requestBody:
description: ''
content:
application/yaml:
schema:
$ref: '#/components/schemas/PrometheusRuleGroup'
required: false
responses:
'202':
description: ConvertPrometheusResponse
headers: {}
content:
application/json:
schema:
$ref: '#/components/schemas/ConvertPrometheusResponse'
'403':
description: ForbiddenError
headers: {}
content:
application/json:
schema:
$ref: '#/components/schemas/ForbiddenError'
deprecated: false
x-api-evangelist-processing:
SplitPascalCaseOperationSummaries: true
CaselCaseOperationIds: true
WriteDescription: true
ChooseTags: true
delete:
tags:
- Routes
summary: Grafana Route Convert Prometheus Delete Namespace
description: Deletes a Prometheus rule namespace configuration in Grafana's conversion API. This operation removes all rules associated with the specified namespace by its title, effectively cleaning up converted Prometheus alerting and recording rules that were previously imported or managed through the conversion endpoint. The route is part of Grafana's Prometheus configuration conversion functionality, allowing administrators to manage the lifecycle of converted rule namespaces programmatically.
operationId: routeConvertPrometheusDeleteNamespace
parameters:
- name: NamespaceTitle
in: path
description: ''
required: true
schema:
type: string
responses:
'202':
description: ConvertPrometheusResponse
headers: {}
content:
application/json:
schema:
$ref: '#/components/schemas/ConvertPrometheusResponse'
'403':
description: ForbiddenError
headers: {}
content:
application/json:
schema:
$ref: '#/components/schemas/ForbiddenError'
deprecated: false
x-api-evangelist-processing:
SplitPascalCaseOperationSummaries: true
CaselCaseOperationIds: true
WriteDescription: true
ChooseTags: true
/convert/prometheus/config/v1/rules/{NamespaceTitle}/{Group}:
parameters: []
get:
tags:
- Routes
summary: Grafana Route Convert Prometheus Get Rule Group
description: This API operation retrieves and converts a Prometheus rule group configuration from a specific namespace in Grafana. It accepts GET requests at the endpoint path that includes both the namespace title and group name as path parameters, allowing users to fetch the configuration details of a particular Prometheus alerting or recording rule group. The operation is part of Grafana's conversion utilities that help transform Prometheus-native rule configurations into Grafana's internal format or vice versa, facilitating migration and management of alerting rules across different monitoring system configurations.
operationId: routeConvertPrometheusGetRuleGroup
parameters:
- name: NamespaceTitle
in: path
description: ''
required: true
schema:
type: string
- name: Group
in: path
description: ''
required: true
schema:
type: string
responses:
'200':
description: PrometheusRuleGroup
headers: {}
content:
application/yaml:
schema:
contentMediaType: application/yaml
'403':
description: ForbiddenError
headers: {}
content:
application/yaml:
schema:
contentMediaType: application/yaml
'404':
description: NotFound
headers: {}
content:
application/yaml:
schema:
contentMediaType: application/yaml
deprecated: false
x-api-evangelist-processing:
SplitPascalCaseOperationSummaries: true
CaselCaseOperationIds: true
WriteDescription: true
ChooseTags: true
delete:
tags:
- Routes
summary: Grafana Route Convert Prometheus Delete Rule Group
description: This API operation is used to delete a Prometheus rule group from a specific namespace in Grafana's configuration. It targets a particular rule group identified by both the namespace title and group name through the URL path parameters. When invoked with a DELETE HTTP method, it removes the specified rule group configuration from the Prometheus-compatible alerting and recording rules system within Grafana, effectively cleaning up rules that are no longer needed or are being replaced.
operationId: routeConvertPrometheusDeleteRuleGroup
parameters:
- name: NamespaceTitle
in: path
description: ''
required: true
schema:
type: string
- name: Group
in: path
description: ''
required: true
schema:
type: string
responses:
'202':
description: ConvertPrometheusResponse
headers: {}
content:
application/json:
schema:
$ref: '#/components/schemas/ConvertPrometheusResponse'
'403':
description: ForbiddenError
headers: {}
content:
application/json:
schema:
$ref: '#/components/schemas/ForbiddenError'
deprecated: false
x-api-evangelist-processing:
SplitPascalCaseOperationSummaries: true
CaselCaseOperationIds: true
WriteDescription: true
ChooseTags: true
/v1/provisioning/alert-rules:
parameters: []
get:
tags:
- Routes
summary: Grafana Route Get Alert Rules
description: This API operation retrieves alert rules from Grafana's provisioning system. It uses a GET request to the /v1/provisioning/alert-rules endpoint to fetch configured alert rules that have been set up through Grafana's provisioning mechanism. The operation returns a list of alert rule definitions including their conditions, notifications, and metadata, allowing administrators and applications to programmatically query and review the current alerting configuration without manual access to the Grafana UI.
operationId: routeGetAlertRules
parameters: []
responses:
'200':
description: ProvisionedAlertRules
headers: {}
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/ProvisionedAlertRule'
description: ''
contentMediaType: application/json
deprecated: false
x-api-evangelist-processing:
SplitPascalCaseOperationSummaries: true
CaselCaseOperationIds: true
WriteDescription: true
ChooseTags: true
post:
tags:
- Routes
summary: Grafana Route Post Alert Rule
description: Creates a new alert rule in Grafana's provisioning API, allowing administrators to programmatically define alerting conditions, evaluation intervals, notification settings, and query expressions. This endpoint accepts a POST request with a JSON payload containing the alert rule configuration including the rule name, folder location, data source queries, alert conditions, evaluation group, and notification channels. The operation enables infrastructure-as-code practices by allowing alert rules to be version-controlled and deployed automatically rather than manually configured through the UI. Upon successful creation, it returns the newly created alert rule object with its assigned unique identifier and complete configuration details. This is commonly used in CI/CD pipelines and automated Grafana deployments to ensure consistent alerting across environments.
operationId: routePostAlertRule
parameters:
- name: X-Disable-Provenance
in: header
description: ''
schema:
type: string
requestBody:
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/ProvisionedAlertRule'
required: false
responses:
'201':
description: ProvisionedAlertRule
headers: {}
content:
application/json:
schema:
$ref: '#/components/schemas/ProvisionedAlertRule'
'400':
description: ValidationError
headers: {}
content:
application/json:
schema:
$ref: '#/components/schemas/ValidationError'
deprecated: false
x-api-evangelist-processing:
SplitPascalCaseOperationSummaries: true
CaselCaseOperationIds: true
WriteDescription: true
ChooseTags: true
/v1/provisioning/alert-rules/export:
parameters: []
get:
tags:
- Routes
summary: Grafana Route Get Alert Rules Export
description: This API operation retrieves alert rules from Grafana in an exportable format, allowing administrators to extract alert rule configurations for backup, migration, or version control purposes. The GET endpoint at /v1/provisioning/alert-rules/export provides a way to programmatically access the complete definition of configured alert rules, including their conditions, notification settings, and metadata. This is particularly useful for maintaining infrastructure as code, replicating alert configurations across multiple Grafana instances, or creating snapshots of monitoring setups for disaster recovery scenarios.
operationId: routeGetAlertRulesExport
parameters:
- name: download
in: query
description: Whether to initiate a download of the file or not.
style: form
explode: true
schema:
type: boolean
default: false
- name: format
in: query
description: Format of the downloaded file. Supported yaml, json or hcl. Accept header can also be used, but the query parameter will take precedence.
style: form
explode: true
schema:
allOf:
- $ref: '#/components/schemas/format'
- description: Format of the downloaded file. Supported yaml, json or hcl. Accept header can also be used, but the query parameter will take precedence.
- name: folderUid
in: query
description: UIDs of folders from which to export rules
style: form
explode: true
schema:
type: array
items:
type: string
- name: group
in: query
description: Name of group of rules to export. Must be specified only together with a single folder UID
style: form
explode: true
schema:
type: string
- name: ruleUid
in: query
description: UID of alert rule to export. If specified, parameters folderUid and group must be empty.
style: form
explode: true
schema:
type: string
responses:
'200':
description: AlertingFileExport
headers: {}
content:
application/json:
schema:
$ref: '#/components/schemas/AlertingFileExportisthefullprovisionedfileexport.'
application/yaml:
schema:
contentMediaType: application/yaml
application/terraform+hcl:
schema:
contentMediaType: application/terraform+hcl
text/yaml:
schema:
contentMediaType: text/yaml
text/hcl:
schema:
contentMediaType: text/hcl
'404':
description: Not found.
headers: {}
content: {}
deprecated: false
x-api-evangelist-processing:
SplitPascalCaseOperationSummaries: true
CaselCaseOperationIds: true
WriteDescription: true
ChooseTags: true
/v1/provisioning/alert-rules/{UID}:
parameters: []
get:
tags:
# --- truncated at 32 KB (112 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/grafana/refs/heads/main/openapi/grafana-routes-api-openapi.yml