> 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

# ListAudienceProviders

# Package: audiences

# Namespace: AudienceService

# Method link: https://dev.wix.com/docs/api-reference/business-management/notifications/audiences/audience-v1/list-audience-providers.md

## Permission Scopes:
Set Up Automations: SCOPE.CRM.SETUP-AUTOMATIONS

## Introduction

Retrieves audience providers whose `participantType` is included in the request's `participantTypes`, and whose `scopes` include the request's `scope`.

Call this method first to discover which providers are available, then use a provider's returned `id` when defining an audience in [List Participants](https://dev.wix.com/docs/api-reference/business-management/notifications/audiences/participant-v1/list-participants.md) or [Count Participants](https://dev.wix.com/docs/api-reference/business-management/notifications/audiences/participant-v1/count-participants.md).

---

## REST API

### Schema

```
 Method: listAudienceProviders
 Description: Retrieves audience providers whose `participantType` is included in the request's `participantTypes`, and whose `scopes` include the request's `scope`.  Call this method first to discover which providers are available, then use a provider's returned `id` when defining an audience in [List Participants](https://dev.wix.com/docs/api-reference/business-management/notifications/audiences/participant-v1/list-participants.md) or [Count Participants](https://dev.wix.com/docs/api-reference/business-management/notifications/audiences/participant-v1/count-participants.md).
 URL: https://www.wixapis.com/audience-service/v1/list-audience-providers
 Method: GET
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  scope, participantTypes
 Method parameters: 
   query param name: participantTypes | type: array<participantTypes> | description: Filters for providers that support at least one of the listed participant types. | required: true | validation: minItems 1, maxItems 10
                 - enum: WIX_USER, CONTACT, ANONYMOUS
   param name: scope | type: Scope   | required: true 
      - enum:
           SPECIFIC_SITE - Provider audience is available only in scope of specific site
           NON_SPECIFIC_SITE - Provider audience is available only in scope of non specific site
 Return type: ListAudienceProvidersResponse
  - name: audienceProviders | type: array<AudienceProvider> | description: Retrieved audience providers.  
     - name: id | type: string | description: Identifier of the provider. Composed of the provider app's GUID and its component key, in the format `{appId}_{key}`.  | validation: minLength 1, maxLength 100
     - name: displayName | type: string | description: Provider's display name.  | validation: maxLength 200
     - name: participantType | type: ParticipantType | description: Type of participant the provider resolves. Each audience provider supports a single participant type.  
         - enum: WIX_USER, CONTACT, ANONYMOUS
     - name: inputSchema | type: object | description: Standard JSON schema describing the data this provider needs to resolve an audience.  
     - name: appInfo | type: AppInfo | description: Information about the app that registers this provider.  
        - name: id | type: string | description: GUID of the provider's app.  | validation: format GUID
        - name: name | type: string | description: Name of the provider's app.  | validation: minLength 0, maxLength 100
     - name: implementedMethods | type: ImplementedMethods | description: Specifies which optional methods this provider implements.  
        - name: countParticipants | type: boolean | description: Whether the provider implements `countParticipants`. If not implemented, [Count Participants](https://dev.wix.com/docs/api-reference/business-management/notifications/audiences/participant-v1/count-participants.md) returns a `count` of `1` for this provider instead of an exact count. If implemented but the provider fails to return a count, the request fails.  
     - name: scopes | type: array<Scope> | description: Scopes this provider's participants are relevant to. `SPECIFIC_SITE` means the participants only make sense in the context of one particular site (e.g. that site's contacts); `NON_SPECIFIC_SITE` means they're relevant at the account level, independent of any single site (e.g. Wix users).  A provider can declare more than one scope if it can resolve participants in more than one context. Scope only affects which providers are returned by List Audience Providers for a given `scope` filter; it isn't enforced when resolving participants.  | validation: maxItems 10
         - enum:
         -     SPECIFIC_SITE: Provider audience is available only in scope of specific site
         -     NON_SPECIFIC_SITE: Provider audience is available only in scope of non specific site


```

### Examples

### List providers that can resolve contact-based audiences
Retrieves audience providers that resolve `CONTACT` participants and are scoped to a specific site.

```curl
curl -X GET \
'https://www.wixapis.com/audience-service/v1/list-audience-providers?scope=SPECIFIC_SITE&participantTypes=CONTACT' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.audiences.audiences.listAudienceProviders(scope, options)
 Description: Retrieves audience providers whose `participantType` is included in the request's `participantTypes`, and whose `scopes` include the request's `scope`.  Call this method first to discover which providers are available, then use a provider's returned `id` when defining an audience in [List Participants](https://dev.wix.com/docs/api-reference/business-management/notifications/audiences/participant-v1/list-participants.md) or [Count Participants](https://dev.wix.com/docs/api-reference/business-management/notifications/audiences/participant-v1/count-participants.md).
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  scope, options.participantTypes, options
 Method parameters: 
   param name: options | type: ListAudienceProvidersOptions  none | required: true 
        - name: participantTypes | type: array<ParticipantType> | description: Filters for providers that support at least one of the listed participant types. | required: true | validation: minItems 1, maxItems 10
             - enum: WIX_USER, CONTACT, ANONYMOUS
   param name: scope | type: Scope   | required: true 
      - enum:
           SPECIFIC_SITE - Provider audience is available only in scope of specific site
           NON_SPECIFIC_SITE - Provider audience is available only in scope of non specific site
 Return type: PROMISE<ListAudienceProvidersResponse>
  - name: audienceProviders | type: array<AudienceProvider> | description: Retrieved audience providers.  
     - name: _id | type: string | description: Identifier of the provider. Composed of the provider app's GUID and its component key, in the format `{appId}_{key}`.  | validation: minLength 1, maxLength 100
     - name: displayName | type: string | description: Provider's display name.  | validation: maxLength 200
     - name: participantType | type: ParticipantType | description: Type of participant the provider resolves. Each audience provider supports a single participant type.  
         - enum: WIX_USER, CONTACT, ANONYMOUS
     - name: inputSchema | type: object | description: Standard JSON schema describing the data this provider needs to resolve an audience.  
     - name: appInfo | type: AppInfo | description: Information about the app that registers this provider.  
        - name: _id | type: string | description: GUID of the provider's app.  | validation: format GUID
        - name: name | type: string | description: Name of the provider's app.  | validation: minLength 0, maxLength 100
     - name: implementedMethods | type: ImplementedMethods | description: Specifies which optional methods this provider implements.  
        - name: countParticipants | type: boolean | description: Whether the provider implements `countParticipants`. If not implemented, [Count Participants](https://dev.wix.com/docs/api-reference/business-management/notifications/audiences/participant-v1/count-participants.md) returns a `count` of `1` for this provider instead of an exact count. If implemented but the provider fails to return a count, the request fails.  
     - name: scopes | type: array<Scope> | description: Scopes this provider's participants are relevant to. `SPECIFIC_SITE` means the participants only make sense in the context of one particular site (e.g. that site's contacts); `NON_SPECIFIC_SITE` means they're relevant at the account level, independent of any single site (e.g. Wix users).  A provider can declare more than one scope if it can resolve participants in more than one context. Scope only affects which providers are returned by List Audience Providers for a given `scope` filter; it isn't enforced when resolving participants.  | validation: maxItems 10
         - enum:
         -     SPECIFIC_SITE: Provider audience is available only in scope of specific site
         -     NON_SPECIFIC_SITE: Provider audience is available only in scope of non specific site


```

### Examples

### List providers that can resolve contact-based audiences
Retrieves audience providers that resolve `CONTACT` participants and are scoped to a specific site.

```javascript
import { audiences } from "@wix/audiences";

async function listAudienceProviders() {
  const response = await audiences.listAudienceProviders("SPECIFIC_SITE", {
    participantTypes: ["CONTACT"],
  });
}

/* Promise resolves to:
 * {
 *   "audienceProviders": [
 *     {
 *       "_id": "74bff718-5977-47f2-9e5f-a9fd0047fd1f_labels",
 *       "displayName": "Contact Labels",
 *       "participantType": "CONTACT",
 *       "inputSchema": {
 *         "type": "object",
 *         "$schema": "http://json-schema.org/draft-06/schema#",
 *         "required": ["labelIds"],
 *         "properties": {
 *           "labelIds": {
 *             "type": "array",
 *             "items": [
 *               {
 *                 "type": "string"
 *               }
 *             ]
 *           }
 *         }
 *       },
 *       "appInfo": {
 *         "_id": "74bff718-5977-47f2-9e5f-a9fd0047fd1f",
 *         "name": "Contacts"
 *       },
 *       "implementedMethods": {
 *         "countParticipants": true
 *       },
 *       "scopes": ["SPECIFIC_SITE"]
 *     }
 *   ]
 * }
 */

```

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

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


async function listAudienceProviders(scope,options) {
  const response = await myWixClient.audiences.listAudienceProviders(scope,options);
};
```

---