> 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 # QuerySendingDomains # Package: emails # Namespace: SendingDomainService # Method link: https://dev.wix.com/docs/api-reference/business-management/marketing/emails/sending-domains/query-sending-domains.md ## Permission Scopes: Read Sending Domains: SCOPE.SENDING-DOMAINS.READ ## Introduction Retrieves a list of up to 50 sending domains, given the provided paging and filtering. *Important:** A filter is required. You must filter by `domain` or `id`. Without a filter, this method returns a `SENDER_DETAILS_DO_NOT_EXIST` error. Query Sending Domains runs with these defaults, which you can override: - `paging.limit` is `50` To learn about working with Query methods, see [API Query Language](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-the-wix-api-query-language.md), [Sorting and Paging](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-sorting-and-paging.md), and [Field Projection](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-field-projection.md). --- ## REST API ### Schema ``` Method: querySendingDomains Description: Retrieves a list of up to 50 sending domains, given the provided paging and filtering. *Important:** A filter is required. You must filter by `domain` or `id`. Without a filter, this method returns a `SENDER_DETAILS_DO_NOT_EXIST` error. Query Sending Domains runs with these defaults, which you can override: - `paging.limit` is `50` To learn about working with Query methods, see [API Query Language](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-the-wix-api-query-language.md), [Sorting and Paging](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-sorting-and-paging.md), and [Field Projection](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-field-projection.md). URL: https://www.wixapis.com/sending-domains/v1/sending-domains/query Method: POST Method parameters: param name: query | type: CursorQuery - name: cursorPaging | type: CursorPaging | description: Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. - 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. - name: filter | type: object | description: Filter object in the following format: `"filter" : { "fieldName1": "value1", "fieldName2":{"$operator":"value2"} }` Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains` - name: sort | type: array | description: Sort object in the following format: `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]` - name: fieldName | type: string | description: Name of the field to sort by. - name: order | type: SortOrder | description: Sort order. - enum: ASC, DESC Return type: QuerySendingDomainsResponse - name: sendingDomains | type: array | description: Retrieved sending domains. - name: id | type: string | description: Sending domain GUID. - name: createdDate | type: string | description: Date and time the sending domain was created. - name: domain | type: string | description: Domain name to authenticate for sending emails. For example, `example.com`. - name: status | type: Status | description: Authentication status. Indicates whether the domain is ready for sending emails. - enum: - INITIALIZING: Domain is being set up. DNS records are being generated. Wait for this to change to NOT_AUTHENTICATED before proceeding. - NOT_AUTHENTICATED: Domain is ready to be authenticated. DNS records are available in dnsRecords. Add these records at the DNS provider, then call [Authenticate Sending Domain](https://dev.wix.com/docs/api-reference/business-management/marketing/emails/sending-domains/authenticate-sending-domain.md) to verify them. - AUTHENTICATED: Domain is authenticated and ready for sending emails. This domain can now be used in the **From** field for email campaigns and transactional emails. - name: dnsRecords | type: array | description: DNS records required to authenticate the domain. These records must be added to the domain's DNS configuration at the DNS provider (such as GoDaddy, Cloudflare, or Namecheap) to verify domain ownership and enable email sending. To authenticate the domain, add these records at the DNS provider and use DNS lookup tools (such as `dig` or online DNS checkers) to verify the records are visible globally. Then call [Authenticate Sending Domain](https://dev.wix.com/docs/api-reference/business-management/marketing/emails/sending-domains/authenticate-sending-domain.md). - name: hostName | type: string | description: Hostname for the DNS record. Add this as the subdomain or record name at the DNS provider. - name: value | type: string | description: Value for the DNS record. Add this as the target value at the DNS provider. - name: type | type: Type | description: DNS record type. - enum: - CNAME: CNAME record for domain authentication. - name: pagingMetadata | type: CursorPagingMetadata | description: Paging metadata for cursor-based pagination. - name: count | type: integer | description: Number of items returned in the response. - name: cursors | type: Cursors | description: Offset that was requested. - name: next | type: string | description: Cursor pointing to next page in the list of results. - name: prev | type: string | description: Cursor pointing to previous page in the list of results. - name: hasNext | type: boolean | description: Indicates if there are more results after the current page. If `true`, another page of results can be retrieved. If `false`, this is the last page. ``` ### Examples ### Query sending domains Retrieves all sending domains with filtering and paging ```curl curl -X POST \ 'https://www.wixapis.com/sending-domains/v1/sending-domains/query' \ -H 'Authorization: ' \ -H 'Content-Type: application/json' \ -d '{ "filter": { "domain": "your-brand.com" }, "cursorPaging": { "limit": 50 } }' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.emails.SendingDomainService.querySendingDomains(query) Description: Retrieves a list of up to 50 sending domains, given the provided paging and filtering. *Important:** A filter is required. You must filter by `domain` or `id`. Without a filter, this method returns a `SENDER_DETAILS_DO_NOT_EXIST` error. Query Sending Domains runs with these defaults, which you can override: - `paging.limit` is `50` To learn about working with Query methods, see [API Query Language](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-the-wix-api-query-language.md), [Sorting and Paging](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-sorting-and-paging.md), and [Field Projection](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-field-projection.md). # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: query Method parameters: param name: query | type: SendingDomainQuery | required: true - name: cursorPaging | type: CursorPaging | description: Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. - 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. - name: filter | type: object | description: Filter object in the following format: `"filter" : { "fieldName1": "value1", "fieldName2":{"$operator":"value2"} }` Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains` - name: sort | type: array | description: Sort object in the following format: `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]` - name: fieldName | type: string | description: Name of the field to sort by. - name: order | type: SortOrder | description: Sort order. - enum: ASC, DESC Return type: PROMISE - name: sendingDomains | type: array | description: Retrieved sending domains. - name: _id | type: string | description: Sending domain GUID. - name: _createdDate | type: Date | description: Date and time the sending domain was created. - name: domain | type: string | description: Domain name to authenticate for sending emails. For example, `example.com`. - name: status | type: Status | description: Authentication status. Indicates whether the domain is ready for sending emails. - enum: - INITIALIZING: Domain is being set up. DNS records are being generated. Wait for this to change to NOT_AUTHENTICATED before proceeding. - NOT_AUTHENTICATED: Domain is ready to be authenticated. DNS records are available in dnsRecords. Add these records at the DNS provider, then call [Authenticate Sending Domain](https://dev.wix.com/docs/api-reference/business-management/marketing/emails/sending-domains/authenticate-sending-domain.md) to verify them. - AUTHENTICATED: Domain is authenticated and ready for sending emails. This domain can now be used in the **From** field for email campaigns and transactional emails. - name: dnsRecords | type: array | description: DNS records required to authenticate the domain. These records must be added to the domain's DNS configuration at the DNS provider (such as GoDaddy, Cloudflare, or Namecheap) to verify domain ownership and enable email sending. To authenticate the domain, add these records at the DNS provider and use DNS lookup tools (such as `dig` or online DNS checkers) to verify the records are visible globally. Then call [Authenticate Sending Domain](https://dev.wix.com/docs/api-reference/business-management/marketing/emails/sending-domains/authenticate-sending-domain.md). - name: hostName | type: string | description: Hostname for the DNS record. Add this as the subdomain or record name at the DNS provider. - name: value | type: string | description: Value for the DNS record. Add this as the target value at the DNS provider. - name: type | type: Type | description: DNS record type. - enum: - CNAME: CNAME record for domain authentication. - name: pagingMetadata | type: CursorPagingMetadata | description: Paging metadata for cursor-based pagination. - name: count | type: integer | description: Number of items returned in the response. - name: cursors | type: Cursors | description: Offset that was requested. - name: next | type: string | description: Cursor pointing to next page in the list of results. - name: prev | type: string | description: Cursor pointing to previous page in the list of results. - name: hasNext | type: boolean | description: Indicates if there are more results after the current page. If `true`, another page of results can be retrieved. If `false`, this is the last page. ``` ### Examples ### querySendingDomains ```javascript import { sendingDomains } from '@wix/sending-domains'; async function querySendingDomains(query) { const response = await sendingDomains.querySendingDomains(query); }; ``` ### querySendingDomains (with elevated permissions) ```javascript import { sendingDomains } from '@wix/sending-domains'; import { auth } from '@wix/essentials'; async function myQuerySendingDomainsMethod(query) { const elevatedQuerySendingDomains = auth.elevate(sendingDomains.querySendingDomains); const response = await elevatedQuerySendingDomains(query); } ``` ### querySendingDomains (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 { sendingDomains } from '@wix/sending-domains'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { sendingDomains }, // Include the auth strategy and host as relevant }); async function querySendingDomains(query) { const response = await myWixClient.sendingDomains.querySendingDomains(query); }; ``` ---