@stephenb Thanks for your answer. I've tried tested as you say but I always get a 401 with the following response. I've tested with all combinations "user:password" that I could. Just to know, I use the same credentials that I use to log in to the cloud.
{"error":{"root_cause":[{"type":"security_exception","reason":"unable to authenticate user [username@domain] for REST request [/my-index/_doc]","header":{"WWW-Authenticate":["Basic realm=\"security\" charset=\"UTF-8\"","Bearer realm=\"security\"","ApiKey"]}}],"type":"security_exception","reason":"unable to authenticate user [username@domain] for REST request [/my-index/_doc]","header":{"WWW-Authenticate":["Basic realm=\"security\" charset=\"UTF-8\"","Bearer realm=\"security\"","ApiKey"]}},"status":401}