> 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 # DeleteConnectedDomain # Package: connectedDomains # Namespace: ConnectedDomainService # Method link: https://dev.wix.com/docs/api-reference/account-level/domains/connected-domains/connected-domain-v1/delete-connected-domain.md ## Introduction Deletes a `connectedDomain` object and removes related DNS records from [Google's Cloud DNS](https://cloud.google.com/dns). You must pass the relevant Wix account ID in the header of the call. If you delete a `"PRIMARY"` domain, the site automatically uses the standard URL for free Wix sites. Read more about [URLs of free Wix sites](https://support.wix.com/en/article/changing-your-free-wix-url-8591528). When you delete a subdomain, its CNAME record is deleted from Google's Cloud DNS. > __Important:__ This call requires an account level API key and cannot be authenticated with the standard authorization header. --- ## REST API ### Schema ``` Method: deleteConnectedDomain Description: Deletes a `connectedDomain` object and removes related DNS records from [Google's Cloud DNS](https://cloud.google.com/dns). You must pass the relevant Wix account GUID in the header of the call. If you delete a `"PRIMARY"` domain, the site automatically uses the standard URL for free Wix sites. Read more about [URLs of free Wix sites](https://support.wix.com/en/article/changing-your-free-wix-url-8591528). When you delete a subdomain, its CNAME record is deleted from Google's Cloud DNS. > __Important:__ This call requires an account level API key and cannot be authenticated with the standard authorization header. URL: https://www.wixapis.com/domains/v1/connected-domains/{connectedDomainId} Method: DELETE # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: connectedDomainId Method parameters: param name: connectedDomainId | type: none | required: true Return type: DeleteConnectedDomainResponse EMPTY-OBJECT {} ``` ### Examples ### Delete a connected domain. ```curl curl -X DELETE 'https://www.wixapis.com/domains/v1/connected-domains/mysite.com' \ -H 'wix-account-id: ' \ -H 'Authorization: ' \ ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.connectedDomains.ConnectedDomainService.deleteConnectedDomain(connectedDomainId) Description: Deletes a `connectedDomain` object and removes related DNS records from [Google's Cloud DNS](https://cloud.google.com/dns). You must pass the relevant Wix account GUID in the header of the call. If you delete a `"PRIMARY"` domain, the site automatically uses the standard URL for free Wix sites. Read more about [URLs of free Wix sites](https://support.wix.com/en/article/changing-your-free-wix-url-8591528). When you delete a subdomain, its CNAME record is deleted from Google's Cloud DNS. > __Important:__ This call requires an account level API key and cannot 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: connectedDomainId Method parameters: param name: connectedDomainId | type: string | description: GUID of the connected domain to delete. Identical to the domain name including TLD. | required: true Return type: PROMISE EMPTY-OBJECT {} ``` ### Examples ### Delete a connected domain with an API key ```javascript import { createClient, ApiKeyStrategy } from "@wix/sdk"; import { connectedDomains } from "@wix/domains"; const wixClient = createClient({ modules: { connectedDomains }, auth: ApiKeyStrategy({ siteId: "MY-SITE-ID", apiKey: "MY-API-KEY", }), }); async function deleteConnectedDomain(connectedDomainId) { const response = await wixClient.connectedDomains.deleteConnectedDomain(connectedDomainId); } ``` ### deleteConnectedDomain (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 { connectedDomains } from '@wix/domains'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { connectedDomains }, // Include the auth strategy and host as relevant }); async function deleteConnectedDomain(connectedDomainId) { const response = await myWixClient.connectedDomains.deleteConnectedDomain(connectedDomainId); }; ``` ---