Grafana 9.2.3 alert feature: How to export / import alerts as yml/json?

Hi.

Is it possible to export all alerts of the Grafana 9.2.3 alerts to a json or yml file like all the other dashboards and datasources (and use it later in the provision process)?
I tried using grafana api, but it’s not returning anything.

Greetings and thanks in advance,
Faizan

Welcome

Could youbpleqse show us what you did?

I’ve tried to list alerts using below grafana api but it’s returning

curl -s -H "Authorization: Bearer api_token -X GET “https://URI/api/alerts

hi @faizanshah

to export all alert rules in provisioning file format,

try :

/api/v1/provisioning/alert-rules/export

Hi there,

I wonder if there is also a way (Grafana 9.4) to import alerts as json.
In a same fashion as it is possible with provisioning for dashboards.

Any recommendations?

Thanks

Have you checked

Antony.