-
What Grafana version and what operating system are you using?
v9.3.2 on Kubernetes -
What are you trying to achieve?
I am trying to create a notification policy via the API. -
How are you trying to achieve it?
Alerting Provisioning HTTP API | Grafana documentation
There is no POST method for creating a notification policy
-
What happened?
I am getting a 404 not found error. -
What did you expect to happen?
I expected the Notification Policy to be created
But I also noticed that the http provisioning docs leave out the POST method for creating a notification policy. DELETE, GET, and PUT exist but not POST -
Can you copy/paste the configuration(s) that you are having problems with?
endpoint = "<grafana-url>/api/v1/provisioning/policies"
payload = {
"receiver": "test_alert_name",
"object_matchers": [ ],
"routes": [
{
"receiver": "test_alert_name",
"object_matchers": [["alertname", "=", "scanappAlert"]],
}
],
}
Sending a post request and getting a 404 Not found error
-
Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
No -
Did you follow any online instructions? If so, what is the URL?
Alerting Provisioning HTTP API | Grafana documentation