Important: This documentation is about an older version. It's relevant only to the release noted, many of the features and functions have been updated or replaced. Please view the current version .
Alerting provisioning HTTP API Version 1.1.0
Content negotiation Consumes Produces application/json text/yaml application/yaml All endpoints Alert rules Note:
Contact point provisioning is for Grafana-managed alerts only.
Notification policies Mute timings Templates 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 pathstring string✓ Alert rule UID X-Disable-Provenance headerstring stringAllows 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}Consumes Parameters Expand table
Name Source Type Go type Separator Required Default Description UID pathstring 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
Schema 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 pathstring string✓ Mute timing name
All responses Expand table
Code Status Description Has headers Schema 204 No Content The mute timing was deleted successfully. schema
Responses 204 - The mute timing was deleted successfully.Status: No Content
Schema Delete a template. (RouteDeleteTemplate )DELETE /api/v1/provisioning/templates/{name}Parameters Expand table
Name Source Type Go type Separator Required Default Description name pathstring string✓ Template Name
All responses Expand table
Code Status Description Has headers Schema 204 No Content The template was deleted successfully. schema
Responses 204 - The template was deleted successfully.Status: No Content
Schema 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 pathstring 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}/exportProduces application/json application/yaml text/yaml Parameters Expand table
Name Source Type Go type Separator Required Default Description UID pathstring string✓ Alert rule UID download queryboolean boolWhether to initiate a download of the file or not. format querystring string"yaml"Format of the downloaded file, either yaml or json. 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 pathstring string✓ Group pathstring 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}/exportProduces application/json application/yaml text/yaml Parameters Expand table
Name Source Type Go type Separator Required Default Description FolderUID pathstring string✓ Group pathstring string✓ download queryboolean boolWhether to initiate a download of the file or not. format querystring string"yaml"Format of the downloaded file, either yaml or json. 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-rulesAll responses Expand table
Code Status Description Has headers Schema 200 OK ProvisionedAlertRules schema
Responses 200 - ProvisionedAlertRulesStatus: OK
SchemaProvisionedAlertRules
GET /api/v1/provisioning/alert-rules/exportParameters Expand table
Name Source Type Go type Separator Required Default Description download queryboolean boolWhether to initiate a download of the file or not. format querystring string"yaml"Format of the downloaded file, either yaml or json. 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-pointsParameters Expand table
Name Source Type Go type Separator Required Default Description name querystring stringFilter by name
All responses Expand table
Code Status Description Has headers Schema 200 OK ContactPoints schema
Responses Status: OK
SchemaContactPoints
GET /api/v1/provisioning/contact-points/exportParameters Expand table
Name Source Type Go type Separator Required Default Description decrypt queryboolean boolWhether 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 queryboolean boolWhether to initiate a download of the file or not. format querystring string"yaml"Format of the downloaded file, either yaml or json. Accept header can also be used, but the query parameter will take precedence. name querystring stringFilter by name
All responses Expand table
Code Status Description Has headers Schema 200 OK AlertingFileExport schema 403 Forbidden PermissionDenied schema
Responses 200 - AlertingFileExportStatus: OK
SchemaAlertingFileExport
403 - PermissionDeniedStatus: Forbidden
SchemaPermissionDenied
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 pathstring 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-timingsAll responses Expand table
Code Status Description Has headers Schema 200 OK MuteTimings schema
Responses 200 - MuteTimingsStatus: OK
SchemaMuteTimings
Get the notification policy tree. (RouteGetPolicyTree )GET /api/v1/provisioning/policiesAll responses Expand table
Code Status Description Has headers Schema 200 OK Route schema
Responses 200 - RouteStatus: OK
SchemaRoute
GET /api/v1/provisioning/policies/exportAll 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. (RouteGetTemplate )GET /api/v1/provisioning/templates/{name}Parameters Expand table
Name Source Type Go type Separator Required Default Description name pathstring string✓ Template Name
All responses Expand table
Code Status Description Has headers Schema 200 OK NotificationTemplate schema 404 Not Found Not found. schema
Responses 200 - NotificationTemplateStatus: OK
SchemaNotificationTemplate
404 - Not found.Status: Not Found
Schema Get all notification templates. (RouteGetTemplates )GET /api/v1/provisioning/templatesAll responses Expand table
Code Status Description Has headers Schema 200 OK NotificationTemplates schema 404 Not Found Not found. schema
Responses 200 - NotificationTemplatesStatus: OK
SchemaNotificationTemplates
404 - Not found.Status: Not Found
Schema Create a new alert rule. (RoutePostAlertRule )POST /api/v1/provisioning/alert-rulesConsumes Parameters Expand table
Name Source Type Go type Separator Required Default Description X-Disable-Provenance headerstring stringAllows editing of provisioned resources in the Grafana UI Body bodyProvisionedAlertRule 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-pointsConsumes Parameters Expand table
Name Source Type Go type Separator Required Default Description X-Disable-Provenance headerstring stringAllows editing of provisioned resources in the Grafana UI Body bodyEmbeddedContactPoint models.EmbeddedContactPoint
All responses Expand table
Code Status Description Has headers Schema 202 Accepted EmbeddedContactPoint schema 400 Bad Request ValidationError schema
Responses Status: Accepted
SchemaEmbeddedContactPoint
400 - ValidationErrorStatus: Bad Request
SchemaValidationError
Create a new mute timing. (RoutePostMuteTiming )POST /api/v1/provisioning/mute-timingsConsumes Parameters Expand table
Name Source Type Go type Separator Required Default Description X-Disable-Provenance headerstring stringAllows editing of provisioned resources in the Grafana UI Body bodyMuteTimeInterval 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}Consumes Parameters Expand table
Name Source Type Go type Separator Required Default Description UID pathstring string✓ Alert rule UID X-Disable-Provenance headerstring stringAllows editing of provisioned resources in the Grafana UI Body bodyProvisionedAlertRule 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 of a rule group. (RoutePutAlertRuleGroup )PUT /api/v1/provisioning/folder/{FolderUID}/rule-groups/{Group}Consumes Parameters Expand table
Name Source Type Go type Separator Required Default Description FolderUID pathstring string✓ Group pathstring string✓ X-Disable-Provenance headerstring stringAllows editing of provisioned resources in the Grafana UI Body bodyAlertRuleGroup models.AlertRuleGroup
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}Consumes Parameters Expand table
Name Source Type Go type Separator Required Default Description UID pathstring string✓ UID is the contact point unique identifier X-Disable-Provenance headerstring stringAllows editing of provisioned resources in the Grafana UI Body bodyEmbeddedContactPoint models.EmbeddedContactPoint
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
Replace an existing mute timing. (RoutePutMuteTiming )PUT /api/v1/provisioning/mute-timings/{name}Consumes Parameters Expand table
Name Source Type Go type Separator Required Default Description name pathstring string✓ Mute timing name X-Disable-Provenance headerstring stringAllows editing of provisioned resources in the Grafana UI Body bodyMuteTimeInterval models.MuteTimeInterval
All responses Expand table
Code Status Description Has headers Schema 200 OK MuteTimeInterval schema 400 Bad Request ValidationError schema
Responses 200 - MuteTimeIntervalStatus: OK
SchemaMuteTimeInterval
400 - ValidationErrorStatus: Bad Request
SchemaValidationError
Sets the notification policy tree. (RoutePutPolicyTree )PUT /api/v1/provisioning/policiesConsumes Parameters Expand table
Name Source Type Go type Separator Required Default Description X-Disable-Provenance headerstring stringAllows editing of provisioned resources in the Grafana UI Body bodyRoute models.RouteThe 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
Updates an existing notification template. (RoutePutTemplate )PUT /api/v1/provisioning/templates/{name}Consumes Parameters Expand table
Name Source Type Go type Separator Required Default Description name pathstring string✓ Template Name X-Disable-Provenance headerstring stringAllows editing of provisioned resources in the Grafana UI Body bodyNotificationTemplateContent models.NotificationTemplateContent
All responses Expand table
Code Status Description Has headers Schema 202 Accepted NotificationTemplate schema 400 Bad Request ValidationError schema
Responses 202 - NotificationTemplateStatus: Accepted
SchemaNotificationTemplate
400 - ValidationErrorStatus: Bad Request
SchemaValidationError
Clears the notification policy tree. (RouteResetPolicyTree )DELETE /api/v1/provisioning/policiesConsumes 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 stringGrafana 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 stringQueryType is an optional identifier for the type of query. It can be used to distinguish different types of queries. refId string stringRefID 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 stringmodel interface{} interface{}queryType string stringrefId string stringrelativeTimeRange RelativeTimeRange RelativeTimeRange
AlertRuleExportProperties
Expand table
Name Type Go type Required Default Description Example annotations map of string map[string]stringcondition string stringdasboardUid string stringdata []AlertQueryExport []*AlertQueryExportexecErrState string stringfor Duration DurationisPaused boolean boollabels map of string map[string]stringnoDataState string stringpanelId int64 (formatted integer) int64title string stringuid string string
AlertRuleGroupProperties
Expand table
Name Type Go type Required Default Description Example folderUid string stringinterval int64 (formatted integer) int64rules []ProvisionedAlertRule []*ProvisionedAlertRuletitle string string
AlertRuleGroupExportProperties
Expand table
Name Type Go type Required Default Description Example folder string stringinterval Duration Durationname string stringorgId int64 (formatted integer) int64rules []AlertRuleExport []*AlertRuleExport
AlertingFileExportProperties
Properties
Expand table
Name Type Go type Required Default Description Example name string stringorgId int64 (formatted integer) int64receivers []ReceiverExport []*ReceiverExport
[]EmbeddedContactPoint
DurationExpand table
Name Type Go type Default Description Example Duration int64 (formatted integer) int64
EmbeddedContactPoint is the contact point type that is used
by grafanas embedded alertmanager implementation.
Properties
Expand table
Name Type Go type Required Default Description Example disableResolveMessage boolean boolfalsename string stringName is used as grouping key in the UI. Contact points with the same name will be grouped in the UI. webhook_1provenance string stringsettings JSON JSON✓ type string string✓ webhookuid string stringUID 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 stringType MatchType MatchTypeValue string string
MatchersMatchers 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 stringtime_intervals []TimeInterval []*TimeInterval
MuteTimings[]MuteTimeInterval
NotFoundinterface{}
NotificationPolicyExportProperties
Expand table
Name Type Go type Required Default Description Example Policy RouteExport RouteExportinline orgId int64 (formatted integer) int64
NotificationTemplateProperties
Expand table
Name Type Go type Required Default Description Example name string stringprovenance Provenance Provenancetemplate string string
NotificationTemplateContentProperties
Expand table
Name Type Go type Required Default Description Example template string string
NotificationTemplates[]NotificationTemplate
ObjectMatchersMatchers
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{"runbook_url":"https://supercoolrunbook.com/page/13"}condition string string✓ Adata []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_xfor Duration Duration✓ id int64 (formatted integer) int64isPaused boolean boolfalselabels map of string map[string]string{"team":"sre-team-1"}noDataState string string✓ orgID int64 (formatted integer) int64✓ provenance Provenance ProvenanceruleGroup string string✓ eval_group_1title string string✓ Always firinguid string stringupdated date-time (formatted string) strfmt.DateTime
ProvisionedAlertRules[]ProvisionedAlertRule
RawMessageinterface{}
ReceiverExportProperties
Expand table
Name Type Go type Required Default Description Example disableResolveMessage boolean boolsettings RawMessage RawMessagetype string stringuid 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 Durationto 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 boolgroup_by []string []stringgroup_interval string stringgroup_wait string stringmatch map of string map[string]stringDeprecated. Remove before v1.0 release. match_re MatchRegexps MatchRegexpsmatchers Matchers Matchersmute_time_intervals []string []stringobject_matchers ObjectMatchers ObjectMatchersprovenance Provenance Provenancereceiver string stringrepeat_interval string stringroutes []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 boolgroup_by []string []stringgroup_interval string stringgroup_wait string stringmatch map of string map[string]stringDeprecated. Remove before v1.0 release. match_re MatchRegexps MatchRegexpsmatchers Matchers Matchersmute_time_intervals []string []stringobject_matchers ObjectMatchers ObjectMatchersreceiver string stringrepeat_interval string stringroutes []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 []stringlocation string stringmonths []string []stringtimes []TimeRange []*TimeRangeweekdays []string []stringyears []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 EndMinute int64 (formatted integer) int64StartMinute int64 (formatted integer) int64
ValidationErrorProperties
Expand table
Name Type Go type Required Default Description Example msg string stringerror message