# Can't generate multiple API keys?

**URL:** <https://meta.discourse.org/t/cant-generate-multiple-api-keys/21011>\
**Category:** Feature\
**Created:** [October 10, 2014, 1:31pm UTC](https://meta.discourse.org/t/cant-generate-multiple-api-keys/21011 "2014-10-10T13:31:27Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![blake](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blake/32/157322_2.png) [@blake](https://meta.discourse.org/u/blake)\
**Post date:** [December 1, 2016, 12:30pm UTC](https://meta.discourse.org/t/cant-generate-multiple-api-keys/21011/5 "2016-12-01T12:30:17Z")

</div>

> [@stefanm](#):
>
> is it possible to generate api\_key for specific user on its creation, or any time after, but not from the UI.I want to give api\_key to user with the API, with main api\_key.

You can generate an API key for a user with this API call:

```
Request URL:http://localhost:3000/admin/users/4/generate_api_key
Request Method:POST
Request Body: 
   api_key,
   api_username

```

The response json will look like:

```
{
  "api_key": {
    "id": 2,
    "key": "630f51d28da39e969eaf26060687449df5ba443b517167a7ae393549a168bdb3",
    "user": {
      "id": 4,
      "username": "discourse2",
      "avatar_template": "/letter_avatar_proxy/v2/letter/d/4af34b/{size}.png"
    }
  }
}

```

---

_[View the full topic](https://meta.discourse.org/t/cant-generate-multiple-api-keys/21011)._
