# Triggering a backup via admin API causes the api\_key to become only valid for system user

**URL:** <https://meta.discourse.org/t/triggering-a-backup-via-admin-api-causes-the-api-key-to-become-only-valid-for-system-user/77858>\
**Category:** Bug\
**Created:** [January 12, 2018, 5:00pm UTC](https://meta.discourse.org/t/triggering-a-backup-via-admin-api-causes-the-api-key-to-become-only-valid-for-system-user/77858 "2018-01-12T17:00:56Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)\
**Post date:** [January 12, 2018, 5:00pm UTC](https://meta.discourse.org/t/triggering-a-backup-via-admin-api-causes-the-api-key-to-become-only-valid-for-system-user/77858/1 "2018-01-12T17:00:56Z")

</div>

Before:

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

Reproduction:

```plaintext
$ api_key=340496f95ab2f28cc45f575cbfcc28edd10db076beb1139da14b3fa80bb23dd2
$ curl -XPOST -H 'Content-Type: application/json' "http://discoursedev:3000/admin/backups.json?api_key=$api_key&api_username=michael" -d '{ "with_uploads": true }'
{"success":"OK"}
$ curl "http://discoursedev:3000/admin/backups.json?api_key=$api_key&api_username=michael"
(HTML error page as I'm in development mode)
$ curl "http://discoursedev:3000/admin/backups.json?api_key=$api_key&api_username=system"
[{"filename":"discourse-2018-01-12-112341-v20180111092141.sql.gz","size":3216556,"link":"//discourse/admin/backups/discourse-2018-01-12-112341-v20180111092141.sql.gz"}]

```

After:

 ![image](https://global.discourse-cdn.com/meta/original/3X/9/4/94d0c0fdd3a2df4440102710fa08ac19b1bbdaf9.png)

---

_[View the full topic](https://meta.discourse.org/t/triggering-a-backup-via-admin-api-causes-the-api-key-to-become-only-valid-for-system-user/77858)._
