> ## Documentation Index
> Fetch the complete documentation index at: https://docs-dev-docs-event-stream-action-templates.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a new user

> Create a new user in a database connection using their credentials.

export const ResponseSchema = ({statusCode, type = "{}", children}) => {
  const [open, setOpen] = useState(false);
  return <div className="border border-gray-100 dark:border-gray-800 rounded-lg mb-3 overflow-hidden">
      <div className={`flex items-center gap-2.5 px-4 py-2.5 cursor-pointer select-none ${open ? "bg-gray-50 dark:bg-gray-800" : ""}`} onClick={() => setOpen(!open)}>
        {statusCode && <span className="border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 font-mono text-xs px-1.5 py-0.5 rounded">
            {statusCode.startsWith("default") ? "default" : statusCode}
          </span>}
        <span className="text-gray-500 dark:text-gray-400 text-sm font-mono">
          {type}
        </span>
        <span className="text-gray-400 dark:text-gray-500 text-sm italic">
          application/json
        </span>
        <svg className={`ml-auto opacity-50 transition-transform duration-200 ${open ? "rotate-180" : ""}`} width="16" height="16" viewBox="0 0 16 16" fill="none">
          <path d="M4 6l4 4 4-4" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" />
        </svg>
      </div>
      {open && <div className="px-4 pt-1 pb-3 border-t border-gray-100 dark:border-gray-800">
          {children}
        </div>}
    </div>;
};

## Endpoint

`POST /dbconnections/signup`

Given a user's credentials and a `connection`, this endpoint creates a new user.

This endpoint only works for database connections.

### Remarks

* The sample auth0.js script uses the library version 8. If you are using auth0.js version 7, please see this [reference guide](https://auth0.com/docs/libraries/auth0js/v7).

### Learn More

* [Password Strength in Auth0 Database Connections](https://auth0.com/docs/authenticate/database-connections/password-strength)
* [Password Options in Auth0 Database Connections](https://auth0.com/docs/authenticate/database-connections/password-options)
* [Adding Username for Database Connections](https://auth0.com/docs/authenticate/database-connections/require-username)
* [Metadata Overview](https://auth0.com/docs/manage-users/user-accounts/metadata)

## Body Parameters

<ParamField body="client_id" type="string" required>
  The `client_id` of your client.
</ParamField>

<ParamField body="email" type="string">
  The user's email address.
</ParamField>

<ParamField body="password" type="string" required>
  The user's desired password.
</ParamField>

<ParamField body="phone_number" type="string">
  The user's phone number.
</ParamField>

<ParamField body="connection" type="string" required>
  The name of the database configured to your client.
</ParamField>

<ParamField body="username" type="string">
  The user's username. Only valid if the connection requires a username.
</ParamField>

<ParamField body="given_name" type="string">
  The user's given name(s).
</ParamField>

<ParamField body="family_name" type="string">
  The user's family name(s).
</ParamField>

<ParamField body="name" type="string">
  The user's full name.
</ParamField>

<ParamField body="nickname" type="string">
  The user's nickname.
</ParamField>

<ParamField body="picture" type="string">
  A URI pointing to the user's picture.
</ParamField>

<ParamField body="user_metadata" type="object">
  The user metadata to be associated with the user. If set, the field must be an object containing no more than ten properties. Property names can have a maximum of 100 characters, and property values must be strings of no more than 500 characters.
</ParamField>

## Response Schema

<ResponseSchema>
  <ResponseField name="_id" type="string">
    The user's unique identifier.
  </ResponseField>

  <ResponseField name="email_verified" type="boolean">
    Indicates whether the user's email address is verified.
  </ResponseField>

  <ResponseField name="email" type="string">
    The user's email address.
  </ResponseField>

  <ResponseField name="username" type="string">
    The user's username.
  </ResponseField>

  <ResponseField name="given_name" type="string">
    The user's given name.
  </ResponseField>

  <ResponseField name="family_name" type="string">
    The user's family name.
  </ResponseField>

  <ResponseField name="name" type="string">
    The user's full name.
  </ResponseField>

  <ResponseField name="nickname" type="string">
    The user's nickname.
  </ResponseField>

  <ResponseField name="picture" type="string">
    A URI pointing to the user's picture.
  </ResponseField>
</ResponseSchema>

## Response Messages

| Status | Description                                 |
| ------ | ------------------------------------------- |
| 200    | User successfully created                   |
| 400    | Bad request, missing or invalid parameters. |
| 409    | Conflict, user already exists.              |
