> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bouncy.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Duplicate Website

> Create a copy of an existing bio link page with a new slug or domain

<Info>
  **Quick Duplication**

  This endpoint copies all content, styling, links, and settings from an existing website. Perfect for creating variations, client sites, or campaign-specific pages without rebuilding from scratch.
</Info>

## Request

### Headers

<ParamField header="Content-Type" type="string" required>
  Must be `application/json`
</ParamField>

### Path Parameters

<ParamField path="websiteId" type="string" required>
  The identifier of the source website to duplicate. Can be a slug, custom domain, or document ID.

  **Example:** `johndoe`
</ParamField>

### Body

<ParamField body="slug" type="string">
  URL slug for the new website. Required if no `domain` is provided, or when using a system domain.

  **Example:** `johndoe-v2`
</ParamField>

<ParamField body="domain" type="string">
  Domain for the new website. The API automatically detects the domain type:

  * **Bouncy domain** (`bouncy.ai`): Uses the `slug` as the path — `bouncy.ai/{slug}`
  * **System domain** (e.g. `bouncy.link`, `spicyl.ink`): Requires a `slug` — `{domain}/{slug}`
  * **Custom domain** (any other domain): Deploys to your custom domain — `{domain}`

  **Example:** `bouncy.link`
</ParamField>

<Note>
  You must provide at least a `slug` or a `domain`. If only `slug` is provided, the website is created on `bouncy.ai/{slug}`.
</Note>

## Response

<ResponseField name="message" type="string">
  Success message
</ResponseField>

<ResponseField name="id" type="string">
  Unique ID of the newly created website
</ResponseField>

<ResponseField name="url" type="string">
  Full URL to the new website

  **Example:** `https://bouncy.ai/johndoe-v2`
</ResponseField>

<ResponseField name="sourceId" type="string">
  ID of the source website that was duplicated
</ResponseField>

<RequestExample>
  ```bash cURL — Bouncy.ai slug theme={null}
  curl -X POST https://api.bouncy.ai/v1/websites/johndoe/duplicate \
    -H "Authorization: Bearer bcy_live_pk_YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "slug": "johndoe-v2"
    }'
  ```

  ```bash cURL — System domain theme={null}
  curl -X POST https://api.bouncy.ai/v1/websites/johndoe/duplicate \
    -H "Authorization: Bearer bcy_live_pk_YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "slug": "johndoe",
      "domain": "bouncy.link"
    }'
  ```

  ```bash cURL — Custom domain theme={null}
  curl -X POST https://api.bouncy.ai/v1/websites/johndoe/duplicate \
    -H "Authorization: Bearer bcy_live_pk_YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "domain": "links.example.com"
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://api.bouncy.ai/v1/websites/johndoe/duplicate',
    {
      method: 'POST',
      headers: {
        'Authorization': 'Bearer bcy_live_pk_YOUR_API_KEY',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        slug: 'johndoe-v2'
      })
    }
  );

  const result = await response.json();
  console.log('Duplicated website:', result.url);
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      'https://api.bouncy.ai/v1/websites/johndoe/duplicate',
      headers={
          'Authorization': 'Bearer bcy_live_pk_YOUR_API_KEY',
          'Content-Type': 'application/json'
      },
      json={
          'slug': 'johndoe-v2'
      }
  )

  result = response.json()
  print(f"Duplicated website: {result['url']}")
  ```
</RequestExample>

<ResponseExample>
  ```json 201 Created theme={null}
  {
    "message": "Website duplicated successfully",
    "id": "johndoe-v2",
    "url": "https://bouncy.ai/johndoe-v2",
    "sourceId": "johndoe"
  }
  ```

  ```json 201 Created (System Domain) theme={null}
  {
    "message": "Website duplicated successfully",
    "id": "bouncy.link__johndoe",
    "url": "https://bouncy.link/johndoe",
    "sourceId": "johndoe"
  }
  ```

  ```json 404 Not Found theme={null}
  {
    "error": "Source website not found or you do not have permission to access it"
  }
  ```

  ```json 400 Bad Request theme={null}
  {
    "error": "The slug 'johndoe-v2' is already taken"
  }
  ```

  ```json 403 Forbidden theme={null}
  {
    "error": "You have reached the maximum number of websites and deeplinks (5) allowed for your free plan. Please upgrade to create more.",
    "currentUsed": 5,
    "totalLimit": 5,
    "plan": "free"
  }
  ```
</ResponseExample>
