# 404 when trying to create an API key for system user

**URL:** https://meta.discourse.org/t/404-when-trying-to-create-an-api-key-for-system-user/33535
**Category:** Bug
**Created:** [21 Settembre 2015, 6:33pm UTC](https://meta.discourse.org/t/404-when-trying-to-create-an-api-key-for-system-user/33535 "2015-09-21T18:33:03Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![OnceWas](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/oncewas/32/40734_2.png) [@OnceWas](https://meta.discourse.org/u/OnceWas)
#### Post date: [21 Settembre 2015, 6:33pm UTC](https://meta.discourse.org/t/404-when-trying-to-create-an-api-key-for-system-user/33535/1 "2015-09-21T18:33:03Z")

</div>

I am trying to create an API key for our ‘system’ user. When I click on Generate from the system user’s admin page, I get no key, and a 404 error appears in the console. There is no entry in the Discourse log.

`https://<site_url>/admin/users/-1/generate_api_key Failed to load resource: the server responded with a status of 404 (Not Found)`

I am able to generate API keys for other users.

I am running v1.4.0.beta9.

 ![](https://global.discourse-cdn.com/meta/original/3X/0/5/05db41e090f6fe25c9f06d16541f37793437119d.png)

 ![](https://global.discourse-cdn.com/meta/original/3X/d/e/dedf5b98bf69a87f34ea64b01f07cf2c31cdc675.png)

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [22 Settembre 2015, 1:36am UTC](https://meta.discourse.org/t/404-when-trying-to-create-an-api-key-for-system-user/33535/2 "2015-09-22T01:36:26Z")

</div>

Can we repro this @sam? Could be legit.

---

<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: [22 Settembre 2015, 2:02am UTC](https://meta.discourse.org/t/404-when-trying-to-create-an-api-key-for-system-user/33535/3 "2015-09-22T02:02:28Z")

</div>

It looks like a routing bug but has a very easy workaround.

Generate a global key and just pass the username system with the API call.

---

<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: [11 Agosto 2020, 3:04am UTC](https://meta.discourse.org/t/404-when-trying-to-create-an-api-key-for-system-user/33535/5 "2020-08-11T03:04:16Z")

</div>

Questo funziona effettivamente ora. Pensavo che si dovesse utilizzare l’opzione “tutti gli utenti”, ma ora è possibile selezionare anche “sistema” come utente e generare una chiave solo per l’utente di sistema.

 ![image](https://global.discourse-cdn.com/meta/original/3X/0/e/0e29dbce986596bfb575a8b00315d3a61dcf5502.png)

---

<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: [11 Agosto 2020, 3:04am UTC](https://meta.discourse.org/t/404-when-trying-to-create-an-api-key-for-system-user/33535/6 "2020-08-11T03:04:18Z")

</div>


