Unable to use RESTful API in Elastic Cloud with curl

Hi,

I have a deployment on Elastic Cloud with an endpoint of the form:
https://my_host_name.es.westusa.azure.elastic-cloud.com

I wish to use the api to edit the extensions, specifically to add a synonyms file, using curl from the command line.

Following the guidelines from the documentation here, I should be able to access deployments in the following way:

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

However any request to this api returns:

{"errors":[{"code":"root.unauthenticated","message":"The supplied authentication is invalid"}]}

My Api Key is valid for any queries directly to the deployment endpoint, so I don't understand why we can't use the api of the form

https://api.elastic-cloud.com/api/v1/...

Thank you in advance

SOLVED: keys created by via rest did not work for using deployments API - they don't appear in elastic cloud console. Creating a new key in the console itself allowed us to use the api

1 Like

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