# Changing roles after api key creation?

**URL:** https://discuss.elastic.co/t/changing-roles-after-api-key-creation/297610
**Category:** Elasticsearch
**Tags:** elastic-stack-security
**Created:** [February 18, 2022, 1:29pm UTC](https://discuss.elastic.co/t/changing-roles-after-api-key-creation/297610 "2022-02-18T13:29:06Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![mybyte](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mybyte/32/99989_2.png) [@mybyte](https://discuss.elastic.co/u/mybyte)
#### Post date: [February 18, 2022, 1:29pm UTC](https://discuss.elastic.co/t/changing-roles-after-api-key-creation/297610/1 "2022-02-18T13:29:07Z")

</div>

Is it possible to change the permissions of an API key after creation or do you have to create a new key and change all the configurations every single time you want to grant access to a new index?

---

<div class="post-metadata">

### Author: ![TimV](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timv/32/13162_2.png) [@TimV](https://discuss.elastic.co/u/TimV)
#### Post date: [February 21, 2022, 2:11am UTC](https://discuss.elastic.co/t/changing-roles-after-api-key-creation/297610/2 "2022-02-21T02:11:06Z")

</div>

There is no way to change an API key after it is created, except to invalidate it.

If you need mutable privileges, then you probably don't want to use API Keys for that.  
Users and Roles have modifiable privileges and maybe better suited to the problem you are solving.

---

<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: [November 4, 2022, 8:34am UTC](https://discuss.elastic.co/t/changing-roles-after-api-key-creation/297610/3 "2022-11-04T08:34:18Z")

</div>


