Error: "no handler found for uri [/api/security/role/my_kibana_role?pretty] and method [PUT]"

Hey there,

I would like to add Kibana roles using the role management API as described in:

https://www.elastic.co/guide/en/kibana/7.4/role-management-api-put.html

For a

PUT /api/security/role/my_kibana_role
{
  "metadata" : {
    "version" : 1
  },
  "kibana": [
    {
      "base": [],
      "feature": {
        "dashboard": ["read"]
      },
      "spaces": [
        "marketing"
      ]
    }
  ]
}

I only get the following error back:

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

Currently I have the Basic licensed version of XPACK installed.

Is this API included in the Basic License, do I have to enable it through some config?

Any hints are appreciated :slight_smile:

Thanks in advance,
Daniel

Hi @daniellienert,

It seems you're using Kibana own Dev Tools to hit Kibana API - it's not supported. Kibana Dev Tools can only query Elasticsearch APIs, but not the ones exposed by Kibana. For those you need to use curl or similar HTTP client (there is a Copy as cURL button on every such snippet in documentation):

curl -X PUT "localhost:5601/api/security/role/my_kibana_role" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d'
{
  "metadata" : {
    "version" : 1
  },
  "elasticsearch": {
    "cluster" : [ ],
    "indices" : [ ]
  },
  "kibana": [
    {
      "base": [],
      "feature": {
       "discover": [
          "all"
        ],
        "visualize": [
          "all"
        ],
        "dashboard": [
          "all"
        ],
        "dev_tools": [
          "read"
        ],
        "advancedSettings": [
          "read"
        ],
        "indexPatterns": [
          "read"
        ],
        "timelion": [
          "all"
        ],
        "graph": [
          "all"
        ],
        "apm": [
          "read"
        ],
        "maps": [
          "read"
        ],
        "canvas": [
          "read"
        ],
        "infrastructure": [
          "all"
        ],
        "logs": [
          "all"
        ],
        "uptime": [
          "all"
        ]
      },
      "spaces": [
        "*"
      ]
    }
  ]
}
'

Thanks @azasypkin,

now I also found the note :slight_smile:

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