# How to create several roles at once

**URL:** <https://discuss.elastic.co/t/how-to-create-several-roles-at-once/278203>\
**Category:** Elasticsearch\
**Created:** [July 8, 2021, 3:12pm UTC](https://discuss.elastic.co/t/how-to-create-several-roles-at-once/278203 "2021-07-08T15:12:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mcosta](https://avatars.discourse-cdn.com/v4/letter/m/6a8cbe/32.png) [@mcosta](https://discuss.elastic.co/u/mcosta)\
**Post date:** [July 8, 2021, 3:12pm UTC](https://discuss.elastic.co/t/how-to-create-several-roles-at-once/278203/1 "2021-07-08T15:12:34Z")

</div>

Hi all,

Is there a way to create several roles at once using POST /\_security/role/ API?

If so, can someone plz give an example?

The ideia here is to first use GET /\_security/role/, remove all reserved roles and then use POST to create same roles on a different cluster.

Thank you

---

<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:** [August 5, 2021, 3:12pm UTC](https://discuss.elastic.co/t/how-to-create-several-roles-at-once/278203/2 "2021-08-05T15:12:42Z")

</div>

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