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

# Templates

> An export of all templates in Elevate.

An export of all templates in Elevate.

```http theme={null}
GET https://{cluster-id}.elevate-api.cloud/api/admin/v3/export/templates
```

## Request

<AccordionGroup>
  <Accordion title="Request header parameters">
    | Name                | Description                                   | Example       |
    | ------------------- | --------------------------------------------- | ------------- |
    | `Api-Key`\*         | API key supplied during onboarding.           | `123456789..` |
    | `Accept-Encoding`\* | Allows responses to be compressed using Gzip. | `gzip`        |
  </Accordion>

  <Accordion title="Example request">
    ```bash title="bash" theme={null}
    curl -i \
    -X GET \
    -H 'Api-Key: 123456789..' \
    -H 'Accept-Encoding: null' \
    "https://{cluster-id}.elevate-api.cloud/api/admin/v3/export/templates"
    ```
  </Accordion>
</AccordionGroup>

## Response

<AccordionGroup>
  <Accordion title="Response codes">
    | Status | Description                                                                                                                                                                                             |
    | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
    | `200`  | Query accepted. The data will be returned as an application/json-object.                                                                                                                                |
    | `403`  | Incorrect cluster credentials.                                                                                                                                                                          |
    | `404`  | Cluster not found.                                                                                                                                                                                      |
    | `406`  | No acceptable encoding found in Accept-Encoding header.                                                                                                                                                 |
    | `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>

  <Accordion title="Example response">
    ```json theme={null}
    {
      "lightTemplate" : {
        "products" : {
          "first" : {
            "fields" : [ "brand", "title", "link", "sellingPrice", "listPrice", "inStock", "custom.material" ],
            "variants" : {
              "all" : {
                "fields" : [ "label", "inStock", "sellingPrice", "listPrice", "custom.campaign" ]
              }
            }
          },
          "rest" : {
            "fields" : [ "link", "swatch" ],
            "maxVariants" : 0
          }
        }
      }
    }
    ```
  </Accordion>

  <Accordion title="Response body schema">
    #### TemplateBody

    Template definitions for response object customization. Template Ids must be alphanumeric and up to 25 characters.
    Keys following pattern: `[a-zA-Z0-9]{1,25}` and with the value: [TemplateSettings](#templatesettings)
    Max: 5 keys
  </Accordion>
</AccordionGroup>

## Inner Schemas

### ProductTemplate

| Name        | Type                                              | Description                                                                                                                                                                          |
| ----------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| fields\*    | string\[]                                         | The product level attributes to include. Custom attributes can be included by prefixing them with `custom.`, or the special `custom.*` can be used to include all custom attributes. |
| maxVariants | integer                                           | The max number of variants to include. If not specified, all variants will be included. Min: `0`.<br /><br />Examples: `0`                                                           |
| variants    | [VariantTemplateMapping](#varianttemplatemapping) | The definition of the product's variants for either `all` or the `first` and `rest` of the variants. Required unless maxVariants is not set to 0.                                    |

### ProductTemplateMapping

| Name  | Type                                | Description                                                             |
| ----- | ----------------------------------- | ----------------------------------------------------------------------- |
| all   | [ProductTemplate](#producttemplate) | All products/variants. Only if first and rest are not used.             |
| first | [ProductTemplate](#producttemplate) | The first product/variant in the list.                                  |
| rest  | [ProductTemplate](#producttemplate) | The remaining products/variants in the list. Required if first is used. |

### TemplateSettings

| Name       | Type                                              | Description                                                                                        |
| ---------- | ------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
| products\* | [ProductTemplateMapping](#producttemplatemapping) | The definition of the group's products for either `all` or the `first` and `rest` of the products. |

### VariantTemplate

| Name     | Type      | Description                                                                                                                                                                          |
| -------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| fields\* | string\[] | The variant level attributes to include. Custom attributes can be included by prefixing them with `custom.`, or the special `custom.*` can be used to include all custom attributes. |

### VariantTemplateMapping

| Name  | Type                                | Description                                                             |
| ----- | ----------------------------------- | ----------------------------------------------------------------------- |
| all   | [VariantTemplate](#varianttemplate) | All products/variants. Only if first and rest are not used.             |
| first | [VariantTemplate](#varianttemplate) | The first product/variant in the list.                                  |
| rest  | [VariantTemplate](#varianttemplate) | The remaining products/variants in the list. Required if first is used. |
