> ## 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.

# Configuration

> An import of the cluster configuration is made through using the standard HTTP POST method, with personal cluster credentials provided during onboarding.

An import of the cluster configuration is made through using the standard <a href="https://en.wikipedia.org/wiki/POST_(HTTP)">HTTP POST method</a>, with personal cluster credentials provided during onboarding. Configuration imports can be used to set up new markets or remove existing markets and all related data. Requests to this endpoint should be made with care. See <a href="https://docs.elevate.voyado.cloud/elevate/4/integration/configuration/">Configuration overview</a> for more information.

```http theme={null}
POST https://{cluster-id}.elevate-api.cloud/api/admin/v4/import/configuration
```

## Request

<AccordionGroup>
  <Accordion title="Request header parameters">
    | Name                 | Description                                                                                                                                                                                                                                  | Example            |
    | -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ |
    | `Api-Key`\*          | API key supplied during onboarding.                                                                                                                                                                                                          | `123456789..`      |
    | `Content-Encoding`\* | Content should be gzip encoded for all production requests. For manual test purposes, uncompressed small bodies may be provided using query parameter 'bypass-compression-for-manual-test=true' and omitted Content-Encoding (or 'identity') | `gzip`             |
    | `Accept-Encoding`    | Allows responses to be compressed using Gzip.                                                                                                                                                                                                | `gzip`             |
    | `Content-Type`       | application/json                                                                                                                                                                                                                             | `application/json` |
  </Accordion>

  <Accordion title="Request query parameters">
    | Name                     | Description                                                                                                             | Example |
    | ------------------------ | ----------------------------------------------------------------------------------------------------------------------- | ------- |
    | `allowDestructiveImport` | If true, allows imports that removes existing markets or locales. If false or omitted, such imports will fail.          | `false` |
    | `blockingTimeout`        | Maximum time to wait before getting a response. Valid values are in the range of 0 to 5 minutes. Defaults to 5 minutes. | `PT3M`  |
    | `name`                   | A name to identify the import in logs                                                                                   |         |
  </Accordion>

  <Accordion title="Request body example">
    ```json title="application/json" theme={null}
    {
      "edit" : {
        "markets" : {
          "se" : {
            "locales" : [ "sv-SE", "en-GB" ],
            "appSettings" : {
              "name" : "Sweden",
              "currency" : "SEK",
              "pageBaseUrl" : "www.example.com/se/categories",
              "searchPageUrl" : "www.example.com/se/home",
              "navigationUrl" : "www.example.com/se/categories"
            }
          },
          "uk" : {
            "locales" : [ "en-GB" ],
            "appSettings" : {
              "name" : "UK",
              "currency" : "GBP"
            }
          }
        }
      }
    }
    ```
  </Accordion>

  <Accordion title="Request body schema">
    #### Configuration

    A config import must include exactly one of 'remove', 'replace', or 'edit'

    | Name    | Type                            | Description                                                                                               |
    | ------- | ------------------------------- | --------------------------------------------------------------------------------------------------------- |
    | edit    | [ConfigEdit](#configedit)       | The edit operation adds or changes the included markets                                                   |
    | remove  | [ConfigRemove](#configremove)   | The remove operation removes specific markets                                                             |
    | replace | [ConfigReplace](#configreplace) | The replace operation fully replaces the configuration, removing all markets not included in the requests |
  </Accordion>

  <Accordion title="Example request">
    ```bash title="bash" theme={null}
    curl -i \
    -X POST \
    -H 'Api-Key: 123456789..' \
    -H 'Content-Encoding: null' \
    -H 'Accept-Encoding: null' \
    -H 'Content-Type: null' \
    "https://{cluster-id}.elevate-api.cloud/api/admin/v4/import/configuration?allowDestructiveImport=allowDestructiveImport&blockingTimeout=blockingTimeout&name=name" \
    -T request-body.file
    ```
  </Accordion>
</AccordionGroup>

## Response

<AccordionGroup>
  <Accordion title="Response codes">
    | Status | Description                                                                                                                                                                                                   |
    | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
    | `202`  | The import exceeded the maximum time, and an identifier for the import will be returned which can be used to poll its progress. The maximum wait time is 5 minutes by default.                                |
    | `204`  | The import was valid and has completed.                                                                                                                                                                       |
    | `400`  | The import was invalid or exceeds the contracted number of markets/locales. In case of the latter, please contact <a href="mailto:support@voyado.com">support</a> if you wish to further extend your cluster. |
    | `403`  | Incorrect cluster credentials.                                                                                                                                                                                |
    | `404`  | Cluster not found.                                                                                                                                                                                            |
    | `405`  | The import is not allowed due to incomplete upgrade. Perform a full v4 catalog import to upgrade.                                                                                                             |
    | `409`  | An import is currently in progress.                                                                                                                                                                           |
    | `500`  | Server error such as cluster unavailable, busy or internal error. If 5xx errors persist, contact <a href="mailto:support@voyado.com">support</a> and attach any information found in the response body.       |
    | `503`  | The server in the cluster that received the request is currently unavailable or busy. It is recommended to retry the request. The time between request attempts should be increasing.                         |
  </Accordion>
</AccordionGroup>

## Inner Schemas

### AppSettings

| Name          | Type   | Description                                                                                                                                                                                                                                                                                            |
| ------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| currency      | string | A currency symbol or string for the market, used in the Elevate app interface. Will default to \* if not provided. Min length: `1`. Max length: `2147483647`.<br /><br />Examples: `"GBP"`                                                                                                             |
| name          | string | A human readable name for the market, used in the Elevate app interface. Will default to the market id if not provided. Min length: `1`. Max length: `2147483647`.<br /><br />Examples: `"UK"`                                                                                                         |
| navigationUrl | string | If specified, previewing navigation changes in the Elevate app will take you to this url. Usually the root or a top-level node in the navigation tree.If not set, users will be asked to provide a link each time they use the preview feature.<br /><br />Examples: `"example.com/categories/ladies"` |
| pageBaseUrl   | string | If specified, previewing page changes in the Elevate app will take you to a url consisting of the pageBaseUrl + the page's id or path.If not set, users will be asked to provide a link each time they use the preview feature.<br /><br />Examples: `"example.com/categories"`                        |
| searchPageUrl | string | If specified, previewing overrides for search & autocomplete in the Elevate app will take you to this url. Usually a page with access to the search box.If not set, users will be asked to provide a link each time they use the preview feature.<br /><br />Examples: `"example.com/search"`          |

### MarketDefinition

A complete or partial market definition

| Name        | Type                        | Description                                                                                                                                      |
| ----------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| appSettings | [AppSettings](#appsettings) | How the market should be presented in the Elevate app interface. It is highly recommended to provide a display name and currency for the market. |
| locales     | string\[]                   | A list of which locales this market should support. New markets must include at least one locale!                                                |

### ConfigEdit

| Name      | Type                                             | Description                                         |
| --------- | ------------------------------------------------ | --------------------------------------------------- |
| markets\* | \<string, [MarketDefinition](#marketdefinition)> | A mapping from market key to a market configuration |

### ConfigRemove

| Name      | Type      | Description                                                                                                                                  |
| --------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| markets\* | string\[] | Which markets to delete. Deleting a market will delete everything on that market, including products and settings (promotions, pages, etc.)! |

### ConfigReplace

| Name      | Type                                             | Description                                         |
| --------- | ------------------------------------------------ | --------------------------------------------------- |
| markets\* | \<string, [MarketDefinition](#marketdefinition)> | A mapping from market key to a market configuration |
