# Can't use ApiKey to update rule

**URL:** <https://discuss.elastic.co/t/cant-use-apikey-to-update-rule/335235>\
**Category:** Kibana\
**Tags:** elastic-stack-alerting\
**Created:** [June 5, 2023, 2:51pm UTC](https://discuss.elastic.co/t/cant-use-apikey-to-update-rule/335235 "2023-06-05T14:51:33Z")\
**Posts on this page:** 2\
**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:** [June 5, 2023, 2:51pm UTC](https://discuss.elastic.co/t/cant-use-apikey-to-update-rule/335235/1 "2023-06-05T14:51:33Z")

</div>

I'm trying to update alerting rules in kibana, if I create an apikey, I can see the rules, and I can authenticate, but when trying to update an alerting rule, it gives me this error:

```auto
{"statusCode":400,"error":"Bad Request","message":"Error updating rule: could not create API key - Unsupported scheme \"ApiKey\" for granting API Key"

```

This is my call:

```auto
curl -X PUT https://kibana:5601/api/alerting/rule/$INT_RULE_ID -H "Authorization: ApiKey $INT_APIKEY" -H 'content-type: application/json' -H 'kbn-xsrf: true' -d"$INT_CONTENT_FILE" -k

```

Thanks  
A

---

<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:** [July 3, 2023, 2:52pm UTC](https://discuss.elastic.co/t/cant-use-apikey-to-update-rule/335235/2 "2023-07-03T14:52:27Z")

</div>

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