# Can't connect to Kibana API with CURL. I keep receiving {"statusCode":404,"error":"Not Found","message":"Not Found"}

**URL:** https://discuss.elastic.co/t/cant-connect-to-kibana-api-with-curl-i-keep-receiving-statuscode-404-error-not-found-message-not-found/324804
**Category:** Kibana
**Created:** [February 6, 2023, 3:17pm UTC](https://discuss.elastic.co/t/cant-connect-to-kibana-api-with-curl-i-keep-receiving-statuscode-404-error-not-found-message-not-found/324804 "2023-02-06T15:17:02Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Piotrek](https://avatars.discourse-cdn.com/v4/letter/p/94ad74/32.png) [@Piotrek](https://discuss.elastic.co/u/Piotrek)
#### Post date: [February 6, 2023, 3:17pm UTC](https://discuss.elastic.co/t/cant-connect-to-kibana-api-with-curl-i-keep-receiving-statuscode-404-error-not-found-message-not-found/324804/1 "2023-02-06T15:17:02Z")

</div>

I'm trying to connect to Kibana API via CURL:

> curl -X "GET" "http://\<my-elastic-host\>:5601/status" --user \<my-username\> --noproxy '\*' -H 'kbn-xsrf: true'

But all I receive is:

> {"statusCode":404,"error":"Not Found","message":"Not Found"}

Even if I give wrong username, the error is the same. Elastic API works perfectly fine on port 9200. The elastic stack version I use is 7.15. My guess is, that API can be totally blocked or wrongly configured, but I can not find anything about it in Kibana API documentation. I've seen in other forum discussions, that this error code is quite generic and can be resolved in multiple ways, but nothing works for me so far.

---

<div class="post-metadata">

### Author: ![Ayush\_Mathur](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ayush_mathur/32/77134_2.png) [@Ayush\_Mathur](https://discuss.elastic.co/u/Ayush_Mathur)
#### Post date: [February 7, 2023, 8:03am UTC](https://discuss.elastic.co/t/cant-connect-to-kibana-api-with-curl-i-keep-receiving-statuscode-404-error-not-found-message-not-found/324804/2 "2023-02-07T08:03:26Z")

</div>

Hello @Piotrek , welcome to the community !

> [@Piotrek](#):
>
> curl -X "GET" "http://:5601/status" --user --noproxy '\*' -H 'kbn-xsrf: true'

The URL you are trying to hit is for Elasticsearch but the port and API being used is for Kibana. If you want to get Kibana status, you need to query the endpoint exposed for Kibana and not ES. So, your curl should be something like:  
`curl -X "GET" "http://<my- **kibana** -host>:5601/status" --user <my-username> --noproxy '*' -H 'kbn-xsrf: true`

---

<div class="post-metadata">

### Author: ![Piotrek](https://avatars.discourse-cdn.com/v4/letter/p/94ad74/32.png) [@Piotrek](https://discuss.elastic.co/u/Piotrek)
#### Post date: [February 7, 2023, 10:00am UTC](https://discuss.elastic.co/t/cant-connect-to-kibana-api-with-curl-i-keep-receiving-statuscode-404-error-not-found-message-not-found/324804/3 "2023-02-07T10:00:59Z")

</div>

> [@Piotrek](#):
>
> 5601

Hey @Ayush_Mathur , many thanks for your responce. Indeed I have changed url to kibana one (one I use to connect via web), also needed to add cert, as I have kibana only on https. Now my curl loos like this:

> Blockquote  
> curl -X "GET" "https://\<my- **kibana** -host\>/kibana:5601/status" --user --noproxy '\*' -H 'kbn-xsrf: true' --cacert cert.pem

Unfortunatelly I still receive same result:

> Blockquote  
> {"statusCode":404,"error":"Not Found","message":"Not Found"}

Do you have any idea how to debug this?

---

<div class="post-metadata">

### Author: ![Ayush\_Mathur](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ayush_mathur/32/77134_2.png) [@Ayush\_Mathur](https://discuss.elastic.co/u/Ayush_Mathur)
#### Post date: [February 7, 2023, 10:04am UTC](https://discuss.elastic.co/t/cant-connect-to-kibana-api-with-curl-i-keep-receiving-statuscode-404-error-not-found-message-not-found/324804/4 "2023-02-07T10:04:30Z")

</div>

Have you tried using `/api/status` instead of just `/status` ?

---

<div class="post-metadata">

### Author: ![Piotrek](https://avatars.discourse-cdn.com/v4/letter/p/94ad74/32.png) [@Piotrek](https://discuss.elastic.co/u/Piotrek)
#### Post date: [February 7, 2023, 1:17pm UTC](https://discuss.elastic.co/t/cant-connect-to-kibana-api-with-curl-i-keep-receiving-statuscode-404-error-not-found-message-not-found/324804/5 "2023-02-07T13:17:06Z")

</div>

Yes that helped, thank you!

---

<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: [March 7, 2023, 1:17pm UTC](https://discuss.elastic.co/t/cant-connect-to-kibana-api-with-curl-i-keep-receiving-statuscode-404-error-not-found-message-not-found/324804/6 "2023-03-07T13:17:51Z")

</div>

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