> 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 # AuthenticateSendingDomain # Package: emails # Namespace: SendingDomainService # Method link: https://dev.wix.com/docs/api-reference/business-management/marketing/emails/sending-domains/authenticate-sending-domain.md ## Permission Scopes: Manage Sending Domains: SCOPE.SENDING-DOMAINS.MANAGE ## Introduction Authenticates a sending domain by verifying the required DNS records. Call this method only when the domain's `status` property is `NOT_AUTHENTICATED` and after DNS records have been added and propagated. If Wix manages DNS for the domain (domain purchased from Wix or connected via nameservers), you don't need to call this method. If authentication succeeds, the domain's `status` property changes to `AUTHENTICATED` and the domain can be used for sending emails. For detailed steps and prerequisites, see [Authenticate a custom domain for email sending](https://dev.wix.com/docs/api-reference/business-management/marketing/emails/sending-domains/sample-flows.md#authenticate-a-custom-domain-for-email-sending). --- ## REST API ### Schema ``` Method: authenticateSendingDomain Description: Authenticates a sending domain by verifying the required DNS records. Call this method only when the domain's `status` property is `NOT_AUTHENTICATED` and after DNS records have been added and propagated. If Wix manages DNS for the domain (domain purchased from Wix or connected via nameservers), you don't need to call this method. If authentication succeeds, the domain's `status` property changes to `AUTHENTICATED` and the domain can be used for sending emails. For detailed steps and prerequisites, see [Authenticate a custom domain for email sending](https://dev.wix.com/docs/api-reference/business-management/marketing/emails/sending-domains/sample-flows.md#authenticate-a-custom-domain-for-email-sending). URL: https://www.wixapis.com/sending-domains/v1/sending-domains/{sendingDomainId}/authenticate Method: POST Return type: AuthenticateSendingDomainResponse - name: sendingDomain | type: SendingDomain | description: Authenticated sending domain. - 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. Possible Errors: HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: NOT_READY_FOR_AUTHENTICATION | Description: Domain isn't ready for authentication yet. DNS records are still being generated. ``` ### Examples ### Authenticate a sending domain Verifies DNS records and authenticates a sending domain ```curl curl -X POST \ 'https://www.wixapis.com/sending-domains/v1/sending-domains/12345678-1234-1234-1234-123456789012/authenticate' \ -H 'Authorization: ' \ -H 'Content-Type: application/json' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.emails.SendingDomainService.authenticateSendingDomain(sendingDomainId) Description: Authenticates a sending domain by verifying the required DNS records. Call this method only when the domain's `status` property is `NOT_AUTHENTICATED` and after DNS records have been added and propagated. If Wix manages DNS for the domain (domain purchased from Wix or connected via nameservers), you don't need to call this method. If authentication succeeds, the domain's `status` property changes to `AUTHENTICATED` and the domain can be used for sending emails. For detailed steps and prerequisites, see [Authenticate a custom domain for email sending](https://dev.wix.com/docs/api-reference/business-management/marketing/emails/sending-domains/sample-flows.md#authenticate-a-custom-domain-for-email-sending). # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: sendingDomainId Method parameters: param name: sendingDomainId | type: string | description: Sending domain GUID. | required: true Return type: PROMISE - name: sendingDomain | type: SendingDomain | description: Authenticated sending domain. - 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. Possible Errors: HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: NOT_READY_FOR_AUTHENTICATION | Description: Domain isn't ready for authentication yet. DNS records are still being generated. ``` ### Examples ### authenticateSendingDomain ```javascript import { sendingDomains } from '@wix/sending-domains'; async function authenticateSendingDomain(sendingDomainId) { const response = await sendingDomains.authenticateSendingDomain(sendingDomainId); }; ``` ### authenticateSendingDomain (with elevated permissions) ```javascript import { sendingDomains } from '@wix/sending-domains'; import { auth } from '@wix/essentials'; async function myAuthenticateSendingDomainMethod(sendingDomainId) { const elevatedAuthenticateSendingDomain = auth.elevate(sendingDomains.authenticateSendingDomain); const response = await elevatedAuthenticateSendingDomain(sendingDomainId); } ``` ### authenticateSendingDomain (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 authenticateSendingDomain(sendingDomainId) { const response = await myWixClient.sendingDomains.authenticateSendingDomain(sendingDomainId); }; ``` ---