# \[SOLVED\] Can not delete fleet enrollement tokens

**URL:** <https://discuss.elastic.co/t/solved-can-not-delete-fleet-enrollement-tokens/369530>\
**Category:** Elastic Search\
**Created:** [October 28, 2024, 9:51am UTC](https://discuss.elastic.co/t/solved-can-not-delete-fleet-enrollement-tokens/369530 "2024-10-28T09:51:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![oO-David-Oo](https://avatars.discourse-cdn.com/v4/letter/o/6a8cbe/32.png) [@oO-David-Oo](https://discuss.elastic.co/u/oO-David-Oo)\
**Post date:** [October 28, 2024, 9:51am UTC](https://discuss.elastic.co/t/solved-can-not-delete-fleet-enrollement-tokens/369530/1 "2024-10-28T09:51:59Z")

</div>

Hello

I want to delete Fleet Server enrollment tokens that are no longer used but that I can no longer delete

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/0/1/01d854155844c0d2f4ba2542f349093a66f95a39.png)

I tested the following process:

> [@How to delete revoked Fleet enrolment tokens](https://discuss.elastic.co/t/how-to-delete-revoked-fleet-enrolment-tokens/324026/3):
>
> Hi @dkprojects, Currently the delete enrollment tokens endpoints only allows to invalidate them, not to delete. It basically works as a soft delete. What's your use case for deleting them? Thanks, Cristina

but it does not work

I found something else that talks about passing  
"allow\_restricted\_indices": on true

which I did but I still have an error I do not understand ☹

```
  "index": ".fleet-enrollment-api-keys-7",
  "id": "38274990-xxxxx-xxxx-xxxxx-175a3af94b89",
  "cause": {
    "type": "security_exception",
    "reason": "action [indices:data/write/bulk[s]] is unauthorized for user [system_user] with effective roles [superuser,systemindices_superuser] on restricted indices [.fleet-enrollment-api-keys-7], this action is granted by the index privileges [create_doc,create,delete,index,write,all]"
  },
  "status": 403
},

```

Please help  
Thanks

**EDIT** :  
I found it 🙂  
I added .fleet-enrollment-api-keys-7  
in my role with "allow\_restricted\_indices": on true

and it worked, I was able to delete the tokens 🙂

---

<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 25, 2024, 9:52am UTC](https://discuss.elastic.co/t/solved-can-not-delete-fleet-enrollement-tokens/369530/2 "2024-11-25T09:52:02Z")

</div>

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