# How to Handle Password While Creating Accounts for Users

For creating accounts and sending users their passwords using Admin API, see `createUser` in the [Admin API documentation](https://docs.authgear.com/authentication-and-access/authentication/passwords/pages/k9OsUIA7hmhGI2gB4Ilq#id-2.3.-createuser).

In this post, we'll cover a few options and describe examples of automating the process of sending passwords to new users using the Authgear Portal or webhooks.

At this moment, Authgear only sends passwords to email accounts.

{% hint style="info" %}
For security reasons, it is not recommended to send users their passwords via text. SMS is unencrypted and insecure for transmitting passwords.
{% endhint %}

## How to create a user and send the password via email

{% stepper %}
{% step %}
Navigate to **User Management** > **Users**. From the Users page, click on the **Create User** button in the top right corner.

<figure><img src="/files/3DQrAoaSOmg7Dr7Tu9cC" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Enter the user's credentials and input a secure password you wish to set for the user, or click on **Generate** to have Authgear automatically create a new password.

<figure><img src="/files/eAyoFmCpNWjykXLRQnA5" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Check the "Send the password to user's email" box to enable Authgear to send the new password to the user.

If you wish to force users to change their password upon logging in with the password you set for them, enable "Ask user to change password on login" as well. Otherwise, users can continue using the password you set for them.
{% endstep %}
{% endstepper %}

## What happens if the user loses the preset password?

Users can still log in to their new account if they lose the password you set for them. They can click **Forgot Password** during login, and an OTP or link will be sent to the user. The user can then set a new password.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.authgear.com/authentication-and-access/authentication/passwords/how-to-handle-password-while-creating-accounts-for-users.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
