> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # SendRecoveryEmail # Package: headless # Namespace: RecoveryService # Method link: https://dev.wix.com/docs/api-reference/business-management/headless/recovery/send-recovery-email.md ## Introduction Sends an email to a member with a unique link to a Wix-managed password reset page. The member can use this page to reset their site password. If the site owner uses this page, it resets their Wix account password instead. > **Note:** You must publish the Wix site connected to your Headless project. > Wix uses the published site to display the password reset page. To do this, open your project dashboard, > select **Design Site** from the left panel, and then select **Publish**. --- ## REST API ### Schema ``` Method: sendRecoveryEmail Description: Sends an email to a member with a unique link to a Wix-managed password reset page. The member can use this page to reset their site password. If the site owner uses this page, it resets their Wix account password instead. > **Note:** You must publish the Wix site connected to your Headless project. > Wix uses the published site to display the password reset page. To do this, open your project dashboard, > select **Design Site** from the left panel, and then select **Publish**. URL: https://www.wixapis.com/v1/send-email Method: POST # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: email Method parameters: param name: email | type: email | description: Email address associated with the account to recover. | required: true param name: language | type: language | description: 2-letter language code in [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format of the email to be sent. If no language is specified, the language specified in the member's profile is used. param name: redirect | type: Redirect - name: url | type: string | description: URL to redirect to after successfully resetting the password. - name: clientId | type: string | description: Client GUID of the [OAuth app](https://dev.wix.com/docs/go-headless/getting-started/setup/authentication/create-an-oauth-app-for-visitors-and-members.md) your Headless project is using. Return type: SendRecoveryEmailResponse EMPTY-OBJECT {} ``` ### Examples ### Send a password recovery email to a member. ```curl curl -X POST \ 'https://www.wixapis.com/_api/iam/recovery/v1/send-email' \ -H 'Content-Type: application/json' \ -H 'Authorization: ' \ -d '{ "email": "test@test.com", "redirect": { "url": "https://mysite.vercel.app", "clientId": "7m30240b-mdiu-4924-3852-882bc25b407a" } }' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.headless.RecoveryService.sendRecoveryEmail(email, options) Description: Sends an email to a member with a unique link to a Wix-managed password reset page. The member can use this page to reset their site password. If the site owner uses this page, it resets their Wix account password instead. > **Note:** You must publish the Wix site connected to your Headless project. > Wix uses the published site to display the password reset page. To do this, open your project dashboard, > select **Design Site** from the left panel, and then select **Publish**. # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: email Method parameters: param name: email | type: string | description: Email address associated with the account to recover. | required: true param name: options | type: SendRecoveryEmailOptions none - name: language | type: string | description: 2-letter language code in [ISO 639-1 alpha-2](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format of the email to be sent. If no language is specified, the language specified in the member's profile is used. - name: redirect | type: Redirect | description: Where to redirect to after successfully resetting the password. - name: url | type: string | description: URL to redirect to after successfully resetting the password. - name: clientId | type: string | description: Client GUID of the [OAuth app](https://dev.wix.com/docs/go-headless/getting-started/setup/authentication/create-an-oauth-app-for-visitors-and-members.md) your Headless project is using. Return type: PROMISE EMPTY-OBJECT {} ``` ### Examples ### sendRecoveryEmail ```javascript import { recovery } from '@wix/identity'; async function sendRecoveryEmail(email,options) { const response = await recovery.sendRecoveryEmail(email,options); }; ``` ### sendRecoveryEmail (with elevated permissions) ```javascript import { recovery } from '@wix/identity'; import { auth } from '@wix/essentials'; async function mySendRecoveryEmailMethod(email,options) { const elevatedSendRecoveryEmail = auth.elevate(recovery.sendRecoveryEmail); const response = await elevatedSendRecoveryEmail(email,options); } ``` ### sendRecoveryEmail (self-hosted) Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md). ```javascript import { createClient } from '@wix/sdk'; import { recovery } from '@wix/identity'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { recovery }, // Include the auth strategy and host as relevant }); async function sendRecoveryEmail(email,options) { const response = await myWixClient.recovery.sendRecoveryEmail(email,options); }; ``` ---