> 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

# 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/site-actions/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 | validation: minLength 1, maxLength 40
   param name: sourceSiteId | type: sourceSiteId | description: GUID of the site to duplicated. | required: true | validation: format GUID
 Return type: DuplicateSiteResponse
  - name: newSiteId | type: string | description: GUID of the new site.  | validation: format GUID


```

### Examples

### DuplicateSite
```curl
curl 'https://www.wixapis.com/site-actions/v1/sites/duplicate' \
  -H 'authorization: <AUTH>' \
  -H 'content-type: application/json' \
  -d '{
        "sourceSiteId": "1e6179e9-c3db-49aa-a074-37566a7bad47",
        "siteDisplayName": "Sunset Boutique Hotel"
      }'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.sites.siteActions.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: sourceSiteId | type: string | description: GUID of the site to duplicated. | required: true | validation: format GUID
   param name: options | type: DuplicateSiteOptions  none | required: true 
        - name: siteDisplayName | type: string | description: Display name for the new site. | required: true | validation: minLength 1, maxLength 40
 Return type: PROMISE<DuplicateSiteResponse>
  - name: newSiteId | type: string | description: GUID of the new site.  | validation: format GUID


```

### 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-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 { 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);
};
```

---