# Programatically creating Kafka API Keys

**URL:** <https://forum.confluent.io/t/programatically-creating-kafka-api-keys/4660>\
**Category:** Confluent Cloud\
**Created:** [1 April 2022 07:42 UTC](https://forum.confluent.io/t/programatically-creating-kafka-api-keys/4660 "2022-04-01T07:42:45Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexcocinda](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/alexcocinda/32/1768_2.png) [@alexcocinda](https://forum.confluent.io/u/alexcocinda)\
**Post date:** [1 April 2022 07:42 UTC](https://forum.confluent.io/t/programatically-creating-kafka-api-keys/4660/1 "2022-04-01T07:42:46Z")

</div>

I am trying to create a Kafka API Key for a Basic Cluster using the Cloud API and I am getting the following error:

```nohighlight
{
  "errors": [
    {
      "id": "#################",
      "status": "403",
      "code": "forbidden_access",
      "detail": "You're not allowed to use this api yet. Contact Confluent to enable it.",
      "source": {}
    }
  ]
}

```

Do I need to use a Standard cluster to use the Cloud API?

---

<div class="post-metadata">

**Author:** ![mmuehlbeyer](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/mmuehlbeyer/32/1088_2.png) [@mmuehlbeyer](https://forum.confluent.io/u/mmuehlbeyer)\
**Post date:** [1 April 2022 08:56 UTC](https://forum.confluent.io/t/programatically-creating-kafka-api-keys/4660/2 "2022-04-01T08:56:46Z")

</div>

hi @alexcocinda

welcome to the forum 🙂

afaik there is no difference regarding the api.

the user you are using has the OrganizationAdmin role assigned?

best,  
michael

---

<div class="post-metadata">

**Author:** ![alexcocinda](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/alexcocinda/32/1768_2.png) [@alexcocinda](https://forum.confluent.io/u/alexcocinda)\
**Post date:** [1 April 2022 11:48 UTC](https://forum.confluent.io/t/programatically-creating-kafka-api-keys/4660/3 "2022-04-01T11:48:31Z")

</div>

I checked and I have the OrganizationAdmin role.

---

<div class="post-metadata">

**Author:** ![mmuehlbeyer](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/mmuehlbeyer/32/1088_2.png) [@mmuehlbeyer](https://forum.confluent.io/u/mmuehlbeyer)\
**Post date:** [1 April 2022 12:44 UTC](https://forum.confluent.io/t/programatically-creating-kafka-api-keys/4660/4 "2022-04-01T12:44:44Z")

</div>

did you create proper Cloud API keys?

how did you setup the whole env?

best  
michael

---

<div class="post-metadata">

**Author:** ![alexcocinda](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/alexcocinda/32/1768_2.png) [@alexcocinda](https://forum.confluent.io/u/alexcocinda)\
**Post date:** [4 April 2022 07:50 UTC](https://forum.confluent.io/t/programatically-creating-kafka-api-keys/4660/5 "2022-04-04T07:50:51Z")

</div>

I created the Cloud API Key from the we portal with global access rights. Are you asking about the development environment or the cloud clusters environment?

---

<div class="post-metadata">

**Author:** ![mmuehlbeyer](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/mmuehlbeyer/32/1088_2.png) [@mmuehlbeyer](https://forum.confluent.io/u/mmuehlbeyer)\
**Post date:** [4 April 2022 07:55 UTC](https://forum.confluent.io/t/programatically-creating-kafka-api-keys/4660/6 "2022-04-04T07:55:25Z")

</div>

ok  
asking about the environment you try to access.

---

<div class="post-metadata">

**Author:** ![mmuehlbeyer](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/mmuehlbeyer/32/1088_2.png) [@mmuehlbeyer](https://forum.confluent.io/u/mmuehlbeyer)\
**Post date:** [4 April 2022 08:02 UTC](https://forum.confluent.io/t/programatically-creating-kafka-api-keys/4660/7 "2022-04-04T08:02:36Z")

</div>

for reference just tested with a basic cluster the following works:

`confluent api-key create --resource lk-xxxxx`

---

<div class="post-metadata">

**Author:** ![alexcocinda](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/alexcocinda/32/1768_2.png) [@alexcocinda](https://forum.confluent.io/u/alexcocinda)\
**Post date:** [6 April 2022 13:46 UTC](https://forum.confluent.io/t/programatically-creating-kafka-api-keys/4660/8 "2022-04-06T13:46:40Z")

</div>

When i try the key generated with the CLI I get an “invalid key” error. However, we are not going to use the cloud API anymore, so I’ll reply with the resolution if we ever use it again. Thank you for the help!
