> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> 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`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - 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/_api/iam/recovery/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 | validation: format EMAIL
   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.  | validation: format LANGUAGE
   param name: redirect | type: Redirect    
        - name: url | type: string | description: URL to redirect to after successfully resetting the password.  | validation: maxLength 1000
        - 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.  | validation: format GUID
 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: <AUTH>' \
-d '{
    "email": "test@test.com",
    "redirect": {
        "url": "https://mysite.vercel.app",
        "clientId": "7m30240b-mdiu-4924-3852-882bc25b407a"
    }
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.identity.recovery.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 | validation: format EMAIL
   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.  | validation: format LANGUAGE
        - 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.  | validation: maxLength 1000
           - 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.  | validation: format GUID
 Return type: PROMISE<SendRecoveryEmailResponse>
  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-managed)
Self-managed 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);
};
```

---