Start a self-serve email update for a Member using the Stytch B2B API.
organization_id and member_id. To perform a self-serve update, members must be active and have a verified email address.
EMAIL_OTP is specified as the delivery method) that expires in 5 minutes. If they do not verify their new email address in that timeframe, the email will be freed up for other members to use.
If using Email Magic Links, the magic link will redirect to your login_redirect_url (or the configured default if one isn’t provided), and you should invoke the Authenticate Magic Link endpoint as normal to complete the flow.
If using Email OTP Codes, you should invoke the Authenticate Email OTP Code endpoint as normal to complete the flow. Make sure to pass the new email address to the endpoint.Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
A Stytch session that can be used to run the request with the given member's permissions.
A Stytch Session JSON Web Token (JWT) that can be used to run the request with the given member's permissions.
Globally unique UUID that identifies a specific Organization. The organization_id is critical to perform operations on an Organization, so be sure to preserve this value. You may also use the organization_slug or organization_external_id here as a convenience.
Globally unique UUID that identifies a specific Member. The member_id is critical to perform operations on a Member, so be sure to preserve this value. You may use an external_id here if one is set for the member.
Request type
The new email address for the Member.
The URL that the Member clicks from the login Email Magic Link. This URL should be an endpoint in the backend server that verifies the request by querying Stytch's authenticate endpoint and finishes the login. If this value is not passed, the default login redirect URL that you set in your Dashboard is used. If you have not set a default login redirect URL, an error is returned.
Used to determine which language to use when sending the user this delivery method. Parameter is an IETF BCP 47 language tag, e.g. "en".
Currently supported languages are English ("en"), Spanish ("es"), French ("fr") and Brazilian Portuguese ("pt-br"); if no value is provided, the copy defaults to English.
Request support for additional languages here!
en, es, pt-br, fr Use a custom template for login emails. By default, it will use your default email template. Templates can be added in the Stytch dashboard using our built-in customization options or custom HTML templates with type “Magic Links - Login”.
The method that should be used to verify a member's new email address. The options are EMAIL_MAGIC_LINK or EMAIL_OTP. This field is optional, if no value is provided, EMAIL_MAGIC_LINK will be used.
EMAIL_MAGIC_LINK, EMAIL_OTP Successful response
Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue.
Globally unique UUID that identifies a specific Member.
The Member object
The Organization object.
The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors.