Type to search.

Access the Elastic Cloud API from the command line

ECH

Elastic Cloud Hosted lets you manage and configure one or more deployments of the versioned Elastic Stack, hosted on Elastic Cloud.

Availability

  • Generally available

    This functionality is generally available and ready for production usage.

You can interact with the full RESTful API for Elastic Cloud directly from the command line through the curl command. To authenticate, you just need to include your API key in the request header.

For convenience, you can export your API key into your shell environment:

Shell
export EC_API_KEY="YOUR_GENERATED_API_KEY"

This example curl command retrieves a list of your Elasticsearch Service deployments:

Shell
curl -H "Authorization: ApiKey $EC_API_KEY" https://api.elastic-cloud.com/api/v1/deployments

If this is your first time exploring the API, you can take a look at our API examples to learn more.