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 API Version 1.0.0
Content negotiation Consumes Produces All endpoints Alert rules 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✓
All responses Expand table
Code Status Description Has headers Schema 204 No Content The alert rule was deleted successfully. schema 400 Bad Request ValidationError schema
Responses 204 - The alert rule was deleted successfully.Status: No Content
Schema 400 - ValidationErrorStatus: Bad Request
SchemaValidationError
DELETE /api/v1/provisioning/contact-points/{UID}Consumes Parameters Expand table
Name Source Type Go type Separator Required Default Description UID pathstring string✓ UID should be the contact point unique identifier
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
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✓ Template Name
All responses Expand table
Code Status Description Has headers Schema 204 No Content Ack schema
Responses 204 - AckStatus: No Content
SchemaAck
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 Ack schema
Responses 204 - AckStatus: No Content
SchemaAck
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✓
All responses Expand table
Code Status Description Has headers Schema 200 OK AlertRule schema 400 Bad Request ValidationError schema
Responses 200 - AlertRuleStatus: OK
SchemaAlertRule
400 - ValidationErrorStatus: Bad Request
SchemaValidationError
GET /api/v1/provisioning/contact-pointsAll responses Responses 200 - RouteStatus: OK
SchemaRoute
400 - ValidationErrorStatus: Bad Request
SchemaValidationError
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✓ Template Name
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
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 400 Bad Request ValidationError schema
Responses 200 - MuteTimingsStatus: OK
SchemaMuteTimings
400 - ValidationErrorStatus: Bad Request
SchemaValidationError
Get the notification policy tree. (RouteGetPolicyTree )GET /api/v1/provisioning/policiesAll responses Responses 200 - RouteStatus: OK
SchemaRoute
400 - ValidationErrorStatus: Bad Request
SchemaValidationError
Get a message 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 MessageTemplate schema 404 Not Found NotFound schema
Responses 200 - MessageTemplateStatus: OK
SchemaMessageTemplate
404 - NotFoundStatus: Not Found
SchemaNotFound
Get all message templates. (RouteGetTemplates )GET /api/v1/provisioning/templatesAll responses Expand table
Code Status Description Has headers Schema 200 OK MessageTemplate schema 400 Bad Request ValidationError schema
Responses 200 - MessageTemplateStatus: OK
SchemaMessageTemplate
400 - ValidationErrorStatus: Bad Request
SchemaValidationError
Create a new alert rule. (RoutePostAlertRule )POST /api/v1/provisioning/alert-rulesParameters Expand table
Name Source Type Go type Separator Required Default Description Body bodyAlertRule models.AlertRule
All responses Expand table
Code Status Description Has headers Schema 201 Created AlertRule schema 400 Bad Request ValidationError schema
Responses 201 - AlertRuleStatus: Created
SchemaAlertRule
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 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
Create a new mute timing. (RoutePostMuteTiming )POST /api/v1/provisioning/mute-timingsConsumes Parameters Expand table
Name Source Type Go type Separator Required Default Description 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✓ Body bodyAlertRule models.AlertRule
All responses Expand table
Code Status Description Has headers Schema 200 OK AlertRule schema 400 Bad Request ValidationError schema
Responses 200 - AlertRuleStatus: OK
SchemaAlertRule
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✓ 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 should be the contact point unique identifier 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✓ Template Name 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 Body bodyRoute models.Route
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 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 Body bodyMessageTemplateContent models.MessageTemplateContent
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
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 object 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
AlertRuleProperties
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✓ Allowed values: “OK”, “Alerting”, “Error” FolderUID string string✓ project_xID int64 (formatted integer) int64Labels map of string map[string]string{"team":"sre-team-1"}NoDataState string string✓ Allowed values: “OK”, “NoData”, “Error” OrgID int64 (formatted integer) int64✓ RuleGroup string string✓ eval_group_1Title string string✓ Always firingUID string stringUpdated date-time (formatted string) strfmt.DateTimefor Duration Duration✓ provenance string Provenance
AlertRuleGroupProperties
Expand table
Name Type Go type Required Default Description Example Interval int64 (formatted integer) int64
DayOfMonthRangeProperties
Expand table
Name Type Go type Required Default Description Example Begin int64 (formatted integer) int64End int64 (formatted integer) int64
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 string✓ Name is used as grouping key in the UI. Contact points with the same name will be grouped in the UI. webhook_1Provenance string stringType string string✓ webhookUID string stringUID is the unique identifier of the contact point. The UID can be set by the user. my_external_referencesettings object JSON✓
MatchTypeExpand table
Name Type Go type Default Description Example MatchType int64 (formatted integer) int64 0 = MatchEqual, 1 = MatchNotEqual, 2 = MatchRegexp, 3 = MatchNotRegexp
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
MessageTemplateProperties
Expand table
Name Type Go type Required Default Description Example Name string stringTemplate string stringprovenance string Provenance
MessageTemplateContentProperties
Expand table
Name Type Go type Required Default Description Example Template string string
MonthRangeProperties
Expand table
Name Type Go type Required Default Description Example Begin int64 (formatted integer) int64End int64 (formatted integer) int64
MuteTimeIntervalProperties
Expand table
Name Type Go type Required Default Description Example Name string stringTimeIntervals []timeinterval []*TimeInterval
MuteTimings[]mutetimeinterval
NotFoundinterface{}
ObjectMatchersMatchers
Inlined models 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.
Properties
Expand table
Name Type Go type Required Default Description Example Continue boolean boolGroupByStr []string []stringMuteTimeIntervals []string []stringReceiver string stringRoutes []route []*Routegroup_interval Duration Durationgroup_wait Duration Durationobject_matchers ObjectMatchers ObjectMatchersprovenance string Provenancerepeat_interval Duration Duration
TimeIntervalTimeInterval describes intervals of time. ContainsTime will tell you if a golang time is contained
within the interval.
Properties
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 string
WeekdayRangeProperties
Expand table
Name Type Go type Required Default Description Example Begin int64 (formatted integer) int64End int64 (formatted integer) int64
YearRangeProperties
Expand table
Name Type Go type Required Default Description Example Begin int64 (formatted integer) int64End int64 (formatted integer) int64