# How to curl elastic or kibana api for alerts?

**URL:** <https://discuss.elastic.co/t/how-to-curl-elastic-or-kibana-api-for-alerts/314455>\
**Category:** Kibana\
**Tags:** elastic-stack-alerting\
**Created:** [September 14, 2022, 7:25pm UTC](https://discuss.elastic.co/t/how-to-curl-elastic-or-kibana-api-for-alerts/314455 "2022-09-14T19:25:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![learningelastic](https://avatars.discourse-cdn.com/v4/letter/l/958977/32.png) [@learningelastic](https://discuss.elastic.co/u/learningelastic)\
**Post date:** [September 14, 2022, 7:25pm UTC](https://discuss.elastic.co/t/how-to-curl-elastic-or-kibana-api-for-alerts/314455/1 "2022-09-14T19:25:34Z")

</div>

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`

```auto

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!

---

<div class="post-metadata">

**Author:** ![Tre\_Seymour](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tre_seymour/32/46507_2.png) [@Tre\_Seymour](https://discuss.elastic.co/u/Tre_Seymour)\
**Post date:** [September 19, 2022, 3:42pm UTC](https://discuss.elastic.co/t/how-to-curl-elastic-or-kibana-api-for-alerts/314455/2 "2022-09-19T15:42:56Z")

</div>

@learningelastic hello there!

Perhaps this page can assist?

> **[Find rules API | Kibana Guide \[8.4\] | Elastic](https://www.elastic.co/guide/en/kibana/current/find-rules-api.html#find-rules-api-request)**
>
> Conceptual and step-by-step procedures for using runtime fields, scripted fields, and field formatters.

---

<div class="post-metadata">

**Author:** ![nickpeihl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nickpeihl/32/112622_2.png) [@nickpeihl](https://discuss.elastic.co/u/nickpeihl)\
**Post date:** [September 22, 2022, 3:11pm UTC](https://discuss.elastic.co/t/how-to-curl-elastic-or-kibana-api-for-alerts/314455/3 "2022-09-22T15:11:35Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 20, 2022, 3:12pm UTC](https://discuss.elastic.co/t/how-to-curl-elastic-or-kibana-api-for-alerts/314455/4 "2022-10-20T15:12:19Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
