# Is it possible to retrieve a users api key via the api?

**URL:** https://meta.discourse.org/t/is-it-possible-to-retrieve-a-users-api-key-via-the-api/76520
**Category:** Support
**Created:** [December 20, 2017, 9:50pm UTC](https://meta.discourse.org/t/is-it-possible-to-retrieve-a-users-api-key-via-the-api/76520 "2017-12-20T21:50:08Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![jordan1909](https://avatars.discourse-cdn.com/v4/letter/j/9f8e36/32.png) [@jordan1909](https://meta.discourse.org/u/jordan1909)
#### Post date: [December 20, 2017, 9:50pm UTC](https://meta.discourse.org/t/is-it-possible-to-retrieve-a-users-api-key-via-the-api/76520/1 "2017-12-20T21:50:08Z")

</div>

In my application I have created a little app on Heroku that sets a timer on topics for whoever is the owner when a customer replies to that topic. It works quite well.

The challenge I have however is I have to statically define the users API key which is not a good idea. I’ve tried looking at the username.json file, I’ve also looked through the API docs and the only thing close is generating a new API key which is going to be somewhat unrealistic to keep doing.

**Is there any query or way that I can retrieve a users api key via the api?** This would allow me to get the username of the owner and dynamically get their key to set the reminder. It is only because the timer api call doesn’t allow the passing of a username.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [December 20, 2017, 10:21pm UTC](https://meta.discourse.org/t/is-it-possible-to-retrieve-a-users-api-key-via-the-api/76520/2 "2017-12-20T22:21:24Z")

</div>

Can’t you use a global admin API key and set the `api_username` when making the calls?

---

<div class="post-metadata">

### Author: ![jordan1909](https://avatars.discourse-cdn.com/v4/letter/j/9f8e36/32.png) [@jordan1909](https://meta.discourse.org/u/jordan1909)
#### Post date: [December 20, 2017, 10:44pm UTC](https://meta.discourse.org/t/is-it-possible-to-retrieve-a-users-api-key-via-the-api/76520/3 "2017-12-20T22:44:07Z")

</div>

Damn @sam now I feel dumb.

My hero!

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [December 20, 2017, 10:44pm UTC](https://meta.discourse.org/t/is-it-possible-to-retrieve-a-users-api-key-via-the-api/76520/4 "2017-12-20T22:44:59Z")

</div>

> [@jordan1909](#):
>
> Damn @sam now I feel dumb.

Don’t feel dumb! Thanks for asking!

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [November 23, 2022, 9:39pm UTC](https://meta.discourse.org/t/is-it-possible-to-retrieve-a-users-api-key-via-the-api/76520/6 "2022-11-23T21:39:00Z")

</div>


