provider User PUT /v1/users/{user_id}/exchange_primary_factor
@utdk/stytch /v1/users/{user_id}/exchange_primary_factor
Exchangeprimaryfactor
Exchange a user's email address or phone number for another. Must pass either an `email_address` or a `phone_number`. This endpoint only works if the user has exactly one factor. You are able to exchange the type of factor for another as well, i.e. exchange an `email_address` for a `phone_number`. Use this endpoint with caution as it performs an admin level action.
user_id path required
The unique ID of a specific User. You may use an `external_id` here if one is set for the user.
string

Try it

Authentication
Configure credentials for Stytch API
Gateway
The gateway proxies requests and injects credentials server-side. Configure credentials above, then enter your gateway URL.

Saved automatically to browser storage.

apiUserV1Exchangeprimaryfactor
PUT/v1/users/{user_id}/exchange_primary_factor
Exchange a user's email address or phone number for another. Must pass either an `email_address` or a `phone_number`. This endpoint only works if the user has exactly one factor. You are able to exchange the type of factor for another as well, i.e. exchange an `email_address` for a `phone_number`. Use this endpoint with caution as it performs an admin level action.

Parameters

required

The unique ID of a specific User. You may use an `external_id` here if one is set for the user.

Input

The email address to exchange to.

The phone number to exchange to. The phone number should be in E.164 format (i.e. +1XXXXXXXXXX).

Enter a gateway URL above to enable sending.

Code snippet
Updates live as you fill in the form above.

TypeScript

import stytch from '@utdk/stytch';

await stytch.apiUserV1Exchangeprimaryfactor()