> 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 # 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 selected campaign based on a specific recipient activity. Pages are returned with a maximum of 1,000 recipients per page and defaults to 40 recipients per page. Call List Statistics to retrieve a list of activity for selected campaigns. Call List Campaigns to retrieve additional information for your campaigns. If no `activity` is included, this method returns an error. --- ## REST API ### Schema ``` Method: listRecipients Description: Retrieves a list of recipients for a selected campaign based on a specific recipient activity. Pages are returned with a maximum of 1,000 recipients per page and defaults to 40 recipients per page. Call List Statistics to retrieve a list of activity for selected campaigns. Call List Campaigns to retrieve additional information for your campaigns. If no `activity` is included, this method returns an error. 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 - OPENED - CLICKED - BOUNCED - NOT_SENT - SENT - NOT_OPENED - param name: campaignId | type: none | required: true param name: paging | type: CursorPaging - name: limit | type: integer | description: Number of items to load. - 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. Return type: ListRecipientsResponse - name: recipients | type: array | description: List of recipients. - name: contactId | type: string | description: Contact GUID. - name: lastActivityDate | type: string | description: Date and time of the last activity. - name: emailAddress | type: string | description: Primary email address of the contact. - name: fullName | type: string | description: Full name of the contact (optional). - name: contactDeleted | type: boolean | description: Is this contact currently deleted from the site or not. - 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. - name: offset | type: integer | description: Offset that was requested. - 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. - 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. - name: prev | type: string | description: Cursor pointing to the previous page in the list of results. ``` ### 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: ' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.emailMarketing.CampaignStatisticsService.listRecipients(campaignId, activity, options) Description: Retrieves a list of recipients for a selected campaign based on a specific recipient activity. Pages are returned with a maximum of 1,000 recipients per page and defaults to 40 recipients per page. Call List Statistics to retrieve a list of activity for selected campaigns. Call List Campaigns to retrieve additional information for your campaigns. If no `activity` is included, this method returns an error. # 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 - OPENED - CLICKED - BOUNCED - NOT_SENT - SENT - NOT_OPENED - param name: campaignId | type: string | description: Campaign GUID. | required: true param name: options | type: ListRecipientsOptions none - name: paging | type: CursorPaging | description: Pagination options. - name: limit | type: integer | description: Number of items to load. - 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. Return type: PROMISE - name: recipients | type: array | description: List of recipients. - name: contactId | type: string | description: Contact GUID. - name: lastActivityDate | type: Date | description: Date and time of the last activity. - name: emailAddress | type: string | description: Primary email address of the contact. - name: fullName | type: string | description: Full name of the contact (optional). - name: contactDeleted | type: boolean | description: Is this contact currently deleted from the site or not. - 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. - name: offset | type: integer | description: Offset that was requested. - 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. - 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. - name: prev | type: string | description: Cursor pointing to the previous page in the list of results. ``` ### 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-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 { 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); }; ``` ---