# Creating a kibana role using Dev Tools

**URL:** <https://discuss.elastic.co/t/creating-a-kibana-role-using-dev-tools/246963>\
**Category:** Kibana\
**Tags:** elastic-stack-security\
**Created:** [August 31, 2020, 1:56pm UTC](https://discuss.elastic.co/t/creating-a-kibana-role-using-dev-tools/246963 "2020-08-31T13:56:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mfa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mfa/32/87041_2.png) [@mfa](https://discuss.elastic.co/u/mfa)\
**Post date:** [August 31, 2020, 1:56pm UTC](https://discuss.elastic.co/t/creating-a-kibana-role-using-dev-tools/246963/1 "2020-08-31T13:56:06Z")

</div>

Hi,  
I am using ElasticCloud v7.9.0, I use Dev Tools to do the setup on kibana like creating users, indexes,... I want to create a kibana role as well however I get an error:

```auto
    PUT /_security/role/mytestrole
    { 
        "elasticsearch": {
            "indices": [{
                "names": ["mytestindex*"],
                "privileges": ["create", "write", "create_index"]
            }]
        },
        "kibana": [{
            "base": [],
            "feature": {"visualize": ["all"],"dashboard": ["read", "url_create"], "metrics": ["all"], "logs": ["all"]},
            "spaces": ["myspace"]
        }] 
    }

```

Error is:

```
{
  "error" : {
    "root_cause" : [
      {
        "type" : "parse_exception",
        "reason" : "failed to parse role [mytestrole]. unexpected field [elasticsearch]"
      }
    ],
    "type" : "parse_exception",
    "reason" : "failed to parse role [mytestrole]. unexpected field [elasticsearch]"
  },
  "status" : 400
}

```

I was able to create the role using Postman however not true Dev Tools.  
I followed the steps on the following link:  
[https://www.elastic.co/guide/en/kibana/current/role-management-api-put.html](https://www.elastic.co/guide/en/kibana/current/role-management-api-put.html)

Is there anyway to run this using Dev tools?

---

<div class="post-metadata">

**Author:** ![markov00](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/markov00/32/33316_2.png) [@markov00](https://discuss.elastic.co/u/markov00)\
**Post date:** [August 31, 2020, 2:00pm UTC](https://discuss.elastic.co/t/creating-a-kibana-role-using-dev-tools/246963/2 "2020-08-31T14:00:28Z")

</div>

Hi, the API URL is a bit different from the one you have used:

```auto
PUT <kibana host>:<port>/api/security/role/my_kibana_role

```

so in your case you should use:

```auto
PUT /api/security/role/mytestrole

```

---

<div class="post-metadata">

**Author:** ![mfa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mfa/32/87041_2.png) [@mfa](https://discuss.elastic.co/u/mfa)\
**Post date:** [August 31, 2020, 2:02pm UTC](https://discuss.elastic.co/t/creating-a-kibana-role-using-dev-tools/246963/3 "2020-08-31T14:02:46Z")

</div>

> [@markov00](#):
>
> `/api/security/role`

If I use /api/ I'll get this error:

```
{
  "error" : "no handler found for uri [/api/security/role/mytestrole?pretty=true] and method [PUT]"
}

```

---

<div class="post-metadata">

**Author:** ![markov00](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/markov00/32/33316_2.png) [@markov00](https://discuss.elastic.co/u/markov00)\
**Post date:** [August 31, 2020, 3:20pm UTC](https://discuss.elastic.co/t/creating-a-kibana-role-using-dev-tools/246963/4 "2020-08-31T15:20:50Z")

</div>

> [@mfa](#):
>
> Is there anyway to run this using Dev tools?

I'm sorry I've just read partially your request. No is not possible to access Kibana `API` directly from devTools, it's used only as ES proxy and doesn't handle API requests like that one

---

<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:** [September 28, 2020, 3:20pm UTC](https://discuss.elastic.co/t/creating-a-kibana-role-using-dev-tools/246963/5 "2020-09-28T15:20:57Z")

</div>

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