# SMS ## Set phone number for a user - [POST /resources/users/phone-numbers/v1](https://developers.frontegg.com/ciam/api/identity/sms/userphonenumberscontrollerv1_createuserphonenumber.md): Assign a new phone number to a user and optionally trigger a verification code. By default, the system sends an SMS verification code to the provided phone number. To skip verification (e.g., for internal setup), set the verify field to false. Request body must include: - phoneNumber: The new phone number to assign to the user. Must follow international format. - verify (optional): Whether to send an SMS verification code. Defaults to true if not provided. Use this endpoint to set or update a user's phone number, with optional control over verification. ## Pre-verify user's phone number - [POST /resources/users/phone-numbers/v1/preverify](https://developers.frontegg.com/ciam/api/identity/sms/userphonenumberscontrollerv1_preverifyuserphonenumber.md): Send a one-time code (OTC) to the specified phone number to initiate verification. This endpoint is used to pre-verify a phone number before associating it with a user account. It sends an SMS-based one-time code to the provided number. Request body must include: - phoneNumber: The phone number to verify, in international format. Use this endpoint to validate ownership of a phone number by sending a one-time code for user input during onboarding or account setup. ## Verify creation of phone number for user - [POST /resources/users/phone-numbers/v1/verify](https://developers.frontegg.com/ciam/api/identity/sms/userphonenumberscontrollerv1_verifycreateuserphonenumber.md): Verify a user's phone number using a one-time code (OTC) that was sent via SMS. This is the final step in the phone number verification process. After initiating verification via the pre-verification route, use this endpoint to confirm the phone number by submitting the OTC and code. Request body must include: - otcToken: The token issued when the OTC was sent. - code: The one-time code the user received on their phone. Use this endpoint to validate the user's ownership of the phone number and complete the verification process. ## Delete user's phone number - [DELETE /resources/users/phone-numbers/v1/{id}](https://developers.frontegg.com/ciam/api/identity/sms/userphonenumberscontrollerv1_deleteuserphonenumber.md): Initiate the deletion process for a user's phone number. This endpoint begins the phone number removal workflow by sending a verification code to the user. The phone number will not be deleted until the verification step is completed. Path parameters: - id: The unique identifier of the phone number to be deleted. Use this endpoint to trigger the secure deletion process for a user's phone number. A follow-up verification step is required to finalize the removal. ## Verify delete user's phone number - [POST /resources/users/phone-numbers/v1/{id}/delete/verify](https://developers.frontegg.com/ciam/api/identity/sms/userphonenumberscontrollerv1_verifydeleteuserphonenumber.md): Verify the deletion of a user's phone number using a one-time code (OTC). This is the final step in the phone number deletion process. After initiating deletion, the system sends a verification code to the user's phone. This endpoint confirms the deletion by validating the OTC and code. Path parameters: - id: The unique identifier of the phone number to delete. Request body must include: - otcToken: The token issued during the deletion request. - code: The one-time code sent to the user via SMS. Use this endpoint to securely complete the deletion of a user's phone number. ## Get current user's phone numbers - [GET /resources/users/phone-numbers/v1/me](https://developers.frontegg.com/ciam/api/identity/sms/userphonenumberscontrollerv1_getuserownphonenumbers.md): Retrieve all phone numbers associated with the current user. This endpoint returns a list of phone numbers linked to the authenticated user, including verification status and timestamps. The response includes metadata such as verification status and timestamps for creation and last update. Use this endpoint to display or manage the user's registered phone numbers in your application. ## Get all phone numbers v2 - [GET /resources/users/phone-numbers/v2](https://developers.frontegg.com/ciam/api/identity/sms/userphonenumberscontrollerv2_getallphonenumbers.md): This route returns all user phone numbers. ## Get all phone numbers (deprecated) - [GET /resources/users/phone-numbers/v1](https://developers.frontegg.com/ciam/api/identity/sms/userphonenumberscontrollerv1_getallphonenumbers.md): Retrieve a paginated list of all user phone numbers associated with your environment. This endpoint returns user phone numbers along with pagination metadata and navigation links. It supports filtering, sorting, and offset-based pagination for efficient querying. Query parameters (optional): - _limit (number ≥ 1): Maximum number of items to return per page. - _offset (number ≥ 0): The page number to retrieve. For example, use 0 for the first page, 1 for the second page. - _sortBy (string): Field to sort by. Allowed values: userId, phoneNumber. - _order (string): Sort order. Allowed values: ASC, DESC. - _phoneNumber (string): Filter by a specific phone number. Use this endpoint to list or search user phone numbers in a paginated format, ideal for administrative tools or reporting.