# Create HTTPS Enabled Elasticsearch API

**URL:** <https://discuss.elastic.co/t/create-https-enabled-elasticsearch-api/274881>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-security\
**Created:** [June 3, 2021, 1:55pm UTC](https://discuss.elastic.co/t/create-https-enabled-elasticsearch-api/274881 "2021-06-03T13:55:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ankitdevnalkar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ankitdevnalkar/32/46158_2.png) [@ankitdevnalkar](https://discuss.elastic.co/u/ankitdevnalkar)\
**Post date:** [June 3, 2021, 1:55pm UTC](https://discuss.elastic.co/t/create-https-enabled-elasticsearch-api/274881/1 "2021-06-03T13:55:40Z")

</div>

While going through the document of creating an Elasticsearch API, there is a note for `http.ssl.enabled` node. It is asking to `specify https` while creating API key, but I am bit confused that where I need to mention about `https`

 ![Selection_175](https://us1.discourse-cdn.com/elastic/original/3X/d/9/d9db9f05937b31833c9f63b95d6d93a4017bea03.png)

Do I need to mention it somewhere in the `POST` request that is performed to generate the API key ?

```
POST /_security/api_key
{
  "name": "my-api-key",
  "expiration": "1d", 
  "role_descriptors": { 
    "role-a": {
      "cluster": ["all"],
      "index": [
        {
          "names": ["index-a*"],
          "privileges": ["read"]
        }
      ]
    },
  "metadata": {
    "application": "my-application",
    "environment": {
       "level": 1,
       "trusted": true,
       "tags": ["dev", "staging"]
    }
  }
}
```

---

<div class="post-metadata">

**Author:** ![ankitdevnalkar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ankitdevnalkar/32/46158_2.png) [@ankitdevnalkar](https://discuss.elastic.co/u/ankitdevnalkar)\
**Post date:** [June 3, 2021, 8:11pm UTC](https://discuss.elastic.co/t/create-https-enabled-elasticsearch-api/274881/2 "2021-06-03T20:11:32Z")

</div>

can anyone help ?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [June 7, 2021, 4:49am UTC](https://discuss.elastic.co/t/create-https-enabled-elasticsearch-api/274881/3 "2021-06-07T04:49:10Z")

</div>

Based on the example on [the page](https://www.elastic.co/guide/en/elasticsearch/reference/7.13/security-api-create-api-key.html) directly below this note, I take that to mean if you are using curl. You are safe if you use Kibana that is connected to a TLS secured Elasticsearch cluster.

---

<div class="post-metadata">

**Author:** ![ankitdevnalkar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ankitdevnalkar/32/46158_2.png) [@ankitdevnalkar](https://discuss.elastic.co/u/ankitdevnalkar)\
**Post date:** [June 7, 2021, 7:51pm UTC](https://discuss.elastic.co/t/create-https-enabled-elasticsearch-api/274881/4 "2021-06-07T19:51:37Z")

</div>

Thanks @warkolm

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2021, 7:52pm UTC](https://discuss.elastic.co/t/create-https-enabled-elasticsearch-api/274881/5 "2021-07-05T19:52:06Z")

</div>

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