> 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

# ListRecipients

# Package: emailMarketing

# Namespace: CampaignStatisticsService

# Method link: https://dev.wix.com/docs/api-reference/business-management/marketing/emails/email-marketing/campaign/list-recipients.md

## Permission Scopes:
Read Email Marketing: SCOPE.DC-PROMOTE.READ-EMAIL-MARKETING

## Introduction

Retrieves a list of recipients for a campaign, filtered by a specific activity type such as opened, clicked, or bounced.

Results are paginated with a default of 40 recipients per page and a maximum of 1,000 per page.

Call [List Statistics](https://dev.wix.com/docs/api-reference/business-management/marketing/emails/email-marketing/campaign/list-statistics.md) to retrieve aggregate statistics for campaigns.
Call [List Campaigns](https://dev.wix.com/docs/api-reference/business-management/marketing/emails/email-marketing/campaign/list-campaigns.md) to retrieve additional information about campaigns.

---

## REST API

### Schema

```
 Method: listRecipients
 Description: Retrieves a list of recipients for a campaign, filtered by a specific activity type such as opened, clicked, or bounced.  Results are paginated with a default of 40 recipients per page and a maximum of 1,000 per page.  Call [List Statistics](https://dev.wix.com/docs/api-reference/business-management/marketing/emails/email-marketing/campaign/list-statistics.md) to retrieve aggregate statistics for campaigns. Call [List Campaigns](https://dev.wix.com/docs/api-reference/business-management/marketing/emails/email-marketing/campaign/list-campaigns.md) to retrieve additional information about campaigns.
 URL: https://www.wixapis.com/email-marketing/v1/campaigns/{campaignId}/statistics/recipients
 Method: GET
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  campaignId, activity
 Method parameters: 
   param name: activity | type: Enum   | required: true 
      - enum:
           DELIVERED - Email was successfully delivered to the recipient.
           OPENED - Recipient opened the email.
           CLICKED - Recipient clicked a link in the email.
           BOUNCED - Email bounced and wasn't delivered to the recipient.
           NOT_SENT - Email wasn't sent due to campaign termination.
           SENT - Email was sent to the recipient (includes delivered and bounced).
           NOT_OPENED - Email was delivered but the recipient didn't open it.
   param name: campaignId | type:   none | required: true 
   param name: paging | type: CursorPaging    
        - name: limit | type: integer | description: Number of items to load.  | validation: minimum 0, maximum 1000, format int32
        - name: cursor | type: string | description: Pointer to the next or previous page in the list of results.  You can get the relevant cursor token from the `pagingMetadata` object in the previous call's response. Not relevant for the first request.  | validation: maxLength 1000
 Return type: ListRecipientsResponse
  - name: recipients | type: array<CampaignRecipientDetails> | description: List of recipients.  
     - name: contactId | type: string | description: Contact GUID.  | validation: format GUID
     - name: lastActivityDate | type: string | description: Date and time of the last activity.  | validation: format date-time
     - name: emailAddress | type: string | description: Primary email address of the contact.  | validation: format EMAIL
     - name: fullName | type: string | description: Full name of the contact (optional).  | validation: maxLength 100
     - name: contactDeleted | type: boolean | description: Whether the contact has been deleted from the site.  
  - name: pagingMetadata | type: PagingMetadataV2 | description: Details on the paged set of returned results.  
     - name: count | type: integer | description: Number of items returned in the response.  | validation: format int32
     - name: offset | type: integer | description: Offset that was requested.  | validation: format int32
     - name: total | type: integer | description: Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set.  | validation: format int32
     - name: tooManyToCount | type: boolean | description: Flag that indicates the server failed to calculate the `total` field.  
     - name: cursors | type: Cursors | description: Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used.  
        - name: next | type: string | description: Cursor string pointing to the next page in the list of results.  | validation: maxLength 16000
        - name: prev | type: string | description: Cursor pointing to the previous page in the list of results.  | validation: maxLength 16000


```

### Examples

### List Recipients
```curl
curl -X GET 'https://www.wixapis.com/email-marketing/v1/campaigns/8a7f8211-99e4-4116-9d41-da2d11c1e261/statistics/recipients?activity=DELIVERED' \
-H 'Authorization: <AUTH>'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.emailMarketing.campaigns.listRecipients(campaignId, activity, options)
 Description: Retrieves a list of recipients for a campaign, filtered by a specific activity type such as opened, clicked, or bounced.  Results are paginated with a default of 40 recipients per page and a maximum of 1,000 per page.  Call [List Statistics](https://dev.wix.com/docs/api-reference/business-management/marketing/emails/email-marketing/campaign/list-statistics.md) to retrieve aggregate statistics for campaigns. Call [List Campaigns](https://dev.wix.com/docs/api-reference/business-management/marketing/emails/email-marketing/campaign/list-campaigns.md) to retrieve additional information about campaigns.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  campaignId, activity
 Method parameters: 
   param name: campaignId | type: string | description: Campaign GUID. | required: true | validation: format GUID
   param name: activity | type: Enum   | required: true 
      - enum:
           DELIVERED - Email was successfully delivered to the recipient.
           OPENED - Recipient opened the email.
           CLICKED - Recipient clicked a link in the email.
           BOUNCED - Email bounced and wasn't delivered to the recipient.
           NOT_SENT - Email wasn't sent due to campaign termination.
           SENT - Email was sent to the recipient (includes delivered and bounced).
           NOT_OPENED - Email was delivered but the recipient didn't open it.
   param name: options | type: ListRecipientsOptions  none  
        - name: paging | type: CursorPaging | description: Pagination options.  
           - name: limit | type: integer | description: Number of items to load.  | validation: minimum 0, maximum 1000, format int32
           - name: cursor | type: string | description: Pointer to the next or previous page in the list of results.  You can get the relevant cursor token from the `pagingMetadata` object in the previous call's response. Not relevant for the first request.  | validation: maxLength 1000
 Return type: PROMISE<ListRecipientsResponse>
  - name: recipients | type: array<CampaignRecipientDetails> | description: List of recipients.  
     - name: contactId | type: string | description: Contact GUID.  | validation: format GUID
     - name: lastActivityDate | type: Date | description: Date and time of the last activity.  
     - name: emailAddress | type: string | description: Primary email address of the contact.  | validation: format EMAIL
     - name: fullName | type: string | description: Full name of the contact (optional).  | validation: maxLength 100
     - name: contactDeleted | type: boolean | description: Whether the contact has been deleted from the site.  
  - name: pagingMetadata | type: PagingMetadataV2 | description: Details on the paged set of returned results.  
     - name: count | type: integer | description: Number of items returned in the response.  | validation: format int32
     - name: offset | type: integer | description: Offset that was requested.  | validation: format int32
     - name: total | type: integer | description: Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set.  | validation: format int32
     - name: tooManyToCount | type: boolean | description: Flag that indicates the server failed to calculate the `total` field.  
     - name: cursors | type: Cursors | description: Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used.  
        - name: next | type: string | description: Cursor string pointing to the next page in the list of results.  | validation: maxLength 16000
        - name: prev | type: string | description: Cursor pointing to the previous page in the list of results.  | validation: maxLength 16000


```

### Examples

### Retrieves a list of recipients for a selected campaign based on a specific recipient activity (with elevated permissions)
```javascript
import { campaigns } from '@wix/email-marketing';
import { auth } from '@wix/essentials';

const elevatedListRecipients = auth.elevate(campaigns.listRecipients);

// Sample campaignId = 'ea46013c-bbbf-4617-ad5d-9247bc4c0970';

// Sample activity = 'OPENED';

// Sample options value:
// {
//   paging: {
//     cursor: "string",
//     limit: 2, 
//    }
// }
 
export async function myListRecipientsFunction(campaignId, activity, options) {
    try {
      const result = await elevatedListRecipients(campaignId, activity, options);

      console.log("Success! Recipients found.")
      return result;
    } catch (error) {
      console.error(error);
    }
}

/* Promise returns:
 * {
 *   "recipients": [
 *     {
 *       "contactId": "cbdf2bf6-85fb-4b27-b7e3-deb7601a6d47",
 *       "lastActivityDate": "2023-08-12T09:05:20.000Z"
 *     }
 *   ],
 *   "pagingMetadata": {
 *     "count": 1,
 *     "tooManyToCount": true
 *   }
 * }
 */
```

### Retrieves a list of recipients for a selected campaign based on a specific recipient activity
```javascript
import { campaigns } from '@wix/email-marketing';

// Sample campaignId = 'ea46013c-bbbf-4617-ad5d-9247bc4c0970';

// Sample activity = 'OPENED';

// Sample options value:
// {
//   paging: {
//     cursor: "string",
//     limit: 2, 
//    }
// }
 
export async function myListRecipientsFunction(campaignId, activity, options) {
    try {
      const result = await campaigns.listRecipients(campaignId, activity, options);

      console.log("Success! Recipients found.")
      return result;
    } catch (error) {
      console.error(error);
    }
}

/* Promise returns:
 * {
 *   "recipients": [
 *     {
 *       "contactId": "cbdf2bf6-85fb-4b27-b7e3-deb7601a6d47",
 *       "lastActivityDate": "2023-08-12T09:05:20.000Z"
 *     }
 *   ],
 *   "pagingMetadata": {
 *     "count": 1,
 *     "tooManyToCount": true
 *   }
 * }
 */
```

### listRecipients (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 { campaigns } from '@wix/email-marketing';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { campaigns },
  // Include the auth strategy and host as relevant
});


async function listRecipients(campaignId,activity,options) {
  const response = await myWixClient.campaigns.listRecipients(campaignId,activity,options);
};
```

---