Grafana Cloud
Enterprise
Open source
Alerting provisioning HTTP API The Alerting Provisioning HTTP API can be used to create, modify, and delete resources relevant to Grafana-managed alerts. This API is the one used by our Grafana Terraform provider .
For more information on the differences between Grafana-managed and data source-managed alerts, refer to Introduction to alert rules .
If you are running Grafana Enterprise, you need to add specific permissions for some endpoints. For more information, refer to Role-based access control permissions .
Grafana-managed endpoints Note that the JSON format from most of the following endpoints is not fully compatible with provisioning via configuration JSON files .
Alert rules Example request for new alert rule:
Expand code
POST /api/v1/provisioning/alert-rules
{
"title" : "TEST-API_1" ,
"ruleGroup" : "API" ,
"folderUID" : "SET_FOLDER_UID" ,
"noDataState" : "OK" ,
"execErrState" : "OK" ,
"for" : "5m" ,
"orgId" : 1 ,
"uid" : "" ,
"condition" : "B" ,
"annotations" : {
"summary" : "test_api_1"
} ,
"labels" : {
"API" : "test1"
} ,
"data" : [
{
"refId" : "A" ,
"queryType" : "" ,
"relativeTimeRange" : {
"from" : 600 ,
"to" : 0
} ,
"datasourceUid" : "XXXXXXXXX-XXXXXXXXX-XXXXXXXXXX" ,
"model" : {
"expr" : "up" ,
"hide" : false ,
"intervalMs" : 1000 ,
"maxDataPoints" : 43200 ,
"refId" : "A"
}
} ,
{
"refId" : "B" ,
"queryType" : "" ,
"relativeTimeRange" : {
"from" : 0 ,
"to" : 0
} ,
"datasourceUid" : "-100" ,
"model" : {
"conditions" : [
{
"evaluator" : {
"params" : [ 6 ] ,
"type" : "gt"
} ,
"operator" : {
"type" : "and"
} ,
"query" : {
"params" : [ "A" ]
} ,
"reducer" : {
"params" : [ ] ,
"type" : "last"
} ,
"type" : "query"
}
] ,
"datasource" : {
"type" : "__expr__" ,
"uid" : "-100"
} ,
"hide" : false ,
"intervalMs" : 1000 ,
"maxDataPoints" : 43200 ,
"refId" : "B" ,
"type" : "classic_conditions"
}
}
]
}
Example Response: Expand code
HTTP/1.1 201 Created
{
"id" : 1 ,
"uid" : "XXXXXXXXX" ,
"orgID" : 1 ,
"folderUID" : "SET_FOLDER_UID" ,
"ruleGroup" : "API3" ,
"title" : "TEST-API_1" ,
"condition" : "B" ,
"data" : [
{
"refId" : "A" ,
"queryType" : "" ,
"relativeTimeRange" : {
"from" : 600 ,
"to" : 0
} ,
"datasourceUid" : "XXXXXXXXX-XXXXXXXXX-XXXXXXXXXX" ,
"model" : {
"expr" : "up" ,
"hide" : false ,
"intervalMs" : 1000 ,
"maxDataPoints" : 43200 ,
"refId" : "A"
}
} ,
{
"refId" : "B" ,
"queryType" : "" ,
"relativeTimeRange" : {
"from" : 0 ,
"to" : 0
} ,
"datasourceUid" : "-100" ,
"model" : {
"conditions" : [
{
"evaluator" : {
"params" : [
6
] ,
"type" : "gt"
} ,
"operator" : {
"type" : "and"
} ,
"query" : {
"params" : [
"A"
]
} ,
"reducer" : {
"params" : [ ] ,
"type" : "last"
} ,
"type" : "query"
}
] ,
"datasource" : {
"type" : "__expr__" ,
"uid" : "-100"
} ,
"hide" : false ,
"intervalMs" : 1000 ,
"maxDataPoints" : 43200 ,
"refId" : "B" ,
"type" : "classic_conditions"
}
}
] ,
"updated" : "2024-08-02T13:19:32.609640048Z" ,
"noDataState" : "OK" ,
"execErrState" : "OK" ,
"for" : "5m" ,
"annotations" : {
"summary" : "test_api_1"
} ,
"labels" : {
"API" : "test1"
} ,
"provenance" : "api" ,
"isPaused" : false ,
"notification_settings" : null ,
"record" : null
}
Example Request for all the contact points:
GET /api/v1/provisioning/contact-points
Example Response:
HTTP/1.1 200 OK
[
{
"uid" : "" ,
"name" : "email receiver" ,
"type" : "email" ,
"settings" : {
"addresses" : "<example@email.com>"
} ,
"disableResolveMessage" : false
}
]
Notification policies Example Request for exporting the notification policy tree in YAML format:
GET /api/v1/provisioning/policies/export?format=yaml
Example Response:
HTTP/1.1 200 OK
policies:
- orgId: 1
receiver: My Contact Email Point
group_by:
- grafana_folder
- alertname
routes:
- receiver: My Contact Email Point
object_matchers:
- - monitor
- =
- testdata
mute_time_intervals:
- weekends
Notification template groups Template groups enable you to define multiple notification templates ({{ define "" }}
) within a single group. They can be managed from the Grafana Alerting UI.
Expand table
Method URI Name Summary DELETE /api/v1/provisioning/templates/:name route delete template Delete a notification template group. GET /api/v1/provisioning/templates/:name route get template Get a notification template group. GET /api/v1/provisioning/templates route get template Get all notification template groups. PUT /api/v1/provisioning/templates/:name route put template Create or update a notification template group.
Example Request for all notification template groups:
GET /api/v1/provisioning/templates
Example Response:
HTTP/1.1 200 OK
[
{
"name" : "custom_email.message" ,
"template" : "{{ define \"custom_email.message\" }}\n Custom alert!\n{{ end }}" ,
"provenance" : "file"
} ,
{
"name" : "custom_email.subject" ,
"template" : "{{ define \"custom_email.subject\" }}\n{{ len .Alerts.Firing }} firing alert(s), {{ len .Alerts.Resolved }} resolved alert(s)\n{{ end }}" ,
"provenance" : "file"
}
]
Mute timings Example Request for all mute timings:
GET /api/v1/provisioning/mute-timings
Example Response:
HTTP/1.1 200 OK
[
{
"name" : "weekends" ,
"time_intervals" : [
{
"weekdays" : [
"saturday" ,
"sunday"
]
}
] ,
"version" : "" ,
"provenance" : "file"
}
]
Edit resources in the Grafana UI By default, you cannot edit API-provisioned alerting resources in Grafana. To enable editing these resources in the Grafana UI, add the X-Disable-Provenance
header to the following requests in the API:
POST /api/v1/provisioning/alert-rules
PUT /api/v1/provisioning/folder/{FolderUID}/rule-groups/{Group}
(calling this endpoint will change provenance for all alert rules within the alert group)POST /api/v1/provisioning/contact-points
POST /api/v1/provisioning/mute-timings
PUT /api/v1/provisioning/policies
PUT /api/v1/provisioning/templates/{name}
To reset the notification policy tree to the default and unlock it for editing in the Grafana UI, use the DELETE /api/v1/provisioning/policies
endpoint.
Data source-managed resources The Alerting Provisioning HTTP API can only be used to manage Grafana-managed alert resources. To manage resources related to data source-managed alerts , consider the following tools:
mimirtool : to interact with the Mimir alertmanager and ruler configuration.cortex-tools : to interact with the Cortex alertmanager and ruler configuration.lokitool : to configure the Loki Ruler.Alternatively, the Grafana Alerting API can be used to access data from data source-managed alerts. This API is primarily intended for internal usage, with the exception of the /api/v1/provisioning/
endpoints. It’s important to note that internal APIs may undergo changes without prior notice and are not officially supported for user consumption.
For Prometheus, amtool
can also be used to interact with the AlertManager API .
Paths Delete a specific alert rule by UID. (RouteDeleteAlertRule )DELETE /api/v1/provisioning/alert-rules/:uid
Parameters Expand table
Name Source Type Go type Separator Required Default Description UID path
string string
✓ Alert rule UID X-Disable-Provenance: true header
string string
Allows editing of provisioned resources in the Grafana UI
All responses Expand table
Code Status Description Has headers Schema 204 No Content The alert rule was deleted successfully. schema
Responses 204 - The alert rule was deleted successfully.Status: No Content
SchemaDELETE /api/v1/provisioning/contact-points/:uid
Parameters Expand table
Name Source Type Go type Separator Required Default Description UID path
string string
✓ UID is the contact point unique identifier
All responses Expand table
Code Status Description Has headers Schema 204 No Content The contact point was deleted successfully. schema
Responses Status: No Content
Delete a mute timing. (RouteDeleteMuteTiming )DELETE /api/v1/provisioning/mute-timings/:name
Parameters Expand table
Name Source Type Go type Separator Required Default Description name path
string string
✓ Mute timing name version query
string string
Current version of the resource. Used for optimistic concurrency validation. Keep empty to bypass validation.
All responses Expand table
Code Status Description Has headers Schema 204 No Content The mute timing was deleted successfully. schema 409 Conflict GenericPublicError schema
Responses 204 - The mute timing was deleted successfully.Status: No Content
Schema 409 - ConflictStatus: Conflict
SchemaGenericPublicError
Delete a notification template group. (RouteDeleteTemplate )DELETE /api/v1/provisioning/templates/:name
Parameters Expand table
Name Source Type Go type Separator Required Default Description name path
string string
✓ Name of the template group version query
string string
Current version of the resource. Used for optimistic concurrency validation. Keep empty to bypass validation.
All responses Expand table
Code Status Description Has headers Schema 204 No Content The template was deleted successfully. schema 409 Conflict GenericPublicError schema
Responses 204 - The template was deleted successfully.Status: No Content
Schema 409 - ConflictStatus: Conflict
SchemaGenericPublicError
Get a specific alert rule by UID. (RouteGetAlertRule )GET /api/v1/provisioning/alert-rules/:uid
Parameters Expand table
Name Source Type Go type Separator Required Default Description UID path
string string
✓ Alert rule UID
All responses Expand table
Code Status Description Has headers Schema 200 OK ProvisionedAlertRule schema 404 Not Found Not found. schema
Responses 200 - ProvisionedAlertRuleStatus: OK
SchemaProvisionedAlertRule
404 - Not found.Status: Not Found
SchemaGET /api/v1/provisioning/alert-rules/:uid/export
Produces application/json application/yaml application/terraform+hcl text/yaml text/hcl Parameters Expand table
Name Source Type Go type Separator Required Default Description UID path
string string
✓ Alert rule UID download query
boolean bool
Whether to initiate a download of the file or not. format query
string string
"yaml"
Format of the downloaded file, either yaml, json or hcl. Accept header can also be used, but the query parameter will take precedence.
All responses Expand table
Code Status Description Has headers Schema 200 OK AlertingFileExport schema 404 Not Found Not found. schema
Responses 200 - AlertingFileExportStatus: OK
SchemaAlertingFileExport
404 - Not found.Status: Not Found
Schema Get a rule group. (RouteGetAlertRuleGroup )GET /api/v1/provisioning/folder/:folderUid/rule-groups/:group
Parameters Expand table
Name Source Type Go type Separator Required Default Description FolderUID path
string string
✓ Group path
string string
✓
All responses Expand table
Code Status Description Has headers Schema 200 OK AlertRuleGroup schema 404 Not Found Not found. schema
Responses 200 - AlertRuleGroupStatus: OK
SchemaAlertRuleGroup
404 - Not found.Status: Not Found
SchemaGET /api/v1/provisioning/folder/:folderUid/rule-groups/:group/export
Produces application/json application/yaml application/terraform+hcl text/yaml text/hcl Parameters Expand table
Name Source Type Go type Separator Required Default Description FolderUID path
string string
✓ Group path
string string
✓ download query
boolean bool
Whether to initiate a download of the file or not. format query
string string
"yaml"
Format of the downloaded file, either yaml, json or hcl. Accept header can also be used, but the query parameter will take precedence.
All responses Expand table
Code Status Description Has headers Schema 200 OK AlertingFileExport schema 404 Not Found Not found. schema
Responses 200 - AlertingFileExportStatus: OK
SchemaAlertingFileExport
404 - Not found.Status: Not Found
Schema Get all the alert rules. (RouteGetAlertRules )GET /api/v1/provisioning/alert-rules
All responses Expand table
Code Status Description Has headers Schema 200 OK ProvisionedAlertRules schema
Responses 200 - ProvisionedAlertRulesStatus: OK
SchemaProvisionedAlertRules
GET /api/v1/provisioning/alert-rules/export
Produces application/json application/yaml application/terraform+hcl text/yaml text/hcl Parameters Expand table
Name Source Type Go type Separator Required Default Description download query
boolean bool
Whether to initiate a download of the file or not. format query
string string
"yaml"
Format of the downloaded file, either yaml, json or hcl. Accept header can also be used, but the query parameter will take precedence.
All responses Expand table
Code Status Description Has headers Schema 200 OK AlertingFileExport schema 404 Not Found Not found. schema
Responses 200 - AlertingFileExportStatus: OK
SchemaAlertingFileExport
404 - Not found.Status: Not Found
SchemaGET /api/v1/provisioning/contact-points
Parameters Expand table
Name Source Type Go type Separator Required Default Description name query
string string
Filter by name
All responses Expand table
Code Status Description Has headers Schema 200 OK ContactPoints schema
Responses Status: OK
ContactPoints
GET /api/v1/provisioning/contact-points/export
Produces application/json application/yaml application/terraform+hcl text/yaml text/hcl Parameters Expand table
Name Source Type Go type Separator Required Default Description decrypt query
boolean bool
Whether any contained secure settings should be decrypted or left redacted. Redacted settings will contain RedactedValue instead. Currently, only org admin can view decrypted secure settings. download query
boolean bool
Whether to initiate a download of the file or not. format query
string string
"yaml"
Format of the downloaded file, either yaml, json or hcl. Accept header can also be used, but the query parameter will take precedence. name query
string string
Filter by name
All responses Expand table
Code Status Description Has headers Schema 200 OK AlertingFileExport schema 403 Forbidden PermissionDenied schema
Responses Status: OK
AlertingFileExport
Status: Forbidden
PermissionDenied
Get a mute timing. (RouteGetMuteTiming )GET /api/v1/provisioning/mute-timings/:name
Parameters Expand table
Name Source Type Go type Separator Required Default Description name path
string string
✓ Mute timing name
All responses Expand table
Code Status Description Has headers Schema 200 OK MuteTimeInterval schema 404 Not Found Not found. schema
Responses 200 - MuteTimeIntervalStatus: OK
SchemaMuteTimeInterval
404 - Not found.Status: Not Found
Schema Get all the mute timings. (RouteGetMuteTimings )GET /api/v1/provisioning/mute-timings
All responses Expand table
Code Status Description Has headers Schema 200 OK MuteTimings schema
Responses 200 - MuteTimingsStatus: OK
SchemaMuteTimings
GET /api/v1/provisioning/mute-timings/export
Produces application/json application/yaml application/terraform+hcl text/yaml text/hcl Parameters Expand table
Name Source Type Go type Separator Required Default Description download query
boolean bool
Whether to initiate a download of the file or not. format query
string string
"yaml"
Format of the downloaded file, either yaml, json or hcl. Accept header can also be used, but the query parameter will take precedence.
All responses Expand table
Code Status Description Has headers Schema 200 OK MuteTimingsExport schema 403 Forbidden PermissionDenied schema
Responses 200 - MuteTimingsExportStatus: OK
SchemaAlertingFileExport
403 - PermissionDeniedStatus: Forbidden
SchemaPermissionDenied
GET /api/v1/provisioning/mute-timings/:name/export
Produces application/json application/yaml application/terraform+hcl text/yaml text/hcl Parameters Expand table
Name Source Type Go type Separator Required Default Description name path
string string
✓ Mute timing name. download query
boolean bool
Whether to initiate a download of the file or not. format query
string string
"yaml"
Format of the downloaded file, either yaml, json or hcl. Accept header can also be used, but the query parameter will take precedence.
All responses Expand table
Code Status Description Has headers Schema 200 OK MuteTimingExport schema 403 Forbidden PermissionDenied schema
Responses 200 - MuteTimingExportStatus: OK
SchemaAlertingFileExport
403 - PermissionDeniedStatus: Forbidden
SchemaPermissionDenied
Get the notification policy tree. (RouteGetPolicyTree )GET /api/v1/provisioning/policies
All responses Expand table
Code Status Description Has headers Schema 200 OK Route schema
Responses 200 - RouteStatus: OK
SchemaRoute
GET /api/v1/provisioning/policies/export
Produces application/json application/yaml application/terraform+hcl text/yaml text/hcl Parameters Expand table
Name Source Type Go type Separator Required Default Description download query
boolean bool
Whether to initiate a download of the file or not. format query
string string
"yaml"
Format of the downloaded file, either yaml, json or hcl. Accept header can also be used, but the query parameter will take precedence.
All responses Expand table
Code Status Description Has headers Schema 200 OK AlertingFileExport schema 404 Not Found NotFound schema
Responses 200 - AlertingFileExportStatus: OK
SchemaAlertingFileExport
404 - NotFoundStatus: Not Found
SchemaNotFound
Get a notification template group. (RouteGetTemplate )GET /api/v1/provisioning/templates/:name
Parameters Expand table
Name Source Type Go type Separator Required Default Description name path
string string
✓ Name of the template group
All responses Expand table
Code Status Description Has headers Schema 200 OK NotificationTemplate schema 404 Not Found GenericPublicError schema
Responses 200 - NotificationTemplateStatus: OK
SchemaNotificationTemplate
404 - Not found.GenericPublicError
Schema Get all notification template groups. (RouteGetTemplates )GET /api/v1/provisioning/templates
All responses Expand table
Code Status Description Has headers Schema 200 OK NotificationTemplates schema
Responses 200 - NotificationTemplatesStatus: OK
SchemaNotificationTemplates
Create a new alert rule. (RoutePostAlertRule )POST /api/v1/provisioning/alert-rules
Parameters Expand table
Name Source Type Go type Separator Required Default Description X-Disable-Provenance: true header
string string
Allows editing of provisioned resources in the Grafana UI Body body
ProvisionedAlertRule models.ProvisionedAlertRule
All responses Expand table
Code Status Description Has headers Schema 201 Created ProvisionedAlertRule schema 400 Bad Request ValidationError schema
Responses 201 - ProvisionedAlertRuleStatus: Created
SchemaProvisionedAlertRule
400 - ValidationErrorStatus: Bad Request
SchemaValidationError
Create a contact point. (RoutePostContactpoints )POST /api/v1/provisioning/contact-points
When creating a contact point, the EmbeddedContactPoint.name
property determines if the new contact point is added to an existing one. In the UI, contact points with the same name are grouped together under a single contact point.
Parameters Expand table
Name Source Type Go type Separator Required Default Description X-Disable-Provenance: true header
string string
Allows editing of provisioned resources in the Grafana UI Body body
EmbeddedContactPoint models.EmbeddedContactPoint
All responses Expand table
Code Status Description Has headers Schema 202 Accepted EmbeddedContactPoint schema 400 Bad Request ValidationError schema
Responses 202 - EmbeddedContactPointStatus: Accepted
SchemaEmbeddedContactPoint
400 - ValidationErrorStatus: Bad Request
SchemaValidationError
Create a new mute timing. (RoutePostMuteTiming )POST /api/v1/provisioning/mute-timings
Parameters Expand table
Name Source Type Go type Separator Required Default Description X-Disable-Provenance: true header
string string
Allows editing of provisioned resources in the Grafana UI Body body
MuteTimeInterval models.MuteTimeInterval
All responses Expand table
Code Status Description Has headers Schema 201 Created MuteTimeInterval schema 400 Bad Request ValidationError schema
Responses 201 - MuteTimeIntervalStatus: Created
SchemaMuteTimeInterval
400 - ValidationErrorStatus: Bad Request
SchemaValidationError
Update an existing alert rule. (RoutePutAlertRule )PUT /api/v1/provisioning/alert-rules/:uid
Parameters Expand table
Name Source Type Go type Separator Required Default Description UID path
string string
✓ Alert rule UID X-Disable-Provenance: true header
string string
Allows editing of provisioned resources in the Grafana UI Body body
ProvisionedAlertRule models.ProvisionedAlertRule
All responses Expand table
Code Status Description Has headers Schema 200 OK ProvisionedAlertRule schema 400 Bad Request ValidationError schema
Responses 200 - ProvisionedAlertRuleStatus: OK
SchemaProvisionedAlertRule
400 - ValidationErrorStatus: Bad Request
SchemaValidationError
Update the interval or alert rules of a rule group. (RoutePutAlertRuleGroup )PUT /api/v1/provisioning/folder/:folderUid/rule-groups/:group
Parameters Expand table
Name Source Type Go type Separator Required Default Description FolderUID path
string string
✓ Group path
string string
✓ X-Disable-Provenance: true header
string string
Allows editing of provisioned resources in the Grafana UI Body body
AlertRuleGroup models.AlertRuleGroup
This action is idempotent and rules included in this body will overwrite configured rules for the group
All responses Expand table
Code Status Description Has headers Schema 200 OK AlertRuleGroup schema 400 Bad Request ValidationError schema
Responses 200 - AlertRuleGroupStatus: OK
SchemaAlertRuleGroup
400 - ValidationErrorStatus: Bad Request
SchemaValidationError
PUT /api/v1/provisioning/contact-points/:uid
Parameters Expand table
Name Source Type Go type Separator Required Default Description UID path
string string
✓ UID is the contact point unique identifier X-Disable-Provenance: true header
string string
Allows editing of provisioned resources in the Grafana UI Body body
EmbeddedContactPoint models.EmbeddedContactPoint
All responses Expand table
Code Status Description Has headers Schema 202 Accepted Ack schema 400 Bad Request ValidationError schema
Responses Status: Accepted
Ack
Status: Bad Request
ValidationError
Replace an existing mute timing. (RoutePutMuteTiming )PUT /api/v1/provisioning/mute-timings/:name
Parameters Expand table
Name Source Type Go type Separator Required Default Description name path
string string
✓ Mute timing name X-Disable-Provenance: true header
string string
Allows editing of provisioned resources in the Grafana UI Body body
MuteTimeInterval models.MuteTimeInterval
All responses Expand table
Code Status Description Has headers Schema 200 OK MuteTimeInterval schema 400 Bad Request ValidationError schema 409 Conflict GenericPublicError schema
Responses 200 - MuteTimeIntervalStatus: OK
SchemaMuteTimeInterval
400 - ValidationErrorStatus: Bad Request
SchemaValidationError
409 - ConflictStatus: Conflict
SchemaGenericPublicError
Sets the notification policy tree. (RoutePutPolicyTree )PUT /api/v1/provisioning/policies
Parameters Expand table
Name Source Type Go type Separator Required Default Description X-Disable-Provenance: true header
string string
Allows editing of provisioned resources in the Grafana UI Body body
Route models.Route
The new notification routing tree to use
All responses Expand table
Code Status Description Has headers Schema 202 Accepted Ack schema 400 Bad Request ValidationError schema
Responses 202 - AckStatus: Accepted
SchemaAck
400 - ValidationErrorStatus: Bad Request
SchemaValidationError
Create or update a notification template group. (RoutePutTemplate )PUT /api/v1/provisioning/templates/:name
Parameters Expand table
Name Source Type Go type Separator Required Default Description name path
string string
✓ Name of the template group X-Disable-Provenance: true header
string string
Allows editing of provisioned resources in the Grafana UI Body body
NotificationTemplateContent models.NotificationTemplateContent
All responses Expand table
Code Status Description Has headers Schema 202 Accepted NotificationTemplate schema 400 Bad Request GenericPublicError schema 409 Conflict GenericPublicError schema
Responses 202 - NotificationTemplateStatus: Accepted
SchemaNotificationTemplate
400 - ValidationErrorStatus: Bad Request
SchemaGenericPublicError
409 - ConflictStatus: Conflict
SchemaGenericPublicError
Clears the notification policy tree. (RouteResetPolicyTree )DELETE /api/v1/provisioning/policies
All responses Expand table
Code Status Description Has headers Schema 202 Accepted Ack schema
Responses 202 - AckStatus: Accepted
SchemaAck
Models Ackinterface{}
AlertQueryProperties
Expand table
Name Type Go type Required Default Description Example datasourceUid string string
Grafana data source unique identifier; it should be ‘expr ’ for a Server Side Expression operation. model interface{} interface{}
JSON is the raw JSON query and includes the above properties as well as custom properties. queryType string string
QueryType is an optional identifier for the type of query. It can be used to distinguish different types of queries. refId string string
RefID is the unique identifier of the query, set by the frontend call. relativeTimeRange RelativeTimeRange RelativeTimeRange
AlertQueryExportProperties
Expand table
Name Type Go type Required Default Description Example datasourceUid string string
model interface{} interface{}
queryType string string
refId string string
relativeTimeRange RelativeTimeRange RelativeTimeRange
AlertRuleExportProperties
Expand table
Name Type Go type Required Default Description Example annotations map of string map[string]string
condition string string
dashboardUid string string
data []AlertQueryExport []*AlertQueryExport
execErrState string string
for Duration Duration
isPaused boolean bool
labels map of string map[string]string
noDataState string string
panelId int64 (formatted integer) int64
title string string
uid string string
AlertRuleGroupProperties
Expand table
Name Type Go type Required Default Description Example folderUid string string
interval int64 (formatted integer) int64
rules []ProvisionedAlertRule []*ProvisionedAlertRule
title string string
AlertRuleGroupExportProperties
Expand table
Name Type Go type Required Default Description Example folder string string
interval Duration Duration
name string string
orgId int64 (formatted integer) int64
rules []AlertRuleExport []*AlertRuleExport
AlertingFileExportProperties
Properties
Expand table
Name Type Go type Required Default Description Example name string string
orgId int64 (formatted integer) int64
receivers []ReceiverExport []*ReceiverExport
[]EmbeddedContactPoint
DurationExpand table
Name Type Go type Default Description Example Duration string int64
EmbeddedContactPoint is the contact point type used by Grafana-managed alerts.
When creating a contact point, the EmbeddedContactPoint.name
property determines if the new contact point is added to an existing one. In the UI, contact points with the same name are grouped together under a single contact point.
Properties
Expand table
Name Type Go type Required Default Description Example disableResolveMessage boolean bool
false
name string string
name
groups multiple contact points with the same name in the UI.webhook_1
provenance string string
settings JSON JSON
✓ type string string
✓ webhook
uid string string
UID is the unique identifier of the contact point. The UID can be set by the user. my_external_reference
Jsoninterface{}
MatchRegexpsMatchRegexps
MatchTypeExpand table
Name Type Go type Default Description Example MatchType int64 (formatted integer) int64
MatcherProperties
Expand table
Name Type Go type Required Default Description Example Name string string
Type MatchType MatchType
Value string string
Matchers is a slice of Matchers that is sortable, implements Stringer, and
provides a Matches method to match a LabelSet against all Matchers in the
slice. Note that some users of Matchers might require it to be sorted.
[]Matcher
MuteTimeIntervalProperties
Expand table
Name Type Go type Required Default Description Example name string string
time_intervals []TimeInterval []*TimeInterval
version string string
Version of resource
MuteTimingExportProperties
MuteTimingsExportProperties
MuteTimings[]MuteTimeInterval
NotFoundinterface{}
NotificationPolicyExportProperties
Expand table
Name Type Go type Required Default Description Example Policy RouteExport RouteExport
inline orgId int64 (formatted integer) int64
NotificationTemplateProperties
Expand table
Name Type Go type Required Default Description Example name string string
provenance Provenance Provenance
template string string
version string string
Version of resource
NotificationTemplateContentProperties
Expand table
Name Type Go type Required Default Description Example template string string
version string string
Version of resource. Should be empty for new templates.
NotificationTemplates[]NotificationTemplate
Matchers
Inlined models PermissionDeniedinterface{}
ProvenanceExpand table
Name Type Go type Default Description Example Provenance string string
ProvisionedAlertRuleProperties
Expand table
Name Type Go type Required Default Description Example annotations map of string map[string]string
Optional key-value pairs. dashboardUId
and panelId
must be set together; one cannot be set without the other. {"runbook_url":"https://supercoolrunbook.com/page/13"}
condition string string
✓ A
data []AlertQuery []*AlertQuery
✓ [{"datasourceUid":"__expr__","model":{"conditions":[{"evaluator":{"params":[0,0],"type":"gt"},"operator":{"type":"and"},"query":{"params":[]},"reducer":{"params":[],"type":"avg"},"type":"query"}],"datasource":{"type":"__expr__","uid":"__expr__"},"expression":"1 == 1","hide":false,"intervalMs":1000,"maxDataPoints":43200,"refId":"A","type":"math"},"queryType":"","refId":"A","relativeTimeRange":{"from":0,"to":0}}]
execErrState string string
✓ folderUID string string
✓ project_x
for Duration Duration
✓ id int64 (formatted integer) int64
isPaused boolean bool
false
labels map of string map[string]string
{"team":"sre-team-1"}
noDataState string string
✓ orgID int64 (formatted integer) int64
✓ provenance Provenance Provenance
ruleGroup string string
✓ eval_group_1
title string string
✓ Always firing
uid string string
updated date-time (formatted string) strfmt.DateTime
ProvisionedAlertRules[]ProvisionedAlertRule
RawMessageinterface{}
ReceiverExportProperties
Expand table
Name Type Go type Required Default Description Example disableResolveMessage boolean bool
settings RawMessage RawMessage
type string string
uid string string
RegexpA Regexp is safe for concurrent use by multiple goroutines,
except for configuration methods, such as Longest.
interface{}
RelativeTimeRangeRelativeTimeRange is the per query start and end time
for requests.
Properties
Expand table
Name Type Go type Required Default Description Example from Duration Duration
to Duration Duration
RouteA Route is a node that contains definitions of how to handle alerts. This is modified
from the upstream alertmanager in that it adds the ObjectMatchers property.
Properties
Expand table
Name Type Go type Required Default Description Example continue boolean bool
group_by []string []string
group_interval string string
group_wait string string
match map of string map[string]string
Deprecated. Remove before v1.0 release. match_re MatchRegexps MatchRegexps
matchers Matchers Matchers
mute_time_intervals []string []string
object_matchers ObjectMatchers ObjectMatchers
provenance Provenance Provenance
receiver string string
repeat_interval string string
routes []Route []*Route
RouteExportRouteExport is the provisioned file export of definitions.Route. This is needed to hide fields that aren’t usable in
provisioning file format. An alternative would be to define a custom MarshalJSON and MarshalYAML that excludes them.
Properties
Expand table
Name Type Go type Required Default Description Example continue boolean bool
group_by []string []string
group_interval string string
group_wait string string
match map of string map[string]string
Deprecated. Remove before v1.0 release. match_re MatchRegexps MatchRegexps
matchers Matchers Matchers
mute_time_intervals []string []string
object_matchers ObjectMatchers ObjectMatchers
receiver string string
repeat_interval string string
routes []RouteExport []*RouteExport
TimeIntervalTimeInterval describes intervals of time. ContainsTime will tell you if a golang time is contained
within the interval.
Properties
Expand table
Name Type Go type Required Default Description Example days_of_month []string []string
location string string
months []string []string
times []TimeRange []*TimeRange
weekdays []string []string
years []string []string
TimeRangeFor example, 4:00PM to End of the day would Begin at 1020 and End at 1440.
Properties
Expand table
Name Type Go type Required Default Description Example end_time string string
"end_time": "24:00"
start_time string string
"start_time": "18:00"
ValidationErrorProperties
Expand table
Name Type Go type Required Default Description Example msg string string
error message
GenericPublicErrorProperties
Expand table
Name Type Go type Required Default Description Example statusCode string string
✓ HTTP Status Code messageId string string
✓ Unique code of the error message string string
Error message extra map of any map[string]any
Extra information about the error. Format is specific to the error code.