# Change password over api?

**URL:** <https://discourse.getcockpit.com/t/change-password-over-api/2605>\
**Category:** Support\
**Created:** [December 11, 2022, 2:49pm UTC](https://discourse.getcockpit.com/t/change-password-over-api/2605 "2022-12-11T14:49:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cryptospy](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/cryptospy/32/1169_2.png) [@Cryptospy](https://discourse.getcockpit.com/u/Cryptospy)\
**Post date:** [December 11, 2022, 2:49pm UTC](https://discourse.getcockpit.com/t/change-password-over-api/2605/1 "2022-12-11T14:49:31Z")

</div>

How to one change password over API? Didnt find any documentation against the same

Also a small feature request: Forgot Password.

Once i got lock out of my own test install. Thanks

---

<div class="post-metadata">

**Author:** ![ronaldaug](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/ronaldaug/32/260_2.png) [@ronaldaug](https://discourse.getcockpit.com/u/ronaldaug)\
**Post date:** [December 12, 2022, 7:25am UTC](https://discourse.getcockpit.com/t/change-password-over-api/2605/2 "2022-12-12T07:25:46Z")

</div>

I don’t think there is an API for change password but you can write a custom API.

* * *

To reset the password of current Admin, you can simply comment off these lines in **install/index.php**

```auto
// check whether cockpit is already installed
    try {
        if ($app->dataStorage->getCollection('system/users')->count()) {
            header('Location: ../'.($APP_SPACE ? ":{$APP_SPACE}" : ""));
            exit;
        }
    } catch(Throwable $e) {
    }

```

And then, open `/install` route again. It should reset the admin password to `admin` as the first time cockpit installation.

---

<div class="post-metadata">

**Author:** ![Cryptospy](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/cryptospy/32/1169_2.png) [@Cryptospy](https://discourse.getcockpit.com/u/Cryptospy)\
**Post date:** [December 19, 2022, 4:26am UTC](https://discourse.getcockpit.com/t/change-password-over-api/2605/3 "2022-12-19T04:26:07Z")

</div>

okay…will the data remain intact?

---

<div class="post-metadata">

**Author:** ![ronaldaug](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/ronaldaug/32/260_2.png) [@ronaldaug](https://discourse.getcockpit.com/u/ronaldaug)\
**Post date:** [December 27, 2022, 5:24pm UTC](https://discourse.getcockpit.com/t/change-password-over-api/2605/4 "2022-12-27T17:24:04Z")

</div>

Yes, it does nothing to your storage (data). `install/index.php` only reset the admin password.
