> 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 # DuplicateSite # Package: sites # Namespace: SiteActionsService # Method link: https://dev.wix.com/docs/api-reference/account-level/sites/site-actions/duplicate-site.md ## Introduction Duplicates a site with a new site name. > **Note:** When you duplicate a site, some business-related content such as store orders, contacts, invoices, and 3rd-party app settings are not be included. > The duplicated site won’t have a domain or any Premium capabilities. Any installed apps that can be used only on sites with a Premium Plan, will be copied to the duplicated site and will appear unactivated. Once the site is upgraded, the app will be available for use. > **Important:** This call requires an account level API key. --- ## REST API ### Schema ``` Method: duplicateSite Description: Duplicates a site with a new site name. > **Note:** When you duplicate a site, some business-related content such as store orders, contacts, invoices, and 3rd-party app settings are not be included. > The duplicated site won’t have a domain or any Premium capabilities. Any installed apps that can be used only on sites with a Premium Plan, will be copied to the duplicated site and will appear unactivated. Once the site is upgraded, the app will be available for use. > **Important:** This call requires an account level API key. URL: https://www.wixapis.com/v1/sites/duplicate Method: POST # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: sourceSiteId, siteDisplayName Method parameters: param name: siteDisplayName | type: siteDisplayName | description: Display name for the new site. | required: true param name: sourceSiteId | type: sourceSiteId | description: GUID of the site to duplicated. | required: true Return type: DuplicateSiteResponse - name: newSiteId | type: string | description: GUID of the new site. ``` ### Examples ### DuplicateSite ```curl curl 'https://www.wixapis.com/site-actions/v1/sites/duplicate' \ -H 'authorization: ' \ -H 'content-type: application/json' \ -d '{ "sourceSiteId": "1e6179e9-c3db-49aa-a074-37566a7bad47", "siteDisplayName": "Sunset Boutique Hotel" }' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.sites.SiteActionsService.duplicateSite(sourceSiteId, options) Description: Duplicates a site with a new site name. > **Note:** When you duplicate a site, some business-related content such as store orders, contacts, invoices, and 3rd-party app settings are not be included. > The duplicated site won’t have a domain or any Premium capabilities. Any installed apps that can be used only on sites with a Premium Plan, will be copied to the duplicated site and will appear unactivated. Once the site is upgraded, the app will be available for use. > **Important:** This call requires an account level API key. # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: sourceSiteId, options.siteDisplayName, options Method parameters: param name: options | type: DuplicateSiteOptions none | required: true - name: siteDisplayName | type: string | description: Display name for the new site. | required: true param name: sourceSiteId | type: string | description: GUID of the site to duplicated. | required: true Return type: PROMISE - name: newSiteId | type: string | description: GUID of the new site. ``` ### Examples ### duplicateSite ```javascript import { siteActions } from '@wix/sites'; async function duplicateSite(sourceSiteId,options) { const response = await siteActions.duplicateSite(sourceSiteId,options); }; ``` ### duplicateSite (with elevated permissions) ```javascript import { siteActions } from '@wix/sites'; import { auth } from '@wix/essentials'; async function myDuplicateSiteMethod(sourceSiteId,options) { const elevatedDuplicateSite = auth.elevate(siteActions.duplicateSite); const response = await elevatedDuplicateSite(sourceSiteId,options); } ``` ### duplicateSite (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 { siteActions } from '@wix/sites'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { siteActions }, // Include the auth strategy and host as relevant }); async function duplicateSite(sourceSiteId,options) { const response = await myWixClient.siteActions.duplicateSite(sourceSiteId,options); }; ``` ---