curl -sS -X PUT 'https://matrix.example.com/_synapse/admin/v2/users/@bob:example.com' -H "Authorization: Bearer $ACCESS_TOKEN" -d '{"password":"newpass123"}'

Category: Matrix & Synapse

curl -sS -X PUT 'https://matrix.example.com/_synapse/admin/v2/users/@bob:example.com' -H "Authorization: Bearer $ACCESS_TOKEN" -d '{"password":"newpass123"}'

Reset a user's password via the Admin API

Sets a new password for @bob:example.com and, by default, logs out every one of their devices (set "logout_devices":false to keep sessions). Unlike hash_password, no database access is needed. The dedicated reset_password endpoint does the same thing. Users who authenticate only through SSO or OIDC may have no password at all.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.