> ## Documentation Index
> Fetch the complete documentation index at: https://product-discovery.developer.voyado.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Import and export pages

> Import and export pages with the Pages API, including import permissions, locale-specific settings, custom data, and full and partial import examples.

[Pages](https://help.elevate.voyado.com/hc/en-gb/articles/27611164840092-Category-Landing-pages) <Icon icon="external-link" size={12} /> can be imported and exported into Elevate using the Pages API. Both the [import](/elevate/docs/api/admin/v4/import/pages) and [export](/elevate/docs/api/admin/v4/export/pages) of pages are based on the `market` attribute, which must be supplied as a [query parameter](/elevate/docs/integration/site-integration/query-integration/query-parameters) to the export, and in the request body of the import. Both endpoints require the `Api-Key` header.

Pages that are imported via the Pages API are automatically published unless the `previewOnly` flag is set, in which case they must be manually published in the app before the changes go live. Pages that already exist will be updated **if** the [permissions](#import-permissions-for-pages) allow it.

<Warning>
  Importing a page will discard *all* currently unpublished changes made to that page. For this reason, imports should ideally be scheduled so that they don't collide with manual edits.
</Warning>

## Import permissions for pages

Permissions to edit pages are set on the origin of the edits, that is, the app and the API. Within each source, permissions can be set to allow for changes in the page and product selections, or in the product lists.

The import permission settings for pages can be configured in the [Configuration tab](https://help.elevate.voyado.com/hc/en-gb/articles/27609609355036-Admin-Configuration-tab) <Icon icon="external-link" size={12} /> in the Admin app. The Page API can always create and remove pages, which means that a full import will **not** be affected by the configured permissions for the API.

### Update existing pages from the API

The following actions can be performed with **Update existing pages from the API** allowed:

* Create pages
* Remove pages
* Add lists
  * Set the list algorithm
  * Limit the product selection
  * Change the product selection of a list
* Remove lists
* Edit the page heading
* Set if a selection should be inherited by child pages

### Update settings for existing pages from the API

The following actions can be performed with **Update settings for existing pages from the API** allowed:

* Pin products
* Block products
* Change list keywords
* Change list facet selections
* Change list sort orders

## Locale-specific settings

While most settings on a page are locale independent, a few are set per locale. These settings take a mapping from the `locale` attribute to a setting value. Each locale is optional, meaning the settings can be set for only a subset (or none) of the available locales if desired.

Additionally, custom data can be added per locale using the `customData` attribute. Custom data is limited to 3,000 characters and 200 keys per locale. Be careful not to include too much data here, as doing so may bloat query responses. For more information, see [Page](/elevate/docs/api/admin/v4/import/pages#page).

In the full import example below, the `headings` and `paths` fields as well as the `customData` are locale-specific.

## Export

The [export endpoint](/elevate/docs/api/admin/v4/export/pages) exports all pages based on the supplied `market` attribute.

## Examples

### Full import

A full import will replace all existing pages of the specified market with the content of `addOrUpdate`.

```json title="Example" icon="code" expandable theme={null}
{
  "market": "UK",
  "type": "FULL",
  "addOrUpdate": [
    {
      "id": "/",
      "heading": "",
      "recLists": [
        {
          "id": "home-1",
          "rules": "rule incl discount [5, 100]",
          "pinned": ["ABC123"],
          "blocked": ["DEF456"]
        }
      ]
    },
    {
      "id": "/tools/power-tools",
      "headings": {
        "en-GB": "Power tools",
        "sv-SE": "Elverktyg"
      },
      "paths": {
        "en-GB": "categories/power-tools",
        "sv-SE": "kategorier/elverktyg"
      },
      "customData": {
        "en-GB": {
          "key": "value",
          "preamble": "All our power tools come with batteries included...",
          "isCategoryPage": "True",
          "banner_image": "/assets/banners/en/power_tools_01.jpg"
        },
        "sv-SE": {
          "preamble": "Alla våra elverktyg inkluderar batterier...",
          "isCategoryPage": "True",
          "banner_image": "/assets/banners/se/power_tools_01.jpg"
        }
      },
      "primaryList": {
        "rules": "rule incl custom.category_name { \"Power tools\" }",
        "pinned": [],
        "blocked": [],
        "keywords": {
          "enabled": false
        },
        "facetsOverride": {
          "enabled": false
        },
        "sortOrderOverride": {
          "enabled": false
        },
        "restrictChildRules": false
      },
      "recLists": [
        {
          "id": "rec-list-1",
          "rules": "rule incl newness 10d",
          "pinned": ["GHI789"],
          "blocked": []
        }
      ]
    }
  ]
}
```

### Partial import

A partial import can both add pages to and remove pages from a market. In this example, pages are added to a specified market.

```json title="Example" icon="code" expandable theme={null}
{
  "market": "UK",
  "type": "PARTIAL",
  "addOrUpdate": [
    {
      "id": "/home/lighting",
      "headings": {
        "en-GB": "Lighting"
      },
      "primaryList": {
        "rules": "rule incl custom.category_name { \"Lighting\" }",
        "pinned": [],
        "blocked": [],
        "keywords": {
          "enabled": true,
          "headingAsKeyword": true,
          "additional": {
            "en-GB": ["lights", "lamp"]
          }
        },
        "facetsOverride": {
          "enabled": true,
          "facets": [
              { "attribute": "brand", "sortOrder": "ALPHABETICAL" },
              { "attribute": "newness" },
              { "attribute": "custom.number.items_in_package" },
              { "attribute": "weight", "unit": "g" },
              { "attribute": "variant.custom.socket_type", "sortOrder": "ALPHABETICAL" }
          ]
        },
        "sortOrderOverride": {
          "enabled": true,
          "sortOrders": ["RELEVANCE",
                        "NEWEST_FIRST",
                        "PRICE_INCREASING",
                        "PRICE_DECREASING",
                        "DISCOUNT",
                        "RATING"]
        },
        "restrictChildRules": false
      },
      "recLists": [
        {
          "id": "rec-list-1",
          "rules": "rule incl discount [5, 30]",
          "pinned": [],
          "blocked": []
        }
      ]
    }
  ],
  "remove": ["KLM012"]
}
```

### Minimal examples

This example contains a primary list and a rec list. It does not override any default settings.

```json title="Example" icon="code" expandable theme={null}
{
  "market": "UK",
  "type": "PARTIAL",
  "addOrUpdate": [
    {
      "id": "/home/lighting",
      "primaryList": {
        "rules": "rule incl custom.category_name { \"Lighting\" }"
      },
      "recLists": [
        {
          "id": "rec-list-1",
          "rules": "rule incl discount [5, 30]"
        }
      ]
    }
  ]
}
```

This example removes the page imported in the above example.

```json title="Example" icon="code" theme={null}
{
  "market": "UK",
  "type": "PARTIAL",
  "remove": [
    "/home/lighting"
  ]
}
```
