# Logins

Login method management for authenticated accounts. Allows adding or removing email/password and phone number as authentication methods. Adding a login method requires email or SMS verification. Removing a method is blocked if it is the last remaining login identifier. All changes are audited. All endpoints require authentication.

## Request to add email/password to account

 - [POST /api/v1/accounts/logins/add-email-password](https://docs.wellesley.social/openapi/logins/paths/~1api~1v1~1accounts~1logins~1add-email-password/post.md): Initiates the process of adding email and password authentication to an existing account. A confirmation code will be sent to the provided email address.

## Confirm email/password addition

 - [POST /api/v1/accounts/logins/add-email-password/confirm](https://docs.wellesley.social/openapi/logins/paths/~1api~1v1~1accounts~1logins~1add-email-password~1confirm/post.md): Confirms the addition of email/password authentication by verifying the confirmation code sent to the email. On success, sets the email and password on the account, sends a confirmation email, and logs the change in the audit trail. Requires authentication.

## Resend email confirmation code

 - [PUT /api/v1/accounts/logins/add-email-password/resend-code](https://docs.wellesley.social/openapi/logins/paths/~1api~1v1~1accounts~1logins~1add-email-password~1resend-code/put.md): Resends the confirmation code to the pending email address when adding email/password authentication.

## Add phone number to account

 - [POST /api/v1/accounts/logins/add-phone](https://docs.wellesley.social/openapi/logins/paths/~1api~1v1~1accounts~1logins~1add-phone/post.md): Adds phone number authentication to the account. If no code is provided, initiates SMS verification. If code is provided, confirms the phone number.

## Remove email/password from account

 - [DELETE /api/v1/accounts/logins/remove-email-password](https://docs.wellesley.social/openapi/logins/paths/~1api~1v1~1accounts~1logins~1remove-email-password/delete.md): Removes email and password authentication method from the account. Cannot be removed if it's the last remaining login method.

## Remove phone number from account

 - [DELETE /api/v1/accounts/logins/remove-phone](https://docs.wellesley.social/openapi/logins/paths/~1api~1v1~1accounts~1logins~1remove-phone/delete.md): Removes phone number authentication from the account. Cannot be removed if it's the last remaining login method.

