cold-scientist-93808
12/11/2024, 2:54 PMchilly-king-10285
12/11/2024, 2:54 PMchilly-king-10285
12/11/2024, 2:54 PMupdateIdentity endpoint or when creating a new identity. When updating an existing identity, you can use the PUT /admin/identities/{id} endpoint [as described in the Ory API Reference](https://www.ory.sh/docs/reference/api). The request body allows you to include credentials, including a password. For creating a new identity with a password, you can use the POST /admin/identities endpoint. Here's an example of how you can include a password when creating an identity: json { "schema_id": "<preset://email>", "traits": { "email": "<mailto:[email protected]|[email protected]>" }, "credentials": { "password": { "config": { "password": "the-password" } } } } As explained in the [Ory documentation on importing credentials](https://www.ory.sh/docs/kratos/manage-identities/import-user-accounts-identities#importing-credentials), you can provide the password in clear text. The system will then hash the password according to the configured password hashing algorithm before storing it in the database. It's important to note that when importing passwords, the usual password validation rules are not applied. Users may need to update their passwords to comply with any password policies in place using self-service flows. Remember to use these admin APIs responsibly and securely, as they allow privileged operations on user identities.