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

# Duplicate and fill

> Create a copy of an existing page and fill it with new content in one request.

Creates a new page by duplicating an existing template page, then applies your content changes to the copy. The original page is not modified. The new page is always created as a draft.

This is the recommended endpoint for creating multiple page variants from a single template (e.g., one landing page per product, per language, or per campaign).

<Info>
  This endpoint requires an API key with **Full access** permission.
</Info>

<ParamField path="page_id" type="string" required>
  The unique ID of the template page to duplicate. Get it from the [list pages](/api/list-pages) endpoint.
</ParamField>

<ParamField header="Authorization" type="string" required>
  Bearer token. Example: `Bearer ew_live_your_key_here`
</ParamField>

<ParamField body="title" type="string">
  Title for the new page. Defaults to `"{original title} (Copy)"`.
</ParamField>

<ParamField body="handle" type="string">
  Custom URL handle for the new page. Auto-slugified. If not provided, one is generated automatically.
</ParamField>

<ParamField body="sections" type="object">
  Content to fill in the new page. Same format as the [fill endpoint](/api/fill-page). If omitted, the page is duplicated as-is.
</ParamField>

<Tip>
  You can omit `sections` entirely to create an exact copy of the template without changing any content.
</Tip>

## What gets duplicated

| Copied                   | Not copied                      |
| ------------------------ | ------------------------------- |
| All sections and content | Shopify page ID                 |
| Brand style              | Published status (always draft) |
| Store connection         | Shopify page handle             |
| Product linking          |                                 |
| Meta description         |                                 |

## Example: multi-language pages

Use this endpoint in an automation to create localized versions of a single template:

```json theme={null}
// French version
{
  "title": "Summer Sale - FR",
  "handle": "summer-sale-fr",
  "sections": {
    "section_1": {
      "hero01_heading": "5 raisons de changer votre routine...",
      "hero01_btn": "En Savoir Plus"
    }
  }
}
```

```json theme={null}
// German version
{
  "title": "Summer Sale - DE",
  "handle": "summer-sale-de",
  "sections": {
    "section_1": {
      "hero01_heading": "5 Grunde Ihre Routine zu verbessern...",
      "hero01_btn": "Mehr Erfahren"
    }
  }
}
```

<Note>
  Each duplicate counts toward your plan's page limit. If you reach the limit, the API returns a `403` error with a message to upgrade your plan.
</Note>

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url https://app.ecomwize.io/api/v1/pages/e22f3857-cf0c-49c0-9e44-d76ea0bb7221/duplicate-and-fill \
    --header 'Authorization: Bearer ew_live_your_key_here' \
    --header 'Content-Type: application/json' \
    --data '{
      "title": "Summer Sale - Dutch Version",
      "handle": "summer-sale-nl",
      "sections": {
        "section_1": {
          "hero01_heading": "5 redenen om je routine te upgraden",
          "hero01_btn": "Meer Ontdekken"
        },
        "section_2": {
          "benefit01_heading": "Waarom natuurlijke ingredienten beter werken",
          "benefit01_btn": "Bekijk het Serum"
        }
      }
    }'
  ```

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

  response = requests.post(
      "https://app.ecomwize.io/api/v1/pages/e22f3857-cf0c-49c0-9e44-d76ea0bb7221/duplicate-and-fill",
      headers={
          "Authorization": "Bearer ew_live_your_key_here",
          "Content-Type": "application/json"
      },
      json={
          "title": "Summer Sale - Dutch Version",
          "handle": "summer-sale-nl",
          "sections": {
              "section_1": {
                  "hero01_heading": "5 redenen om je routine te upgraden",
                  "hero01_btn": "Meer Ontdekken"
              }
          }
      }
  )
  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    "https://app.ecomwize.io/api/v1/pages/e22f3857-cf0c-49c0-9e44-d76ea0bb7221/duplicate-and-fill",
    {
      method: "POST",
      headers: {
        "Authorization": "Bearer ew_live_your_key_here",
        "Content-Type": "application/json"
      },
      body: JSON.stringify({
        title: "Summer Sale - Dutch Version",
        handle: "summer-sale-nl",
        sections: {
          section_1: {
            hero01_heading: "5 redenen om je routine te upgraden",
            hero01_btn: "Meer Ontdekken"
          }
        }
      })
    }
  );
  const data = await response.json();
  ```
</RequestExample>

<ResponseExample>
  ```json 201 theme={null}
  {
    "success": true,
    "message": "Page duplicated as \"Summer Sale - Dutch Version\"",
    "page": {
      "id": "f8a1b2c3-d4e5-6789-abcd-ef0123456789",
      "title": "Summer Sale - Dutch Version",
      "slug": "summer-sale-nl",
      "handle": "summer-sale-nl",
      "status": "draft",
      "created_at": "2026-04-09T10:30:00.000Z"
    }
  }
  ```

  ```json 403 theme={null}
  {
    "error": "Page limit reached",
    "message": "Your starter plan has reached its page limit. Upgrade to create more pages.",
    "status": 403
  }
  ```

  ```json 404 theme={null}
  {
    "error": "Page not found",
    "message": "No page found with this ID. Use GET /api/v1/pages to list your pages.",
    "status": 404
  }
  ```
</ResponseExample>
