# Phone

Phone number change management for authenticated users. Implements a secure 4-step phone change flow: (1) request change and receive SMS code on current phone, (2) verify current phone ownership, (3) submit new phone number and receive SMS code, (4) verify new phone number. All endpoints require authentication.

## Confirm authentication with phone number

 - [POST /api/v1/accounts/phone/change/confirm/auth](https://docs.wellesley.social/openapi/phone/paths/~1api~1v1~1accounts~1phone~1change~1confirm~1auth/post.md): Step 2. Validate the provided authentication code. After 3 failed attempts, the current user session will be invalidated.

## Change phone number for authenticated user

 - [POST /api/v1/accounts/phone/change/confirm/new-phone](https://docs.wellesley.social/openapi/phone/paths/~1api~1v1~1accounts~1phone~1change~1confirm~1new-phone/post.md): Step 4. Validate the new verification code. Upon successful verification, the user's phone number will be updated to the newly verified number. All other active sessions are invalidated for security. The change is logged in the audit trail.

## Request a new phone number

 - [POST /api/v1/accounts/phone/change/new-phone](https://docs.wellesley.social/openapi/phone/paths/~1api~1v1~1accounts~1phone~1change~1new-phone/post.md): Step 3. Request a new phone number from the user. Verification code will be sent via SMS to that number.

## Request phone number change for authenticated user

 - [PUT /api/v1/accounts/phone/change/request](https://docs.wellesley.social/openapi/phone/paths/~1api~1v1~1accounts~1phone~1change~1request/put.md): Step 1. Request an authentication code to be sent via SMS to the user's original phone number.

## Resend code to check authentication with phone number

 - [PUT /api/v1/accounts/phone/change/resend-code/auth](https://docs.wellesley.social/openapi/phone/paths/~1api~1v1~1accounts~1phone~1change~1resend-code~1auth/put.md): Resends the SMS verification code to the user's current phone number. Use when the original code was not received or expired. Requires authentication. Rate limited.

## Resend code to confirm new phone number

 - [PUT /api/v1/accounts/phone/change/resend-code/new-phone](https://docs.wellesley.social/openapi/phone/paths/~1api~1v1~1accounts~1phone~1change~1resend-code~1new-phone/put.md): Resends the SMS verification code to the new phone number submitted in step 3. Use when the original code was not received or expired. Requires authentication. Rate limited.

