# How to create Apikey to call users okta api from java code

**URL:** <https://devforum.okta.com/t/how-to-create-apikey-to-call-users-okta-api-from-java-code/6388>\
**Category:** Questions\
**Created:** [September 25, 2019, 7:21am UTC](https://devforum.okta.com/t/how-to-create-apikey-to-call-users-okta-api-from-java-code/6388 "2019-09-25T07:21:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ssumita.srivastawa](https://avatars.discourse-cdn.com/v4/letter/s/9d8465/32.png) [@ssumita.srivastawa](https://devforum.okta.com/u/ssumita.srivastawa)\
**Post date:** [September 25, 2019, 7:21am UTC](https://devforum.okta.com/t/how-to-create-apikey-to-call-users-okta-api-from-java-code/6388/1 "2019-09-25T07:21:41Z")

</div>

Hi All,

I have a method to create users , before creating users we have to create same user in okta. To call users api from okta, i have to generate apikey to add in the request.  
How to generate apikey from java code??

---

<div class="post-metadata">

**Author:** ![abroadhurst](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@abroadhurst](https://devforum.okta.com/u/abroadhurst)\
**Post date:** [September 25, 2019, 9:12am UTC](https://devforum.okta.com/t/how-to-create-apikey-to-call-users-okta-api-from-java-code/6388/2 "2019-09-25T09:12:31Z")

</div>

Hi there!

Go into your admin dashboard then ‘Security’ -\> ‘API’.

---

<div class="post-metadata">

**Author:** ![ssumita.srivastawa](https://avatars.discourse-cdn.com/v4/letter/s/9d8465/32.png) [@ssumita.srivastawa](https://devforum.okta.com/u/ssumita.srivastawa)\
**Post date:** [September 25, 2019, 9:16am UTC](https://devforum.okta.com/t/how-to-create-apikey-to-call-users-okta-api-from-java-code/6388/3 "2019-09-25T09:16:07Z")

</div>

Hi, Thanks for the reply… From admin dashboard i am able to get the apikey and that is working also by hardcoding in my properties file.  
But i have to generate apikey from java code and then call the /users api.  
Please let me know how to do this ?

---

<div class="post-metadata">

**Author:** ![abroadhurst](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@abroadhurst](https://devforum.okta.com/u/abroadhurst)\
**Post date:** [September 25, 2019, 9:23am UTC](https://devforum.okta.com/t/how-to-create-apikey-to-call-users-okta-api-from-java-code/6388/4 "2019-09-25T09:23:36Z")

</div>

For now there is no way to generate an api key.

There are some early access feature (api) that allows you to get an api key for a specific tenant however you are required to have another verified api key to be able to do it.

Why do you need to generate a new api token each time?

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/oktadev/original/1X/589c4c5f80de422d01f47cee7185a7fb8227835c.png) [@system](https://devforum.okta.com/u/system)\
**Post date:** [January 18, 2024, 12:12am UTC](https://devforum.okta.com/t/how-to-create-apikey-to-call-users-okta-api-from-java-code/6388/5 "2024-01-18T00:12:41Z")

</div>

Closed on January 18, 2024, 12:12am UTC

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