How to curl elastic or kibana api for alerts?

I am learning to use the ELK stack. Both kibana and elasticsearch are installed on my localhost. I just learnt how to install metricbeat and how to set up alerts. When setting up the alerts, I used the index connector, and called my index testconnector.

I see the alerts showing up in my web browser when i go to http://localhost:5601/app/observability/alerts.

Is there a way for me to get the same information via REST API? i tried all these endpoints but they all say no handler found for uri


curl -X GET -k -u elasticuser:elasticpass "http://localhost:9200/api/index_management/indices"
curl -X GET -k -u elasticuser:elasticpass "http://localhost:9200/api/alert"
curl -X GET -k -u elasticuser:elasticpass "http://localhost:9200/api/alert/_search"
curl -X GET -k -u elasticuser:elasticpass "http://localhost:9200/api/alert/_find"
curl -X GET -k -u elasticuser:elasticpass "http://localhost:9200/alert/_search"
curl -X GET -k -u elasticuser:elasticpass "http://localhost:9200/alert/_find"
curl -X GET -k -u elasticuser:elasticpass "http://localhost:9200/kibana/api/alerting"
curl -X GET -k -u elasticuser:elasticpass "http://localhost:9200/testconnector/_search"

If anyone can tell me how to get the alerts (not the rules) through a REST API, that will be great!

@learningelastic hello there!

Perhaps this page can assist?

I believe you are looking for this endpoint.
curl -X GET -k -u elasticuser:elasticpass "http://localhost:9200/api/alerts/_find"

1 Like