Connecting to Elasticsearch Using cURL


In this example, we will use curl command to communicate with the Elasticsearch cluster.


Before making a curl request to the cluster, you first need to whitelist your public IP on your cluster. For more details on how to connect to your cluster click here.

Following are few curl example to communicate with your cluster

Checking your cluster health

curl -X PUT -u icelasticsearch:8c0d6939de6e0d7ff6a84c2f63e08ce4 -k

Creating indices

curl -X PUT -u icelasticsearch:8c0d6939de6e0d7ff6a84c2f63e08ce4 -H ‘Content-Type: application/json’ -d’
“description” : “this is a test”,
“timestamp” : “2020-01-16T04:32:49”
}’ -k

Deleting Indices

curl -X DELETE -u icelasticsearch:8c0d6939de6e0d7ff6a84c2f63e08ce4 -k


Spin up a cluster in less
than 5 minutes.
(No credit card required)

Sign Up Now

Site by Swell Design Group