# API key?

**URL:** https://hub.mender.io/t/api-key/1746
**Category:** General Discussions
**Created:** [April 3, 2020, 3:38pm UTC](https://hub.mender.io/t/api-key/1746 "2020-04-03T15:38:33Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![ngrilly](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/ngrilly/32/468_2.png) [@ngrilly](https://hub.mender.io/u/ngrilly)
#### Post date: [April 3, 2020, 3:38pm UTC](https://hub.mender.io/t/api-key/1746/1 "2020-04-03T15:38:33Z")

</div>

I’m writing a script to fetch the device inventory using the API. But I don’t see any API key in Hosted Mender?

---

<div class="post-metadata">

### Author: ![mirzak](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mirzak/32/2056_2.png) [@mirzak](https://hub.mender.io/u/mirzak)
#### Post date: [April 3, 2020, 3:41pm UTC](https://hub.mender.io/t/api-key/1746/2 "2020-04-03T15:41:36Z")

</div>

Hi @ngrilly,

Take a look at this section in the docs, which should cover how to get an access key,

[https://docs.mender.io/2.3/server-integration/using-the-apis](https://docs.mender.io/2.3/server-integration/using-the-apis)

Specifically,

```auto
Now obtain a management API JSON Web Token by using the Open Source or Enterprise login API:

JWT=$(curl -X POST -u $MENDER_SERVER_USER $MENDER_SERVER_URI/api/management/v1/useradm/auth/login)

```

---

<div class="post-metadata">

### Author: ![ngrilly](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/ngrilly/32/468_2.png) [@ngrilly](https://hub.mender.io/u/ngrilly)
#### Post date: [April 5, 2020, 3:49pm UTC](https://hub.mender.io/t/api-key/1746/3 "2020-04-05T15:49:51Z")

</div>

Hi @mirzak,

Yes, this is what I currently do. But the JWT token expires after a few days. That means the server needs to know my Mender username and password, to be able to refresh the JWT token. That’s why I’m asking for API keys.

---

<div class="post-metadata">

### Author: ![mirzak](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mirzak/32/2056_2.png) [@mirzak](https://hub.mender.io/u/mirzak)
#### Post date: [April 6, 2020, 7:29am UTC](https://hub.mender.io/t/api-key/1746/4 "2020-04-06T07:29:13Z")

</div>

Ah, understand. We do not yet have API keys and currently only the mentioned method is supported. With that said, it is definitely a valid use-case to provide API keys and is something that we are looking at.
