Register a Phone
Adds a phone number to the user's profile in Transmit
Description
This step is used to add a user’s phone number to their profile in Mosaic, either as a secondary number or as the primary number, overriding the existing one. It can be used as a known phone number for the user for SMS-based authentication flows. A registered phone number can be removed from the user using the Deregister a Phone step and retrieved using the Get User Phones step. A user's phone numbers can also be viewed from the user's profile in the Admin Portal (from Identity Management > Users), where they are listed as secondary phone numbers.
The user's phone number must be available before initiating the step. For example, the user may enter their phone number in a registration form (using the Get Information From Client step). Before adding the phone number to the user profile, you should ensure the phone number is verified for this user. For example, you could perform an SMS OTP authentication or fetch the phone number from a trusted source.
The user context for the step may be provided implicitly by the journey if the user is already authenticated; otherwise, a user identifier must be specified in the step configuration.
If the step is successfully completed, the journey adds the phone number to the user’s profile and proceeds to the next step. However, setting a primary phone number may fail if the phone number is defined as unique at the tenant level and conflicts with another user. In the event of a failure, the journey follows a specified failure branch or, if none is specified, is aborted and an error is sent to the client.
Configuration
Field | Description |
---|---|
User Auth State | Indicates if the user has authenticated in this journey. - If set to The user is authenticated (default), the user context is provided implicitly by the journey. - If set to The user is not authenticated , a user identifier must be provided. Note that, if the identifier doesn’t exist, a Mosaic user record is automatically created. |
User Identifier | User identifier, specified as an expression. Only configured if the journey doesn't authenticate the user before invoking this step. |
Phone | Phone number to register, specified as an expression and in E.164 format (e.g., +14155552671). It should be a verified phone number for this user. If set as primary, it will override the current primary phone number. |
Error Output Variable | Name of the variable that stores any errors returned by step |
Failure Behavior | Determines the behavior in case of failure, which either aborts the journey or proceeds to a failure branch of the control flow (default). |
Example
Consider a registration form that collects the user's phone number, created using the Get Information From Client step. In our example, the step ID is regForm
, the input will be stored in regData
, and the schema contains phone_number
.
After verifying the phone number (e.g., using a SMS OTP), the Register a Phone step is used to add the phone number for this user. Since an SMS OTP authentication was performed, the user is authenticated and the user context is provided by the journey. The phone number can be retrieved from the form output using regForm.phone_number
: