> 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

# ListMailboxProviders

# Package: domains

# Namespace: MailboxProviders

# Method link: https://dev.wix.com/docs/api-reference/account-level/domains/mailbox-providers/list-mailbox-providers.md

## Permission Scopes:
Manage Domains: SCOPE.ACC-DC-PREMIUM.MANAGE-DOMAINS

## Introduction

Retrieves a list of the email providers that can be connected to a domain.


Each provider includes the DNS records that are added to the domain's DNS
zone when it's connected, with the domain name filled in. You can use the
records to show users a preview before they choose a provider.

To connect a provider to the domain, pass its `id` as `providerId` when you
call [Add Mailbox Records](https://dev.wix.com/docs/api-reference/account-level/domains/domain-dns/add-mailbox-records.md).
Retrieve provider IDs with this method rather than hard-coding them.

The list always includes the `Other` provider, which has no records. It
represents an email provider that isn't listed. To connect such a provider,
call Add Mailbox Records with `customMailbox` instead.

A provider whose records can't be generated for the domain isn't returned.

> __Important:__ This method requires an account-level API key and can't be authenticated with the standard authorization header.

---

## REST API

### Schema

```
 Method: listMailboxProviders
 Description: Retrieves a list of the email providers that can be connected to a domain.   Each provider includes the DNS records that are added to the domain's DNS zone when it's connected, with the domain name filled in. You can use the records to show users a preview before they choose a provider.  To connect a provider to the domain, pass its `id` as `providerId` when you call [Add Mailbox Records](https://dev.wix.com/docs/api-reference/account-level/domains/domain-dns/add-mailbox-records.md). Retrieve provider GUIDs with this method rather than hard-coding them.  The list always includes the `Other` provider, which has no records. It represents an email provider that isn't listed. To connect such a provider, call Add Mailbox Records with `customMailbox` instead.  A provider whose records can't be generated for the domain isn't returned.  > __Important:__ This method requires an account-level API key and can't be authenticated with the standard authorization header.
 URL: https://www.wixapis.com/premium/domains/v1/mailbox-providers/{domainName}
 Method: GET
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  domainName
 Method parameters: 
   param name: domainName | type:   none | required: true 
 Return type: ListMailboxProvidersResponse
  - name: providers | type: array<MailboxProvider> | description: Email providers that can be connected to the domain, with their DNS records for the requested domain.  | validation: maxItems 200
     - name: id | type: integer | description: Email provider GUID. To connect the provider to a domain, pass this GUID as `providerId` when you call [Add Mailbox Records](https://dev.wix.com/docs/api-reference/account-level/domains/domain-dns/add-mailbox-records.md).  Retrieve provider GUIDs with List Mailbox Providers rather than hard-coding them.  The `Other` provider has no records. It represents an email provider that isn't listed. To connect such a provider, call Add Mailbox Records with `customMailbox` and the provider's records instead of `providerId`.  | read-only: true 
     - name: name | type: string | description: Email provider's display name. For example, `Google Workspace`.  | validation: maxLength 200
     - name: records | type: array<DnsRecord> | description: DNS records that are added to the domain's DNS zone when the email provider is connected, with the requested domain name filled in. Includes the provider's `MX` records and any `CNAME`, `TXT`, or `SRV` records it requires.  | validation: maxItems 50
        - name: type | type: RecordType | description: [DNS record type](https://en.wikipedia.org/wiki/List_of_DNS_record_types).  
             - enum:
             -     UNKNOWN: Default value. Used in case the record type isn't known. You can't set a record type to `UNKNOWN`.
             -     A: Address record. Most fundamental type of DNS record that indicates the IP address of a given domain.
             -     AAAA: Address record in [IPv6 format](https://en.wikipedia.org/wiki/IPv6).
             -     NS: Name server record. Describes which server contains the actual DNS record.
             -     SOA: [Start of authority record](https://en.wikipedia.org/wiki/SOA_record). Holds administrative information about the zone.
             -     CNAME: [CNAME record](https://en.wikipedia.org/wiki/CNAME_record). Maps an alias name to the canonical domain name.
             -     MX: MX record. Directs emails to mail servers.
             -     TXT: [TXT record](https://en.wikipedia.org/wiki/TXT_record). Used by domain admins to add human-readable descriptions.
             -     SPF: SPF record. Used for email authentication.
             -     SRV: [Service record](https://en.wikipedia.org/wiki/SRV_record). Defines the server location.
             -     PTR: Pointer record. Specifies which host is supported for a given IP address.
             -     NAPTR: [Name Authority Pointer record](https://en.wikipedia.org/wiki/NAPTR_record). Used by Internet telephony applications.
        - name: hostName | type: string | description: Host name the record applies to. Can be the domain itself or a subdomain. For example, `example.com` or `mail.example.com`.  | validation: maxLength 256
        - name: ttl | type: integer | description: [Time to live](https://en.wikipedia.org/wiki/Time_to_live) in seconds.  
        - name: values | type: array<string> | description: DNS record values.  External DNS providers may support a different maximum number of values for a record type. These external limits aren't validated.  | validation: minItems 1, maxItems 50, maxLength 1000
     - name: iconName | type: string | description: Name of the email provider's icon. Returned only for providers that have an icon.  | validation: maxLength 200


```

### Examples

### List the email providers for a domain
```curl
curl -X GET \
'https://www.wixapis.com/premium/domains/v1/mailbox-providers/mydomain.com' \
-H 'wix-account-id: <ACCOUNT_ID>' \
-H 'Authorization: <AUTH>'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.domains.mailboxProviders.listMailboxProviders(domainName)
 Description: Retrieves a list of the email providers that can be connected to a domain.   Each provider includes the DNS records that are added to the domain's DNS zone when it's connected, with the domain name filled in. You can use the records to show users a preview before they choose a provider.  To connect a provider to the domain, pass its `id` as `providerId` when you call [Add Mailbox Records](https://dev.wix.com/docs/api-reference/account-level/domains/domain-dns/add-mailbox-records.md). Retrieve provider GUIDs with this method rather than hard-coding them.  The list always includes the `Other` provider, which has no records. It represents an email provider that isn't listed. To connect such a provider, call Add Mailbox Records with `customMailbox` instead.  A provider whose records can't be generated for the domain isn't returned.  > __Important:__ This method requires an account-level API key and can't be authenticated with the standard authorization header.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  domainName
 Method parameters: 
   param name: domainName | type: string | description: Domain name to retrieve the email providers for, including the TLD. For example, `example.com`. | required: true | validation: format HOSTNAME
 Return type: PROMISE<ListMailboxProvidersResponse>
  - name: providers | type: array<MailboxProvider> | description: Email providers that can be connected to the domain, with their DNS records for the requested domain.  | validation: maxItems 200
     - name: _id | type: integer | description: Email provider GUID. To connect the provider to a domain, pass this GUID as `providerId` when you call [Add Mailbox Records](https://dev.wix.com/docs/api-reference/account-level/domains/domain-dns/add-mailbox-records.md).  Retrieve provider GUIDs with List Mailbox Providers rather than hard-coding them.  The `Other` provider has no records. It represents an email provider that isn't listed. To connect such a provider, call Add Mailbox Records with `customMailbox` and the provider's records instead of `providerId`.  | read-only: true 
     - name: name | type: string | description: Email provider's display name. For example, `Google Workspace`.  | validation: maxLength 200
     - name: records | type: array<DnsRecord> | description: DNS records that are added to the domain's DNS zone when the email provider is connected, with the requested domain name filled in. Includes the provider's `MX` records and any `CNAME`, `TXT`, or `SRV` records it requires.  | validation: maxItems 50
        - name: type | type: RecordType | description: [DNS record type](https://en.wikipedia.org/wiki/List_of_DNS_record_types).  
             - enum:
             -     UNKNOWN: Default value. Used in case the record type isn't known. You can't set a record type to `UNKNOWN`.
             -     A: Address record. Most fundamental type of DNS record that indicates the IP address of a given domain.
             -     AAAA: Address record in [IPv6 format](https://en.wikipedia.org/wiki/IPv6).
             -     NS: Name server record. Describes which server contains the actual DNS record.
             -     SOA: [Start of authority record](https://en.wikipedia.org/wiki/SOA_record). Holds administrative information about the zone.
             -     CNAME: [CNAME record](https://en.wikipedia.org/wiki/CNAME_record). Maps an alias name to the canonical domain name.
             -     MX: MX record. Directs emails to mail servers.
             -     TXT: [TXT record](https://en.wikipedia.org/wiki/TXT_record). Used by domain admins to add human-readable descriptions.
             -     SPF: SPF record. Used for email authentication.
             -     SRV: [Service record](https://en.wikipedia.org/wiki/SRV_record). Defines the server location.
             -     PTR: Pointer record. Specifies which host is supported for a given IP address.
             -     NAPTR: [Name Authority Pointer record](https://en.wikipedia.org/wiki/NAPTR_record). Used by Internet telephony applications.
        - name: hostName | type: string | description: Host name the record applies to. Can be the domain itself or a subdomain. For example, `example.com` or `mail.example.com`.  | validation: maxLength 256
        - name: ttl | type: integer | description: [Time to live](https://en.wikipedia.org/wiki/Time_to_live) in seconds.  
        - name: values | type: array<string> | description: DNS record values.  External DNS providers may support a different maximum number of values for a record type. These external limits aren't validated.  | validation: minItems 1, maxItems 50, maxLength 1000
     - name: iconName | type: string | description: Name of the email provider's icon. Returned only for providers that have an icon.  | validation: maxLength 200


```

### Examples

### List the email providers for a domain
```javascript
import { mailboxProviders } from "@wix/domains";

async function listMailboxProviders() {
  const response = await mailboxProviders.listMailboxProviders("mydomain.com");
}

/* Promise resolves to:
 * {
 *   "providers": [
 *     {
 *       "id": 1,
 *       "name": "Other"
 *     },
 *     {
 *       "id": 3,
 *       "name": "Google Workspace",
 *       "records": [
 *         {
 *           "type": "MX",
 *           "hostName": "mydomain.com",
 *           "ttl": 3600,
 *           "values": [
 *             "10 aspmx.l.google.com",
 *             "20 alt1.aspmx.l.google.com",
 *             "30 alt2.aspmx.l.google.com",
 *             "40 alt3.aspmx.l.google.com",
 *             "50 alt4.aspmx.l.google.com"
 *           ]
 *         },
 *         {
 *           "type": "TXT",
 *           "hostName": "mydomain.com",
 *           "ttl": 3600,
 *           "values": [
 *             "v=spf1 include:_spf.google.com ~all"
 *           ]
 *         }
 *       ],
 *       "iconName": "Google Workspace"
 *     }
 *   ]
 * }
 */

```

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

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


async function listMailboxProviders(domainName) {
  const response = await myWixClient.mailboxProviders.listMailboxProviders(domainName);
};
```

---