# ApiKey for a rule maker viewer

**URL:** https://discuss.elastic.co/t/apikey-for-a-rule-maker-viewer/340573
**Category:** Kibana
**Tags:** elastic-stack-alerting
**Created:** [August 10, 2023, 2:23pm UTC](https://discuss.elastic.co/t/apikey-for-a-rule-maker-viewer/340573 "2023-08-10T14:23:30Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![A\_Mightiev](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/a_mightiev/32/62186_2.png) [@A\_Mightiev](https://discuss.elastic.co/u/A_Mightiev)
#### Post date: [August 10, 2023, 2:23pm UTC](https://discuss.elastic.co/t/apikey-for-a-rule-maker-viewer/340573/1 "2023-08-10T14:23:30Z")

</div>

Hi  
I'm trying to create an apikey that would allow to create/view rules/alerts in kibana.  
I tried this restrictions but apparently they are not enough:

```auto
{
  "kibana_rulemaker": {
    "cluster": [],
    "indices": [],
    "applications": [
      {
        "application": "kibana-.kibana",
        "privileges": [
          "feature_stackAlerts.all",
          "feature_actions.all"
        ],
        "resources": [
          "*"
        ]
      }
    ],
    "run_as": [],
    "metadata": {},
    "transient_metadata": {
      "enabled": true
    }
  }
}

```

If I try to see a specific rule say

```auto
[server]$ curl -XGET localhost:5601/api/alerting/rule/abc -H "kbn-x: true" -H "Authorization: ApiKey: abcd"
{"statusCode":403,"error":"Forbidden","message":"Unauthorized to get a \"metrics.alert.threshold\" rule by \"infrastructure\""}

```

---

<div class="post-metadata">

### Author: ![A\_Mightiev](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/a_mightiev/32/62186_2.png) [@A\_Mightiev](https://discuss.elastic.co/u/A_Mightiev)
#### Post date: [August 10, 2023, 2:41pm UTC](https://discuss.elastic.co/t/apikey-for-a-rule-maker-viewer/340573/2 "2023-08-10T14:41:20Z")

</div>

Apparently I only need to add  
`"feature_infrastructure.all"`

---

<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 7, 2023, 2:42pm UTC](https://discuss.elastic.co/t/apikey-for-a-rule-maker-viewer/340573/3 "2023-09-07T14:42:10Z")

</div>

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