It seems you're using Kibana own Dev Tools to hit Kibana API - it's not supported. Kibana Dev Tools can only query Elasticsearch APIs, but not the ones exposed by Kibana. For those you need to use curl or similar HTTP client (there is a Copy as cURL button on every such snippet in documentation):
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.