# Add username/email auth to account

Adds the username/email and password authentication to the existing user account. This call is used if the account is created via device ID or phone number.


{% html name="div" attrs={"class": "notice"} %}
Notice

Rate limits for client-side methods are applied to this method.
{% /html %}

Endpoint: POST /users/me/link_email_password
Version: v1
Security: Bearer

## Query parameters:

  - `login_url` (string)
    URL to redirect the user to after account confirmation, successful authentication, two-factor authentication configuration, or password reset confirmation. Must be identical to the Callback URL specified in the URL block of Publisher Account. For the scenario of a login error, the value should be identical to the the Error callback URL specified in the URL block of Publisher Account. To find the settings, go to Login > your Login project and select the Callback URLs section in the upper block. Required if there are several Callback URLs.

## Request fields (application/json):

  - `email` (string, required)
    User email address.
    Example: "john-email@email.com"

  - `password` (string, required)
    User password.
    Example: "password123"

  - `promo_email_agreement` (integer)
    User consent to receive the newsletter.
    Enum: 0, 1

  - `username` (string, required)
    Username.
    Example: "John"

## Response 200 fields (application/json):

  - `email_confirmation_required` (boolean, required)
    Whether the user has to confirm the email address or not.
    Example: true

## Response 400 fields (application/json):

  - `error` (object, required)

  - `error.code` (string, required)
    Error code.
    Example: "003-061"

  - `error.description` (string, required)
    Error description.
    Example: "Object not found."

  - `error.details` (object)
    Additional information.

## Response 401 fields (application/json):

  - `error` (object, required)

  - `error.code` (string, required)
    Error code.
    Example: "003-061"

  - `error.description` (string, required)
    Error description.
    Example: "Object not found."

  - `error.details` (object)
    Additional information.

## Response 422 fields (application/json):

  - `error` (object, required)

  - `error.code` (string, required)
    Error code.
    Example: "003-061"

  - `error.description` (string, required)
    Error description.
    Example: "Object not found."

  - `error.details` (object)
    Additional information.

## Response 429 fields (application/json):

  - `error` (object, required)

  - `error.code` (string, required)
    Error code.
    Example: "003-061"

  - `error.description` (string, required)
    Error description.
    Example: "Object not found."

  - `error.details` (object)
    Additional information.


