openapi: 3.0.0
info:
  title: AI Suite - Synerise Public API
  version: 1.2.2
servers:
  - description: Microsoft Azure EU
    url: https://api.synerise.com
  - description: Microsoft Azure USA
    url: https://api.azu.synerise.com
  - description: Google Cloud Platform
    url: https://api.geb.synerise.com
tags:
  - name: Recommendation campaigns
  - name: Recommendation statistics
  - name: Recommendations
  - name: Search
  - name: Visual Search
  - name: Search Stats
  - name: Time Optimizer
  - name: Item filters
x-tagGroups:
  - name: AI Suite
    tags:
      - Recommendation campaigns
      - Recommendation statistics
      - Recommendations
      - Search
      - Visual Search
      - Search Stats
      - Time Optimizer
      - Item filters
paths:
  /activity-time-estimator/v1/query-model:
    post:
      summary: Generate activity time predictions
      description: |
        Calculate the probability of a profile performing an activity (event) at specific times of the week.

        ---

        **API consumers:** <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=userLogin" target="_blank" rel="noopener">Synerise User</a>

        **API key permission required:** `AI_TIME_OPTIMIZER_GET_PREDICTIONS_ANALYTICS_READ`

        **User role permission required:** `analytics_ai_time_optimizer: read`
      operationId: generate-time-predictions
      security:
        - JWT: []
      requestBody:
        content:
          application/json:
            schema:
              oneOf:
                - type: object
                  title: With profile ID
                  required:
                    - clientID
                  properties:
                    clientID:
                      $ref: "#/components/schemas/activity-time-estimator-ClientIDs"
                    mode:
                      $ref: "#/components/schemas/activity-time-estimator-Mode"
                    timeIndex:
                      $ref: "#/components/schemas/activity-time-estimator-TimeIndex"
                    timeIndexExclude:
                      $ref: "#/components/schemas/activity-time-estimator-TimeIndexExclude"
                    topN:
                      $ref: "#/components/schemas/activity-time-estimator-TopN"
                - type: object
                  title: With profile UUID
                  required:
                    - clientUUID
                  properties:
                    clientUUID:
                      $ref: "#/components/schemas/activity-time-estimator-ClientUUIDs"
                    mode:
                      $ref: "#/components/schemas/activity-time-estimator-Mode"
                    timeIndex:
                      $ref: "#/components/schemas/activity-time-estimator-TimeIndex"
                    timeIndexExclude:
                      $ref: "#/components/schemas/activity-time-estimator-TimeIndexExclude"
                    topN:
                      $ref: "#/components/schemas/activity-time-estimator-TopN"
      responses:
        "200":
          description: Predicted activity times
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    title: With profile ID
                    properties:
                      clientID:
                        $ref: "#/components/schemas/activity-time-estimator-ClientIDs"
                      hours:
                        $ref: "#/components/schemas/activity-time-estimator-Hours"
                      predictions:
                        $ref: "#/components/schemas/activity-time-estimator-Predictions"
                  - type: object
                    title: With profile UUID
                    properties:
                      clientUUID:
                        $ref: "#/components/schemas/activity-time-estimator-ClientUUIDs"
                      hours:
                        $ref: "#/components/schemas/activity-time-estimator-Hours"
                      predictions:
                        $ref: "#/components/schemas/activity-time-estimator-Predictions"
      tags:
        - Time Optimizer
      x-snr-doc-urls:
        - /api-reference/ai-suite#tag/Time-Optimizer/operation/generate-time-predictions
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/activity-time-estimator/v1/query-model \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"clientID":["67346"],"mode":"standard","timeIndex":[[0,23],24,25,26,[27,48]],"timeIndexExclude":[[0,23],24,25,26],"topN":1}'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            payload = "{\"clientID\":[\"67346\"],\"mode\":\"standard\",\"timeIndex\":[[0,23],24,25,26,[27,48]],\"timeIndexExclude\":[[0,23],24,25,26],\"topN\":1}"

            headers = {
                'Authorization': "Bearer REPLACE_BEARER_TOKEN",
                'content-type': "application/json"
                }

            conn.request("POST", "/activity-time-estimator/v1/query-model", payload, headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "clientID": [
                "67346"
              ],
              "mode": "standard",
              "timeIndex": [
                [
                  0,
                  23
                ],
                24,
                25,
                26,
                [
                  27,
                  48
                ]
              ],
              "timeIndexExclude": [
                [
                  0,
                  23
                ],
                24,
                25,
                26
              ],
              "topN": 1
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://api.synerise.com/activity-time-estimator/v1/query-model");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/activity-time-estimator/v1/query-model",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              clientID: ['67346'],
              mode: 'standard',
              timeIndex: [[0, 23], 24, 25, 26, [27, 48]],
              timeIndexExclude: [[0, 23], 24, 25, 26],
              topN: 1
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/activity-time-estimator/v1/query-model');
            $request->setMethod(HTTP_METH_POST);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN',
              'content-type' => 'application/json'
            ]);

            $request->setBody('{"clientID":["67346"],"mode":"standard","timeIndex":[[0,23],24,25,26,[27,48]],"timeIndexExclude":[[0,23],24,25,26],"topN":1}');

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.post("https://api.synerise.com/activity-time-estimator/v1/query-model")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"clientID\":[\"67346\"],\"mode\":\"standard\",\"timeIndex\":[[0,23],24,25,26,[27,48]],\"timeIndexExclude\":[[0,23],24,25,26],\"topN\":1}")
              .asString();
  /search/v2/indices/{indexId}/stats/queries/summary:
    get:
      summary: Get queries stats summary
      description: |
        Retrieves the statistics of all queries or a single query defined in the request.

        ---

        **API consumers:** <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=userLogin" target="_blank" rel="noopener">Synerise User</a>

        **API key permission required:** `AI_STATS_READ`

        **User role permission required:** `assets_search: read`
      operationId: GetQueriesSummary
      tags:
        - Search Stats
      security:
        - JWT: []
      parameters:
        - $ref: "#/components/parameters/ai-stats-indexId"
        - $ref: "#/components/parameters/ai-stats-dateFrom"
        - $ref: "#/components/parameters/ai-stats-dateTo"
        - $ref: "#/components/parameters/ai-stats-query"
        - $ref: "#/components/parameters/ai-stats-searchType"
        - $ref: "#/components/parameters/ai-stats-searchGroupBy"
      responses:
        "200":
          description: Statistics returned
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ai-stats-QueriesSummarySchema"
        "500":
          description: Service error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ai-stats-Error"
        4xx:
          description: Incorrect request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ai-stats-Error"
      x-snr-doc-urls:
        - /api-reference/ai-search#tag/Search-Stats/operation/GetQueriesSummary
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.synerise.com/search/v2/indices/4add1a1fa877c1651906bb22c9dfd37a1618852272/stats/queries/summary?dateFrom=SOME_STRING_VALUE&dateTo=SOME_STRING_VALUE&query=SOME_STRING_VALUE&searchType=SOME_STRING_VALUE&groupBy=SOME_STRING_VALUE' \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            headers = { 'Authorization': "Bearer REPLACE_BEARER_TOKEN" }

            conn.request("GET", "/search/v2/indices/4add1a1fa877c1651906bb22c9dfd37a1618852272/stats/queries/summary?dateFrom=SOME_STRING_VALUE&dateTo=SOME_STRING_VALUE&query=SOME_STRING_VALUE&searchType=SOME_STRING_VALUE&groupBy=SOME_STRING_VALUE", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://api.synerise.com/search/v2/indices/4add1a1fa877c1651906bb22c9dfd37a1618852272/stats/queries/summary?dateFrom=SOME_STRING_VALUE&dateTo=SOME_STRING_VALUE&query=SOME_STRING_VALUE&searchType=SOME_STRING_VALUE&groupBy=SOME_STRING_VALUE");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/search/v2/indices/4add1a1fa877c1651906bb22c9dfd37a1618852272/stats/queries/summary?dateFrom=SOME_STRING_VALUE&dateTo=SOME_STRING_VALUE&query=SOME_STRING_VALUE&searchType=SOME_STRING_VALUE&groupBy=SOME_STRING_VALUE",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/search/v2/indices/4add1a1fa877c1651906bb22c9dfd37a1618852272/stats/queries/summary');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'dateFrom' => 'SOME_STRING_VALUE',
              'dateTo' => 'SOME_STRING_VALUE',
              'query' => 'SOME_STRING_VALUE',
              'searchType' => 'SOME_STRING_VALUE',
              'groupBy' => 'SOME_STRING_VALUE'
            ]);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.get("https://api.synerise.com/search/v2/indices/4add1a1fa877c1651906bb22c9dfd37a1618852272/stats/queries/summary?dateFrom=SOME_STRING_VALUE&dateTo=SOME_STRING_VALUE&query=SOME_STRING_VALUE&searchType=SOME_STRING_VALUE&groupBy=SOME_STRING_VALUE")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
  /search/v2/indices/{indexId}/stats/queries/top:
    get:
      summary: Get top query statistics
      description: |
        Retrieves the 1000 most popular queries. 

        <strong>IMPORTANT</strong>: Don't use this endpoint for displaying most popular queries to end users when they're searching. Instead, use [`search/v2/indices/{indexId}/list`](https://developers.synerise.com/AISearch/AISearch.html#operation/ListingGet), where `indexId` is a suggestion index.


        ---

        **API consumers:** <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=userLogin" target="_blank" rel="noopener">Synerise User</a>, <span title="Deprecated">AI API key (legacy)</span>

        **API key permission required:** `AI_STATS_READ`

        **User role permission required:** `assets_search: read`
      operationId: GetQueriesTop
      tags:
        - Search Stats
      security:
        - JWT: []
        - TrackerKey: []
      parameters:
        - $ref: "#/components/parameters/ai-stats-indexId"
        - $ref: "#/components/parameters/ai-stats-dateFrom"
        - $ref: "#/components/parameters/ai-stats-dateTo"
        - $ref: "#/components/parameters/ai-stats-query"
        - $ref: "#/components/parameters/ai-stats-searchType"
        - $ref: "#/components/parameters/ai-stats-queryFilter"
        - $ref: "#/components/parameters/ai-stats-searchGroupBy"
        - $ref: "#/components/parameters/ai-stats-withFilters"
        - $ref: "#/components/parameters/ai-stats-searchSortBy"
        - $ref: "#/components/parameters/ai-stats-searchOrdering"
      responses:
        "200":
          description: Statistics returned
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ai-stats-QueriesTopSchema"
        "500":
          description: Service error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ai-stats-Error"
        4xx:
          description: Incorrect request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ai-stats-Error"
      x-snr-doc-urls:
        - /api-reference/ai-search#tag/Search-Stats/operation/GetQueriesTop
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.synerise.com/search/v2/indices/4add1a1fa877c1651906bb22c9dfd37a1618852272/stats/queries/top?dateFrom=SOME_STRING_VALUE&dateTo=SOME_STRING_VALUE&query=SOME_STRING_VALUE&searchType=SOME_STRING_VALUE&queryFilter=SOME_STRING_VALUE&groupBy=SOME_STRING_VALUE&withFilters=SOME_STRING_VALUE&SortBy=SOME_STRING_VALUE&ordering=SOME_STRING_VALUE' \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            headers = { 'Authorization': "Bearer REPLACE_BEARER_TOKEN" }

            conn.request("GET", "/search/v2/indices/4add1a1fa877c1651906bb22c9dfd37a1618852272/stats/queries/top?dateFrom=SOME_STRING_VALUE&dateTo=SOME_STRING_VALUE&query=SOME_STRING_VALUE&searchType=SOME_STRING_VALUE&queryFilter=SOME_STRING_VALUE&groupBy=SOME_STRING_VALUE&withFilters=SOME_STRING_VALUE&SortBy=SOME_STRING_VALUE&ordering=SOME_STRING_VALUE", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://api.synerise.com/search/v2/indices/4add1a1fa877c1651906bb22c9dfd37a1618852272/stats/queries/top?dateFrom=SOME_STRING_VALUE&dateTo=SOME_STRING_VALUE&query=SOME_STRING_VALUE&searchType=SOME_STRING_VALUE&queryFilter=SOME_STRING_VALUE&groupBy=SOME_STRING_VALUE&withFilters=SOME_STRING_VALUE&SortBy=SOME_STRING_VALUE&ordering=SOME_STRING_VALUE");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/search/v2/indices/4add1a1fa877c1651906bb22c9dfd37a1618852272/stats/queries/top?dateFrom=SOME_STRING_VALUE&dateTo=SOME_STRING_VALUE&query=SOME_STRING_VALUE&searchType=SOME_STRING_VALUE&queryFilter=SOME_STRING_VALUE&groupBy=SOME_STRING_VALUE&withFilters=SOME_STRING_VALUE&SortBy=SOME_STRING_VALUE&ordering=SOME_STRING_VALUE",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/search/v2/indices/4add1a1fa877c1651906bb22c9dfd37a1618852272/stats/queries/top');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'dateFrom' => 'SOME_STRING_VALUE',
              'dateTo' => 'SOME_STRING_VALUE',
              'query' => 'SOME_STRING_VALUE',
              'searchType' => 'SOME_STRING_VALUE',
              'queryFilter' => 'SOME_STRING_VALUE',
              'groupBy' => 'SOME_STRING_VALUE',
              'withFilters' => 'SOME_STRING_VALUE',
              'SortBy' => 'SOME_STRING_VALUE',
              'ordering' => 'SOME_STRING_VALUE'
            ]);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.get("https://api.synerise.com/search/v2/indices/4add1a1fa877c1651906bb22c9dfd37a1618852272/stats/queries/top?dateFrom=SOME_STRING_VALUE&dateTo=SOME_STRING_VALUE&query=SOME_STRING_VALUE&searchType=SOME_STRING_VALUE&queryFilter=SOME_STRING_VALUE&groupBy=SOME_STRING_VALUE&withFilters=SOME_STRING_VALUE&SortBy=SOME_STRING_VALUE&ordering=SOME_STRING_VALUE")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
  /search/v2/indices/{indexId}/stats/filters/summary:
    get:
      summary: Get filters stats
      description: |
        Retrieves the statistics of filters used in searches.

        ---

        **API consumers:** <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=userLogin" target="_blank" rel="noopener">Synerise User</a>

        **API key permission required:** `AI_STATS_READ`

        **User role permission required:** `assets_search: read`
      operationId: GetFiltersSummary
      tags:
        - Search Stats
      security:
        - JWT: []
      parameters:
        - $ref: "#/components/parameters/ai-stats-indexId"
        - $ref: "#/components/parameters/ai-stats-filterName"
        - $ref: "#/components/parameters/ai-stats-dateFrom"
        - $ref: "#/components/parameters/ai-stats-dateTo"
        - $ref: "#/components/parameters/ai-stats-searchGroupBy"
        - $ref: "#/components/parameters/ai-stats-searchOrdering"
      responses:
        "200":
          description: Statistics returned
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ai-stats-FiltersSummarySchema"
        "500":
          description: Service error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ai-stats-Error"
        4xx:
          description: Incorrect request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ai-stats-Error"
      x-snr-doc-urls:
        - /api-reference/ai-search#tag/Search-Stats/operation/GetFiltersSummary
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.synerise.com/search/v2/indices/4add1a1fa877c1651906bb22c9dfd37a1618852272/stats/filters/summary?filterName=brand&dateFrom=SOME_STRING_VALUE&dateTo=SOME_STRING_VALUE&groupBy=SOME_STRING_VALUE&ordering=SOME_STRING_VALUE' \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            headers = { 'Authorization': "Bearer REPLACE_BEARER_TOKEN" }

            conn.request("GET", "/search/v2/indices/4add1a1fa877c1651906bb22c9dfd37a1618852272/stats/filters/summary?filterName=brand&dateFrom=SOME_STRING_VALUE&dateTo=SOME_STRING_VALUE&groupBy=SOME_STRING_VALUE&ordering=SOME_STRING_VALUE", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://api.synerise.com/search/v2/indices/4add1a1fa877c1651906bb22c9dfd37a1618852272/stats/filters/summary?filterName=brand&dateFrom=SOME_STRING_VALUE&dateTo=SOME_STRING_VALUE&groupBy=SOME_STRING_VALUE&ordering=SOME_STRING_VALUE");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/search/v2/indices/4add1a1fa877c1651906bb22c9dfd37a1618852272/stats/filters/summary?filterName=brand&dateFrom=SOME_STRING_VALUE&dateTo=SOME_STRING_VALUE&groupBy=SOME_STRING_VALUE&ordering=SOME_STRING_VALUE",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/search/v2/indices/4add1a1fa877c1651906bb22c9dfd37a1618852272/stats/filters/summary');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'filterName' => 'brand',
              'dateFrom' => 'SOME_STRING_VALUE',
              'dateTo' => 'SOME_STRING_VALUE',
              'groupBy' => 'SOME_STRING_VALUE',
              'ordering' => 'SOME_STRING_VALUE'
            ]);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.get("https://api.synerise.com/search/v2/indices/4add1a1fa877c1651906bb22c9dfd37a1618852272/stats/filters/summary?filterName=brand&dateFrom=SOME_STRING_VALUE&dateTo=SOME_STRING_VALUE&groupBy=SOME_STRING_VALUE&ordering=SOME_STRING_VALUE")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
  /search/v2/indices/{indexId}/stats/rules/summary:
    get:
      summary: Get rules stats
      description: |
        Retrieves the statistics of applied rules.

        ---

        **API consumers:** <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=userLogin" target="_blank" rel="noopener">Synerise User</a>

        **API key permission required:** `AI_STATS_READ`

        **User role permission required:** `assets_search: read`
      operationId: GetRulesSummary
      tags:
        - Search Stats
      security:
        - JWT: []
      parameters:
        - $ref: "#/components/parameters/ai-stats-indexId"
        - $ref: "#/components/parameters/ai-stats-dateFrom"
        - $ref: "#/components/parameters/ai-stats-dateTo"
        - $ref: "#/components/parameters/ai-stats-searchGroupBy"
      responses:
        "200":
          description: Statistics returned
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ai-stats-RulesSummarySchema"
        "500":
          description: Service error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ai-stats-Error"
        4xx:
          description: Incorrect request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ai-stats-Error"
      x-snr-doc-urls:
        - /api-reference/ai-search#tag/Search-Stats/operation/GetRulesSummary
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.synerise.com/search/v2/indices/4add1a1fa877c1651906bb22c9dfd37a1618852272/stats/rules/summary?dateFrom=SOME_STRING_VALUE&dateTo=SOME_STRING_VALUE&groupBy=SOME_STRING_VALUE' \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            headers = { 'Authorization': "Bearer REPLACE_BEARER_TOKEN" }

            conn.request("GET", "/search/v2/indices/4add1a1fa877c1651906bb22c9dfd37a1618852272/stats/rules/summary?dateFrom=SOME_STRING_VALUE&dateTo=SOME_STRING_VALUE&groupBy=SOME_STRING_VALUE", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://api.synerise.com/search/v2/indices/4add1a1fa877c1651906bb22c9dfd37a1618852272/stats/rules/summary?dateFrom=SOME_STRING_VALUE&dateTo=SOME_STRING_VALUE&groupBy=SOME_STRING_VALUE");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/search/v2/indices/4add1a1fa877c1651906bb22c9dfd37a1618852272/stats/rules/summary?dateFrom=SOME_STRING_VALUE&dateTo=SOME_STRING_VALUE&groupBy=SOME_STRING_VALUE",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/search/v2/indices/4add1a1fa877c1651906bb22c9dfd37a1618852272/stats/rules/summary');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'dateFrom' => 'SOME_STRING_VALUE',
              'dateTo' => 'SOME_STRING_VALUE',
              'groupBy' => 'SOME_STRING_VALUE'
            ]);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.get("https://api.synerise.com/search/v2/indices/4add1a1fa877c1651906bb22c9dfd37a1618852272/stats/rules/summary?dateFrom=SOME_STRING_VALUE&dateTo=SOME_STRING_VALUE&groupBy=SOME_STRING_VALUE")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
  /search/v2/indices/stats/queries/summary:
    get:
      summary: Get queries summary for multiple indices
      description: |
        Retrieves the statistics of all queries or a single query defined in the request for multiple indices.

        ---

        **API consumers:** <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=userLogin" target="_blank" rel="noopener">Synerise User</a>

        **API key permission required:** `AI_STATS_READ`

        **User role permission required:** `assets_search: read`
      operationId: GetQueriesSummaryMultipleIndices
      tags:
        - Search Stats
      security:
        - JWT: []
      parameters:
        - $ref: "#/components/parameters/ai-stats-indexIdArray"
        - $ref: "#/components/parameters/ai-stats-dateFrom"
        - $ref: "#/components/parameters/ai-stats-dateTo"
        - $ref: "#/components/parameters/ai-stats-query"
        - $ref: "#/components/parameters/ai-stats-searchType"
        - $ref: "#/components/parameters/ai-stats-searchGroupBy"
      responses:
        "200":
          description: Statistics returned
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ai-stats-QueriesSummaryMultipleIndicesSchema"
        "500":
          description: Service error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ai-stats-Error"
        4xx:
          description: Incorrect request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ai-stats-Error"
      x-snr-doc-urls:
        - /api-reference/ai-search#tag/Search-Stats/operation/GetQueriesSummaryMultipleIndices
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.synerise.com/search/v2/indices/stats/queries/summary?indexId=SOME_ARRAY_VALUE&dateFrom=SOME_STRING_VALUE&dateTo=SOME_STRING_VALUE&query=SOME_STRING_VALUE&searchType=SOME_STRING_VALUE&groupBy=SOME_STRING_VALUE' \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            headers = { 'Authorization': "Bearer REPLACE_BEARER_TOKEN" }

            conn.request("GET", "/search/v2/indices/stats/queries/summary?indexId=SOME_ARRAY_VALUE&dateFrom=SOME_STRING_VALUE&dateTo=SOME_STRING_VALUE&query=SOME_STRING_VALUE&searchType=SOME_STRING_VALUE&groupBy=SOME_STRING_VALUE", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://api.synerise.com/search/v2/indices/stats/queries/summary?indexId=SOME_ARRAY_VALUE&dateFrom=SOME_STRING_VALUE&dateTo=SOME_STRING_VALUE&query=SOME_STRING_VALUE&searchType=SOME_STRING_VALUE&groupBy=SOME_STRING_VALUE");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/search/v2/indices/stats/queries/summary?indexId=SOME_ARRAY_VALUE&dateFrom=SOME_STRING_VALUE&dateTo=SOME_STRING_VALUE&query=SOME_STRING_VALUE&searchType=SOME_STRING_VALUE&groupBy=SOME_STRING_VALUE",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/search/v2/indices/stats/queries/summary');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'indexId' => 'SOME_ARRAY_VALUE',
              'dateFrom' => 'SOME_STRING_VALUE',
              'dateTo' => 'SOME_STRING_VALUE',
              'query' => 'SOME_STRING_VALUE',
              'searchType' => 'SOME_STRING_VALUE',
              'groupBy' => 'SOME_STRING_VALUE'
            ]);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.get("https://api.synerise.com/search/v2/indices/stats/queries/summary?indexId=SOME_ARRAY_VALUE&dateFrom=SOME_STRING_VALUE&dateTo=SOME_STRING_VALUE&query=SOME_STRING_VALUE&searchType=SOME_STRING_VALUE&groupBy=SOME_STRING_VALUE")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
  /recommendations/v2/campaigns/stats:
    post:
      summary: Get recommendation campaign statistics
      description: |
        Retrieves the statistics of campaigns defined in the request.

        ---

        **API consumers:** <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=userLogin" target="_blank" rel="noopener">Synerise User</a>

        **API key permission required:** `AI_STATS_READ`

        **User role permission required:** `campaigns_recommendations: read`
      operationId: PostCampaignsStats
      tags:
        - Recommendation statistics
      security:
        - JWT: []
        - TrackerKey: []
      requestBody:
        description: Request for recommendation campaigns stats.
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                campaignIds:
                  type: array
                  minItems: 1
                  items:
                    type: string
                  description: List of campaign IDs for which the statistics are requested. Must not be empty.
                from:
                  type: string
                  format: date
                  description: |
                    Upper bound of the interval for which the statistics will be retrieved.  
                    Must be provided with `to`, otherwise the filter is treated as unspecified.  
                    If not specified, the interval is last 7 days.
                to:
                  type: string
                  format: date
                  description: |
                    Lower bound of the interval for which the statistics will be retrieved.  
                    Must be provided with `from`, otherwise the filter is treated as unspecified.  
                    If not specified, the interval is last 7 days.
                timeZone:
                  type: string
                  description: Time zone identifier.
                  default: UTC
                  example: Europe/Warsaw
              required:
                - campaignIds
      responses:
        "200":
          description: Statistics returned
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ai-stats-RecoStatsByCampaignSchema"
        "500":
          description: Service error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ai-stats-Error"
        4xx:
          description: Incorrect request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ai-stats-Error"
      x-snr-doc-urls:
        - /api-reference/ai-recommendations#tag/Recommendation-statistics/operation/PostCampaignsStats
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/recommendations/v2/campaigns/stats \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"campaignIds":["string"],"from":"2019-08-24","to":"2019-08-24","timeZone":"Europe/Warsaw"}'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            payload = "{\"campaignIds\":[\"string\"],\"from\":\"2019-08-24\",\"to\":\"2019-08-24\",\"timeZone\":\"Europe/Warsaw\"}"

            headers = {
                'Authorization': "Bearer REPLACE_BEARER_TOKEN",
                'content-type': "application/json"
                }

            conn.request("POST", "/recommendations/v2/campaigns/stats", payload, headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "campaignIds": [
                "string"
              ],
              "from": "2019-08-24",
              "to": "2019-08-24",
              "timeZone": "Europe/Warsaw"
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://api.synerise.com/recommendations/v2/campaigns/stats");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/recommendations/v2/campaigns/stats",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              campaignIds: ['string'],
              from: '2019-08-24',
              to: '2019-08-24',
              timeZone: 'Europe/Warsaw'
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/recommendations/v2/campaigns/stats');
            $request->setMethod(HTTP_METH_POST);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN',
              'content-type' => 'application/json'
            ]);

            $request->setBody('{"campaignIds":["string"],"from":"2019-08-24","to":"2019-08-24","timeZone":"Europe/Warsaw"}');

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.post("https://api.synerise.com/recommendations/v2/campaigns/stats")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"campaignIds\":[\"string\"],\"from\":\"2019-08-24\",\"to\":\"2019-08-24\",\"timeZone\":\"Europe/Warsaw\"}")
              .asString();
  /recommendations/v2/campaigns/stats/global:
    get:
      summary: Get global recommendation campaign statistics
      description: |
        Retrieves the statistics of all recommendation campaigns.

        ---

        **API consumers:** <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=userLogin" target="_blank" rel="noopener">Synerise User</a>

        **API key permission required:** `AI_STATS_READ`

        **User role permission required:** `campaigns_recommendations: read`
      operationId: GetCampaignsGlobalStats
      tags:
        - Recommendation statistics
      security:
        - JWT: []
        - TrackerKey: []
      parameters:
        - $ref: "#/components/parameters/ai-stats-from"
        - $ref: "#/components/parameters/ai-stats-to"
        - $ref: "#/components/parameters/ai-stats-timeZone"
      responses:
        "200":
          description: Statistics returned
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ai-stats-RecoStatsByDateSchema"
        "500":
          description: Service error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ai-stats-Error"
        4xx:
          description: Incorrect request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ai-stats-Error"
      x-snr-doc-urls:
        - /api-reference/ai-recommendations#tag/Recommendation-statistics/operation/GetCampaignsGlobalStats
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.synerise.com/recommendations/v2/campaigns/stats/global?from=SOME_STRING_VALUE&to=SOME_STRING_VALUE&timeZone=Europe%2FWarsaw' \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            headers = { 'Authorization': "Bearer REPLACE_BEARER_TOKEN" }

            conn.request("GET", "/recommendations/v2/campaigns/stats/global?from=SOME_STRING_VALUE&to=SOME_STRING_VALUE&timeZone=Europe%2FWarsaw", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://api.synerise.com/recommendations/v2/campaigns/stats/global?from=SOME_STRING_VALUE&to=SOME_STRING_VALUE&timeZone=Europe%2FWarsaw");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/recommendations/v2/campaigns/stats/global?from=SOME_STRING_VALUE&to=SOME_STRING_VALUE&timeZone=Europe%2FWarsaw",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/recommendations/v2/campaigns/stats/global');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'from' => 'SOME_STRING_VALUE',
              'to' => 'SOME_STRING_VALUE',
              'timeZone' => 'Europe/Warsaw'
            ]);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.get("https://api.synerise.com/recommendations/v2/campaigns/stats/global?from=SOME_STRING_VALUE&to=SOME_STRING_VALUE&timeZone=Europe%2FWarsaw")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
  /recommendations/v2/campaigns/{campaignId}/stats:
    get:
      summary: Get recommendation campaign statistics
      description: |
        Retrieves the statistics of a single recommendation campaign.

        ---

        **API consumers:** <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=userLogin" target="_blank" rel="noopener">Synerise User</a>

        **API key permission required:** `AI_STATS_READ`

        **User role permission required:** `campaigns_recommendations: read`
      operationId: GetCampaignStats
      tags:
        - Recommendation statistics
      security:
        - JWT: []
        - TrackerKey: []
      parameters:
        - $ref: "#/components/parameters/ai-stats-campaignIdPath"
        - $ref: "#/components/parameters/ai-stats-from"
        - $ref: "#/components/parameters/ai-stats-to"
        - $ref: "#/components/parameters/ai-stats-timeZone"
      responses:
        "200":
          description: Statistics returned
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ai-stats-RecoStatsByDateSchema"
        "500":
          description: Service error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ai-stats-Error"
        4xx:
          description: Incorrect request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ai-stats-Error"
      x-snr-doc-urls:
        - /api-reference/ai-recommendations#tag/Recommendation-statistics/operation/GetCampaignStats
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.synerise.com/recommendations/v2/campaigns/50NCGoRK0VRb/stats?from=SOME_STRING_VALUE&to=SOME_STRING_VALUE&timeZone=Europe%2FWarsaw' \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            headers = { 'Authorization': "Bearer REPLACE_BEARER_TOKEN" }

            conn.request("GET", "/recommendations/v2/campaigns/50NCGoRK0VRb/stats?from=SOME_STRING_VALUE&to=SOME_STRING_VALUE&timeZone=Europe%2FWarsaw", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://api.synerise.com/recommendations/v2/campaigns/50NCGoRK0VRb/stats?from=SOME_STRING_VALUE&to=SOME_STRING_VALUE&timeZone=Europe%2FWarsaw");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/recommendations/v2/campaigns/50NCGoRK0VRb/stats?from=SOME_STRING_VALUE&to=SOME_STRING_VALUE&timeZone=Europe%2FWarsaw",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/recommendations/v2/campaigns/50NCGoRK0VRb/stats');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'from' => 'SOME_STRING_VALUE',
              'to' => 'SOME_STRING_VALUE',
              'timeZone' => 'Europe/Warsaw'
            ]);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.get("https://api.synerise.com/recommendations/v2/campaigns/50NCGoRK0VRb/stats?from=SOME_STRING_VALUE&to=SOME_STRING_VALUE&timeZone=Europe%2FWarsaw")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
  /recommendations/v2/campaigns/{campaignId}/products/stats:
    get:
      summary: Get statistics for top items in a campaign
      description: |
        Retrieves the statistics of top products for a single recommendation campaign.

        ---

        **API consumers:** <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=userLogin" target="_blank" rel="noopener">Synerise User</a>

        **API key permission required:** `AI_STATS_READ`

        **User role permission required:** `campaigns_recommendations: read`
      operationId: GetRecoTopProductsStats
      tags:
        - Recommendation statistics
      security:
        - JWT: []
        - TrackerKey: []
      parameters:
        - $ref: "#/components/parameters/ai-stats-campaignIdPath"
        - $ref: "#/components/parameters/ai-stats-from"
        - $ref: "#/components/parameters/ai-stats-to"
        - $ref: "#/components/parameters/ai-stats-timeZone"
        - $ref: "#/components/parameters/ai-stats-productMetricName"
      responses:
        "200":
          description: Statistics returned
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ai-stats-RecoTopProductsStatsSchema"
        "500":
          description: Service error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ai-stats-Error"
        4xx:
          description: Incorrect request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ai-stats-Error"
      x-snr-doc-urls:
        - /api-reference/ai-recommendations#tag/Recommendation-statistics/operation/GetRecoTopProductsStats
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.synerise.com/recommendations/v2/campaigns/50NCGoRK0VRb/products/stats?from=SOME_STRING_VALUE&to=SOME_STRING_VALUE&timeZone=Europe%2FWarsaw&metric=SOME_STRING_VALUE' \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            headers = { 'Authorization': "Bearer REPLACE_BEARER_TOKEN" }

            conn.request("GET", "/recommendations/v2/campaigns/50NCGoRK0VRb/products/stats?from=SOME_STRING_VALUE&to=SOME_STRING_VALUE&timeZone=Europe%2FWarsaw&metric=SOME_STRING_VALUE", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://api.synerise.com/recommendations/v2/campaigns/50NCGoRK0VRb/products/stats?from=SOME_STRING_VALUE&to=SOME_STRING_VALUE&timeZone=Europe%2FWarsaw&metric=SOME_STRING_VALUE");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/recommendations/v2/campaigns/50NCGoRK0VRb/products/stats?from=SOME_STRING_VALUE&to=SOME_STRING_VALUE&timeZone=Europe%2FWarsaw&metric=SOME_STRING_VALUE",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/recommendations/v2/campaigns/50NCGoRK0VRb/products/stats');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'from' => 'SOME_STRING_VALUE',
              'to' => 'SOME_STRING_VALUE',
              'timeZone' => 'Europe/Warsaw',
              'metric' => 'SOME_STRING_VALUE'
            ]);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.get("https://api.synerise.com/recommendations/v2/campaigns/50NCGoRK0VRb/products/stats?from=SOME_STRING_VALUE&to=SOME_STRING_VALUE&timeZone=Europe%2FWarsaw&metric=SOME_STRING_VALUE")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
  /items/v2/filter/validate:
    post:
      summary: Validate item filter
      description: |
        This endpoint lets you validate the syntax of a filter and preview its results.

        The `parserResult` object in the response validates only the IQL syntax, it does not check if the attributes or contexts referenced in the IQL query exist!


        ---

        **API consumers:** <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=userLogin" target="_blank" rel="noopener">Synerise User</a>

        **API key permission required:** `ITEMS_FILTER_VALIDATE_READ`

        **User role permission required:** `campaigns_recommendations: read`
      operationId: ValidateItemFilter
      tags:
        - Item filters
      security:
        - JWT: []
      parameters:
        - $ref: "#/components/parameters/items-filter-all-itemsCatalogId"
        - $ref: "#/components/parameters/items-filter-all-exampleItems"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/items-filter-all-ValidateItemsFilterRequestBody"
      responses:
        "200":
          description: Validation response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/items-filter-all-FilterValidateResponse"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/items-filter-all-Error"
        "500":
          description: Service not available
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/items-filter-all-Error"
        "502":
          description: Catalog not ready
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/items-filter-all-Error"
      x-snr-doc-urls:
        - /api-reference/ai-suite#tag/Item-filters/operation/ValidateItemFilter
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url 'https://api.synerise.com/items/v2/filter/validate?itemsCatalogId=SOME_STRING_VALUE&exampleItems=SOME_INTEGER_VALUE' \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"filteringString":"IF(\"abcd\" IN client.tags,discount == 0,discount > 0)","clientUUID":"68df2317-0edb-4cc9-8b39-5ab68325f891","contextItems":["12345"],"inventoryContext":{"channelIds":["string"]},"candidateItems":["67890"]}'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            payload = "{\"filteringString\":\"IF(\\\"abcd\\\" IN client.tags,discount == 0,discount > 0)\",\"clientUUID\":\"68df2317-0edb-4cc9-8b39-5ab68325f891\",\"contextItems\":[\"12345\"],\"inventoryContext\":{\"channelIds\":[\"string\"]},\"candidateItems\":[\"67890\"]}"

            headers = {
                'Authorization': "Bearer REPLACE_BEARER_TOKEN",
                'content-type': "application/json"
                }

            conn.request("POST", "/items/v2/filter/validate?itemsCatalogId=SOME_STRING_VALUE&exampleItems=SOME_INTEGER_VALUE", payload, headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "filteringString": "IF(\"abcd\" IN client.tags,discount == 0,discount > 0)",
              "clientUUID": "68df2317-0edb-4cc9-8b39-5ab68325f891",
              "contextItems": [
                "12345"
              ],
              "inventoryContext": {
                "channelIds": [
                  "string"
                ]
              },
              "candidateItems": [
                "67890"
              ]
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://api.synerise.com/items/v2/filter/validate?itemsCatalogId=SOME_STRING_VALUE&exampleItems=SOME_INTEGER_VALUE");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/items/v2/filter/validate?itemsCatalogId=SOME_STRING_VALUE&exampleItems=SOME_INTEGER_VALUE",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              filteringString: 'IF("abcd" IN client.tags,discount == 0,discount > 0)',
              clientUUID: '68df2317-0edb-4cc9-8b39-5ab68325f891',
              contextItems: ['12345'],
              inventoryContext: {channelIds: ['string']},
              candidateItems: ['67890']
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/items/v2/filter/validate');
            $request->setMethod(HTTP_METH_POST);

            $request->setQueryData([
              'itemsCatalogId' => 'SOME_STRING_VALUE',
              'exampleItems' => 'SOME_INTEGER_VALUE'
            ]);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN',
              'content-type' => 'application/json'
            ]);

            $request->setBody('{"filteringString":"IF(\\"abcd\\" IN client.tags,discount == 0,discount > 0)","clientUUID":"68df2317-0edb-4cc9-8b39-5ab68325f891","contextItems":["12345"],"inventoryContext":{"channelIds":["string"]},"candidateItems":["67890"]}');

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.post("https://api.synerise.com/items/v2/filter/validate?itemsCatalogId=SOME_STRING_VALUE&exampleItems=SOME_INTEGER_VALUE")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"filteringString\":\"IF(\\\"abcd\\\" IN client.tags,discount == 0,discount > 0)\",\"clientUUID\":\"68df2317-0edb-4cc9-8b39-5ab68325f891\",\"contextItems\":[\"12345\"],\"inventoryContext\":{\"channelIds\":[\"string\"]},\"candidateItems\":[\"67890\"]}")
              .asString();
  /search/v2/indices/{indexId}/visual:
    get:
      summary: Visual items search
      description: |
        Retrieves items that match an image. The results can be filtered and sorted.

        ---

        **API consumers:** <span title="Deprecated">AI API key (legacy)</span>, <a href="/docs/settings/tool/tracking_codes" target="_blank" rel="noopener" title="Pass your tracker key in the request header">Web SDK Tracker</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>

        **API key permission required:** `ITEMS_SEARCH_SEARCH_READ`
      operationId: SearchVisualGet
      tags:
        - Visual Search
      security:
        - TrackerKey: []
        - JWT: []
      parameters:
        - $ref: "#/components/parameters/items-search-imageUrl"
        - $ref: "#/components/parameters/items-search-inPathIndexId"
        - $ref: "#/components/parameters/items-search-clientUUID"
        - $ref: "#/components/parameters/items-search-personalize"
        - $ref: "#/components/parameters/items-search-correlationId"
        - $ref: "#/components/parameters/items-search-searchId"
        - $ref: "#/components/parameters/items-search-sortByMetric"
        - $ref: "#/components/parameters/items-search-sortByGeoPoint"
        - $ref: "#/components/parameters/items-search-filterGeoPoints"
        - $ref: "#/components/parameters/items-search-filterAroundRadius"
        - $ref: "#/components/parameters/items-search-filterAnchor"
        - $ref: "#/components/parameters/items-search-filters"
        - $ref: "#/components/parameters/items-search-facets"
        - $ref: "#/components/parameters/items-search-facetsSize"
        - $ref: "#/components/parameters/items-search-maxValuesPerFacet"
        - $ref: "#/components/parameters/items-search-caseSensitiveFacetValues"
        - $ref: "#/components/parameters/items-search-displayAttributes"
        - $ref: "#/components/parameters/items-search-context"
        - $ref: "#/components/parameters/items-search-includeFacets"
        - $ref: "#/components/parameters/items-search-facetsOrderBy"
        - $ref: "#/components/parameters/items-search-paginationPage"
        - $ref: "#/components/parameters/items-search-paginationLimit"
        - $ref: "#/components/parameters/items-search-paginationSortBy"
        - $ref: "#/components/parameters/items-search-paginationOrdering"
        - $ref: "#/components/parameters/items-search-paginationIncludeMeta"
        - $ref: "#/components/parameters/items-search-ignoreQueryRules"
        - $ref: "#/components/parameters/items-search-excludeQueryRules"
        - $ref: "#/components/parameters/items-search-params"
      responses:
        "200":
          description: Search response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/items-search-VisualSearchResponse"
        "500":
          description: Service not available
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/items-search-Error"
      x-snr-doc-urls:
        - /api-reference/ai-search#tag/Visual-Search/operation/SearchVisualGet
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.synerise.com/search/v2/indices/%7BindexId%7D/visual?url=SOME_STRING_VALUE&clientUUID=SOME_STRING_VALUE&personalize=SOME_BOOLEAN_VALUE&correlationId=SOME_STRING_VALUE&searchId=SOME_STRING_VALUE&sortByMetric=SOME_STRING_VALUE&sortByGeoPoint=34.052235%2C-118.243685&filterGeoPoints=34.052235%2C-118.243685&filterGeoPoints=15.0%2C65.0&filterAroundRadius=5000&filterAnchor=0.2%2C0.8&filters=SOME_STRING_VALUE&facets=SOME_ARRAY_VALUE&facetsSize=SOME_INTEGER_VALUE&maxValuesPerFacet=SOME_INTEGER_VALUE&caseSensitiveFacetValues=SOME_BOOLEAN_VALUE&displayAttributes=title&displayAttributes=price&context=mobile&context=listing&includeFacets=SOME_STRING_VALUE&facetsOrderBy=SOME_STRING_VALUE&page=4&limit=10&sortBy=SOME_STRING_VALUE&ordering=SOME_STRING_VALUE&includeMeta=SOME_BOOLEAN_VALUE&ignoreQueryRules=SOME_BOOLEAN_VALUE&excludeQueryRules=2&excludeQueryRules=5&params=source%3Amobile' \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            headers = { 'Authorization': "Bearer REPLACE_BEARER_TOKEN" }

            conn.request("GET", "/search/v2/indices/%7BindexId%7D/visual?url=SOME_STRING_VALUE&clientUUID=SOME_STRING_VALUE&personalize=SOME_BOOLEAN_VALUE&correlationId=SOME_STRING_VALUE&searchId=SOME_STRING_VALUE&sortByMetric=SOME_STRING_VALUE&sortByGeoPoint=34.052235%2C-118.243685&filterGeoPoints=34.052235%2C-118.243685&filterGeoPoints=15.0%2C65.0&filterAroundRadius=5000&filterAnchor=0.2%2C0.8&filters=SOME_STRING_VALUE&facets=SOME_ARRAY_VALUE&facetsSize=SOME_INTEGER_VALUE&maxValuesPerFacet=SOME_INTEGER_VALUE&caseSensitiveFacetValues=SOME_BOOLEAN_VALUE&displayAttributes=title&displayAttributes=price&context=mobile&context=listing&includeFacets=SOME_STRING_VALUE&facetsOrderBy=SOME_STRING_VALUE&page=4&limit=10&sortBy=SOME_STRING_VALUE&ordering=SOME_STRING_VALUE&includeMeta=SOME_BOOLEAN_VALUE&ignoreQueryRules=SOME_BOOLEAN_VALUE&excludeQueryRules=2&excludeQueryRules=5&params=source%3Amobile", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://api.synerise.com/search/v2/indices/%7BindexId%7D/visual?url=SOME_STRING_VALUE&clientUUID=SOME_STRING_VALUE&personalize=SOME_BOOLEAN_VALUE&correlationId=SOME_STRING_VALUE&searchId=SOME_STRING_VALUE&sortByMetric=SOME_STRING_VALUE&sortByGeoPoint=34.052235%2C-118.243685&filterGeoPoints=34.052235%2C-118.243685&filterGeoPoints=15.0%2C65.0&filterAroundRadius=5000&filterAnchor=0.2%2C0.8&filters=SOME_STRING_VALUE&facets=SOME_ARRAY_VALUE&facetsSize=SOME_INTEGER_VALUE&maxValuesPerFacet=SOME_INTEGER_VALUE&caseSensitiveFacetValues=SOME_BOOLEAN_VALUE&displayAttributes=title&displayAttributes=price&context=mobile&context=listing&includeFacets=SOME_STRING_VALUE&facetsOrderBy=SOME_STRING_VALUE&page=4&limit=10&sortBy=SOME_STRING_VALUE&ordering=SOME_STRING_VALUE&includeMeta=SOME_BOOLEAN_VALUE&ignoreQueryRules=SOME_BOOLEAN_VALUE&excludeQueryRules=2&excludeQueryRules=5&params=source%3Amobile");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/search/v2/indices/%7BindexId%7D/visual?url=SOME_STRING_VALUE&clientUUID=SOME_STRING_VALUE&personalize=SOME_BOOLEAN_VALUE&correlationId=SOME_STRING_VALUE&searchId=SOME_STRING_VALUE&sortByMetric=SOME_STRING_VALUE&sortByGeoPoint=34.052235%2C-118.243685&filterGeoPoints=34.052235%2C-118.243685&filterGeoPoints=15.0%2C65.0&filterAroundRadius=5000&filterAnchor=0.2%2C0.8&filters=SOME_STRING_VALUE&facets=SOME_ARRAY_VALUE&facetsSize=SOME_INTEGER_VALUE&maxValuesPerFacet=SOME_INTEGER_VALUE&caseSensitiveFacetValues=SOME_BOOLEAN_VALUE&displayAttributes=title&displayAttributes=price&context=mobile&context=listing&includeFacets=SOME_STRING_VALUE&facetsOrderBy=SOME_STRING_VALUE&page=4&limit=10&sortBy=SOME_STRING_VALUE&ordering=SOME_STRING_VALUE&includeMeta=SOME_BOOLEAN_VALUE&ignoreQueryRules=SOME_BOOLEAN_VALUE&excludeQueryRules=2&excludeQueryRules=5&params=source%3Amobile",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/search/v2/indices/%7BindexId%7D/visual');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'url' => 'SOME_STRING_VALUE',
              'clientUUID' => 'SOME_STRING_VALUE',
              'personalize' => 'SOME_BOOLEAN_VALUE',
              'correlationId' => 'SOME_STRING_VALUE',
              'searchId' => 'SOME_STRING_VALUE',
              'sortByMetric' => 'SOME_STRING_VALUE',
              'sortByGeoPoint' => '34.052235,-118.243685',
              'filterGeoPoints' => [
                '34.052235,-118.243685',
                '15.0,65.0'
              ],
              'filterAroundRadius' => '5000',
              'filterAnchor' => '0.2,0.8',
              'filters' => 'SOME_STRING_VALUE',
              'facets' => 'SOME_ARRAY_VALUE',
              'facetsSize' => 'SOME_INTEGER_VALUE',
              'maxValuesPerFacet' => 'SOME_INTEGER_VALUE',
              'caseSensitiveFacetValues' => 'SOME_BOOLEAN_VALUE',
              'displayAttributes' => [
                'title',
                'price'
              ],
              'context' => [
                'mobile',
                'listing'
              ],
              'includeFacets' => 'SOME_STRING_VALUE',
              'facetsOrderBy' => 'SOME_STRING_VALUE',
              'page' => '4',
              'limit' => '10',
              'sortBy' => 'SOME_STRING_VALUE',
              'ordering' => 'SOME_STRING_VALUE',
              'includeMeta' => 'SOME_BOOLEAN_VALUE',
              'ignoreQueryRules' => 'SOME_BOOLEAN_VALUE',
              'excludeQueryRules' => [
                '2',
                '5'
              ],
              'params' => 'source:mobile'
            ]);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.get("https://api.synerise.com/search/v2/indices/%7BindexId%7D/visual?url=SOME_STRING_VALUE&clientUUID=SOME_STRING_VALUE&personalize=SOME_BOOLEAN_VALUE&correlationId=SOME_STRING_VALUE&searchId=SOME_STRING_VALUE&sortByMetric=SOME_STRING_VALUE&sortByGeoPoint=34.052235%2C-118.243685&filterGeoPoints=34.052235%2C-118.243685&filterGeoPoints=15.0%2C65.0&filterAroundRadius=5000&filterAnchor=0.2%2C0.8&filters=SOME_STRING_VALUE&facets=SOME_ARRAY_VALUE&facetsSize=SOME_INTEGER_VALUE&maxValuesPerFacet=SOME_INTEGER_VALUE&caseSensitiveFacetValues=SOME_BOOLEAN_VALUE&displayAttributes=title&displayAttributes=price&context=mobile&context=listing&includeFacets=SOME_STRING_VALUE&facetsOrderBy=SOME_STRING_VALUE&page=4&limit=10&sortBy=SOME_STRING_VALUE&ordering=SOME_STRING_VALUE&includeMeta=SOME_BOOLEAN_VALUE&ignoreQueryRules=SOME_BOOLEAN_VALUE&excludeQueryRules=2&excludeQueryRules=5&params=source%3Amobile")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
    post:
      summary: Visual items search
      description: |
        Retrieves items that match an image. The results can be filtered and sorted.

        ---

        **API consumers:** <span title="Deprecated">AI API key (legacy)</span>, <a href="/docs/settings/tool/tracking_codes" target="_blank" rel="noopener" title="Pass your tracker key in the request header">Web SDK Tracker</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>

        **API key permission required:** `ITEMS_SEARCH_SEARCH_READ`
      operationId: SearchVisualPost
      tags:
        - Visual Search
      security:
        - TrackerKey: []
        - JWT: []
      parameters:
        - $ref: "#/components/parameters/items-search-inPathIndexId"
      requestBody:
        description: Request for performing visual search
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/items-search-VisualSearchRequest"
          multipart/form-data:
            schema:
              type: object
              properties:
                image:
                  type: string
                  format: binary
                  description: Uploaded image to be used in the visual search
                params:
                  type: object
                  description: Parameters of the search
                  properties:
                    page:
                      $ref: "#/components/schemas/items-search-PaginationPage"
                    limit:
                      $ref: "#/components/schemas/items-search-PaginationLimit"
                    sortBy:
                      $ref: "#/components/schemas/items-search-PaginationSortBy"
                    ordering:
                      $ref: "#/components/schemas/items-search-PaginationOrdering"
                    includeMeta:
                      $ref: "#/components/schemas/items-search-PaginationIncludeMeta"
                    clientUUID:
                      $ref: "#/components/schemas/items-search-ClientUUID"
                    correlationId:
                      $ref: "#/components/schemas/items-search-CorrelationId"
                    searchId:
                      $ref: "#/components/schemas/items-search-SearchId"
                    sortByMetric:
                      $ref: "#/components/schemas/items-search-SortByMetric"
                    sortByGeoPoints:
                      $ref: "#/components/schemas/items-search-SortByGeoPoint"
                    filterGeoPoints:
                      $ref: "#/components/schemas/items-search-FilterGeoPoints"
                    filterAroundRadius:
                      $ref: "#/components/schemas/items-search-FilterAroundRadius"
                    filterAnchor:
                      $ref: "#/components/schemas/items-search-FilterAnchor"
                    filters:
                      $ref: "#/components/schemas/items-search-Filters"
                    facets:
                      $ref: "#/components/schemas/items-search-Facets"
                    facetsSize:
                      $ref: "#/components/schemas/items-search-FacetsSize"
                    maxValuesPerFacet:
                      $ref: "#/components/schemas/items-search-MaxValuesPerFacet"
                    caseSensitiveFacetValues:
                      $ref: "#/components/schemas/items-search-CaseSensitiveFacetValues"
                    includeFacets:
                      $ref: "#/components/schemas/items-search-IncludeFacets"
                    facetsOrderBy:
                      $ref: "#/components/schemas/items-search-FacetsOrdering"
                    context:
                      $ref: "#/components/schemas/items-search-Context"
                    displayAttributes:
                      $ref: "#/components/schemas/items-search-DisplayAttributes"
                    ignoreQueryRules:
                      $ref: "#/components/schemas/items-search-IgnoreQueryRules"
                    excludeQueryRules:
                      $ref: "#/components/schemas/items-search-ExcludeQueryRules"
                    params:
                      $ref: "#/components/schemas/items-search-Params"
      responses:
        "200":
          description: Search response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/items-search-VisualSearchResponse"
        "500":
          description: Service not available
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/items-search-Error"
      x-snr-doc-urls:
        - /api-reference/ai-search#tag/Visual-Search/operation/SearchVisualPost
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/search/v2/indices/%7BindexId%7D/visual \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"url":"string","page":0,"limit":10,"sortBy":"string","ordering":"desc","includeMeta":true,"clientUUID":"string","personalize":true,"correlationId":"string","searchId":"string","sortByMetric":"TransactionsPopularity","sortByGeoPoints":"34.052235,-118.243685","filterGeoPoints":["34.052235,-118.243685","15.0,65.0"],"filterAroundRadius":2000,"filterAnchor":"0.2,0.8","filters":"string","facets":["string"],"customFilteredFacets":{"brand":"price > 100","price":"brand == foo"},"facetsSize":2000,"maxValuesPerFacet":50,"caseSensitiveFacetValues":false,"includeFacets":"all","facetsOrderBy":"coverage","context":["mobile","listing"],"displayAttributes":["title","price"],"ignoreQueryRules":false,"excludeQueryRules":[2,5],"params":{"source":"mobile"}}'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            payload = "{\"url\":\"string\",\"page\":0,\"limit\":10,\"sortBy\":\"string\",\"ordering\":\"desc\",\"includeMeta\":true,\"clientUUID\":\"string\",\"personalize\":true,\"correlationId\":\"string\",\"searchId\":\"string\",\"sortByMetric\":\"TransactionsPopularity\",\"sortByGeoPoints\":\"34.052235,-118.243685\",\"filterGeoPoints\":[\"34.052235,-118.243685\",\"15.0,65.0\"],\"filterAroundRadius\":2000,\"filterAnchor\":\"0.2,0.8\",\"filters\":\"string\",\"facets\":[\"string\"],\"customFilteredFacets\":{\"brand\":\"price > 100\",\"price\":\"brand == foo\"},\"facetsSize\":2000,\"maxValuesPerFacet\":50,\"caseSensitiveFacetValues\":false,\"includeFacets\":\"all\",\"facetsOrderBy\":\"coverage\",\"context\":[\"mobile\",\"listing\"],\"displayAttributes\":[\"title\",\"price\"],\"ignoreQueryRules\":false,\"excludeQueryRules\":[2,5],\"params\":{\"source\":\"mobile\"}}"

            headers = {
                'Authorization': "Bearer REPLACE_BEARER_TOKEN",
                'content-type': "application/json"
                }

            conn.request("POST", "/search/v2/indices/%7BindexId%7D/visual", payload, headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "url": "string",
              "page": 0,
              "limit": 10,
              "sortBy": "string",
              "ordering": "desc",
              "includeMeta": true,
              "clientUUID": "string",
              "personalize": true,
              "correlationId": "string",
              "searchId": "string",
              "sortByMetric": "TransactionsPopularity",
              "sortByGeoPoints": "34.052235,-118.243685",
              "filterGeoPoints": [
                "34.052235,-118.243685",
                "15.0,65.0"
              ],
              "filterAroundRadius": 2000,
              "filterAnchor": "0.2,0.8",
              "filters": "string",
              "facets": [
                "string"
              ],
              "customFilteredFacets": {
                "brand": "price > 100",
                "price": "brand == foo"
              },
              "facetsSize": 2000,
              "maxValuesPerFacet": 50,
              "caseSensitiveFacetValues": false,
              "includeFacets": "all",
              "facetsOrderBy": "coverage",
              "context": [
                "mobile",
                "listing"
              ],
              "displayAttributes": [
                "title",
                "price"
              ],
              "ignoreQueryRules": false,
              "excludeQueryRules": [
                2,
                5
              ],
              "params": {
                "source": "mobile"
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://api.synerise.com/search/v2/indices/%7BindexId%7D/visual");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/search/v2/indices/%7BindexId%7D/visual",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              url: 'string',
              page: 0,
              limit: 10,
              sortBy: 'string',
              ordering: 'desc',
              includeMeta: true,
              clientUUID: 'string',
              personalize: true,
              correlationId: 'string',
              searchId: 'string',
              sortByMetric: 'TransactionsPopularity',
              sortByGeoPoints: '34.052235,-118.243685',
              filterGeoPoints: ['34.052235,-118.243685', '15.0,65.0'],
              filterAroundRadius: 2000,
              filterAnchor: '0.2,0.8',
              filters: 'string',
              facets: ['string'],
              customFilteredFacets: {brand: 'price > 100', price: 'brand == foo'},
              facetsSize: 2000,
              maxValuesPerFacet: 50,
              caseSensitiveFacetValues: false,
              includeFacets: 'all',
              facetsOrderBy: 'coverage',
              context: ['mobile', 'listing'],
              displayAttributes: ['title', 'price'],
              ignoreQueryRules: false,
              excludeQueryRules: [2, 5],
              params: {source: 'mobile'}
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/search/v2/indices/%7BindexId%7D/visual');
            $request->setMethod(HTTP_METH_POST);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN',
              'content-type' => 'application/json'
            ]);

            $request->setBody('{"url":"string","page":0,"limit":10,"sortBy":"string","ordering":"desc","includeMeta":true,"clientUUID":"string","personalize":true,"correlationId":"string","searchId":"string","sortByMetric":"TransactionsPopularity","sortByGeoPoints":"34.052235,-118.243685","filterGeoPoints":["34.052235,-118.243685","15.0,65.0"],"filterAroundRadius":2000,"filterAnchor":"0.2,0.8","filters":"string","facets":["string"],"customFilteredFacets":{"brand":"price > 100","price":"brand == foo"},"facetsSize":2000,"maxValuesPerFacet":50,"caseSensitiveFacetValues":false,"includeFacets":"all","facetsOrderBy":"coverage","context":["mobile","listing"],"displayAttributes":["title","price"],"ignoreQueryRules":false,"excludeQueryRules":[2,5],"params":{"source":"mobile"}}');

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.post("https://api.synerise.com/search/v2/indices/%7BindexId%7D/visual")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"url\":\"string\",\"page\":0,\"limit\":10,\"sortBy\":\"string\",\"ordering\":\"desc\",\"includeMeta\":true,\"clientUUID\":\"string\",\"personalize\":true,\"correlationId\":\"string\",\"searchId\":\"string\",\"sortByMetric\":\"TransactionsPopularity\",\"sortByGeoPoints\":\"34.052235,-118.243685\",\"filterGeoPoints\":[\"34.052235,-118.243685\",\"15.0,65.0\"],\"filterAroundRadius\":2000,\"filterAnchor\":\"0.2,0.8\",\"filters\":\"string\",\"facets\":[\"string\"],\"customFilteredFacets\":{\"brand\":\"price > 100\",\"price\":\"brand == foo\"},\"facetsSize\":2000,\"maxValuesPerFacet\":50,\"caseSensitiveFacetValues\":false,\"includeFacets\":\"all\",\"facetsOrderBy\":\"coverage\",\"context\":[\"mobile\",\"listing\"],\"displayAttributes\":[\"title\",\"price\"],\"ignoreQueryRules\":false,\"excludeQueryRules\":[2,5],\"params\":{\"source\":\"mobile\"}}")
              .asString();
        - lang: shell_curl
          label: Shell + Curl
          source: |-
            curl --request POST \
              --url https://api.synerise.com/search/v2/indices/%7BindexId%7D/visual \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: multipart/form-data' \
              --form image=string \
              --form 'params={"page":0,"limit":10,"sortBy":"string","ordering":"desc","includeMeta":true,"clientUUID":"string","correlationId":"string","searchId":"string","sortByMetric":"TransactionsPopularity","sortByGeoPoints":"34.052235,-118.243685","filterGeoPoints":["34.052235,-118.243685","15.0,65.0"],"filterAroundRadius":2000,"filterAnchor":"0.2,0.8","filters":"string","facets":["string"],"facetsSize":2000,"maxValuesPerFacet":50,"caseSensitiveFacetValues":false,"includeFacets":"all","facetsOrderBy":"coverage","context":["mobile","listing"],"displayAttributes":["title","price"],"ignoreQueryRules":false,"excludeQueryRules":[2,5],"params":{"source":"mobile"}}'
        - lang: python_python3
          label: Python + Python3
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            payload = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image\"\r\n\r\nstring\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"params\"\r\n\r\n{\"page\":0,\"limit\":10,\"sortBy\":\"string\",\"ordering\":\"desc\",\"includeMeta\":true,\"clientUUID\":\"string\",\"correlationId\":\"string\",\"searchId\":\"string\",\"sortByMetric\":\"TransactionsPopularity\",\"sortByGeoPoints\":\"34.052235,-118.243685\",\"filterGeoPoints\":[\"34.052235,-118.243685\",\"15.0,65.0\"],\"filterAroundRadius\":2000,\"filterAnchor\":\"0.2,0.8\",\"filters\":\"string\",\"facets\":[\"string\"],\"facetsSize\":2000,\"maxValuesPerFacet\":50,\"caseSensitiveFacetValues\":false,\"includeFacets\":\"all\",\"facetsOrderBy\":\"coverage\",\"context\":[\"mobile\",\"listing\"],\"displayAttributes\":[\"title\",\"price\"],\"ignoreQueryRules\":false,\"excludeQueryRules\":[2,5],\"params\":{\"source\":\"mobile\"}}\r\n-----011000010111000001101001--\r\n"

            headers = {
                'Authorization': "Bearer REPLACE_BEARER_TOKEN",
                'content-type': "multipart/form-data"
                }

            conn.request("POST", "/search/v2/indices/%7BindexId%7D/visual", payload, headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: javascript_xhr
          label: Javascript + Xhr
          source: |-
            const data = new FormData();
            data.append("image", "string");
            data.append("params", "{\"page\":0,\"limit\":10,\"sortBy\":\"string\",\"ordering\":\"desc\",\"includeMeta\":true,\"clientUUID\":\"string\",\"correlationId\":\"string\",\"searchId\":\"string\",\"sortByMetric\":\"TransactionsPopularity\",\"sortByGeoPoints\":\"34.052235,-118.243685\",\"filterGeoPoints\":[\"34.052235,-118.243685\",\"15.0,65.0\"],\"filterAroundRadius\":2000,\"filterAnchor\":\"0.2,0.8\",\"filters\":\"string\",\"facets\":[\"string\"],\"facetsSize\":2000,\"maxValuesPerFacet\":50,\"caseSensitiveFacetValues\":false,\"includeFacets\":\"all\",\"facetsOrderBy\":\"coverage\",\"context\":[\"mobile\",\"listing\"],\"displayAttributes\":[\"title\",\"price\"],\"ignoreQueryRules\":false,\"excludeQueryRules\":[2,5],\"params\":{\"source\":\"mobile\"}}");

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://api.synerise.com/search/v2/indices/%7BindexId%7D/visual");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

            xhr.send(data);
        - lang: node_native
          label: Node + Native
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/search/v2/indices/%7BindexId%7D/visual",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image\"\r\n\r\nstring\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"params\"\r\n\r\n{\"page\":0,\"limit\":10,\"sortBy\":\"string\",\"ordering\":\"desc\",\"includeMeta\":true,\"clientUUID\":\"string\",\"correlationId\":\"string\",\"searchId\":\"string\",\"sortByMetric\":\"TransactionsPopularity\",\"sortByGeoPoints\":\"34.052235,-118.243685\",\"filterGeoPoints\":[\"34.052235,-118.243685\",\"15.0,65.0\"],\"filterAroundRadius\":2000,\"filterAnchor\":\"0.2,0.8\",\"filters\":\"string\",\"facets\":[\"string\"],\"facetsSize\":2000,\"maxValuesPerFacet\":50,\"caseSensitiveFacetValues\":false,\"includeFacets\":\"all\",\"facetsOrderBy\":\"coverage\",\"context\":[\"mobile\",\"listing\"],\"displayAttributes\":[\"title\",\"price\"],\"ignoreQueryRules\":false,\"excludeQueryRules\":[2,5],\"params\":{\"source\":\"mobile\"}}\r\n-----011000010111000001101001--\r\n");
            req.end();
        - lang: php_http1
          label: Php + Http1
          source: "<?php


            $request = new HttpRequest();

            $request->setUrl('https://api.synerise.com/search/v2/indices/%7BindexId%7D/visual');

            $request->setMethod(HTTP_METH_POST);


            $request->setHeaders([

            \  'Authorization' => 'Bearer REPLACE_BEARER_TOKEN',

            \  'content-type' => 'multipart/form-data'

            ]);


            $request->setBody('-----011000010111000001101001\r

            Content-Disposition: form-data; name=\"image\"\r

            \r

            string\r

            -----011000010111000001101001\r

            Content-Disposition: form-data; name=\"params\"\r

            \r

            {\"page\":0,\"limit\":10,\"sortBy\":\"string\",\"ordering\":\"desc\",\"includeMeta\":true,\"clientUUID\":\"string\",\"correlationId\":\"string\",\"searchId\":\"string\",\"sortByMetric\":\"TransactionsPopularity\",\"sortByGeoPoints\":\"34.052235,-118.243685\",\"filterGeoPoints\":[\"34.052235,-118.243685\",\"15.0,65.0\"],\"filterAroundRadius\":2000,\"filterAnchor\":\"0.2,0.8\",\"filters\":\"string\",\"facets\":[\"string\"],\"facetsSize\":2000,\"maxValuesPerFacet\":50,\"caseSensitiveFacetValues\":false,\"includeFacets\":\"all\",\"facetsOrderBy\":\"coverage\",\"context\":[\"mobile\",\"listing\"],\"displayAttributes\":[\"title\",\"price\"],\"ignoreQueryRules\":false,\"excludeQueryRules\":[2,5],\"params\":{\"source\":\"mobile\"}}\r

            -----011000010111000001101001--\r

            ');


            try {

            \  $response = $request->send();


            \  echo $response->getBody();

            } catch (HttpException $ex) {

            \  echo $ex;

            }"
        - lang: java_unirest
          label: Java + Unirest
          source: |-
            HttpResponse<String> response = Unirest.post("https://api.synerise.com/search/v2/indices/%7BindexId%7D/visual")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image\"\r\n\r\nstring\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"params\"\r\n\r\n{\"page\":0,\"limit\":10,\"sortBy\":\"string\",\"ordering\":\"desc\",\"includeMeta\":true,\"clientUUID\":\"string\",\"correlationId\":\"string\",\"searchId\":\"string\",\"sortByMetric\":\"TransactionsPopularity\",\"sortByGeoPoints\":\"34.052235,-118.243685\",\"filterGeoPoints\":[\"34.052235,-118.243685\",\"15.0,65.0\"],\"filterAroundRadius\":2000,\"filterAnchor\":\"0.2,0.8\",\"filters\":\"string\",\"facets\":[\"string\"],\"facetsSize\":2000,\"maxValuesPerFacet\":50,\"caseSensitiveFacetValues\":false,\"includeFacets\":\"all\",\"facetsOrderBy\":\"coverage\",\"context\":[\"mobile\",\"listing\"],\"displayAttributes\":[\"title\",\"price\"],\"ignoreQueryRules\":false,\"excludeQueryRules\":[2,5],\"params\":{\"source\":\"mobile\"}}\r\n-----011000010111000001101001--\r\n")
              .asString();
  /search/v2/indices/{indexId}/visual/explain:
    get:
      summary: Explained visual items search
      description: |
        Retrieves items that match an image. The results can be filtered and sorted. The response contains an explanation of the factors that influenced the result.

        ---

        **API consumers:** <span title="Deprecated">AI API key (legacy)</span>, <a href="/docs/settings/tool/tracking_codes" target="_blank" rel="noopener" title="Pass your tracker key in the request header">Web SDK Tracker</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>

        **API key permission required:** `ITEMS_SEARCH_SEARCH_READ`
      operationId: SearchVisualGetWithExplanation
      tags:
        - Visual Search
      security:
        - TrackerKey: []
        - JWT: []
      parameters:
        - $ref: "#/components/parameters/items-search-imageUrl"
        - $ref: "#/components/parameters/items-search-inPathIndexId"
        - $ref: "#/components/parameters/items-search-clientUUID"
        - $ref: "#/components/parameters/items-search-personalize"
        - $ref: "#/components/parameters/items-search-correlationId"
        - $ref: "#/components/parameters/items-search-searchId"
        - $ref: "#/components/parameters/items-search-sortByMetric"
        - $ref: "#/components/parameters/items-search-sortByGeoPoint"
        - $ref: "#/components/parameters/items-search-filterGeoPoints"
        - $ref: "#/components/parameters/items-search-filterAroundRadius"
        - $ref: "#/components/parameters/items-search-filterAnchor"
        - $ref: "#/components/parameters/items-search-filters"
        - $ref: "#/components/parameters/items-search-facets"
        - $ref: "#/components/parameters/items-search-facetsSize"
        - $ref: "#/components/parameters/items-search-maxValuesPerFacet"
        - $ref: "#/components/parameters/items-search-caseSensitiveFacetValues"
        - $ref: "#/components/parameters/items-search-displayAttributes"
        - $ref: "#/components/parameters/items-search-context"
        - $ref: "#/components/parameters/items-search-includeFacets"
        - $ref: "#/components/parameters/items-search-facetsOrderBy"
        - $ref: "#/components/parameters/items-search-paginationPage"
        - $ref: "#/components/parameters/items-search-paginationLimit"
        - $ref: "#/components/parameters/items-search-paginationSortBy"
        - $ref: "#/components/parameters/items-search-paginationOrdering"
        - $ref: "#/components/parameters/items-search-paginationIncludeMeta"
        - $ref: "#/components/parameters/items-search-ignoreQueryRules"
        - $ref: "#/components/parameters/items-search-excludeQueryRules"
        - $ref: "#/components/parameters/items-search-crossWorkspaceModeEnabled"
        - $ref: "#/components/parameters/items-search-params"
      responses:
        "200":
          description: Search response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/items-search-VisualSearchResponseWithExplanation"
        "500":
          description: Service not available
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/items-search-Error"
      x-snr-doc-urls:
        - /api-reference/ai-search#tag/Visual-Search/operation/SearchVisualGetWithExplanation
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.synerise.com/search/v2/indices/%7BindexId%7D/visual/explain?url=SOME_STRING_VALUE&clientUUID=SOME_STRING_VALUE&personalize=SOME_BOOLEAN_VALUE&correlationId=SOME_STRING_VALUE&searchId=SOME_STRING_VALUE&sortByMetric=SOME_STRING_VALUE&sortByGeoPoint=34.052235%2C-118.243685&filterGeoPoints=34.052235%2C-118.243685&filterGeoPoints=15.0%2C65.0&filterAroundRadius=5000&filterAnchor=0.2%2C0.8&filters=SOME_STRING_VALUE&facets=SOME_ARRAY_VALUE&facetsSize=SOME_INTEGER_VALUE&maxValuesPerFacet=SOME_INTEGER_VALUE&caseSensitiveFacetValues=SOME_BOOLEAN_VALUE&displayAttributes=title&displayAttributes=price&context=mobile&context=listing&includeFacets=SOME_STRING_VALUE&facetsOrderBy=SOME_STRING_VALUE&page=4&limit=10&sortBy=SOME_STRING_VALUE&ordering=SOME_STRING_VALUE&includeMeta=SOME_BOOLEAN_VALUE&ignoreQueryRules=SOME_BOOLEAN_VALUE&excludeQueryRules=2&excludeQueryRules=5&crossWorkspaceModeEnabled=SOME_BOOLEAN_VALUE&params=source%3Amobile' \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            headers = { 'Authorization': "Bearer REPLACE_BEARER_TOKEN" }

            conn.request("GET", "/search/v2/indices/%7BindexId%7D/visual/explain?url=SOME_STRING_VALUE&clientUUID=SOME_STRING_VALUE&personalize=SOME_BOOLEAN_VALUE&correlationId=SOME_STRING_VALUE&searchId=SOME_STRING_VALUE&sortByMetric=SOME_STRING_VALUE&sortByGeoPoint=34.052235%2C-118.243685&filterGeoPoints=34.052235%2C-118.243685&filterGeoPoints=15.0%2C65.0&filterAroundRadius=5000&filterAnchor=0.2%2C0.8&filters=SOME_STRING_VALUE&facets=SOME_ARRAY_VALUE&facetsSize=SOME_INTEGER_VALUE&maxValuesPerFacet=SOME_INTEGER_VALUE&caseSensitiveFacetValues=SOME_BOOLEAN_VALUE&displayAttributes=title&displayAttributes=price&context=mobile&context=listing&includeFacets=SOME_STRING_VALUE&facetsOrderBy=SOME_STRING_VALUE&page=4&limit=10&sortBy=SOME_STRING_VALUE&ordering=SOME_STRING_VALUE&includeMeta=SOME_BOOLEAN_VALUE&ignoreQueryRules=SOME_BOOLEAN_VALUE&excludeQueryRules=2&excludeQueryRules=5&crossWorkspaceModeEnabled=SOME_BOOLEAN_VALUE&params=source%3Amobile", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://api.synerise.com/search/v2/indices/%7BindexId%7D/visual/explain?url=SOME_STRING_VALUE&clientUUID=SOME_STRING_VALUE&personalize=SOME_BOOLEAN_VALUE&correlationId=SOME_STRING_VALUE&searchId=SOME_STRING_VALUE&sortByMetric=SOME_STRING_VALUE&sortByGeoPoint=34.052235%2C-118.243685&filterGeoPoints=34.052235%2C-118.243685&filterGeoPoints=15.0%2C65.0&filterAroundRadius=5000&filterAnchor=0.2%2C0.8&filters=SOME_STRING_VALUE&facets=SOME_ARRAY_VALUE&facetsSize=SOME_INTEGER_VALUE&maxValuesPerFacet=SOME_INTEGER_VALUE&caseSensitiveFacetValues=SOME_BOOLEAN_VALUE&displayAttributes=title&displayAttributes=price&context=mobile&context=listing&includeFacets=SOME_STRING_VALUE&facetsOrderBy=SOME_STRING_VALUE&page=4&limit=10&sortBy=SOME_STRING_VALUE&ordering=SOME_STRING_VALUE&includeMeta=SOME_BOOLEAN_VALUE&ignoreQueryRules=SOME_BOOLEAN_VALUE&excludeQueryRules=2&excludeQueryRules=5&crossWorkspaceModeEnabled=SOME_BOOLEAN_VALUE&params=source%3Amobile");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/search/v2/indices/%7BindexId%7D/visual/explain?url=SOME_STRING_VALUE&clientUUID=SOME_STRING_VALUE&personalize=SOME_BOOLEAN_VALUE&correlationId=SOME_STRING_VALUE&searchId=SOME_STRING_VALUE&sortByMetric=SOME_STRING_VALUE&sortByGeoPoint=34.052235%2C-118.243685&filterGeoPoints=34.052235%2C-118.243685&filterGeoPoints=15.0%2C65.0&filterAroundRadius=5000&filterAnchor=0.2%2C0.8&filters=SOME_STRING_VALUE&facets=SOME_ARRAY_VALUE&facetsSize=SOME_INTEGER_VALUE&maxValuesPerFacet=SOME_INTEGER_VALUE&caseSensitiveFacetValues=SOME_BOOLEAN_VALUE&displayAttributes=title&displayAttributes=price&context=mobile&context=listing&includeFacets=SOME_STRING_VALUE&facetsOrderBy=SOME_STRING_VALUE&page=4&limit=10&sortBy=SOME_STRING_VALUE&ordering=SOME_STRING_VALUE&includeMeta=SOME_BOOLEAN_VALUE&ignoreQueryRules=SOME_BOOLEAN_VALUE&excludeQueryRules=2&excludeQueryRules=5&crossWorkspaceModeEnabled=SOME_BOOLEAN_VALUE&params=source%3Amobile",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/search/v2/indices/%7BindexId%7D/visual/explain');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'url' => 'SOME_STRING_VALUE',
              'clientUUID' => 'SOME_STRING_VALUE',
              'personalize' => 'SOME_BOOLEAN_VALUE',
              'correlationId' => 'SOME_STRING_VALUE',
              'searchId' => 'SOME_STRING_VALUE',
              'sortByMetric' => 'SOME_STRING_VALUE',
              'sortByGeoPoint' => '34.052235,-118.243685',
              'filterGeoPoints' => [
                '34.052235,-118.243685',
                '15.0,65.0'
              ],
              'filterAroundRadius' => '5000',
              'filterAnchor' => '0.2,0.8',
              'filters' => 'SOME_STRING_VALUE',
              'facets' => 'SOME_ARRAY_VALUE',
              'facetsSize' => 'SOME_INTEGER_VALUE',
              'maxValuesPerFacet' => 'SOME_INTEGER_VALUE',
              'caseSensitiveFacetValues' => 'SOME_BOOLEAN_VALUE',
              'displayAttributes' => [
                'title',
                'price'
              ],
              'context' => [
                'mobile',
                'listing'
              ],
              'includeFacets' => 'SOME_STRING_VALUE',
              'facetsOrderBy' => 'SOME_STRING_VALUE',
              'page' => '4',
              'limit' => '10',
              'sortBy' => 'SOME_STRING_VALUE',
              'ordering' => 'SOME_STRING_VALUE',
              'includeMeta' => 'SOME_BOOLEAN_VALUE',
              'ignoreQueryRules' => 'SOME_BOOLEAN_VALUE',
              'excludeQueryRules' => [
                '2',
                '5'
              ],
              'crossWorkspaceModeEnabled' => 'SOME_BOOLEAN_VALUE',
              'params' => 'source:mobile'
            ]);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.get("https://api.synerise.com/search/v2/indices/%7BindexId%7D/visual/explain?url=SOME_STRING_VALUE&clientUUID=SOME_STRING_VALUE&personalize=SOME_BOOLEAN_VALUE&correlationId=SOME_STRING_VALUE&searchId=SOME_STRING_VALUE&sortByMetric=SOME_STRING_VALUE&sortByGeoPoint=34.052235%2C-118.243685&filterGeoPoints=34.052235%2C-118.243685&filterGeoPoints=15.0%2C65.0&filterAroundRadius=5000&filterAnchor=0.2%2C0.8&filters=SOME_STRING_VALUE&facets=SOME_ARRAY_VALUE&facetsSize=SOME_INTEGER_VALUE&maxValuesPerFacet=SOME_INTEGER_VALUE&caseSensitiveFacetValues=SOME_BOOLEAN_VALUE&displayAttributes=title&displayAttributes=price&context=mobile&context=listing&includeFacets=SOME_STRING_VALUE&facetsOrderBy=SOME_STRING_VALUE&page=4&limit=10&sortBy=SOME_STRING_VALUE&ordering=SOME_STRING_VALUE&includeMeta=SOME_BOOLEAN_VALUE&ignoreQueryRules=SOME_BOOLEAN_VALUE&excludeQueryRules=2&excludeQueryRules=5&crossWorkspaceModeEnabled=SOME_BOOLEAN_VALUE&params=source%3Amobile")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
    post:
      summary: Explained visual items search
      description: |
        Retrieves items that match an image. The results can be filtered and sorted. The response contains an explanation of the factors that influenced the result.

        ---

        **API consumers:** <span title="Deprecated">AI API key (legacy)</span>, <a href="/docs/settings/tool/tracking_codes" target="_blank" rel="noopener" title="Pass your tracker key in the request header">Web SDK Tracker</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>

        **API key permission required:** `ITEMS_SEARCH_SEARCH_READ`
      operationId: SearchVisualPostWithExplanation
      tags:
        - Visual Search
      security:
        - TrackerKey: []
        - JWT: []
      parameters:
        - $ref: "#/components/parameters/items-search-inPathIndexId"
      requestBody:
        description: Request for performing visual search with explanation
        required: true
        content:
          application/json:
            schema:
              allOf:
                - $ref: "#/components/schemas/items-search-VisualSearchRequest"
                - type: object
                  properties:
                    crossWorkspaceMode:
                      $ref: "#/components/schemas/items-search-CrossWorkspaceMode"
      responses:
        "200":
          description: Search response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/items-search-VisualSearchResponseWithExplanation"
        "500":
          description: Service not available
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/items-search-Error"
      x-snr-doc-urls:
        - /api-reference/ai-search#tag/Visual-Search/operation/SearchVisualPostWithExplanation
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/search/v2/indices/%7BindexId%7D/visual/explain \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"url":"string","page":0,"limit":10,"sortBy":"string","ordering":"desc","includeMeta":true,"clientUUID":"string","personalize":true,"correlationId":"string","searchId":"string","sortByMetric":"TransactionsPopularity","sortByGeoPoints":"34.052235,-118.243685","filterGeoPoints":["34.052235,-118.243685","15.0,65.0"],"filterAroundRadius":2000,"filterAnchor":"0.2,0.8","filters":"string","facets":["string"],"customFilteredFacets":{"brand":"price > 100","price":"brand == foo"},"facetsSize":2000,"maxValuesPerFacet":50,"caseSensitiveFacetValues":false,"includeFacets":"all","facetsOrderBy":"coverage","context":["mobile","listing"],"displayAttributes":["title","price"],"ignoreQueryRules":false,"excludeQueryRules":[2,5],"params":{"source":"mobile"},"crossWorkspaceMode":{"enabled":true}}'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            payload = "{\"url\":\"string\",\"page\":0,\"limit\":10,\"sortBy\":\"string\",\"ordering\":\"desc\",\"includeMeta\":true,\"clientUUID\":\"string\",\"personalize\":true,\"correlationId\":\"string\",\"searchId\":\"string\",\"sortByMetric\":\"TransactionsPopularity\",\"sortByGeoPoints\":\"34.052235,-118.243685\",\"filterGeoPoints\":[\"34.052235,-118.243685\",\"15.0,65.0\"],\"filterAroundRadius\":2000,\"filterAnchor\":\"0.2,0.8\",\"filters\":\"string\",\"facets\":[\"string\"],\"customFilteredFacets\":{\"brand\":\"price > 100\",\"price\":\"brand == foo\"},\"facetsSize\":2000,\"maxValuesPerFacet\":50,\"caseSensitiveFacetValues\":false,\"includeFacets\":\"all\",\"facetsOrderBy\":\"coverage\",\"context\":[\"mobile\",\"listing\"],\"displayAttributes\":[\"title\",\"price\"],\"ignoreQueryRules\":false,\"excludeQueryRules\":[2,5],\"params\":{\"source\":\"mobile\"},\"crossWorkspaceMode\":{\"enabled\":true}}"

            headers = {
                'Authorization': "Bearer REPLACE_BEARER_TOKEN",
                'content-type': "application/json"
                }

            conn.request("POST", "/search/v2/indices/%7BindexId%7D/visual/explain", payload, headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "url": "string",
              "page": 0,
              "limit": 10,
              "sortBy": "string",
              "ordering": "desc",
              "includeMeta": true,
              "clientUUID": "string",
              "personalize": true,
              "correlationId": "string",
              "searchId": "string",
              "sortByMetric": "TransactionsPopularity",
              "sortByGeoPoints": "34.052235,-118.243685",
              "filterGeoPoints": [
                "34.052235,-118.243685",
                "15.0,65.0"
              ],
              "filterAroundRadius": 2000,
              "filterAnchor": "0.2,0.8",
              "filters": "string",
              "facets": [
                "string"
              ],
              "customFilteredFacets": {
                "brand": "price > 100",
                "price": "brand == foo"
              },
              "facetsSize": 2000,
              "maxValuesPerFacet": 50,
              "caseSensitiveFacetValues": false,
              "includeFacets": "all",
              "facetsOrderBy": "coverage",
              "context": [
                "mobile",
                "listing"
              ],
              "displayAttributes": [
                "title",
                "price"
              ],
              "ignoreQueryRules": false,
              "excludeQueryRules": [
                2,
                5
              ],
              "params": {
                "source": "mobile"
              },
              "crossWorkspaceMode": {
                "enabled": true
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://api.synerise.com/search/v2/indices/%7BindexId%7D/visual/explain");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/search/v2/indices/%7BindexId%7D/visual/explain",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              url: 'string',
              page: 0,
              limit: 10,
              sortBy: 'string',
              ordering: 'desc',
              includeMeta: true,
              clientUUID: 'string',
              personalize: true,
              correlationId: 'string',
              searchId: 'string',
              sortByMetric: 'TransactionsPopularity',
              sortByGeoPoints: '34.052235,-118.243685',
              filterGeoPoints: ['34.052235,-118.243685', '15.0,65.0'],
              filterAroundRadius: 2000,
              filterAnchor: '0.2,0.8',
              filters: 'string',
              facets: ['string'],
              customFilteredFacets: {brand: 'price > 100', price: 'brand == foo'},
              facetsSize: 2000,
              maxValuesPerFacet: 50,
              caseSensitiveFacetValues: false,
              includeFacets: 'all',
              facetsOrderBy: 'coverage',
              context: ['mobile', 'listing'],
              displayAttributes: ['title', 'price'],
              ignoreQueryRules: false,
              excludeQueryRules: [2, 5],
              params: {source: 'mobile'},
              crossWorkspaceMode: {enabled: true}
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/search/v2/indices/%7BindexId%7D/visual/explain');
            $request->setMethod(HTTP_METH_POST);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN',
              'content-type' => 'application/json'
            ]);

            $request->setBody('{"url":"string","page":0,"limit":10,"sortBy":"string","ordering":"desc","includeMeta":true,"clientUUID":"string","personalize":true,"correlationId":"string","searchId":"string","sortByMetric":"TransactionsPopularity","sortByGeoPoints":"34.052235,-118.243685","filterGeoPoints":["34.052235,-118.243685","15.0,65.0"],"filterAroundRadius":2000,"filterAnchor":"0.2,0.8","filters":"string","facets":["string"],"customFilteredFacets":{"brand":"price > 100","price":"brand == foo"},"facetsSize":2000,"maxValuesPerFacet":50,"caseSensitiveFacetValues":false,"includeFacets":"all","facetsOrderBy":"coverage","context":["mobile","listing"],"displayAttributes":["title","price"],"ignoreQueryRules":false,"excludeQueryRules":[2,5],"params":{"source":"mobile"},"crossWorkspaceMode":{"enabled":true}}');

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.post("https://api.synerise.com/search/v2/indices/%7BindexId%7D/visual/explain")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"url\":\"string\",\"page\":0,\"limit\":10,\"sortBy\":\"string\",\"ordering\":\"desc\",\"includeMeta\":true,\"clientUUID\":\"string\",\"personalize\":true,\"correlationId\":\"string\",\"searchId\":\"string\",\"sortByMetric\":\"TransactionsPopularity\",\"sortByGeoPoints\":\"34.052235,-118.243685\",\"filterGeoPoints\":[\"34.052235,-118.243685\",\"15.0,65.0\"],\"filterAroundRadius\":2000,\"filterAnchor\":\"0.2,0.8\",\"filters\":\"string\",\"facets\":[\"string\"],\"customFilteredFacets\":{\"brand\":\"price > 100\",\"price\":\"brand == foo\"},\"facetsSize\":2000,\"maxValuesPerFacet\":50,\"caseSensitiveFacetValues\":false,\"includeFacets\":\"all\",\"facetsOrderBy\":\"coverage\",\"context\":[\"mobile\",\"listing\"],\"displayAttributes\":[\"title\",\"price\"],\"ignoreQueryRules\":false,\"excludeQueryRules\":[2,5],\"params\":{\"source\":\"mobile\"},\"crossWorkspaceMode\":{\"enabled\":true}}")
              .asString();
  /search/v2/indices/{indexId}/query:
    get:
      summary: Full-text items search
      description: |
        Retrieves items that match a full-text query from a search index or a suggestion index. The results can be filtered and sorted.

        ---

        **API consumers:** <span title="Deprecated">AI API key (legacy)</span>, <a href="/docs/settings/tool/tracking_codes" target="_blank" rel="noopener" title="Pass your tracker key in the request header">Web SDK Tracker</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>

        **API key permission required:** `ITEMS_SEARCH_SEARCH_READ`
      operationId: SearchFullTextGet
      tags:
        - Search
      security:
        - TrackerKey: []
        - JWT: []
      parameters:
        - $ref: "#/components/parameters/items-search-searchQuery"
        - $ref: "#/components/parameters/items-search-inPathIndexId"
        - $ref: "#/components/parameters/items-search-clientUUID"
        - $ref: "#/components/parameters/items-search-personalize"
        - $ref: "#/components/parameters/items-search-correlationId"
        - $ref: "#/components/parameters/items-search-searchId"
        - $ref: "#/components/parameters/items-search-sortByMetric"
        - $ref: "#/components/parameters/items-search-sortByGeoPoint"
        - $ref: "#/components/parameters/items-search-filterGeoPoints"
        - $ref: "#/components/parameters/items-search-filterAroundRadius"
        - $ref: "#/components/parameters/items-search-filters"
        - $ref: "#/components/parameters/items-search-facets"
        - $ref: "#/components/parameters/items-search-facetsSize"
        - $ref: "#/components/parameters/items-search-maxValuesPerFacet"
        - $ref: "#/components/parameters/items-search-caseSensitiveFacetValues"
        - $ref: "#/components/parameters/items-search-displayAttributes"
        - $ref: "#/components/parameters/items-search-context"
        - $ref: "#/components/parameters/items-search-includeFacets"
        - $ref: "#/components/parameters/items-search-facetsOrderBy"
        - $ref: "#/components/parameters/items-search-paginationPage"
        - $ref: "#/components/parameters/items-search-paginationLimit"
        - $ref: "#/components/parameters/items-search-paginationSortBy"
        - $ref: "#/components/parameters/items-search-paginationOrdering"
        - $ref: "#/components/parameters/items-search-paginationIncludeMeta"
        - $ref: "#/components/parameters/items-search-distinctFilter"
        - $ref: "#/components/parameters/items-search-ignoreQueryRules"
        - $ref: "#/components/parameters/items-search-excludeQueryRules"
        - $ref: "#/components/parameters/items-search-disableQueryClassification"
        - $ref: "#/components/parameters/items-search-disableDynamicReranker"
        - $ref: "#/components/parameters/items-search-params"
      responses:
        "200":
          $ref: "#/components/responses/items-search-FullTextSearchResponse200"
        "500":
          description: Service not available
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/items-search-Error"
      x-snr-doc-urls:
        - /api-reference/ai-search#tag/Search/operation/SearchFullTextGet
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.synerise.com/search/v2/indices/%7BindexId%7D/query?query=SOME_STRING_VALUE&clientUUID=SOME_STRING_VALUE&personalize=SOME_BOOLEAN_VALUE&correlationId=SOME_STRING_VALUE&searchId=SOME_STRING_VALUE&sortByMetric=SOME_STRING_VALUE&sortByGeoPoint=34.052235%2C-118.243685&filterGeoPoints=34.052235%2C-118.243685&filterGeoPoints=15.0%2C65.0&filterAroundRadius=5000&filters=SOME_STRING_VALUE&facets=SOME_ARRAY_VALUE&facetsSize=SOME_INTEGER_VALUE&maxValuesPerFacet=SOME_INTEGER_VALUE&caseSensitiveFacetValues=SOME_BOOLEAN_VALUE&displayAttributes=title&displayAttributes=price&context=mobile&context=listing&includeFacets=SOME_STRING_VALUE&facetsOrderBy=SOME_STRING_VALUE&page=4&limit=10&sortBy=SOME_STRING_VALUE&ordering=SOME_STRING_VALUE&includeMeta=SOME_BOOLEAN_VALUE&distinctFilter=%7B%22attribute%22%3A%20%22color%22%2C%20%22maxNumItems%22%3A%203%7D&ignoreQueryRules=SOME_BOOLEAN_VALUE&excludeQueryRules=2&excludeQueryRules=5&disableQueryClassification=SOME_BOOLEAN_VALUE&disableDynamicReranker=SOME_BOOLEAN_VALUE&params=source%3Amobile' \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            headers = { 'Authorization': "Bearer REPLACE_BEARER_TOKEN" }

            conn.request("GET", "/search/v2/indices/%7BindexId%7D/query?query=SOME_STRING_VALUE&clientUUID=SOME_STRING_VALUE&personalize=SOME_BOOLEAN_VALUE&correlationId=SOME_STRING_VALUE&searchId=SOME_STRING_VALUE&sortByMetric=SOME_STRING_VALUE&sortByGeoPoint=34.052235%2C-118.243685&filterGeoPoints=34.052235%2C-118.243685&filterGeoPoints=15.0%2C65.0&filterAroundRadius=5000&filters=SOME_STRING_VALUE&facets=SOME_ARRAY_VALUE&facetsSize=SOME_INTEGER_VALUE&maxValuesPerFacet=SOME_INTEGER_VALUE&caseSensitiveFacetValues=SOME_BOOLEAN_VALUE&displayAttributes=title&displayAttributes=price&context=mobile&context=listing&includeFacets=SOME_STRING_VALUE&facetsOrderBy=SOME_STRING_VALUE&page=4&limit=10&sortBy=SOME_STRING_VALUE&ordering=SOME_STRING_VALUE&includeMeta=SOME_BOOLEAN_VALUE&distinctFilter=%7B%22attribute%22%3A%20%22color%22%2C%20%22maxNumItems%22%3A%203%7D&ignoreQueryRules=SOME_BOOLEAN_VALUE&excludeQueryRules=2&excludeQueryRules=5&disableQueryClassification=SOME_BOOLEAN_VALUE&disableDynamicReranker=SOME_BOOLEAN_VALUE&params=source%3Amobile", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://api.synerise.com/search/v2/indices/%7BindexId%7D/query?query=SOME_STRING_VALUE&clientUUID=SOME_STRING_VALUE&personalize=SOME_BOOLEAN_VALUE&correlationId=SOME_STRING_VALUE&searchId=SOME_STRING_VALUE&sortByMetric=SOME_STRING_VALUE&sortByGeoPoint=34.052235%2C-118.243685&filterGeoPoints=34.052235%2C-118.243685&filterGeoPoints=15.0%2C65.0&filterAroundRadius=5000&filters=SOME_STRING_VALUE&facets=SOME_ARRAY_VALUE&facetsSize=SOME_INTEGER_VALUE&maxValuesPerFacet=SOME_INTEGER_VALUE&caseSensitiveFacetValues=SOME_BOOLEAN_VALUE&displayAttributes=title&displayAttributes=price&context=mobile&context=listing&includeFacets=SOME_STRING_VALUE&facetsOrderBy=SOME_STRING_VALUE&page=4&limit=10&sortBy=SOME_STRING_VALUE&ordering=SOME_STRING_VALUE&includeMeta=SOME_BOOLEAN_VALUE&distinctFilter=%7B%22attribute%22%3A%20%22color%22%2C%20%22maxNumItems%22%3A%203%7D&ignoreQueryRules=SOME_BOOLEAN_VALUE&excludeQueryRules=2&excludeQueryRules=5&disableQueryClassification=SOME_BOOLEAN_VALUE&disableDynamicReranker=SOME_BOOLEAN_VALUE&params=source%3Amobile");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/search/v2/indices/%7BindexId%7D/query?query=SOME_STRING_VALUE&clientUUID=SOME_STRING_VALUE&personalize=SOME_BOOLEAN_VALUE&correlationId=SOME_STRING_VALUE&searchId=SOME_STRING_VALUE&sortByMetric=SOME_STRING_VALUE&sortByGeoPoint=34.052235%2C-118.243685&filterGeoPoints=34.052235%2C-118.243685&filterGeoPoints=15.0%2C65.0&filterAroundRadius=5000&filters=SOME_STRING_VALUE&facets=SOME_ARRAY_VALUE&facetsSize=SOME_INTEGER_VALUE&maxValuesPerFacet=SOME_INTEGER_VALUE&caseSensitiveFacetValues=SOME_BOOLEAN_VALUE&displayAttributes=title&displayAttributes=price&context=mobile&context=listing&includeFacets=SOME_STRING_VALUE&facetsOrderBy=SOME_STRING_VALUE&page=4&limit=10&sortBy=SOME_STRING_VALUE&ordering=SOME_STRING_VALUE&includeMeta=SOME_BOOLEAN_VALUE&distinctFilter=%7B%22attribute%22%3A%20%22color%22%2C%20%22maxNumItems%22%3A%203%7D&ignoreQueryRules=SOME_BOOLEAN_VALUE&excludeQueryRules=2&excludeQueryRules=5&disableQueryClassification=SOME_BOOLEAN_VALUE&disableDynamicReranker=SOME_BOOLEAN_VALUE&params=source%3Amobile",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/search/v2/indices/%7BindexId%7D/query');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'query' => 'SOME_STRING_VALUE',
              'clientUUID' => 'SOME_STRING_VALUE',
              'personalize' => 'SOME_BOOLEAN_VALUE',
              'correlationId' => 'SOME_STRING_VALUE',
              'searchId' => 'SOME_STRING_VALUE',
              'sortByMetric' => 'SOME_STRING_VALUE',
              'sortByGeoPoint' => '34.052235,-118.243685',
              'filterGeoPoints' => [
                '34.052235,-118.243685',
                '15.0,65.0'
              ],
              'filterAroundRadius' => '5000',
              'filters' => 'SOME_STRING_VALUE',
              'facets' => 'SOME_ARRAY_VALUE',
              'facetsSize' => 'SOME_INTEGER_VALUE',
              'maxValuesPerFacet' => 'SOME_INTEGER_VALUE',
              'caseSensitiveFacetValues' => 'SOME_BOOLEAN_VALUE',
              'displayAttributes' => [
                'title',
                'price'
              ],
              'context' => [
                'mobile',
                'listing'
              ],
              'includeFacets' => 'SOME_STRING_VALUE',
              'facetsOrderBy' => 'SOME_STRING_VALUE',
              'page' => '4',
              'limit' => '10',
              'sortBy' => 'SOME_STRING_VALUE',
              'ordering' => 'SOME_STRING_VALUE',
              'includeMeta' => 'SOME_BOOLEAN_VALUE',
              'distinctFilter' => '{"attribute": "color", "maxNumItems": 3}',
              'ignoreQueryRules' => 'SOME_BOOLEAN_VALUE',
              'excludeQueryRules' => [
                '2',
                '5'
              ],
              'disableQueryClassification' => 'SOME_BOOLEAN_VALUE',
              'disableDynamicReranker' => 'SOME_BOOLEAN_VALUE',
              'params' => 'source:mobile'
            ]);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.get("https://api.synerise.com/search/v2/indices/%7BindexId%7D/query?query=SOME_STRING_VALUE&clientUUID=SOME_STRING_VALUE&personalize=SOME_BOOLEAN_VALUE&correlationId=SOME_STRING_VALUE&searchId=SOME_STRING_VALUE&sortByMetric=SOME_STRING_VALUE&sortByGeoPoint=34.052235%2C-118.243685&filterGeoPoints=34.052235%2C-118.243685&filterGeoPoints=15.0%2C65.0&filterAroundRadius=5000&filters=SOME_STRING_VALUE&facets=SOME_ARRAY_VALUE&facetsSize=SOME_INTEGER_VALUE&maxValuesPerFacet=SOME_INTEGER_VALUE&caseSensitiveFacetValues=SOME_BOOLEAN_VALUE&displayAttributes=title&displayAttributes=price&context=mobile&context=listing&includeFacets=SOME_STRING_VALUE&facetsOrderBy=SOME_STRING_VALUE&page=4&limit=10&sortBy=SOME_STRING_VALUE&ordering=SOME_STRING_VALUE&includeMeta=SOME_BOOLEAN_VALUE&distinctFilter=%7B%22attribute%22%3A%20%22color%22%2C%20%22maxNumItems%22%3A%203%7D&ignoreQueryRules=SOME_BOOLEAN_VALUE&excludeQueryRules=2&excludeQueryRules=5&disableQueryClassification=SOME_BOOLEAN_VALUE&disableDynamicReranker=SOME_BOOLEAN_VALUE&params=source%3Amobile")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
    post:
      summary: Full-text items search
      description: |
        Retrieves items that match a full-text query from a search index or a suggestion index. The results can be filtered and sorted.

        ---

        **API consumers:** <span title="Deprecated">AI API key (legacy)</span>, <a href="/docs/settings/tool/tracking_codes" target="_blank" rel="noopener" title="Pass your tracker key in the request header">Web SDK Tracker</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>

        **API key permission required:** `ITEMS_SEARCH_SEARCH_READ`
      operationId: SearchFullTextPost
      tags:
        - Search
      security:
        - TrackerKey: []
        - JWT: []
      parameters:
        - $ref: "#/components/parameters/items-search-inPathIndexId"
      requestBody:
        description: Request for performing full-text search
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/items-search-FullTextSearchRequest"
      responses:
        "200":
          $ref: "#/components/responses/items-search-FullTextSearchResponse200"
        "500":
          description: Service not available
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/items-search-Error"
      x-snr-doc-urls:
        - /api-reference/ai-search#tag/Search/operation/SearchFullTextPost
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/search/v2/indices/%7BindexId%7D/query \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"query":"string","page":0,"limit":10,"sortBy":"string","ordering":"desc","includeMeta":true,"clientUUID":"string","personalize":true,"correlationId":"string","searchId":"string","sortByMetric":"TransactionsPopularity","sortByGeoPoints":"34.052235,-118.243685","filterGeoPoints":["34.052235,-118.243685","15.0,65.0"],"filterAroundRadius":2000,"filters":"string","facets":["string"],"customFilteredFacets":{"brand":"price > 100","price":"brand == foo"},"facetsSize":2000,"maxValuesPerFacet":50,"caseSensitiveFacetValues":false,"includeFacets":"all","facetsOrderBy":"coverage","context":["mobile","listing"],"displayAttributes":["title","price"],"distinctFilter":{"attribute":"string","maxNumItems":1,"levelRangeModifier":0},"ignoreQueryRules":false,"excludeQueryRules":[2,5],"params":{"source":"mobile"},"disableQueryClassification":false,"disableDynamicReranker":false}'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            payload = "{\"query\":\"string\",\"page\":0,\"limit\":10,\"sortBy\":\"string\",\"ordering\":\"desc\",\"includeMeta\":true,\"clientUUID\":\"string\",\"personalize\":true,\"correlationId\":\"string\",\"searchId\":\"string\",\"sortByMetric\":\"TransactionsPopularity\",\"sortByGeoPoints\":\"34.052235,-118.243685\",\"filterGeoPoints\":[\"34.052235,-118.243685\",\"15.0,65.0\"],\"filterAroundRadius\":2000,\"filters\":\"string\",\"facets\":[\"string\"],\"customFilteredFacets\":{\"brand\":\"price > 100\",\"price\":\"brand == foo\"},\"facetsSize\":2000,\"maxValuesPerFacet\":50,\"caseSensitiveFacetValues\":false,\"includeFacets\":\"all\",\"facetsOrderBy\":\"coverage\",\"context\":[\"mobile\",\"listing\"],\"displayAttributes\":[\"title\",\"price\"],\"distinctFilter\":{\"attribute\":\"string\",\"maxNumItems\":1,\"levelRangeModifier\":0},\"ignoreQueryRules\":false,\"excludeQueryRules\":[2,5],\"params\":{\"source\":\"mobile\"},\"disableQueryClassification\":false,\"disableDynamicReranker\":false}"

            headers = {
                'Authorization': "Bearer REPLACE_BEARER_TOKEN",
                'content-type': "application/json"
                }

            conn.request("POST", "/search/v2/indices/%7BindexId%7D/query", payload, headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "query": "string",
              "page": 0,
              "limit": 10,
              "sortBy": "string",
              "ordering": "desc",
              "includeMeta": true,
              "clientUUID": "string",
              "personalize": true,
              "correlationId": "string",
              "searchId": "string",
              "sortByMetric": "TransactionsPopularity",
              "sortByGeoPoints": "34.052235,-118.243685",
              "filterGeoPoints": [
                "34.052235,-118.243685",
                "15.0,65.0"
              ],
              "filterAroundRadius": 2000,
              "filters": "string",
              "facets": [
                "string"
              ],
              "customFilteredFacets": {
                "brand": "price > 100",
                "price": "brand == foo"
              },
              "facetsSize": 2000,
              "maxValuesPerFacet": 50,
              "caseSensitiveFacetValues": false,
              "includeFacets": "all",
              "facetsOrderBy": "coverage",
              "context": [
                "mobile",
                "listing"
              ],
              "displayAttributes": [
                "title",
                "price"
              ],
              "distinctFilter": {
                "attribute": "string",
                "maxNumItems": 1,
                "levelRangeModifier": 0
              },
              "ignoreQueryRules": false,
              "excludeQueryRules": [
                2,
                5
              ],
              "params": {
                "source": "mobile"
              },
              "disableQueryClassification": false,
              "disableDynamicReranker": false
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://api.synerise.com/search/v2/indices/%7BindexId%7D/query");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/search/v2/indices/%7BindexId%7D/query",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              query: 'string',
              page: 0,
              limit: 10,
              sortBy: 'string',
              ordering: 'desc',
              includeMeta: true,
              clientUUID: 'string',
              personalize: true,
              correlationId: 'string',
              searchId: 'string',
              sortByMetric: 'TransactionsPopularity',
              sortByGeoPoints: '34.052235,-118.243685',
              filterGeoPoints: ['34.052235,-118.243685', '15.0,65.0'],
              filterAroundRadius: 2000,
              filters: 'string',
              facets: ['string'],
              customFilteredFacets: {brand: 'price > 100', price: 'brand == foo'},
              facetsSize: 2000,
              maxValuesPerFacet: 50,
              caseSensitiveFacetValues: false,
              includeFacets: 'all',
              facetsOrderBy: 'coverage',
              context: ['mobile', 'listing'],
              displayAttributes: ['title', 'price'],
              distinctFilter: {attribute: 'string', maxNumItems: 1, levelRangeModifier: 0},
              ignoreQueryRules: false,
              excludeQueryRules: [2, 5],
              params: {source: 'mobile'},
              disableQueryClassification: false,
              disableDynamicReranker: false
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/search/v2/indices/%7BindexId%7D/query');
            $request->setMethod(HTTP_METH_POST);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN',
              'content-type' => 'application/json'
            ]);

            $request->setBody('{"query":"string","page":0,"limit":10,"sortBy":"string","ordering":"desc","includeMeta":true,"clientUUID":"string","personalize":true,"correlationId":"string","searchId":"string","sortByMetric":"TransactionsPopularity","sortByGeoPoints":"34.052235,-118.243685","filterGeoPoints":["34.052235,-118.243685","15.0,65.0"],"filterAroundRadius":2000,"filters":"string","facets":["string"],"customFilteredFacets":{"brand":"price > 100","price":"brand == foo"},"facetsSize":2000,"maxValuesPerFacet":50,"caseSensitiveFacetValues":false,"includeFacets":"all","facetsOrderBy":"coverage","context":["mobile","listing"],"displayAttributes":["title","price"],"distinctFilter":{"attribute":"string","maxNumItems":1,"levelRangeModifier":0},"ignoreQueryRules":false,"excludeQueryRules":[2,5],"params":{"source":"mobile"},"disableQueryClassification":false,"disableDynamicReranker":false}');

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.post("https://api.synerise.com/search/v2/indices/%7BindexId%7D/query")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"query\":\"string\",\"page\":0,\"limit\":10,\"sortBy\":\"string\",\"ordering\":\"desc\",\"includeMeta\":true,\"clientUUID\":\"string\",\"personalize\":true,\"correlationId\":\"string\",\"searchId\":\"string\",\"sortByMetric\":\"TransactionsPopularity\",\"sortByGeoPoints\":\"34.052235,-118.243685\",\"filterGeoPoints\":[\"34.052235,-118.243685\",\"15.0,65.0\"],\"filterAroundRadius\":2000,\"filters\":\"string\",\"facets\":[\"string\"],\"customFilteredFacets\":{\"brand\":\"price > 100\",\"price\":\"brand == foo\"},\"facetsSize\":2000,\"maxValuesPerFacet\":50,\"caseSensitiveFacetValues\":false,\"includeFacets\":\"all\",\"facetsOrderBy\":\"coverage\",\"context\":[\"mobile\",\"listing\"],\"displayAttributes\":[\"title\",\"price\"],\"distinctFilter\":{\"attribute\":\"string\",\"maxNumItems\":1,\"levelRangeModifier\":0},\"ignoreQueryRules\":false,\"excludeQueryRules\":[2,5],\"params\":{\"source\":\"mobile\"},\"disableQueryClassification\":false,\"disableDynamicReranker\":false}")
              .asString();
  /search/v2/indices/{indexId}/query/explain:
    get:
      summary: Explained full-text items search
      description: |
        Retrieves items that match a full-text query from a search index or a suggestion index. The results can be filtered and sorted.  The response contains an explanation of the factors that influenced the result.

        ---

        **API consumers:** <span title="Deprecated">AI API key (legacy)</span>, <a href="/docs/settings/tool/tracking_codes" target="_blank" rel="noopener" title="Pass your tracker key in the request header">Web SDK Tracker</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>

        **API key permission required:** `ITEMS_SEARCH_SEARCH_READ`
      operationId: SearchFullTextGetWithExplanation
      tags:
        - Search
      security:
        - TrackerKey: []
        - JWT: []
      parameters:
        - $ref: "#/components/parameters/items-search-searchQuery"
        - $ref: "#/components/parameters/items-search-inPathIndexId"
        - $ref: "#/components/parameters/items-search-clientUUID"
        - $ref: "#/components/parameters/items-search-personalize"
        - $ref: "#/components/parameters/items-search-correlationId"
        - $ref: "#/components/parameters/items-search-searchId"
        - $ref: "#/components/parameters/items-search-sortByMetric"
        - $ref: "#/components/parameters/items-search-sortByGeoPoint"
        - $ref: "#/components/parameters/items-search-filterGeoPoints"
        - $ref: "#/components/parameters/items-search-filterAroundRadius"
        - $ref: "#/components/parameters/items-search-filters"
        - $ref: "#/components/parameters/items-search-facets"
        - $ref: "#/components/parameters/items-search-facetsSize"
        - $ref: "#/components/parameters/items-search-maxValuesPerFacet"
        - $ref: "#/components/parameters/items-search-caseSensitiveFacetValues"
        - $ref: "#/components/parameters/items-search-displayAttributes"
        - $ref: "#/components/parameters/items-search-context"
        - $ref: "#/components/parameters/items-search-includeFacets"
        - $ref: "#/components/parameters/items-search-facetsOrderBy"
        - $ref: "#/components/parameters/items-search-paginationPage"
        - $ref: "#/components/parameters/items-search-paginationLimit"
        - $ref: "#/components/parameters/items-search-paginationSortBy"
        - $ref: "#/components/parameters/items-search-paginationOrdering"
        - $ref: "#/components/parameters/items-search-paginationIncludeMeta"
        - $ref: "#/components/parameters/items-search-distinctFilter"
        - $ref: "#/components/parameters/items-search-ignoreQueryRules"
        - $ref: "#/components/parameters/items-search-disableQueryClassification"
        - $ref: "#/components/parameters/items-search-disableDynamicReranker"
        - $ref: "#/components/parameters/items-search-excludeQueryRules"
        - $ref: "#/components/parameters/items-search-crossWorkspaceModeEnabled"
        - $ref: "#/components/parameters/items-search-params"
      responses:
        "200":
          $ref: "#/components/responses/items-search-FullTextSearchResponse200WithExplanation"
        "500":
          description: Service not available
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/items-search-Error"
      x-snr-doc-urls:
        - /api-reference/ai-search#tag/Search/operation/SearchFullTextGetWithExplanation
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.synerise.com/search/v2/indices/%7BindexId%7D/query/explain?query=SOME_STRING_VALUE&clientUUID=SOME_STRING_VALUE&personalize=SOME_BOOLEAN_VALUE&correlationId=SOME_STRING_VALUE&searchId=SOME_STRING_VALUE&sortByMetric=SOME_STRING_VALUE&sortByGeoPoint=34.052235%2C-118.243685&filterGeoPoints=34.052235%2C-118.243685&filterGeoPoints=15.0%2C65.0&filterAroundRadius=5000&filters=SOME_STRING_VALUE&facets=SOME_ARRAY_VALUE&facetsSize=SOME_INTEGER_VALUE&maxValuesPerFacet=SOME_INTEGER_VALUE&caseSensitiveFacetValues=SOME_BOOLEAN_VALUE&displayAttributes=title&displayAttributes=price&context=mobile&context=listing&includeFacets=SOME_STRING_VALUE&facetsOrderBy=SOME_STRING_VALUE&page=4&limit=10&sortBy=SOME_STRING_VALUE&ordering=SOME_STRING_VALUE&includeMeta=SOME_BOOLEAN_VALUE&distinctFilter=%7B%22attribute%22%3A%20%22color%22%2C%20%22maxNumItems%22%3A%203%7D&ignoreQueryRules=SOME_BOOLEAN_VALUE&disableQueryClassification=SOME_BOOLEAN_VALUE&disableDynamicReranker=SOME_BOOLEAN_VALUE&excludeQueryRules=2&excludeQueryRules=5&crossWorkspaceModeEnabled=SOME_BOOLEAN_VALUE&params=source%3Amobile' \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            headers = { 'Authorization': "Bearer REPLACE_BEARER_TOKEN" }

            conn.request("GET", "/search/v2/indices/%7BindexId%7D/query/explain?query=SOME_STRING_VALUE&clientUUID=SOME_STRING_VALUE&personalize=SOME_BOOLEAN_VALUE&correlationId=SOME_STRING_VALUE&searchId=SOME_STRING_VALUE&sortByMetric=SOME_STRING_VALUE&sortByGeoPoint=34.052235%2C-118.243685&filterGeoPoints=34.052235%2C-118.243685&filterGeoPoints=15.0%2C65.0&filterAroundRadius=5000&filters=SOME_STRING_VALUE&facets=SOME_ARRAY_VALUE&facetsSize=SOME_INTEGER_VALUE&maxValuesPerFacet=SOME_INTEGER_VALUE&caseSensitiveFacetValues=SOME_BOOLEAN_VALUE&displayAttributes=title&displayAttributes=price&context=mobile&context=listing&includeFacets=SOME_STRING_VALUE&facetsOrderBy=SOME_STRING_VALUE&page=4&limit=10&sortBy=SOME_STRING_VALUE&ordering=SOME_STRING_VALUE&includeMeta=SOME_BOOLEAN_VALUE&distinctFilter=%7B%22attribute%22%3A%20%22color%22%2C%20%22maxNumItems%22%3A%203%7D&ignoreQueryRules=SOME_BOOLEAN_VALUE&disableQueryClassification=SOME_BOOLEAN_VALUE&disableDynamicReranker=SOME_BOOLEAN_VALUE&excludeQueryRules=2&excludeQueryRules=5&crossWorkspaceModeEnabled=SOME_BOOLEAN_VALUE&params=source%3Amobile", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://api.synerise.com/search/v2/indices/%7BindexId%7D/query/explain?query=SOME_STRING_VALUE&clientUUID=SOME_STRING_VALUE&personalize=SOME_BOOLEAN_VALUE&correlationId=SOME_STRING_VALUE&searchId=SOME_STRING_VALUE&sortByMetric=SOME_STRING_VALUE&sortByGeoPoint=34.052235%2C-118.243685&filterGeoPoints=34.052235%2C-118.243685&filterGeoPoints=15.0%2C65.0&filterAroundRadius=5000&filters=SOME_STRING_VALUE&facets=SOME_ARRAY_VALUE&facetsSize=SOME_INTEGER_VALUE&maxValuesPerFacet=SOME_INTEGER_VALUE&caseSensitiveFacetValues=SOME_BOOLEAN_VALUE&displayAttributes=title&displayAttributes=price&context=mobile&context=listing&includeFacets=SOME_STRING_VALUE&facetsOrderBy=SOME_STRING_VALUE&page=4&limit=10&sortBy=SOME_STRING_VALUE&ordering=SOME_STRING_VALUE&includeMeta=SOME_BOOLEAN_VALUE&distinctFilter=%7B%22attribute%22%3A%20%22color%22%2C%20%22maxNumItems%22%3A%203%7D&ignoreQueryRules=SOME_BOOLEAN_VALUE&disableQueryClassification=SOME_BOOLEAN_VALUE&disableDynamicReranker=SOME_BOOLEAN_VALUE&excludeQueryRules=2&excludeQueryRules=5&crossWorkspaceModeEnabled=SOME_BOOLEAN_VALUE&params=source%3Amobile");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/search/v2/indices/%7BindexId%7D/query/explain?query=SOME_STRING_VALUE&clientUUID=SOME_STRING_VALUE&personalize=SOME_BOOLEAN_VALUE&correlationId=SOME_STRING_VALUE&searchId=SOME_STRING_VALUE&sortByMetric=SOME_STRING_VALUE&sortByGeoPoint=34.052235%2C-118.243685&filterGeoPoints=34.052235%2C-118.243685&filterGeoPoints=15.0%2C65.0&filterAroundRadius=5000&filters=SOME_STRING_VALUE&facets=SOME_ARRAY_VALUE&facetsSize=SOME_INTEGER_VALUE&maxValuesPerFacet=SOME_INTEGER_VALUE&caseSensitiveFacetValues=SOME_BOOLEAN_VALUE&displayAttributes=title&displayAttributes=price&context=mobile&context=listing&includeFacets=SOME_STRING_VALUE&facetsOrderBy=SOME_STRING_VALUE&page=4&limit=10&sortBy=SOME_STRING_VALUE&ordering=SOME_STRING_VALUE&includeMeta=SOME_BOOLEAN_VALUE&distinctFilter=%7B%22attribute%22%3A%20%22color%22%2C%20%22maxNumItems%22%3A%203%7D&ignoreQueryRules=SOME_BOOLEAN_VALUE&disableQueryClassification=SOME_BOOLEAN_VALUE&disableDynamicReranker=SOME_BOOLEAN_VALUE&excludeQueryRules=2&excludeQueryRules=5&crossWorkspaceModeEnabled=SOME_BOOLEAN_VALUE&params=source%3Amobile",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/search/v2/indices/%7BindexId%7D/query/explain');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'query' => 'SOME_STRING_VALUE',
              'clientUUID' => 'SOME_STRING_VALUE',
              'personalize' => 'SOME_BOOLEAN_VALUE',
              'correlationId' => 'SOME_STRING_VALUE',
              'searchId' => 'SOME_STRING_VALUE',
              'sortByMetric' => 'SOME_STRING_VALUE',
              'sortByGeoPoint' => '34.052235,-118.243685',
              'filterGeoPoints' => [
                '34.052235,-118.243685',
                '15.0,65.0'
              ],
              'filterAroundRadius' => '5000',
              'filters' => 'SOME_STRING_VALUE',
              'facets' => 'SOME_ARRAY_VALUE',
              'facetsSize' => 'SOME_INTEGER_VALUE',
              'maxValuesPerFacet' => 'SOME_INTEGER_VALUE',
              'caseSensitiveFacetValues' => 'SOME_BOOLEAN_VALUE',
              'displayAttributes' => [
                'title',
                'price'
              ],
              'context' => [
                'mobile',
                'listing'
              ],
              'includeFacets' => 'SOME_STRING_VALUE',
              'facetsOrderBy' => 'SOME_STRING_VALUE',
              'page' => '4',
              'limit' => '10',
              'sortBy' => 'SOME_STRING_VALUE',
              'ordering' => 'SOME_STRING_VALUE',
              'includeMeta' => 'SOME_BOOLEAN_VALUE',
              'distinctFilter' => '{"attribute": "color", "maxNumItems": 3}',
              'ignoreQueryRules' => 'SOME_BOOLEAN_VALUE',
              'disableQueryClassification' => 'SOME_BOOLEAN_VALUE',
              'disableDynamicReranker' => 'SOME_BOOLEAN_VALUE',
              'excludeQueryRules' => [
                '2',
                '5'
              ],
              'crossWorkspaceModeEnabled' => 'SOME_BOOLEAN_VALUE',
              'params' => 'source:mobile'
            ]);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.get("https://api.synerise.com/search/v2/indices/%7BindexId%7D/query/explain?query=SOME_STRING_VALUE&clientUUID=SOME_STRING_VALUE&personalize=SOME_BOOLEAN_VALUE&correlationId=SOME_STRING_VALUE&searchId=SOME_STRING_VALUE&sortByMetric=SOME_STRING_VALUE&sortByGeoPoint=34.052235%2C-118.243685&filterGeoPoints=34.052235%2C-118.243685&filterGeoPoints=15.0%2C65.0&filterAroundRadius=5000&filters=SOME_STRING_VALUE&facets=SOME_ARRAY_VALUE&facetsSize=SOME_INTEGER_VALUE&maxValuesPerFacet=SOME_INTEGER_VALUE&caseSensitiveFacetValues=SOME_BOOLEAN_VALUE&displayAttributes=title&displayAttributes=price&context=mobile&context=listing&includeFacets=SOME_STRING_VALUE&facetsOrderBy=SOME_STRING_VALUE&page=4&limit=10&sortBy=SOME_STRING_VALUE&ordering=SOME_STRING_VALUE&includeMeta=SOME_BOOLEAN_VALUE&distinctFilter=%7B%22attribute%22%3A%20%22color%22%2C%20%22maxNumItems%22%3A%203%7D&ignoreQueryRules=SOME_BOOLEAN_VALUE&disableQueryClassification=SOME_BOOLEAN_VALUE&disableDynamicReranker=SOME_BOOLEAN_VALUE&excludeQueryRules=2&excludeQueryRules=5&crossWorkspaceModeEnabled=SOME_BOOLEAN_VALUE&params=source%3Amobile")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
    post:
      summary: Explained full-text items search
      description: |
        Retrieves items that match a full-text query from a search index or a suggestion index. The results can be filtered and sorted. The response contains an explanation of the factors that influenced the result.

        ---

        **API consumers:** <span title="Deprecated">AI API key (legacy)</span>, <a href="/docs/settings/tool/tracking_codes" target="_blank" rel="noopener" title="Pass your tracker key in the request header">Web SDK Tracker</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>

        **API key permission required:** `ITEMS_SEARCH_SEARCH_READ`
      operationId: SearchFullTextPostWithExplanation
      tags:
        - Search
      security:
        - TrackerKey: []
        - JWT: []
      parameters:
        - $ref: "#/components/parameters/items-search-inPathIndexId"
      requestBody:
        description: Request for performing full-text search with explanation
        required: true
        content:
          application/json:
            schema:
              allOf:
                - $ref: "#/components/schemas/items-search-FullTextSearchRequest"
                - type: object
                  properties:
                    crossWorkspaceMode:
                      $ref: "#/components/schemas/items-search-CrossWorkspaceMode"
      responses:
        "200":
          $ref: "#/components/responses/items-search-FullTextSearchResponse200WithExplanation"
        "500":
          description: Service not available
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/items-search-Error"
      x-snr-doc-urls:
        - /api-reference/ai-search#tag/Search/operation/SearchFullTextPostWithExplanation
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/search/v2/indices/%7BindexId%7D/query/explain \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"query":"string","page":0,"limit":10,"sortBy":"string","ordering":"desc","includeMeta":true,"clientUUID":"string","personalize":true,"correlationId":"string","searchId":"string","sortByMetric":"TransactionsPopularity","sortByGeoPoints":"34.052235,-118.243685","filterGeoPoints":["34.052235,-118.243685","15.0,65.0"],"filterAroundRadius":2000,"filters":"string","facets":["string"],"customFilteredFacets":{"brand":"price > 100","price":"brand == foo"},"facetsSize":2000,"maxValuesPerFacet":50,"caseSensitiveFacetValues":false,"includeFacets":"all","facetsOrderBy":"coverage","context":["mobile","listing"],"displayAttributes":["title","price"],"distinctFilter":{"attribute":"string","maxNumItems":1,"levelRangeModifier":0},"ignoreQueryRules":false,"excludeQueryRules":[2,5],"params":{"source":"mobile"},"disableQueryClassification":false,"disableDynamicReranker":false,"crossWorkspaceMode":{"enabled":true}}'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            payload = "{\"query\":\"string\",\"page\":0,\"limit\":10,\"sortBy\":\"string\",\"ordering\":\"desc\",\"includeMeta\":true,\"clientUUID\":\"string\",\"personalize\":true,\"correlationId\":\"string\",\"searchId\":\"string\",\"sortByMetric\":\"TransactionsPopularity\",\"sortByGeoPoints\":\"34.052235,-118.243685\",\"filterGeoPoints\":[\"34.052235,-118.243685\",\"15.0,65.0\"],\"filterAroundRadius\":2000,\"filters\":\"string\",\"facets\":[\"string\"],\"customFilteredFacets\":{\"brand\":\"price > 100\",\"price\":\"brand == foo\"},\"facetsSize\":2000,\"maxValuesPerFacet\":50,\"caseSensitiveFacetValues\":false,\"includeFacets\":\"all\",\"facetsOrderBy\":\"coverage\",\"context\":[\"mobile\",\"listing\"],\"displayAttributes\":[\"title\",\"price\"],\"distinctFilter\":{\"attribute\":\"string\",\"maxNumItems\":1,\"levelRangeModifier\":0},\"ignoreQueryRules\":false,\"excludeQueryRules\":[2,5],\"params\":{\"source\":\"mobile\"},\"disableQueryClassification\":false,\"disableDynamicReranker\":false,\"crossWorkspaceMode\":{\"enabled\":true}}"

            headers = {
                'Authorization': "Bearer REPLACE_BEARER_TOKEN",
                'content-type': "application/json"
                }

            conn.request("POST", "/search/v2/indices/%7BindexId%7D/query/explain", payload, headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "query": "string",
              "page": 0,
              "limit": 10,
              "sortBy": "string",
              "ordering": "desc",
              "includeMeta": true,
              "clientUUID": "string",
              "personalize": true,
              "correlationId": "string",
              "searchId": "string",
              "sortByMetric": "TransactionsPopularity",
              "sortByGeoPoints": "34.052235,-118.243685",
              "filterGeoPoints": [
                "34.052235,-118.243685",
                "15.0,65.0"
              ],
              "filterAroundRadius": 2000,
              "filters": "string",
              "facets": [
                "string"
              ],
              "customFilteredFacets": {
                "brand": "price > 100",
                "price": "brand == foo"
              },
              "facetsSize": 2000,
              "maxValuesPerFacet": 50,
              "caseSensitiveFacetValues": false,
              "includeFacets": "all",
              "facetsOrderBy": "coverage",
              "context": [
                "mobile",
                "listing"
              ],
              "displayAttributes": [
                "title",
                "price"
              ],
              "distinctFilter": {
                "attribute": "string",
                "maxNumItems": 1,
                "levelRangeModifier": 0
              },
              "ignoreQueryRules": false,
              "excludeQueryRules": [
                2,
                5
              ],
              "params": {
                "source": "mobile"
              },
              "disableQueryClassification": false,
              "disableDynamicReranker": false,
              "crossWorkspaceMode": {
                "enabled": true
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://api.synerise.com/search/v2/indices/%7BindexId%7D/query/explain");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/search/v2/indices/%7BindexId%7D/query/explain",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              query: 'string',
              page: 0,
              limit: 10,
              sortBy: 'string',
              ordering: 'desc',
              includeMeta: true,
              clientUUID: 'string',
              personalize: true,
              correlationId: 'string',
              searchId: 'string',
              sortByMetric: 'TransactionsPopularity',
              sortByGeoPoints: '34.052235,-118.243685',
              filterGeoPoints: ['34.052235,-118.243685', '15.0,65.0'],
              filterAroundRadius: 2000,
              filters: 'string',
              facets: ['string'],
              customFilteredFacets: {brand: 'price > 100', price: 'brand == foo'},
              facetsSize: 2000,
              maxValuesPerFacet: 50,
              caseSensitiveFacetValues: false,
              includeFacets: 'all',
              facetsOrderBy: 'coverage',
              context: ['mobile', 'listing'],
              displayAttributes: ['title', 'price'],
              distinctFilter: {attribute: 'string', maxNumItems: 1, levelRangeModifier: 0},
              ignoreQueryRules: false,
              excludeQueryRules: [2, 5],
              params: {source: 'mobile'},
              disableQueryClassification: false,
              disableDynamicReranker: false,
              crossWorkspaceMode: {enabled: true}
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/search/v2/indices/%7BindexId%7D/query/explain');
            $request->setMethod(HTTP_METH_POST);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN',
              'content-type' => 'application/json'
            ]);

            $request->setBody('{"query":"string","page":0,"limit":10,"sortBy":"string","ordering":"desc","includeMeta":true,"clientUUID":"string","personalize":true,"correlationId":"string","searchId":"string","sortByMetric":"TransactionsPopularity","sortByGeoPoints":"34.052235,-118.243685","filterGeoPoints":["34.052235,-118.243685","15.0,65.0"],"filterAroundRadius":2000,"filters":"string","facets":["string"],"customFilteredFacets":{"brand":"price > 100","price":"brand == foo"},"facetsSize":2000,"maxValuesPerFacet":50,"caseSensitiveFacetValues":false,"includeFacets":"all","facetsOrderBy":"coverage","context":["mobile","listing"],"displayAttributes":["title","price"],"distinctFilter":{"attribute":"string","maxNumItems":1,"levelRangeModifier":0},"ignoreQueryRules":false,"excludeQueryRules":[2,5],"params":{"source":"mobile"},"disableQueryClassification":false,"disableDynamicReranker":false,"crossWorkspaceMode":{"enabled":true}}');

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.post("https://api.synerise.com/search/v2/indices/%7BindexId%7D/query/explain")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"query\":\"string\",\"page\":0,\"limit\":10,\"sortBy\":\"string\",\"ordering\":\"desc\",\"includeMeta\":true,\"clientUUID\":\"string\",\"personalize\":true,\"correlationId\":\"string\",\"searchId\":\"string\",\"sortByMetric\":\"TransactionsPopularity\",\"sortByGeoPoints\":\"34.052235,-118.243685\",\"filterGeoPoints\":[\"34.052235,-118.243685\",\"15.0,65.0\"],\"filterAroundRadius\":2000,\"filters\":\"string\",\"facets\":[\"string\"],\"customFilteredFacets\":{\"brand\":\"price > 100\",\"price\":\"brand == foo\"},\"facetsSize\":2000,\"maxValuesPerFacet\":50,\"caseSensitiveFacetValues\":false,\"includeFacets\":\"all\",\"facetsOrderBy\":\"coverage\",\"context\":[\"mobile\",\"listing\"],\"displayAttributes\":[\"title\",\"price\"],\"distinctFilter\":{\"attribute\":\"string\",\"maxNumItems\":1,\"levelRangeModifier\":0},\"ignoreQueryRules\":false,\"excludeQueryRules\":[2,5],\"params\":{\"source\":\"mobile\"},\"disableQueryClassification\":false,\"disableDynamicReranker\":false,\"crossWorkspaceMode\":{\"enabled\":true}}")
              .asString();
  /search/v2/indices/{indexId}/autocomplete:
    get:
      summary: Autocomplete items search
      description: |
        Retrieves items that match a query from a search index or a suggestion index. The results can be filtered and sorted. The results of this search type are not cached.

        ---

        **API consumers:** <span title="Deprecated">AI API key (legacy)</span>, <a href="/docs/settings/tool/tracking_codes" target="_blank" rel="noopener" title="Pass your tracker key in the request header">Web SDK Tracker</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>

        **API key permission required:** `ITEMS_SEARCH_SEARCH_READ`
      operationId: SearchAutocompleteGet
      tags:
        - Search
      security:
        - TrackerKey: []
        - JWT: []
      parameters:
        - $ref: "#/components/parameters/items-search-searchQuery"
        - $ref: "#/components/parameters/items-search-inPathIndexId"
        - $ref: "#/components/parameters/items-search-clientUUID"
        - $ref: "#/components/parameters/items-search-personalize"
        - $ref: "#/components/parameters/items-search-sortByMetric"
        - $ref: "#/components/parameters/items-search-sortByGeoPoint"
        - $ref: "#/components/parameters/items-search-filterGeoPoints"
        - $ref: "#/components/parameters/items-search-filterAroundRadius"
        - $ref: "#/components/parameters/items-search-filters"
        - $ref: "#/components/parameters/items-search-facets"
        - $ref: "#/components/parameters/items-search-facetsSize"
        - $ref: "#/components/parameters/items-search-maxValuesPerFacet"
        - $ref: "#/components/parameters/items-search-caseSensitiveFacetValues"
        - $ref: "#/components/parameters/items-search-displayAttributes"
        - $ref: "#/components/parameters/items-search-context"
        - $ref: "#/components/parameters/items-search-includeFacets"
        - $ref: "#/components/parameters/items-search-facetsOrderBy"
        - $ref: "#/components/parameters/items-search-paginationPage"
        - $ref: "#/components/parameters/items-search-paginationLimit"
        - $ref: "#/components/parameters/items-search-paginationSortBy"
        - $ref: "#/components/parameters/items-search-paginationOrdering"
        - $ref: "#/components/parameters/items-search-paginationIncludeMeta"
        - $ref: "#/components/parameters/items-search-distinctFilter"
        - $ref: "#/components/parameters/items-search-ignoreQueryRules"
        - $ref: "#/components/parameters/items-search-excludeQueryRules"
        - $ref: "#/components/parameters/items-search-params"
        - $ref: "#/components/parameters/items-search-disableQueryClassification"
        - $ref: "#/components/parameters/items-search-disableDynamicReranker"
      responses:
        "200":
          $ref: "#/components/responses/items-search-AutocompleteSearchResponse200"
        "500":
          description: Service not available
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/items-search-Error"
      x-snr-doc-urls:
        - /api-reference/ai-search#tag/Search/operation/SearchAutocompleteGet
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.synerise.com/search/v2/indices/%7BindexId%7D/autocomplete?query=SOME_STRING_VALUE&clientUUID=SOME_STRING_VALUE&personalize=SOME_BOOLEAN_VALUE&sortByMetric=SOME_STRING_VALUE&sortByGeoPoint=34.052235%2C-118.243685&filterGeoPoints=34.052235%2C-118.243685&filterGeoPoints=15.0%2C65.0&filterAroundRadius=5000&filters=SOME_STRING_VALUE&facets=SOME_ARRAY_VALUE&facetsSize=SOME_INTEGER_VALUE&maxValuesPerFacet=SOME_INTEGER_VALUE&caseSensitiveFacetValues=SOME_BOOLEAN_VALUE&displayAttributes=title&displayAttributes=price&context=mobile&context=listing&includeFacets=SOME_STRING_VALUE&facetsOrderBy=SOME_STRING_VALUE&page=4&limit=10&sortBy=SOME_STRING_VALUE&ordering=SOME_STRING_VALUE&includeMeta=SOME_BOOLEAN_VALUE&distinctFilter=%7B%22attribute%22%3A%20%22color%22%2C%20%22maxNumItems%22%3A%203%7D&ignoreQueryRules=SOME_BOOLEAN_VALUE&excludeQueryRules=2&excludeQueryRules=5&params=source%3Amobile&disableQueryClassification=SOME_BOOLEAN_VALUE&disableDynamicReranker=SOME_BOOLEAN_VALUE' \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            headers = { 'Authorization': "Bearer REPLACE_BEARER_TOKEN" }

            conn.request("GET", "/search/v2/indices/%7BindexId%7D/autocomplete?query=SOME_STRING_VALUE&clientUUID=SOME_STRING_VALUE&personalize=SOME_BOOLEAN_VALUE&sortByMetric=SOME_STRING_VALUE&sortByGeoPoint=34.052235%2C-118.243685&filterGeoPoints=34.052235%2C-118.243685&filterGeoPoints=15.0%2C65.0&filterAroundRadius=5000&filters=SOME_STRING_VALUE&facets=SOME_ARRAY_VALUE&facetsSize=SOME_INTEGER_VALUE&maxValuesPerFacet=SOME_INTEGER_VALUE&caseSensitiveFacetValues=SOME_BOOLEAN_VALUE&displayAttributes=title&displayAttributes=price&context=mobile&context=listing&includeFacets=SOME_STRING_VALUE&facetsOrderBy=SOME_STRING_VALUE&page=4&limit=10&sortBy=SOME_STRING_VALUE&ordering=SOME_STRING_VALUE&includeMeta=SOME_BOOLEAN_VALUE&distinctFilter=%7B%22attribute%22%3A%20%22color%22%2C%20%22maxNumItems%22%3A%203%7D&ignoreQueryRules=SOME_BOOLEAN_VALUE&excludeQueryRules=2&excludeQueryRules=5&params=source%3Amobile&disableQueryClassification=SOME_BOOLEAN_VALUE&disableDynamicReranker=SOME_BOOLEAN_VALUE", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://api.synerise.com/search/v2/indices/%7BindexId%7D/autocomplete?query=SOME_STRING_VALUE&clientUUID=SOME_STRING_VALUE&personalize=SOME_BOOLEAN_VALUE&sortByMetric=SOME_STRING_VALUE&sortByGeoPoint=34.052235%2C-118.243685&filterGeoPoints=34.052235%2C-118.243685&filterGeoPoints=15.0%2C65.0&filterAroundRadius=5000&filters=SOME_STRING_VALUE&facets=SOME_ARRAY_VALUE&facetsSize=SOME_INTEGER_VALUE&maxValuesPerFacet=SOME_INTEGER_VALUE&caseSensitiveFacetValues=SOME_BOOLEAN_VALUE&displayAttributes=title&displayAttributes=price&context=mobile&context=listing&includeFacets=SOME_STRING_VALUE&facetsOrderBy=SOME_STRING_VALUE&page=4&limit=10&sortBy=SOME_STRING_VALUE&ordering=SOME_STRING_VALUE&includeMeta=SOME_BOOLEAN_VALUE&distinctFilter=%7B%22attribute%22%3A%20%22color%22%2C%20%22maxNumItems%22%3A%203%7D&ignoreQueryRules=SOME_BOOLEAN_VALUE&excludeQueryRules=2&excludeQueryRules=5&params=source%3Amobile&disableQueryClassification=SOME_BOOLEAN_VALUE&disableDynamicReranker=SOME_BOOLEAN_VALUE");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/search/v2/indices/%7BindexId%7D/autocomplete?query=SOME_STRING_VALUE&clientUUID=SOME_STRING_VALUE&personalize=SOME_BOOLEAN_VALUE&sortByMetric=SOME_STRING_VALUE&sortByGeoPoint=34.052235%2C-118.243685&filterGeoPoints=34.052235%2C-118.243685&filterGeoPoints=15.0%2C65.0&filterAroundRadius=5000&filters=SOME_STRING_VALUE&facets=SOME_ARRAY_VALUE&facetsSize=SOME_INTEGER_VALUE&maxValuesPerFacet=SOME_INTEGER_VALUE&caseSensitiveFacetValues=SOME_BOOLEAN_VALUE&displayAttributes=title&displayAttributes=price&context=mobile&context=listing&includeFacets=SOME_STRING_VALUE&facetsOrderBy=SOME_STRING_VALUE&page=4&limit=10&sortBy=SOME_STRING_VALUE&ordering=SOME_STRING_VALUE&includeMeta=SOME_BOOLEAN_VALUE&distinctFilter=%7B%22attribute%22%3A%20%22color%22%2C%20%22maxNumItems%22%3A%203%7D&ignoreQueryRules=SOME_BOOLEAN_VALUE&excludeQueryRules=2&excludeQueryRules=5&params=source%3Amobile&disableQueryClassification=SOME_BOOLEAN_VALUE&disableDynamicReranker=SOME_BOOLEAN_VALUE",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/search/v2/indices/%7BindexId%7D/autocomplete');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'query' => 'SOME_STRING_VALUE',
              'clientUUID' => 'SOME_STRING_VALUE',
              'personalize' => 'SOME_BOOLEAN_VALUE',
              'sortByMetric' => 'SOME_STRING_VALUE',
              'sortByGeoPoint' => '34.052235,-118.243685',
              'filterGeoPoints' => [
                '34.052235,-118.243685',
                '15.0,65.0'
              ],
              'filterAroundRadius' => '5000',
              'filters' => 'SOME_STRING_VALUE',
              'facets' => 'SOME_ARRAY_VALUE',
              'facetsSize' => 'SOME_INTEGER_VALUE',
              'maxValuesPerFacet' => 'SOME_INTEGER_VALUE',
              'caseSensitiveFacetValues' => 'SOME_BOOLEAN_VALUE',
              'displayAttributes' => [
                'title',
                'price'
              ],
              'context' => [
                'mobile',
                'listing'
              ],
              'includeFacets' => 'SOME_STRING_VALUE',
              'facetsOrderBy' => 'SOME_STRING_VALUE',
              'page' => '4',
              'limit' => '10',
              'sortBy' => 'SOME_STRING_VALUE',
              'ordering' => 'SOME_STRING_VALUE',
              'includeMeta' => 'SOME_BOOLEAN_VALUE',
              'distinctFilter' => '{"attribute": "color", "maxNumItems": 3}',
              'ignoreQueryRules' => 'SOME_BOOLEAN_VALUE',
              'excludeQueryRules' => [
                '2',
                '5'
              ],
              'params' => 'source:mobile',
              'disableQueryClassification' => 'SOME_BOOLEAN_VALUE',
              'disableDynamicReranker' => 'SOME_BOOLEAN_VALUE'
            ]);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.get("https://api.synerise.com/search/v2/indices/%7BindexId%7D/autocomplete?query=SOME_STRING_VALUE&clientUUID=SOME_STRING_VALUE&personalize=SOME_BOOLEAN_VALUE&sortByMetric=SOME_STRING_VALUE&sortByGeoPoint=34.052235%2C-118.243685&filterGeoPoints=34.052235%2C-118.243685&filterGeoPoints=15.0%2C65.0&filterAroundRadius=5000&filters=SOME_STRING_VALUE&facets=SOME_ARRAY_VALUE&facetsSize=SOME_INTEGER_VALUE&maxValuesPerFacet=SOME_INTEGER_VALUE&caseSensitiveFacetValues=SOME_BOOLEAN_VALUE&displayAttributes=title&displayAttributes=price&context=mobile&context=listing&includeFacets=SOME_STRING_VALUE&facetsOrderBy=SOME_STRING_VALUE&page=4&limit=10&sortBy=SOME_STRING_VALUE&ordering=SOME_STRING_VALUE&includeMeta=SOME_BOOLEAN_VALUE&distinctFilter=%7B%22attribute%22%3A%20%22color%22%2C%20%22maxNumItems%22%3A%203%7D&ignoreQueryRules=SOME_BOOLEAN_VALUE&excludeQueryRules=2&excludeQueryRules=5&params=source%3Amobile&disableQueryClassification=SOME_BOOLEAN_VALUE&disableDynamicReranker=SOME_BOOLEAN_VALUE")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
    post:
      summary: Autocomplete items search
      description: |
        Retrieves items that match a query from a search index or a suggestion index. The results can be filtered and sorted. The results of this search type are not cached.

        ---

        **API consumers:** <span title="Deprecated">AI API key (legacy)</span>, <a href="/docs/settings/tool/tracking_codes" target="_blank" rel="noopener" title="Pass your tracker key in the request header">Web SDK Tracker</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>

        **API key permission required:** `ITEMS_SEARCH_SEARCH_READ`
      operationId: SearchAutocompletePost
      tags:
        - Search
      security:
        - TrackerKey: []
        - JWT: []
      parameters:
        - $ref: "#/components/parameters/items-search-inPathIndexId"
      requestBody:
        description: Request for performing an autocomplete search
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/items-search-AutocompleteRequest"
      responses:
        "200":
          $ref: "#/components/responses/items-search-AutocompleteSearchResponse200"
        "500":
          description: Service not available
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/items-search-Error"
      x-snr-doc-urls:
        - /api-reference/ai-search#tag/Search/operation/SearchAutocompletePost
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/search/v2/indices/%7BindexId%7D/autocomplete \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"query":"string","page":0,"limit":10,"sortBy":"string","ordering":"desc","includeMeta":true,"clientUUID":"string","sortByMetric":"TransactionsPopularity","sortByGeoPoints":"34.052235,-118.243685","filterGeoPoints":["34.052235,-118.243685","15.0,65.0"],"filterAroundRadius":2000,"filters":"string","facets":["string"],"customFilteredFacets":{"brand":"price > 100","price":"brand == foo"},"facetsSize":2000,"maxValuesPerFacet":50,"caseSensitiveFacetValues":false,"includeFacets":"all","facetsOrderBy":"coverage","context":["mobile","listing"],"displayAttributes":["title","price"],"distinctFilter":{"attribute":"string","maxNumItems":1,"levelRangeModifier":0},"ignoreQueryRules":false,"excludeQueryRules":[2,5],"params":{"source":"mobile"},"disableQueryClassification":false,"disableDynamicReranker":false}'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            payload = "{\"query\":\"string\",\"page\":0,\"limit\":10,\"sortBy\":\"string\",\"ordering\":\"desc\",\"includeMeta\":true,\"clientUUID\":\"string\",\"sortByMetric\":\"TransactionsPopularity\",\"sortByGeoPoints\":\"34.052235,-118.243685\",\"filterGeoPoints\":[\"34.052235,-118.243685\",\"15.0,65.0\"],\"filterAroundRadius\":2000,\"filters\":\"string\",\"facets\":[\"string\"],\"customFilteredFacets\":{\"brand\":\"price > 100\",\"price\":\"brand == foo\"},\"facetsSize\":2000,\"maxValuesPerFacet\":50,\"caseSensitiveFacetValues\":false,\"includeFacets\":\"all\",\"facetsOrderBy\":\"coverage\",\"context\":[\"mobile\",\"listing\"],\"displayAttributes\":[\"title\",\"price\"],\"distinctFilter\":{\"attribute\":\"string\",\"maxNumItems\":1,\"levelRangeModifier\":0},\"ignoreQueryRules\":false,\"excludeQueryRules\":[2,5],\"params\":{\"source\":\"mobile\"},\"disableQueryClassification\":false,\"disableDynamicReranker\":false}"

            headers = {
                'Authorization': "Bearer REPLACE_BEARER_TOKEN",
                'content-type': "application/json"
                }

            conn.request("POST", "/search/v2/indices/%7BindexId%7D/autocomplete", payload, headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "query": "string",
              "page": 0,
              "limit": 10,
              "sortBy": "string",
              "ordering": "desc",
              "includeMeta": true,
              "clientUUID": "string",
              "sortByMetric": "TransactionsPopularity",
              "sortByGeoPoints": "34.052235,-118.243685",
              "filterGeoPoints": [
                "34.052235,-118.243685",
                "15.0,65.0"
              ],
              "filterAroundRadius": 2000,
              "filters": "string",
              "facets": [
                "string"
              ],
              "customFilteredFacets": {
                "brand": "price > 100",
                "price": "brand == foo"
              },
              "facetsSize": 2000,
              "maxValuesPerFacet": 50,
              "caseSensitiveFacetValues": false,
              "includeFacets": "all",
              "facetsOrderBy": "coverage",
              "context": [
                "mobile",
                "listing"
              ],
              "displayAttributes": [
                "title",
                "price"
              ],
              "distinctFilter": {
                "attribute": "string",
                "maxNumItems": 1,
                "levelRangeModifier": 0
              },
              "ignoreQueryRules": false,
              "excludeQueryRules": [
                2,
                5
              ],
              "params": {
                "source": "mobile"
              },
              "disableQueryClassification": false,
              "disableDynamicReranker": false
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://api.synerise.com/search/v2/indices/%7BindexId%7D/autocomplete");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/search/v2/indices/%7BindexId%7D/autocomplete",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              query: 'string',
              page: 0,
              limit: 10,
              sortBy: 'string',
              ordering: 'desc',
              includeMeta: true,
              clientUUID: 'string',
              sortByMetric: 'TransactionsPopularity',
              sortByGeoPoints: '34.052235,-118.243685',
              filterGeoPoints: ['34.052235,-118.243685', '15.0,65.0'],
              filterAroundRadius: 2000,
              filters: 'string',
              facets: ['string'],
              customFilteredFacets: {brand: 'price > 100', price: 'brand == foo'},
              facetsSize: 2000,
              maxValuesPerFacet: 50,
              caseSensitiveFacetValues: false,
              includeFacets: 'all',
              facetsOrderBy: 'coverage',
              context: ['mobile', 'listing'],
              displayAttributes: ['title', 'price'],
              distinctFilter: {attribute: 'string', maxNumItems: 1, levelRangeModifier: 0},
              ignoreQueryRules: false,
              excludeQueryRules: [2, 5],
              params: {source: 'mobile'},
              disableQueryClassification: false,
              disableDynamicReranker: false
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/search/v2/indices/%7BindexId%7D/autocomplete');
            $request->setMethod(HTTP_METH_POST);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN',
              'content-type' => 'application/json'
            ]);

            $request->setBody('{"query":"string","page":0,"limit":10,"sortBy":"string","ordering":"desc","includeMeta":true,"clientUUID":"string","sortByMetric":"TransactionsPopularity","sortByGeoPoints":"34.052235,-118.243685","filterGeoPoints":["34.052235,-118.243685","15.0,65.0"],"filterAroundRadius":2000,"filters":"string","facets":["string"],"customFilteredFacets":{"brand":"price > 100","price":"brand == foo"},"facetsSize":2000,"maxValuesPerFacet":50,"caseSensitiveFacetValues":false,"includeFacets":"all","facetsOrderBy":"coverage","context":["mobile","listing"],"displayAttributes":["title","price"],"distinctFilter":{"attribute":"string","maxNumItems":1,"levelRangeModifier":0},"ignoreQueryRules":false,"excludeQueryRules":[2,5],"params":{"source":"mobile"},"disableQueryClassification":false,"disableDynamicReranker":false}');

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.post("https://api.synerise.com/search/v2/indices/%7BindexId%7D/autocomplete")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"query\":\"string\",\"page\":0,\"limit\":10,\"sortBy\":\"string\",\"ordering\":\"desc\",\"includeMeta\":true,\"clientUUID\":\"string\",\"sortByMetric\":\"TransactionsPopularity\",\"sortByGeoPoints\":\"34.052235,-118.243685\",\"filterGeoPoints\":[\"34.052235,-118.243685\",\"15.0,65.0\"],\"filterAroundRadius\":2000,\"filters\":\"string\",\"facets\":[\"string\"],\"customFilteredFacets\":{\"brand\":\"price > 100\",\"price\":\"brand == foo\"},\"facetsSize\":2000,\"maxValuesPerFacet\":50,\"caseSensitiveFacetValues\":false,\"includeFacets\":\"all\",\"facetsOrderBy\":\"coverage\",\"context\":[\"mobile\",\"listing\"],\"displayAttributes\":[\"title\",\"price\"],\"distinctFilter\":{\"attribute\":\"string\",\"maxNumItems\":1,\"levelRangeModifier\":0},\"ignoreQueryRules\":false,\"excludeQueryRules\":[2,5],\"params\":{\"source\":\"mobile\"},\"disableQueryClassification\":false,\"disableDynamicReranker\":false}")
              .asString();
  /search/v2/indices/{indexId}/autocomplete/explain:
    get:
      summary: Explained autocomplete items search
      description: |
        Retrieves items that match a query from a search index or a suggestion index. The results can be filtered and sorted. The results of this search type are not cached. The response contains an explanation of the factors that influenced the result.

        ---

        **API consumers:** <span title="Deprecated">AI API key (legacy)</span>, <a href="/docs/settings/tool/tracking_codes" target="_blank" rel="noopener" title="Pass your tracker key in the request header">Web SDK Tracker</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>

        **API key permission required:** `ITEMS_SEARCH_SEARCH_READ`
      operationId: SearchAutocompleteGetWithExplanation
      tags:
        - Search
      security:
        - TrackerKey: []
        - JWT: []
      parameters:
        - $ref: "#/components/parameters/items-search-searchQuery"
        - $ref: "#/components/parameters/items-search-inPathIndexId"
        - $ref: "#/components/parameters/items-search-clientUUID"
        - $ref: "#/components/parameters/items-search-personalize"
        - $ref: "#/components/parameters/items-search-sortByMetric"
        - $ref: "#/components/parameters/items-search-sortByGeoPoint"
        - $ref: "#/components/parameters/items-search-filterGeoPoints"
        - $ref: "#/components/parameters/items-search-filterAroundRadius"
        - $ref: "#/components/parameters/items-search-filters"
        - $ref: "#/components/parameters/items-search-facets"
        - $ref: "#/components/parameters/items-search-facetsSize"
        - $ref: "#/components/parameters/items-search-maxValuesPerFacet"
        - $ref: "#/components/parameters/items-search-caseSensitiveFacetValues"
        - $ref: "#/components/parameters/items-search-displayAttributes"
        - $ref: "#/components/parameters/items-search-context"
        - $ref: "#/components/parameters/items-search-includeFacets"
        - $ref: "#/components/parameters/items-search-facetsOrderBy"
        - $ref: "#/components/parameters/items-search-paginationPage"
        - $ref: "#/components/parameters/items-search-paginationLimit"
        - $ref: "#/components/parameters/items-search-paginationSortBy"
        - $ref: "#/components/parameters/items-search-paginationOrdering"
        - $ref: "#/components/parameters/items-search-paginationIncludeMeta"
        - $ref: "#/components/parameters/items-search-distinctFilter"
        - $ref: "#/components/parameters/items-search-ignoreQueryRules"
        - $ref: "#/components/parameters/items-search-excludeQueryRules"
        - $ref: "#/components/parameters/items-search-crossWorkspaceModeEnabled"
        - $ref: "#/components/parameters/items-search-params"
        - $ref: "#/components/parameters/items-search-disableQueryClassification"
        - $ref: "#/components/parameters/items-search-disableDynamicReranker"
      responses:
        "200":
          $ref: "#/components/responses/items-search-AutocompleteSearchResponse200WithExplanation"
        "500":
          description: Service not available
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/items-search-Error"
      x-snr-doc-urls:
        - /api-reference/ai-search#tag/Search/operation/SearchAutocompleteGetWithExplanation
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.synerise.com/search/v2/indices/%7BindexId%7D/autocomplete/explain?query=SOME_STRING_VALUE&clientUUID=SOME_STRING_VALUE&personalize=SOME_BOOLEAN_VALUE&sortByMetric=SOME_STRING_VALUE&sortByGeoPoint=34.052235%2C-118.243685&filterGeoPoints=34.052235%2C-118.243685&filterGeoPoints=15.0%2C65.0&filterAroundRadius=5000&filters=SOME_STRING_VALUE&facets=SOME_ARRAY_VALUE&facetsSize=SOME_INTEGER_VALUE&maxValuesPerFacet=SOME_INTEGER_VALUE&caseSensitiveFacetValues=SOME_BOOLEAN_VALUE&displayAttributes=title&displayAttributes=price&context=mobile&context=listing&includeFacets=SOME_STRING_VALUE&facetsOrderBy=SOME_STRING_VALUE&page=4&limit=10&sortBy=SOME_STRING_VALUE&ordering=SOME_STRING_VALUE&includeMeta=SOME_BOOLEAN_VALUE&distinctFilter=%7B%22attribute%22%3A%20%22color%22%2C%20%22maxNumItems%22%3A%203%7D&ignoreQueryRules=SOME_BOOLEAN_VALUE&excludeQueryRules=2&excludeQueryRules=5&crossWorkspaceModeEnabled=SOME_BOOLEAN_VALUE&params=source%3Amobile&disableQueryClassification=SOME_BOOLEAN_VALUE&disableDynamicReranker=SOME_BOOLEAN_VALUE' \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            headers = { 'Authorization': "Bearer REPLACE_BEARER_TOKEN" }

            conn.request("GET", "/search/v2/indices/%7BindexId%7D/autocomplete/explain?query=SOME_STRING_VALUE&clientUUID=SOME_STRING_VALUE&personalize=SOME_BOOLEAN_VALUE&sortByMetric=SOME_STRING_VALUE&sortByGeoPoint=34.052235%2C-118.243685&filterGeoPoints=34.052235%2C-118.243685&filterGeoPoints=15.0%2C65.0&filterAroundRadius=5000&filters=SOME_STRING_VALUE&facets=SOME_ARRAY_VALUE&facetsSize=SOME_INTEGER_VALUE&maxValuesPerFacet=SOME_INTEGER_VALUE&caseSensitiveFacetValues=SOME_BOOLEAN_VALUE&displayAttributes=title&displayAttributes=price&context=mobile&context=listing&includeFacets=SOME_STRING_VALUE&facetsOrderBy=SOME_STRING_VALUE&page=4&limit=10&sortBy=SOME_STRING_VALUE&ordering=SOME_STRING_VALUE&includeMeta=SOME_BOOLEAN_VALUE&distinctFilter=%7B%22attribute%22%3A%20%22color%22%2C%20%22maxNumItems%22%3A%203%7D&ignoreQueryRules=SOME_BOOLEAN_VALUE&excludeQueryRules=2&excludeQueryRules=5&crossWorkspaceModeEnabled=SOME_BOOLEAN_VALUE&params=source%3Amobile&disableQueryClassification=SOME_BOOLEAN_VALUE&disableDynamicReranker=SOME_BOOLEAN_VALUE", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://api.synerise.com/search/v2/indices/%7BindexId%7D/autocomplete/explain?query=SOME_STRING_VALUE&clientUUID=SOME_STRING_VALUE&personalize=SOME_BOOLEAN_VALUE&sortByMetric=SOME_STRING_VALUE&sortByGeoPoint=34.052235%2C-118.243685&filterGeoPoints=34.052235%2C-118.243685&filterGeoPoints=15.0%2C65.0&filterAroundRadius=5000&filters=SOME_STRING_VALUE&facets=SOME_ARRAY_VALUE&facetsSize=SOME_INTEGER_VALUE&maxValuesPerFacet=SOME_INTEGER_VALUE&caseSensitiveFacetValues=SOME_BOOLEAN_VALUE&displayAttributes=title&displayAttributes=price&context=mobile&context=listing&includeFacets=SOME_STRING_VALUE&facetsOrderBy=SOME_STRING_VALUE&page=4&limit=10&sortBy=SOME_STRING_VALUE&ordering=SOME_STRING_VALUE&includeMeta=SOME_BOOLEAN_VALUE&distinctFilter=%7B%22attribute%22%3A%20%22color%22%2C%20%22maxNumItems%22%3A%203%7D&ignoreQueryRules=SOME_BOOLEAN_VALUE&excludeQueryRules=2&excludeQueryRules=5&crossWorkspaceModeEnabled=SOME_BOOLEAN_VALUE&params=source%3Amobile&disableQueryClassification=SOME_BOOLEAN_VALUE&disableDynamicReranker=SOME_BOOLEAN_VALUE");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/search/v2/indices/%7BindexId%7D/autocomplete/explain?query=SOME_STRING_VALUE&clientUUID=SOME_STRING_VALUE&personalize=SOME_BOOLEAN_VALUE&sortByMetric=SOME_STRING_VALUE&sortByGeoPoint=34.052235%2C-118.243685&filterGeoPoints=34.052235%2C-118.243685&filterGeoPoints=15.0%2C65.0&filterAroundRadius=5000&filters=SOME_STRING_VALUE&facets=SOME_ARRAY_VALUE&facetsSize=SOME_INTEGER_VALUE&maxValuesPerFacet=SOME_INTEGER_VALUE&caseSensitiveFacetValues=SOME_BOOLEAN_VALUE&displayAttributes=title&displayAttributes=price&context=mobile&context=listing&includeFacets=SOME_STRING_VALUE&facetsOrderBy=SOME_STRING_VALUE&page=4&limit=10&sortBy=SOME_STRING_VALUE&ordering=SOME_STRING_VALUE&includeMeta=SOME_BOOLEAN_VALUE&distinctFilter=%7B%22attribute%22%3A%20%22color%22%2C%20%22maxNumItems%22%3A%203%7D&ignoreQueryRules=SOME_BOOLEAN_VALUE&excludeQueryRules=2&excludeQueryRules=5&crossWorkspaceModeEnabled=SOME_BOOLEAN_VALUE&params=source%3Amobile&disableQueryClassification=SOME_BOOLEAN_VALUE&disableDynamicReranker=SOME_BOOLEAN_VALUE",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/search/v2/indices/%7BindexId%7D/autocomplete/explain');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'query' => 'SOME_STRING_VALUE',
              'clientUUID' => 'SOME_STRING_VALUE',
              'personalize' => 'SOME_BOOLEAN_VALUE',
              'sortByMetric' => 'SOME_STRING_VALUE',
              'sortByGeoPoint' => '34.052235,-118.243685',
              'filterGeoPoints' => [
                '34.052235,-118.243685',
                '15.0,65.0'
              ],
              'filterAroundRadius' => '5000',
              'filters' => 'SOME_STRING_VALUE',
              'facets' => 'SOME_ARRAY_VALUE',
              'facetsSize' => 'SOME_INTEGER_VALUE',
              'maxValuesPerFacet' => 'SOME_INTEGER_VALUE',
              'caseSensitiveFacetValues' => 'SOME_BOOLEAN_VALUE',
              'displayAttributes' => [
                'title',
                'price'
              ],
              'context' => [
                'mobile',
                'listing'
              ],
              'includeFacets' => 'SOME_STRING_VALUE',
              'facetsOrderBy' => 'SOME_STRING_VALUE',
              'page' => '4',
              'limit' => '10',
              'sortBy' => 'SOME_STRING_VALUE',
              'ordering' => 'SOME_STRING_VALUE',
              'includeMeta' => 'SOME_BOOLEAN_VALUE',
              'distinctFilter' => '{"attribute": "color", "maxNumItems": 3}',
              'ignoreQueryRules' => 'SOME_BOOLEAN_VALUE',
              'excludeQueryRules' => [
                '2',
                '5'
              ],
              'crossWorkspaceModeEnabled' => 'SOME_BOOLEAN_VALUE',
              'params' => 'source:mobile',
              'disableQueryClassification' => 'SOME_BOOLEAN_VALUE',
              'disableDynamicReranker' => 'SOME_BOOLEAN_VALUE'
            ]);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.get("https://api.synerise.com/search/v2/indices/%7BindexId%7D/autocomplete/explain?query=SOME_STRING_VALUE&clientUUID=SOME_STRING_VALUE&personalize=SOME_BOOLEAN_VALUE&sortByMetric=SOME_STRING_VALUE&sortByGeoPoint=34.052235%2C-118.243685&filterGeoPoints=34.052235%2C-118.243685&filterGeoPoints=15.0%2C65.0&filterAroundRadius=5000&filters=SOME_STRING_VALUE&facets=SOME_ARRAY_VALUE&facetsSize=SOME_INTEGER_VALUE&maxValuesPerFacet=SOME_INTEGER_VALUE&caseSensitiveFacetValues=SOME_BOOLEAN_VALUE&displayAttributes=title&displayAttributes=price&context=mobile&context=listing&includeFacets=SOME_STRING_VALUE&facetsOrderBy=SOME_STRING_VALUE&page=4&limit=10&sortBy=SOME_STRING_VALUE&ordering=SOME_STRING_VALUE&includeMeta=SOME_BOOLEAN_VALUE&distinctFilter=%7B%22attribute%22%3A%20%22color%22%2C%20%22maxNumItems%22%3A%203%7D&ignoreQueryRules=SOME_BOOLEAN_VALUE&excludeQueryRules=2&excludeQueryRules=5&crossWorkspaceModeEnabled=SOME_BOOLEAN_VALUE&params=source%3Amobile&disableQueryClassification=SOME_BOOLEAN_VALUE&disableDynamicReranker=SOME_BOOLEAN_VALUE")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
    post:
      summary: Explained autocomplete items search
      description: |
        Retrieves items that match a query from a search index or a suggestion index. The results can be filtered and sorted. The results of this search type are not cached. The response contains an explanation of the factors that influenced the result.

        ---

        **API consumers:** <span title="Deprecated">AI API key (legacy)</span>, <a href="/docs/settings/tool/tracking_codes" target="_blank" rel="noopener" title="Pass your tracker key in the request header">Web SDK Tracker</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>

        **API key permission required:** `ITEMS_SEARCH_SEARCH_READ`
      operationId: SearchAutocompletePostWithExplanation
      tags:
        - Search
      security:
        - TrackerKey: []
        - JWT: []
      parameters:
        - $ref: "#/components/parameters/items-search-inPathIndexId"
      requestBody:
        description: Request for performing an autocomplete search with explanation
        required: true
        content:
          application/json:
            schema:
              allOf:
                - $ref: "#/components/schemas/items-search-AutocompleteRequest"
                - type: object
                  properties:
                    crossWorkspaceMode:
                      $ref: "#/components/schemas/items-search-CrossWorkspaceMode"
      responses:
        "200":
          $ref: "#/components/responses/items-search-AutocompleteSearchResponse200WithExplanation"
        "500":
          description: Service not available
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/items-search-Error"
      x-snr-doc-urls:
        - /api-reference/ai-search#tag/Search/operation/SearchAutocompletePostWithExplanation
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/search/v2/indices/%7BindexId%7D/autocomplete/explain \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"query":"string","page":0,"limit":10,"sortBy":"string","ordering":"desc","includeMeta":true,"clientUUID":"string","sortByMetric":"TransactionsPopularity","sortByGeoPoints":"34.052235,-118.243685","filterGeoPoints":["34.052235,-118.243685","15.0,65.0"],"filterAroundRadius":2000,"filters":"string","facets":["string"],"customFilteredFacets":{"brand":"price > 100","price":"brand == foo"},"facetsSize":2000,"maxValuesPerFacet":50,"caseSensitiveFacetValues":false,"includeFacets":"all","facetsOrderBy":"coverage","context":["mobile","listing"],"displayAttributes":["title","price"],"distinctFilter":{"attribute":"string","maxNumItems":1,"levelRangeModifier":0},"ignoreQueryRules":false,"excludeQueryRules":[2,5],"params":{"source":"mobile"},"disableQueryClassification":false,"disableDynamicReranker":false,"crossWorkspaceMode":{"enabled":true}}'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            payload = "{\"query\":\"string\",\"page\":0,\"limit\":10,\"sortBy\":\"string\",\"ordering\":\"desc\",\"includeMeta\":true,\"clientUUID\":\"string\",\"sortByMetric\":\"TransactionsPopularity\",\"sortByGeoPoints\":\"34.052235,-118.243685\",\"filterGeoPoints\":[\"34.052235,-118.243685\",\"15.0,65.0\"],\"filterAroundRadius\":2000,\"filters\":\"string\",\"facets\":[\"string\"],\"customFilteredFacets\":{\"brand\":\"price > 100\",\"price\":\"brand == foo\"},\"facetsSize\":2000,\"maxValuesPerFacet\":50,\"caseSensitiveFacetValues\":false,\"includeFacets\":\"all\",\"facetsOrderBy\":\"coverage\",\"context\":[\"mobile\",\"listing\"],\"displayAttributes\":[\"title\",\"price\"],\"distinctFilter\":{\"attribute\":\"string\",\"maxNumItems\":1,\"levelRangeModifier\":0},\"ignoreQueryRules\":false,\"excludeQueryRules\":[2,5],\"params\":{\"source\":\"mobile\"},\"disableQueryClassification\":false,\"disableDynamicReranker\":false,\"crossWorkspaceMode\":{\"enabled\":true}}"

            headers = {
                'Authorization': "Bearer REPLACE_BEARER_TOKEN",
                'content-type': "application/json"
                }

            conn.request("POST", "/search/v2/indices/%7BindexId%7D/autocomplete/explain", payload, headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "query": "string",
              "page": 0,
              "limit": 10,
              "sortBy": "string",
              "ordering": "desc",
              "includeMeta": true,
              "clientUUID": "string",
              "sortByMetric": "TransactionsPopularity",
              "sortByGeoPoints": "34.052235,-118.243685",
              "filterGeoPoints": [
                "34.052235,-118.243685",
                "15.0,65.0"
              ],
              "filterAroundRadius": 2000,
              "filters": "string",
              "facets": [
                "string"
              ],
              "customFilteredFacets": {
                "brand": "price > 100",
                "price": "brand == foo"
              },
              "facetsSize": 2000,
              "maxValuesPerFacet": 50,
              "caseSensitiveFacetValues": false,
              "includeFacets": "all",
              "facetsOrderBy": "coverage",
              "context": [
                "mobile",
                "listing"
              ],
              "displayAttributes": [
                "title",
                "price"
              ],
              "distinctFilter": {
                "attribute": "string",
                "maxNumItems": 1,
                "levelRangeModifier": 0
              },
              "ignoreQueryRules": false,
              "excludeQueryRules": [
                2,
                5
              ],
              "params": {
                "source": "mobile"
              },
              "disableQueryClassification": false,
              "disableDynamicReranker": false,
              "crossWorkspaceMode": {
                "enabled": true
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://api.synerise.com/search/v2/indices/%7BindexId%7D/autocomplete/explain");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/search/v2/indices/%7BindexId%7D/autocomplete/explain",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              query: 'string',
              page: 0,
              limit: 10,
              sortBy: 'string',
              ordering: 'desc',
              includeMeta: true,
              clientUUID: 'string',
              sortByMetric: 'TransactionsPopularity',
              sortByGeoPoints: '34.052235,-118.243685',
              filterGeoPoints: ['34.052235,-118.243685', '15.0,65.0'],
              filterAroundRadius: 2000,
              filters: 'string',
              facets: ['string'],
              customFilteredFacets: {brand: 'price > 100', price: 'brand == foo'},
              facetsSize: 2000,
              maxValuesPerFacet: 50,
              caseSensitiveFacetValues: false,
              includeFacets: 'all',
              facetsOrderBy: 'coverage',
              context: ['mobile', 'listing'],
              displayAttributes: ['title', 'price'],
              distinctFilter: {attribute: 'string', maxNumItems: 1, levelRangeModifier: 0},
              ignoreQueryRules: false,
              excludeQueryRules: [2, 5],
              params: {source: 'mobile'},
              disableQueryClassification: false,
              disableDynamicReranker: false,
              crossWorkspaceMode: {enabled: true}
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/search/v2/indices/%7BindexId%7D/autocomplete/explain');
            $request->setMethod(HTTP_METH_POST);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN',
              'content-type' => 'application/json'
            ]);

            $request->setBody('{"query":"string","page":0,"limit":10,"sortBy":"string","ordering":"desc","includeMeta":true,"clientUUID":"string","sortByMetric":"TransactionsPopularity","sortByGeoPoints":"34.052235,-118.243685","filterGeoPoints":["34.052235,-118.243685","15.0,65.0"],"filterAroundRadius":2000,"filters":"string","facets":["string"],"customFilteredFacets":{"brand":"price > 100","price":"brand == foo"},"facetsSize":2000,"maxValuesPerFacet":50,"caseSensitiveFacetValues":false,"includeFacets":"all","facetsOrderBy":"coverage","context":["mobile","listing"],"displayAttributes":["title","price"],"distinctFilter":{"attribute":"string","maxNumItems":1,"levelRangeModifier":0},"ignoreQueryRules":false,"excludeQueryRules":[2,5],"params":{"source":"mobile"},"disableQueryClassification":false,"disableDynamicReranker":false,"crossWorkspaceMode":{"enabled":true}}');

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.post("https://api.synerise.com/search/v2/indices/%7BindexId%7D/autocomplete/explain")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"query\":\"string\",\"page\":0,\"limit\":10,\"sortBy\":\"string\",\"ordering\":\"desc\",\"includeMeta\":true,\"clientUUID\":\"string\",\"sortByMetric\":\"TransactionsPopularity\",\"sortByGeoPoints\":\"34.052235,-118.243685\",\"filterGeoPoints\":[\"34.052235,-118.243685\",\"15.0,65.0\"],\"filterAroundRadius\":2000,\"filters\":\"string\",\"facets\":[\"string\"],\"customFilteredFacets\":{\"brand\":\"price > 100\",\"price\":\"brand == foo\"},\"facetsSize\":2000,\"maxValuesPerFacet\":50,\"caseSensitiveFacetValues\":false,\"includeFacets\":\"all\",\"facetsOrderBy\":\"coverage\",\"context\":[\"mobile\",\"listing\"],\"displayAttributes\":[\"title\",\"price\"],\"distinctFilter\":{\"attribute\":\"string\",\"maxNumItems\":1,\"levelRangeModifier\":0},\"ignoreQueryRules\":false,\"excludeQueryRules\":[2,5],\"params\":{\"source\":\"mobile\"},\"disableQueryClassification\":false,\"disableDynamicReranker\":false,\"crossWorkspaceMode\":{\"enabled\":true}}")
              .asString();
  /search/v2/indices/{indexId}/explain-match:
    get:
      summary: Searchable attributes match
      description: |
        Enter a query and an item ID to check if a token (a word or a synonym which replaced it) matches a value or part of a value from the item's searchable attributes.


        ---

        **API consumers:** <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=userLogin" target="_blank" rel="noopener">Synerise User</a>

        **API key permission required:** `ITEMS_SEARCH_SEARCH_READ`

        **User role permission required:** `assets_search: read`
      operationId: searchableAttributesMatch
      tags:
        - Search
      security:
        - TrackerKey: []
        - JWT: []
      parameters:
        - $ref: "#/components/parameters/items-search-inPathIndexId"
        - $ref: "#/components/parameters/items-search-searchQuery"
        - $ref: "#/components/parameters/items-search-itemId"
      responses:
        "200":
          $ref: "#/components/responses/items-search-SearchableAttributesMatchResponse200"
        "500":
          description: Service not available
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/items-search-Error"
      x-snr-doc-urls:
        - /api-reference/ai-search#tag/Search/operation/searchableAttributesMatch
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.synerise.com/search/v2/indices/%7BindexId%7D/explain-match?query=SOME_STRING_VALUE&itemId=SOME_STRING_VALUE' \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            headers = { 'Authorization': "Bearer REPLACE_BEARER_TOKEN" }

            conn.request("GET", "/search/v2/indices/%7BindexId%7D/explain-match?query=SOME_STRING_VALUE&itemId=SOME_STRING_VALUE", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://api.synerise.com/search/v2/indices/%7BindexId%7D/explain-match?query=SOME_STRING_VALUE&itemId=SOME_STRING_VALUE");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/search/v2/indices/%7BindexId%7D/explain-match?query=SOME_STRING_VALUE&itemId=SOME_STRING_VALUE",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/search/v2/indices/%7BindexId%7D/explain-match');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'query' => 'SOME_STRING_VALUE',
              'itemId' => 'SOME_STRING_VALUE'
            ]);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.get("https://api.synerise.com/search/v2/indices/%7BindexId%7D/explain-match?query=SOME_STRING_VALUE&itemId=SOME_STRING_VALUE")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
  /search/v2/indices/{indexId}/deleted-searches:
    get:
      summary: Get deleted searches
      description: |
        Retrieve the searches deleted from a profile's history.

        ---

        **API consumers:** <span title="Deprecated">AI API key (legacy)</span>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>, <a href="/docs/settings/tool/tracking_codes" target="_blank" rel="noopener" title="Pass your tracker key in the request header">Web SDK Tracker</a>

        **API key permission required:** `ITEMS_SEARCH_RECENT_SEARCH_READ`
      operationId: GetDeletedSearches
      tags:
        - Search
      security:
        - JWT: []
        - TrackerKey: []
      parameters:
        - $ref: "#/components/parameters/items-search-recent-indexId"
        - $ref: "#/components/parameters/items-search-recent-clientUUID"
      responses:
        "200":
          description: Deleted searches returned
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/items-search-recent-DeletedSearch"
        "400":
          description: Check error message for more details
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/items-search-recent-Error"
      x-snr-doc-urls:
        - /api-reference/ai-search#tag/Search/operation/GetDeletedSearches
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.synerise.com/search/v2/indices/4add1a1fa877c1651906bb22c9dfd37a1618852272/deleted-searches?clientUUID=e0097757-d1e2-44ac-ba3c-d97979a354c1' \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            headers = { 'Authorization': "Bearer REPLACE_BEARER_TOKEN" }

            conn.request("GET", "/search/v2/indices/4add1a1fa877c1651906bb22c9dfd37a1618852272/deleted-searches?clientUUID=e0097757-d1e2-44ac-ba3c-d97979a354c1", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://api.synerise.com/search/v2/indices/4add1a1fa877c1651906bb22c9dfd37a1618852272/deleted-searches?clientUUID=e0097757-d1e2-44ac-ba3c-d97979a354c1");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/search/v2/indices/4add1a1fa877c1651906bb22c9dfd37a1618852272/deleted-searches?clientUUID=e0097757-d1e2-44ac-ba3c-d97979a354c1",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/search/v2/indices/4add1a1fa877c1651906bb22c9dfd37a1618852272/deleted-searches');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'clientUUID' => 'e0097757-d1e2-44ac-ba3c-d97979a354c1'
            ]);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.get("https://api.synerise.com/search/v2/indices/4add1a1fa877c1651906bb22c9dfd37a1618852272/deleted-searches?clientUUID=e0097757-d1e2-44ac-ba3c-d97979a354c1")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
    post:
      summary: Soft-delete a recent search
      description: |
        Delete a recent search from the history accessible to a profile. The search remains in the database and you can retrieve it by using [this endpoint](#operation/GetDeletedSearches).

        ---

        **API consumers:** <span title="Deprecated">AI API key (legacy)</span>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>, <a href="/docs/settings/tool/tracking_codes" target="_blank" rel="noopener" title="Pass your tracker key in the request header">Web SDK Tracker</a>

        **API key permission required:** `ITEMS_SEARCH_RECENT_SEARCH_CREATE`
      operationId: PostDeletedSearch
      tags:
        - Search
      security:
        - JWT: []
        - TrackerKey: []
      parameters:
        - $ref: "#/components/parameters/items-search-recent-indexId"
        - $ref: "#/components/parameters/items-search-recent-clientUUID"
      requestBody:
        description: Request for deleting search query
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/items-search-recent-DeletedSearch"
      responses:
        "204":
          description: Soft-delete successful
        "400":
          description: Check error message for more details
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/items-search-recent-Error"
      x-snr-doc-urls:
        - /api-reference/ai-search#tag/Search/operation/PostDeletedSearch
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url 'https://api.synerise.com/search/v2/indices/4add1a1fa877c1651906bb22c9dfd37a1618852272/deleted-searches?clientUUID=e0097757-d1e2-44ac-ba3c-d97979a354c1' \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"query":"string","match":"query","timestamp":"2019-08-24T14:15:22Z"}'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            payload = "{\"query\":\"string\",\"match\":\"query\",\"timestamp\":\"2019-08-24T14:15:22Z\"}"

            headers = {
                'Authorization': "Bearer REPLACE_BEARER_TOKEN",
                'content-type': "application/json"
                }

            conn.request("POST", "/search/v2/indices/4add1a1fa877c1651906bb22c9dfd37a1618852272/deleted-searches?clientUUID=e0097757-d1e2-44ac-ba3c-d97979a354c1", payload, headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "query": "string",
              "match": "query",
              "timestamp": "2019-08-24T14:15:22Z"
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://api.synerise.com/search/v2/indices/4add1a1fa877c1651906bb22c9dfd37a1618852272/deleted-searches?clientUUID=e0097757-d1e2-44ac-ba3c-d97979a354c1");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/search/v2/indices/4add1a1fa877c1651906bb22c9dfd37a1618852272/deleted-searches?clientUUID=e0097757-d1e2-44ac-ba3c-d97979a354c1",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({query: 'string', match: 'query', timestamp: '2019-08-24T14:15:22Z'}));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/search/v2/indices/4add1a1fa877c1651906bb22c9dfd37a1618852272/deleted-searches');
            $request->setMethod(HTTP_METH_POST);

            $request->setQueryData([
              'clientUUID' => 'e0097757-d1e2-44ac-ba3c-d97979a354c1'
            ]);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN',
              'content-type' => 'application/json'
            ]);

            $request->setBody('{"query":"string","match":"query","timestamp":"2019-08-24T14:15:22Z"}');

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.post("https://api.synerise.com/search/v2/indices/4add1a1fa877c1651906bb22c9dfd37a1618852272/deleted-searches?clientUUID=e0097757-d1e2-44ac-ba3c-d97979a354c1")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"query\":\"string\",\"match\":\"query\",\"timestamp\":\"2019-08-24T14:15:22Z\"}")
              .asString();
  /search/v2/indices/{indexId}/recent-searches:
    get:
      summary: Get recent searches
      description: |
        Get a profile's recent searches from a particular index.

        ---

        **API consumers:** <span title="Deprecated">AI API key (legacy)</span>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>, <a href="/docs/settings/tool/tracking_codes" target="_blank" rel="noopener" title="Pass your tracker key in the request header">Web SDK Tracker</a>

        **API key permission required:** `ITEMS_SEARCH_RECENT_SEARCH_READ`
      operationId: GetRecentSearches
      tags:
        - Search
      security:
        - JWT: []
        - TrackerKey: []
      parameters:
        - $ref: "#/components/parameters/items-search-recent-indexId"
        - $ref: "#/components/parameters/items-search-recent-clientUUID"
        - $ref: "#/components/parameters/items-search-recent-windowSize"
        - $ref: "#/components/parameters/items-search-recent-timeUnit"
        - $ref: "#/components/parameters/items-search-recent-timeValue"
      responses:
        "200":
          description: Recent searches returned
          content:
            application/json:
              schema:
                type: array
                items:
                  type: string
                  description: Recent search query
        "400":
          description: Check error message for more details
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/items-search-recent-Error"
      x-snr-doc-urls:
        - /api-reference/ai-search#tag/Search/operation/GetRecentSearches
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.synerise.com/search/v2/indices/4add1a1fa877c1651906bb22c9dfd37a1618852272/recent-searches?clientUUID=e0097757-d1e2-44ac-ba3c-d97979a354c1&windowSize=SOME_INTEGER_VALUE&timeUnit=SOME_STRING_VALUE&timeValue=SOME_INTEGER_VALUE' \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            headers = { 'Authorization': "Bearer REPLACE_BEARER_TOKEN" }

            conn.request("GET", "/search/v2/indices/4add1a1fa877c1651906bb22c9dfd37a1618852272/recent-searches?clientUUID=e0097757-d1e2-44ac-ba3c-d97979a354c1&windowSize=SOME_INTEGER_VALUE&timeUnit=SOME_STRING_VALUE&timeValue=SOME_INTEGER_VALUE", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://api.synerise.com/search/v2/indices/4add1a1fa877c1651906bb22c9dfd37a1618852272/recent-searches?clientUUID=e0097757-d1e2-44ac-ba3c-d97979a354c1&windowSize=SOME_INTEGER_VALUE&timeUnit=SOME_STRING_VALUE&timeValue=SOME_INTEGER_VALUE");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/search/v2/indices/4add1a1fa877c1651906bb22c9dfd37a1618852272/recent-searches?clientUUID=e0097757-d1e2-44ac-ba3c-d97979a354c1&windowSize=SOME_INTEGER_VALUE&timeUnit=SOME_STRING_VALUE&timeValue=SOME_INTEGER_VALUE",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/search/v2/indices/4add1a1fa877c1651906bb22c9dfd37a1618852272/recent-searches');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'clientUUID' => 'e0097757-d1e2-44ac-ba3c-d97979a354c1',
              'windowSize' => 'SOME_INTEGER_VALUE',
              'timeUnit' => 'SOME_STRING_VALUE',
              'timeValue' => 'SOME_INTEGER_VALUE'
            ]);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.get("https://api.synerise.com/search/v2/indices/4add1a1fa877c1651906bb22c9dfd37a1618852272/recent-searches?clientUUID=e0097757-d1e2-44ac-ba3c-d97979a354c1&windowSize=SOME_INTEGER_VALUE&timeUnit=SOME_STRING_VALUE&timeValue=SOME_INTEGER_VALUE")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
  /recommendations/v2/campaigns:
    get:
      summary: Get all recommendation campaigns
      description: |
        Fetch all recommendation campaigns.

        ---

        **API consumers:** <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=userLogin" target="_blank" rel="noopener">Synerise User</a>

        **API key permission required:** `RECOMMENDATIONS_V2_MANY_CAMPAIGN_READ`

        **User role permission required:** `campaigns_recommendations: read`
      operationId: GetRecommendationCampaignsV2
      tags:
        - Recommendation campaigns
      security:
        - JWT: []
      parameters:
        - name: page
          in: query
          required: false
          description: Page number
          schema:
            type: integer
            default: 0
        - name: limit
          in: query
          required: false
          description: Maximum number of campaigns on a page
          schema:
            type: integer
            default: 50
        - name: sortBy
          in: query
          required: false
          description: Name of the field by which data will be sorted
          schema:
            type: string
            default: createdAt
            enum:
              - createdAt
              - updatedAt
              - startDate
              - endDate
              - state
              - type
        - name: ordering
          in: query
          required: false
          description: Sorting order
          schema:
            type: string
            default: desc
            enum:
              - asc
              - desc
        - name: includeMeta
          in: query
          required: false
          description: |
            If true, a `meta` JSON block with pagination data is included in the response body.
            If false, the pagination data is included in the response headers.
          schema:
            type: boolean
            default: false
        - name: type
          in: query
          required: false
          description: Filters the results by campaign type.
          schema:
            type: string
        - name: state
          in: query
          required: false
          description: Shows only results with states matching this parameter. When this parameter is omitted, all campaigns are returned regardless of state.
          schema:
            type: array
            items:
              type: string
              enum:
                - draft
                - active
                - paused
        - name: search
          in: query
          required: false
          description: Searches campaigns by the specified phrase in their `id` and `title`.
          schema:
            type: string
      responses:
        "200":
          description: Returns paginated campaigns. If `showMeta` was set to `true`, the metadata is included in the JSON response. If it was set to `false`, the metadata is included in the headers.
          headers:
            Link:
              description: Links to neighboring pages, first page, and last page in pagination
              schema:
                type: string
            X-Pagination-Total-Count:
              description: Total number of campaigns
              schema:
                type: integer
            X-Pagination-Total-Pages:
              description: Total number of pages
              schema:
                type: integer
            X-Pagination-Page:
              description: The current page
              schema:
                type: integer
            X-Pagination-Limit:
              description: Maximal number of items on a page
              schema:
                type: integer
            X-Pagination-Sorted-By:
              description: The column (attribute) that the campaigns were sorted by
              schema:
                type: string
            X-Pagination-Ordering:
              description: Sorting order
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/recommendation-campaigns-RecommendationCampaignsResponseV2"
        "404":
          description: Could not find campaigns
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/recommendation-campaigns-Error"
        "500":
          description: An error occurred
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/recommendation-campaigns-Error"
      x-snr-doc-urls:
        - /api-reference/ai-recommendations#tag/Recommendation-campaigns/operation/GetRecommendationCampaignsV2
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.synerise.com/recommendations/v2/campaigns?page=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&sortBy=SOME_STRING_VALUE&ordering=SOME_STRING_VALUE&includeMeta=SOME_BOOLEAN_VALUE&type=SOME_STRING_VALUE&state=SOME_ARRAY_VALUE&search=SOME_STRING_VALUE' \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            headers = { 'Authorization': "Bearer REPLACE_BEARER_TOKEN" }

            conn.request("GET", "/recommendations/v2/campaigns?page=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&sortBy=SOME_STRING_VALUE&ordering=SOME_STRING_VALUE&includeMeta=SOME_BOOLEAN_VALUE&type=SOME_STRING_VALUE&state=SOME_ARRAY_VALUE&search=SOME_STRING_VALUE", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://api.synerise.com/recommendations/v2/campaigns?page=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&sortBy=SOME_STRING_VALUE&ordering=SOME_STRING_VALUE&includeMeta=SOME_BOOLEAN_VALUE&type=SOME_STRING_VALUE&state=SOME_ARRAY_VALUE&search=SOME_STRING_VALUE");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/recommendations/v2/campaigns?page=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&sortBy=SOME_STRING_VALUE&ordering=SOME_STRING_VALUE&includeMeta=SOME_BOOLEAN_VALUE&type=SOME_STRING_VALUE&state=SOME_ARRAY_VALUE&search=SOME_STRING_VALUE",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/recommendations/v2/campaigns');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'page' => 'SOME_INTEGER_VALUE',
              'limit' => 'SOME_INTEGER_VALUE',
              'sortBy' => 'SOME_STRING_VALUE',
              'ordering' => 'SOME_STRING_VALUE',
              'includeMeta' => 'SOME_BOOLEAN_VALUE',
              'type' => 'SOME_STRING_VALUE',
              'state' => 'SOME_ARRAY_VALUE',
              'search' => 'SOME_STRING_VALUE'
            ]);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.get("https://api.synerise.com/recommendations/v2/campaigns?page=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&sortBy=SOME_STRING_VALUE&ordering=SOME_STRING_VALUE&includeMeta=SOME_BOOLEAN_VALUE&type=SOME_STRING_VALUE&state=SOME_ARRAY_VALUE&search=SOME_STRING_VALUE")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
    post:
      summary: Create a recommendation campaign
      description: |
        Create a new recommendation campaign.

        ---

        **API consumers:** <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=userLogin" target="_blank" rel="noopener">Synerise User</a>

        **API key permission required:** `RECOMMENDATIONS_V2_CAMPAIGN_CREATE`

        **User role permission required:** `campaigns_recommendations: create`
      operationId: CreateRecommendationCampaignV2
      tags:
        - Recommendation campaigns
      security:
        - JWT: []
      requestBody:
        content:
          application/json:
            schema:
              oneOf:
                - $ref: "#/components/schemas/recommendation-campaigns-SimilarRecommendationCampaignsCreateRequestV2"
                - $ref: "#/components/schemas/recommendation-campaigns-MetricsRecommendationCampaignsCreateRequestV2"
                - $ref: "#/components/schemas/recommendation-campaigns-CrossSellRecommendationCampaignsCreateRequestV2"
                - $ref: "#/components/schemas/recommendation-campaigns-SetComplementRecommendationCampaignsCreateRequestV2"
                - $ref: "#/components/schemas/recommendation-campaigns-LastViewedRecommendationCampaignsCreateRequestV2"
                - $ref: "#/components/schemas/recommendation-campaigns-PersonalizedRecommendationCampaignsCreateRequestV2"
                - $ref: "#/components/schemas/recommendation-campaigns-VisuallySimilarRecommendationCampaignsCreateRequestV2"
                - $ref: "#/components/schemas/recommendation-campaigns-ItemComparisonRecommendationCampaignsCreateRequestV2"
                - $ref: "#/components/schemas/recommendation-campaigns-RecentInteractionsRecommendationCampaignsCreateRequestV2"
                - $ref: "#/components/schemas/recommendation-campaigns-SectionRecommendationCampaignsCreateRequestV2"
                - $ref: "#/components/schemas/recommendation-campaigns-AttributeRecommendationCampaignsCreateRequestV2"
                - $ref: "#/components/schemas/recommendation-campaigns-ExternalItemsRecommendationCampaignCreateRequestV2"
                - $ref: "#/components/schemas/recommendation-campaigns-NextInteractionRecommendationCampaignsCreateRequestV2"
        description: All the details of a campaign
        required: true
      responses:
        "200":
          description: OK campaign has been returned
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/recommendation-campaigns-RecommendationCampaignDefinitionV2"
        "500":
          description: An error occurred
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/recommendation-campaigns-Error"
      x-snr-doc-urls:
        - /api-reference/ai-recommendations#tag/Recommendation-campaigns/operation/CreateRecommendationCampaignV2
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/recommendations/v2/campaigns \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"type":"similar","parameters":{"additionalResponseAttributes":["string"],"boostMetric":"string","sortMetric":"string","boostMetricStrength":-100,"shuffleNumItems":0,"personalizedBoostingStrength":0},"title":"string","slug":"string","description":"string","startDate":"string","endDate":"string","state":"draft","filterRules":{"excludePurchasedItems":true,"excludePurchasedItemsSinceDays":0,"elasticExcludePurchasedItems":true,"elasticExcludePurchasedItemsSinceDays":0},"itemsCatalogId":"string","slots":[{"name":"string","itemMin":0,"itemMax":0,"filterRules":{"filters":"string","elasticFilters":"string"},"distinctFilter":{"elastic":true,"filters":[{"field":"string","maxNumItems":0,"levelRangeModifier":0}]},"attribute":{"name":"string","levelRangeModifier":0},"numRows":0,"numItems":0,"useDefaultDistinctFilters":true,"useDefaultItemFilters":true}],"keepSlotsOrder":true,"personalizeSlotsOrder":false,"boostingStrategies":[{"name":"string","condition":"string","strength":1}],"itemsSource":{"type":"aggregate","id":"string"}}'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            payload = "{\"type\":\"similar\",\"parameters\":{\"additionalResponseAttributes\":[\"string\"],\"boostMetric\":\"string\",\"sortMetric\":\"string\",\"boostMetricStrength\":-100,\"shuffleNumItems\":0,\"personalizedBoostingStrength\":0},\"title\":\"string\",\"slug\":\"string\",\"description\":\"string\",\"startDate\":\"string\",\"endDate\":\"string\",\"state\":\"draft\",\"filterRules\":{\"excludePurchasedItems\":true,\"excludePurchasedItemsSinceDays\":0,\"elasticExcludePurchasedItems\":true,\"elasticExcludePurchasedItemsSinceDays\":0},\"itemsCatalogId\":\"string\",\"slots\":[{\"name\":\"string\",\"itemMin\":0,\"itemMax\":0,\"filterRules\":{\"filters\":\"string\",\"elasticFilters\":\"string\"},\"distinctFilter\":{\"elastic\":true,\"filters\":[{\"field\":\"string\",\"maxNumItems\":0,\"levelRangeModifier\":0}]},\"attribute\":{\"name\":\"string\",\"levelRangeModifier\":0},\"numRows\":0,\"numItems\":0,\"useDefaultDistinctFilters\":true,\"useDefaultItemFilters\":true}],\"keepSlotsOrder\":true,\"personalizeSlotsOrder\":false,\"boostingStrategies\":[{\"name\":\"string\",\"condition\":\"string\",\"strength\":1}],\"itemsSource\":{\"type\":\"aggregate\",\"id\":\"string\"}}"

            headers = {
                'Authorization': "Bearer REPLACE_BEARER_TOKEN",
                'content-type': "application/json"
                }

            conn.request("POST", "/recommendations/v2/campaigns", payload, headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "type": "similar",
              "parameters": {
                "additionalResponseAttributes": [
                  "string"
                ],
                "boostMetric": "string",
                "sortMetric": "string",
                "boostMetricStrength": -100,
                "shuffleNumItems": 0,
                "personalizedBoostingStrength": 0
              },
              "title": "string",
              "slug": "string",
              "description": "string",
              "startDate": "string",
              "endDate": "string",
              "state": "draft",
              "filterRules": {
                "excludePurchasedItems": true,
                "excludePurchasedItemsSinceDays": 0,
                "elasticExcludePurchasedItems": true,
                "elasticExcludePurchasedItemsSinceDays": 0
              },
              "itemsCatalogId": "string",
              "slots": [
                {
                  "name": "string",
                  "itemMin": 0,
                  "itemMax": 0,
                  "filterRules": {
                    "filters": "string",
                    "elasticFilters": "string"
                  },
                  "distinctFilter": {
                    "elastic": true,
                    "filters": [
                      {
                        "field": "string",
                        "maxNumItems": 0,
                        "levelRangeModifier": 0
                      }
                    ]
                  },
                  "attribute": {
                    "name": "string",
                    "levelRangeModifier": 0
                  },
                  "numRows": 0,
                  "numItems": 0,
                  "useDefaultDistinctFilters": true,
                  "useDefaultItemFilters": true
                }
              ],
              "keepSlotsOrder": true,
              "personalizeSlotsOrder": false,
              "boostingStrategies": [
                {
                  "name": "string",
                  "condition": "string",
                  "strength": 1
                }
              ],
              "itemsSource": {
                "type": "aggregate",
                "id": "string"
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://api.synerise.com/recommendations/v2/campaigns");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/recommendations/v2/campaigns",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              type: 'similar',
              parameters: {
                additionalResponseAttributes: ['string'],
                boostMetric: 'string',
                sortMetric: 'string',
                boostMetricStrength: -100,
                shuffleNumItems: 0,
                personalizedBoostingStrength: 0
              },
              title: 'string',
              slug: 'string',
              description: 'string',
              startDate: 'string',
              endDate: 'string',
              state: 'draft',
              filterRules: {
                excludePurchasedItems: true,
                excludePurchasedItemsSinceDays: 0,
                elasticExcludePurchasedItems: true,
                elasticExcludePurchasedItemsSinceDays: 0
              },
              itemsCatalogId: 'string',
              slots: [
                {
                  name: 'string',
                  itemMin: 0,
                  itemMax: 0,
                  filterRules: {filters: 'string', elasticFilters: 'string'},
                  distinctFilter: {
                    elastic: true,
                    filters: [{field: 'string', maxNumItems: 0, levelRangeModifier: 0}]
                  },
                  attribute: {name: 'string', levelRangeModifier: 0},
                  numRows: 0,
                  numItems: 0,
                  useDefaultDistinctFilters: true,
                  useDefaultItemFilters: true
                }
              ],
              keepSlotsOrder: true,
              personalizeSlotsOrder: false,
              boostingStrategies: [{name: 'string', condition: 'string', strength: 1}],
              itemsSource: {type: 'aggregate', id: 'string'}
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/recommendations/v2/campaigns');
            $request->setMethod(HTTP_METH_POST);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN',
              'content-type' => 'application/json'
            ]);

            $request->setBody('{"type":"similar","parameters":{"additionalResponseAttributes":["string"],"boostMetric":"string","sortMetric":"string","boostMetricStrength":-100,"shuffleNumItems":0,"personalizedBoostingStrength":0},"title":"string","slug":"string","description":"string","startDate":"string","endDate":"string","state":"draft","filterRules":{"excludePurchasedItems":true,"excludePurchasedItemsSinceDays":0,"elasticExcludePurchasedItems":true,"elasticExcludePurchasedItemsSinceDays":0},"itemsCatalogId":"string","slots":[{"name":"string","itemMin":0,"itemMax":0,"filterRules":{"filters":"string","elasticFilters":"string"},"distinctFilter":{"elastic":true,"filters":[{"field":"string","maxNumItems":0,"levelRangeModifier":0}]},"attribute":{"name":"string","levelRangeModifier":0},"numRows":0,"numItems":0,"useDefaultDistinctFilters":true,"useDefaultItemFilters":true}],"keepSlotsOrder":true,"personalizeSlotsOrder":false,"boostingStrategies":[{"name":"string","condition":"string","strength":1}],"itemsSource":{"type":"aggregate","id":"string"}}');

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.post("https://api.synerise.com/recommendations/v2/campaigns")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"type\":\"similar\",\"parameters\":{\"additionalResponseAttributes\":[\"string\"],\"boostMetric\":\"string\",\"sortMetric\":\"string\",\"boostMetricStrength\":-100,\"shuffleNumItems\":0,\"personalizedBoostingStrength\":0},\"title\":\"string\",\"slug\":\"string\",\"description\":\"string\",\"startDate\":\"string\",\"endDate\":\"string\",\"state\":\"draft\",\"filterRules\":{\"excludePurchasedItems\":true,\"excludePurchasedItemsSinceDays\":0,\"elasticExcludePurchasedItems\":true,\"elasticExcludePurchasedItemsSinceDays\":0},\"itemsCatalogId\":\"string\",\"slots\":[{\"name\":\"string\",\"itemMin\":0,\"itemMax\":0,\"filterRules\":{\"filters\":\"string\",\"elasticFilters\":\"string\"},\"distinctFilter\":{\"elastic\":true,\"filters\":[{\"field\":\"string\",\"maxNumItems\":0,\"levelRangeModifier\":0}]},\"attribute\":{\"name\":\"string\",\"levelRangeModifier\":0},\"numRows\":0,\"numItems\":0,\"useDefaultDistinctFilters\":true,\"useDefaultItemFilters\":true}],\"keepSlotsOrder\":true,\"personalizeSlotsOrder\":false,\"boostingStrategies\":[{\"name\":\"string\",\"condition\":\"string\",\"strength\":1}],\"itemsSource\":{\"type\":\"aggregate\",\"id\":\"string\"}}")
              .asString();
  /recommendations/v2/campaigns/{campaignId}:
    get:
      summary: Get recommendation campaign details
      description: |
        Retrieve the details of a single campaign.

        ---

        **API consumers:** <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=userLogin" target="_blank" rel="noopener">Synerise User</a>

        **API key permission required:** `RECOMMENDATIONS_V2_SINGLE_CAMPAIGN_READ`

        **User role permission required:** `campaigns_recommendations: read`
      operationId: GetRecommendationCampaignV2
      tags:
        - Recommendation campaigns
      security:
        - JWT: []
      responses:
        "200":
          description: Data of a single campaign
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/recommendation-campaigns-RecommendationCampaignDefinitionV2"
        "404":
          description: Could not find campaign
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/recommendation-campaigns-Error"
        "500":
          description: An error occurred
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/recommendation-campaigns-Error"
      x-snr-doc-urls:
        - /api-reference/ai-recommendations#tag/Recommendation-campaigns/operation/GetRecommendationCampaignV2
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url https://api.synerise.com/recommendations/v2/campaigns/%7BcampaignId%7D \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            headers = { 'Authorization': "Bearer REPLACE_BEARER_TOKEN" }

            conn.request("GET", "/recommendations/v2/campaigns/%7BcampaignId%7D", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://api.synerise.com/recommendations/v2/campaigns/%7BcampaignId%7D");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/recommendations/v2/campaigns/%7BcampaignId%7D",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/recommendations/v2/campaigns/%7BcampaignId%7D');
            $request->setMethod(HTTP_METH_GET);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.get("https://api.synerise.com/recommendations/v2/campaigns/%7BcampaignId%7D")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
    post:
      summary: Update a recommendation campaign
      description: |
        Update a recommendation campaign by changing the parameters or copying the definition from another campaign.

        When you copy from another campaign:
        - the following campaign data is NOT updated:
          - `title`
          - `state`
          - `start_date`
          - `end_date`
          - `campaignId`
          - `createdAt`
        - `modified_by_user_id` changes to the user who performed the update


        ---

        **API consumers:** <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=userLogin" target="_blank" rel="noopener">Synerise User</a>

        **API key permission required:** `RECOMMENDATIONS_V2_CAMPAIGN_UPDATE`

        **User role permission required:** `campaigns_recommendations: update`
      operationId: UpdateRecommendationCampaignV2
      tags:
        - Recommendation campaigns
      security:
        - JWT: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/recommendation-campaigns-RecommendationCampaignUpdateRequest"
        description: Definition of the updated campaign.
        required: true
      responses:
        "200":
          description: Campaign updated and returned
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/recommendation-campaigns-RecommendationCampaignDefinitionV2"
        "404":
          description: Could not find campaign
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/recommendation-campaigns-Error"
        "500":
          description: An error occurred
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/recommendation-campaigns-Error"
      x-snr-doc-urls:
        - /api-reference/ai-recommendations#tag/Recommendation-campaigns/operation/UpdateRecommendationCampaignV2
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/recommendations/v2/campaigns/%7BcampaignId%7D \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"type":"similar","parameters":{"additionalResponseAttributes":["string"],"boostMetric":"string","sortMetric":"string","boostMetricStrength":-100,"shuffleNumItems":0},"campaignId":"string","title":"string","slug":"string","description":"string","startDate":"string","endDate":"string","createdAt":"string","updatedAt":"string","state":"draft","filterRules":{"excludePurchasedItems":true,"excludePurchasedItemsSinceDays":0,"elasticExcludePurchasedItems":true,"elasticExcludePurchasedItemsSinceDays":0},"itemsCatalogId":"string","additionalResponseAttributes":["string"],"slots":[{"name":"string","itemMin":0,"itemMax":0,"filterRules":{"filters":"string","elasticFilters":"string"},"distinctFilter":{"elastic":true,"filters":[{"field":"string","maxNumItems":0,"levelRangeModifier":0}]},"attribute":{"name":"string","levelRangeModifier":0},"numRows":0,"numItems":0,"useDefaultDistinctFilters":true,"useDefaultItemFilters":true}],"keepSlotsOrder":true,"personalizeSlotsOrder":false,"boostingStrategies":[{"name":"string","condition":"string","strength":1}],"itemsSource":{"type":"aggregate","id":"string"},"abTest":{"experimentId":0,"variantId":0,"status":"NotStarted","isBaseline":true},"crossWorkspaceMode":{"enabled":true}}'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            payload = "{\"type\":\"similar\",\"parameters\":{\"additionalResponseAttributes\":[\"string\"],\"boostMetric\":\"string\",\"sortMetric\":\"string\",\"boostMetricStrength\":-100,\"shuffleNumItems\":0},\"campaignId\":\"string\",\"title\":\"string\",\"slug\":\"string\",\"description\":\"string\",\"startDate\":\"string\",\"endDate\":\"string\",\"createdAt\":\"string\",\"updatedAt\":\"string\",\"state\":\"draft\",\"filterRules\":{\"excludePurchasedItems\":true,\"excludePurchasedItemsSinceDays\":0,\"elasticExcludePurchasedItems\":true,\"elasticExcludePurchasedItemsSinceDays\":0},\"itemsCatalogId\":\"string\",\"additionalResponseAttributes\":[\"string\"],\"slots\":[{\"name\":\"string\",\"itemMin\":0,\"itemMax\":0,\"filterRules\":{\"filters\":\"string\",\"elasticFilters\":\"string\"},\"distinctFilter\":{\"elastic\":true,\"filters\":[{\"field\":\"string\",\"maxNumItems\":0,\"levelRangeModifier\":0}]},\"attribute\":{\"name\":\"string\",\"levelRangeModifier\":0},\"numRows\":0,\"numItems\":0,\"useDefaultDistinctFilters\":true,\"useDefaultItemFilters\":true}],\"keepSlotsOrder\":true,\"personalizeSlotsOrder\":false,\"boostingStrategies\":[{\"name\":\"string\",\"condition\":\"string\",\"strength\":1}],\"itemsSource\":{\"type\":\"aggregate\",\"id\":\"string\"},\"abTest\":{\"experimentId\":0,\"variantId\":0,\"status\":\"NotStarted\",\"isBaseline\":true},\"crossWorkspaceMode\":{\"enabled\":true}}"

            headers = {
                'Authorization': "Bearer REPLACE_BEARER_TOKEN",
                'content-type': "application/json"
                }

            conn.request("POST", "/recommendations/v2/campaigns/%7BcampaignId%7D", payload, headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "type": "similar",
              "parameters": {
                "additionalResponseAttributes": [
                  "string"
                ],
                "boostMetric": "string",
                "sortMetric": "string",
                "boostMetricStrength": -100,
                "shuffleNumItems": 0
              },
              "campaignId": "string",
              "title": "string",
              "slug": "string",
              "description": "string",
              "startDate": "string",
              "endDate": "string",
              "createdAt": "string",
              "updatedAt": "string",
              "state": "draft",
              "filterRules": {
                "excludePurchasedItems": true,
                "excludePurchasedItemsSinceDays": 0,
                "elasticExcludePurchasedItems": true,
                "elasticExcludePurchasedItemsSinceDays": 0
              },
              "itemsCatalogId": "string",
              "additionalResponseAttributes": [
                "string"
              ],
              "slots": [
                {
                  "name": "string",
                  "itemMin": 0,
                  "itemMax": 0,
                  "filterRules": {
                    "filters": "string",
                    "elasticFilters": "string"
                  },
                  "distinctFilter": {
                    "elastic": true,
                    "filters": [
                      {
                        "field": "string",
                        "maxNumItems": 0,
                        "levelRangeModifier": 0
                      }
                    ]
                  },
                  "attribute": {
                    "name": "string",
                    "levelRangeModifier": 0
                  },
                  "numRows": 0,
                  "numItems": 0,
                  "useDefaultDistinctFilters": true,
                  "useDefaultItemFilters": true
                }
              ],
              "keepSlotsOrder": true,
              "personalizeSlotsOrder": false,
              "boostingStrategies": [
                {
                  "name": "string",
                  "condition": "string",
                  "strength": 1
                }
              ],
              "itemsSource": {
                "type": "aggregate",
                "id": "string"
              },
              "abTest": {
                "experimentId": 0,
                "variantId": 0,
                "status": "NotStarted",
                "isBaseline": true
              },
              "crossWorkspaceMode": {
                "enabled": true
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://api.synerise.com/recommendations/v2/campaigns/%7BcampaignId%7D");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/recommendations/v2/campaigns/%7BcampaignId%7D",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              type: 'similar',
              parameters: {
                additionalResponseAttributes: ['string'],
                boostMetric: 'string',
                sortMetric: 'string',
                boostMetricStrength: -100,
                shuffleNumItems: 0
              },
              campaignId: 'string',
              title: 'string',
              slug: 'string',
              description: 'string',
              startDate: 'string',
              endDate: 'string',
              createdAt: 'string',
              updatedAt: 'string',
              state: 'draft',
              filterRules: {
                excludePurchasedItems: true,
                excludePurchasedItemsSinceDays: 0,
                elasticExcludePurchasedItems: true,
                elasticExcludePurchasedItemsSinceDays: 0
              },
              itemsCatalogId: 'string',
              additionalResponseAttributes: ['string'],
              slots: [
                {
                  name: 'string',
                  itemMin: 0,
                  itemMax: 0,
                  filterRules: {filters: 'string', elasticFilters: 'string'},
                  distinctFilter: {
                    elastic: true,
                    filters: [{field: 'string', maxNumItems: 0, levelRangeModifier: 0}]
                  },
                  attribute: {name: 'string', levelRangeModifier: 0},
                  numRows: 0,
                  numItems: 0,
                  useDefaultDistinctFilters: true,
                  useDefaultItemFilters: true
                }
              ],
              keepSlotsOrder: true,
              personalizeSlotsOrder: false,
              boostingStrategies: [{name: 'string', condition: 'string', strength: 1}],
              itemsSource: {type: 'aggregate', id: 'string'},
              abTest: {experimentId: 0, variantId: 0, status: 'NotStarted', isBaseline: true},
              crossWorkspaceMode: {enabled: true}
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/recommendations/v2/campaigns/%7BcampaignId%7D');
            $request->setMethod(HTTP_METH_POST);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN',
              'content-type' => 'application/json'
            ]);

            $request->setBody('{"type":"similar","parameters":{"additionalResponseAttributes":["string"],"boostMetric":"string","sortMetric":"string","boostMetricStrength":-100,"shuffleNumItems":0},"campaignId":"string","title":"string","slug":"string","description":"string","startDate":"string","endDate":"string","createdAt":"string","updatedAt":"string","state":"draft","filterRules":{"excludePurchasedItems":true,"excludePurchasedItemsSinceDays":0,"elasticExcludePurchasedItems":true,"elasticExcludePurchasedItemsSinceDays":0},"itemsCatalogId":"string","additionalResponseAttributes":["string"],"slots":[{"name":"string","itemMin":0,"itemMax":0,"filterRules":{"filters":"string","elasticFilters":"string"},"distinctFilter":{"elastic":true,"filters":[{"field":"string","maxNumItems":0,"levelRangeModifier":0}]},"attribute":{"name":"string","levelRangeModifier":0},"numRows":0,"numItems":0,"useDefaultDistinctFilters":true,"useDefaultItemFilters":true}],"keepSlotsOrder":true,"personalizeSlotsOrder":false,"boostingStrategies":[{"name":"string","condition":"string","strength":1}],"itemsSource":{"type":"aggregate","id":"string"},"abTest":{"experimentId":0,"variantId":0,"status":"NotStarted","isBaseline":true},"crossWorkspaceMode":{"enabled":true}}');

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.post("https://api.synerise.com/recommendations/v2/campaigns/%7BcampaignId%7D")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"type\":\"similar\",\"parameters\":{\"additionalResponseAttributes\":[\"string\"],\"boostMetric\":\"string\",\"sortMetric\":\"string\",\"boostMetricStrength\":-100,\"shuffleNumItems\":0},\"campaignId\":\"string\",\"title\":\"string\",\"slug\":\"string\",\"description\":\"string\",\"startDate\":\"string\",\"endDate\":\"string\",\"createdAt\":\"string\",\"updatedAt\":\"string\",\"state\":\"draft\",\"filterRules\":{\"excludePurchasedItems\":true,\"excludePurchasedItemsSinceDays\":0,\"elasticExcludePurchasedItems\":true,\"elasticExcludePurchasedItemsSinceDays\":0},\"itemsCatalogId\":\"string\",\"additionalResponseAttributes\":[\"string\"],\"slots\":[{\"name\":\"string\",\"itemMin\":0,\"itemMax\":0,\"filterRules\":{\"filters\":\"string\",\"elasticFilters\":\"string\"},\"distinctFilter\":{\"elastic\":true,\"filters\":[{\"field\":\"string\",\"maxNumItems\":0,\"levelRangeModifier\":0}]},\"attribute\":{\"name\":\"string\",\"levelRangeModifier\":0},\"numRows\":0,\"numItems\":0,\"useDefaultDistinctFilters\":true,\"useDefaultItemFilters\":true}],\"keepSlotsOrder\":true,\"personalizeSlotsOrder\":false,\"boostingStrategies\":[{\"name\":\"string\",\"condition\":\"string\",\"strength\":1}],\"itemsSource\":{\"type\":\"aggregate\",\"id\":\"string\"},\"abTest\":{\"experimentId\":0,\"variantId\":0,\"status\":\"NotStarted\",\"isBaseline\":true},\"crossWorkspaceMode\":{\"enabled\":true}}")
              .asString();
    delete:
      summary: Delete a recommendation campaign
      description: |
        Delete a recommendation campaign. This operation is irreversible.

        ---

        **API consumers:** <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=userLogin" target="_blank" rel="noopener">Synerise User</a>

        **API key permission required:** `RECOMMENDATIONS_V2_CAMPAIGN_DELETE`

        **User role permission required:** `campaigns_recommendations: delete`
      operationId: DeleteRecommendationCampaign
      tags:
        - Recommendation campaigns
      security:
        - JWT: []
      responses:
        "200":
          description: OK campaign has been deleted
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/recommendation-campaigns-RecommendationCampaignDefinitionV2"
        "404":
          description: Could not find campaign
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/recommendation-campaigns-Error"
        "500":
          description: An error occurred
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/recommendation-campaigns-Error"
      x-snr-doc-urls:
        - /api-reference/ai-recommendations#tag/Recommendation-campaigns/operation/DeleteRecommendationCampaign
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request DELETE \
              --url https://api.synerise.com/recommendations/v2/campaigns/%7BcampaignId%7D \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            headers = { 'Authorization': "Bearer REPLACE_BEARER_TOKEN" }

            conn.request("DELETE", "/recommendations/v2/campaigns/%7BcampaignId%7D", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("DELETE", "https://api.synerise.com/recommendations/v2/campaigns/%7BcampaignId%7D");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "DELETE",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/recommendations/v2/campaigns/%7BcampaignId%7D",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/recommendations/v2/campaigns/%7BcampaignId%7D');
            $request->setMethod(HTTP_METH_DELETE);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.delete("https://api.synerise.com/recommendations/v2/campaigns/%7BcampaignId%7D")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
    parameters:
      - $ref: "#/components/parameters/recommendation-campaigns-campaignId"
  /recommendations/v2/campaigns/state:
    post:
      summary: Change campaigns' states
      description: |
        Change the status of one or more campaigns.

        ---

        **API consumers:** <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=userLogin" target="_blank" rel="noopener">Synerise User</a>

        **API key permission required:** `RECOMMENDATIONS_V2_STATE_CAMPAIGN_UPDATE`

        **User role permission required:** `campaigns_recommendations: update`
      operationId: UpdateRecommendationsStatesV2
      tags:
        - Recommendation campaigns
      security:
        - JWT: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/recommendation-campaigns-RecommendationStateChangeRequestV2"
        description: List of updated campaign IDs and new states.
        required: true
      responses:
        "200":
          description: Campaigns status changed
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/recommendation-campaigns-RecommendationStateChangeResponseV2"
        "500":
          description: An error occurred
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/recommendation-campaigns-Error"
      x-snr-doc-urls:
        - /api-reference/ai-recommendations#tag/Recommendation-campaigns/operation/UpdateRecommendationsStatesV2
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/recommendations/v2/campaigns/state \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"state":"draft","ids":["string"]}'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            payload = "{\"state\":\"draft\",\"ids\":[\"string\"]}"

            headers = {
                'Authorization': "Bearer REPLACE_BEARER_TOKEN",
                'content-type': "application/json"
                }

            conn.request("POST", "/recommendations/v2/campaigns/state", payload, headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "state": "draft",
              "ids": [
                "string"
              ]
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://api.synerise.com/recommendations/v2/campaigns/state");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/recommendations/v2/campaigns/state",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({state: 'draft', ids: ['string']}));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/recommendations/v2/campaigns/state');
            $request->setMethod(HTTP_METH_POST);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN',
              'content-type' => 'application/json'
            ]);

            $request->setBody('{"state":"draft","ids":["string"]}');

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.post("https://api.synerise.com/recommendations/v2/campaigns/state")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"state\":\"draft\",\"ids\":[\"string\"]}")
              .asString();
  /recommendations/v2/campaigns/{campaignId}/copy:
    post:
      summary: Copy a recommendation campaign
      description: |
        Copy a campaign. The copied campaign's `state` will be `draft` and `slug` will be undefined.

        ---

        **API consumers:** <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=userLogin" target="_blank" rel="noopener">Synerise User</a>

        **API key permission required:** `RECOMMENDATIONS_V2_COPY_CAMPAIGN_CREATE`

        **User role permission required:** `campaigns_recommendations: create`
      operationId: CopyRecommendationCampaignV2
      tags:
        - Recommendation campaigns
      security:
        - JWT: []
      parameters:
        - $ref: "#/components/parameters/recommendation-campaigns-campaignId"
      responses:
        "200":
          description: Copy created and returned
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/recommendation-campaigns-RecommendationCampaignDefinitionV2"
        "404":
          description: Could not find campaign
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/recommendation-campaigns-Error"
        "500":
          description: An error occurred
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/recommendation-campaigns-Error"
      x-snr-doc-urls:
        - /api-reference/ai-recommendations#tag/Recommendation-campaigns/operation/CopyRecommendationCampaignV2
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/recommendations/v2/campaigns/%7BcampaignId%7D/copy \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            headers = { 'Authorization': "Bearer REPLACE_BEARER_TOKEN" }

            conn.request("POST", "/recommendations/v2/campaigns/%7BcampaignId%7D/copy", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://api.synerise.com/recommendations/v2/campaigns/%7BcampaignId%7D/copy");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/recommendations/v2/campaigns/%7BcampaignId%7D/copy",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/recommendations/v2/campaigns/%7BcampaignId%7D/copy');
            $request->setMethod(HTTP_METH_POST);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.post("https://api.synerise.com/recommendations/v2/campaigns/%7BcampaignId%7D/copy")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
  /recommendations/v2/campaigns/simplified:
    get:
      summary: Get simplified recommendation campaigns
      description: |
        Fetch simplified recommendation campaign data.

        ---

        **API consumers:** <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=userLogin" target="_blank" rel="noopener">Synerise User</a>

        **API key permission required:** `RECOMMENDATIONS_V2_MANY_SIMPLIFIED_CAMPAIGN_READ`

        **User role permission required:** `campaigns_recommendations: read`
      operationId: GetSimplifiedRecommendationCampaign
      tags:
        - Recommendation campaigns
      security:
        - JWT: []
      parameters:
        - name: type
          in: query
          description: Filter by campaign type.
          required: false
          schema:
            type: array
            items:
              type: string
        - name: state
          in: query
          description: Filter by states.
          required: false
          schema:
            type: array
            items:
              type: string
              enum:
                - draft
                - active
                - paused
      responses:
        "200":
          description: Simplified campaigns returned
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/recommendation-campaigns-SimpleRecommendationCampaignsV2"
        "404":
          description: Could not find campaign
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/recommendation-campaigns-Error"
        "500":
          description: An error occurred
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/recommendation-campaigns-Error"
      x-snr-doc-urls:
        - /api-reference/ai-recommendations#tag/Recommendation-campaigns/operation/GetSimplifiedRecommendationCampaign
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.synerise.com/recommendations/v2/campaigns/simplified?type=SOME_ARRAY_VALUE&state=SOME_ARRAY_VALUE' \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            headers = { 'Authorization': "Bearer REPLACE_BEARER_TOKEN" }

            conn.request("GET", "/recommendations/v2/campaigns/simplified?type=SOME_ARRAY_VALUE&state=SOME_ARRAY_VALUE", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://api.synerise.com/recommendations/v2/campaigns/simplified?type=SOME_ARRAY_VALUE&state=SOME_ARRAY_VALUE");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/recommendations/v2/campaigns/simplified?type=SOME_ARRAY_VALUE&state=SOME_ARRAY_VALUE",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/recommendations/v2/campaigns/simplified');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'type' => 'SOME_ARRAY_VALUE',
              'state' => 'SOME_ARRAY_VALUE'
            ]);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.get("https://api.synerise.com/recommendations/v2/campaigns/simplified?type=SOME_ARRAY_VALUE&state=SOME_ARRAY_VALUE")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
  /recommendations/v2/recommend/campaigns/{campaignIdentifier}:
    get:
      summary: Get recommendations by campaign
      description: |
        This method allows you to retrieve recommendations based on a campaignID or a slug and a context. The context is built based on:

          - campaign identifier (required)
          - profile UUID
          - items (for example, items currently in the basket)
          - item exclusions


          This is the recommended and simplest way to fetch recommendations.

          Before you use this method, you must to create a recommendations campaign in Synerise. All the recommendation filters and parameters will be handled for you automatically according to a campaign's configuration.


        ---

        **API consumers:** <span title="Deprecated">AI API key (legacy)</span>, <a href="/docs/settings/tool/tracking_codes" target="_blank" rel="noopener" title="Pass your tracker key in the request header">Web SDK Tracker</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>

        **API key permission required:** `API_MATERIALIZER_V2_RECOMMEND_CAMPAIGNS_RECOMMENDATIONS_READ`
      operationId: GetRecommendationsByCampaignV2
      security:
        - TrackerKey: []
        - JWT: []
      tags:
        - Recommendations
      parameters:
        - $ref: "#/components/parameters/recommendations-api-materializer-campaignIdentifier"
        - in: query
          name: clientUUID
          description: |
            Profile UUID. This parameter is required for these recommendation types:
              - Personalized
              - Last seen
              - Recent interactions
              - Section
              - Attribute

            This parameter can be passed in all recommendations. In recommendations which don't require the customer context, it can still be used to create filters.
          required: false
          schema:
            type: string
        - name: itemId
          in: query
          description: |
            Item ID or item IDs for the recommendation context. This parameter is:

            - required for similar/complementary items campaigns.

            - optional for personalized campaigns.

            This parameter can be passed in all recommendations. In recommendations which don't use the context item as part of the recommendation model, the context item can only be used to create filters.

            You can repeat this parameter in order to pass a number of context-creating items, for example, in a cart recommendation campaign.

            This overrides the `itemsSource` settings of the campaign definition.

            Alternatively, you can pass the `itemsSourceType` and `itemsSourceId` parameters to use context items from source (aggregate or expression). These parameters can't be used at the same request with `itemId`.
          required: false
          schema:
            type: string
        - name: inventoryChannelId
          in: query
          description: Inventory context identifier used to evaluate inventory-related filters and boosting strategies. If not provided, no inventory context will be applied.
          required: false
          schema:
            type: string
        - $ref: "#/components/parameters/recommendations-api-materializer-itemsSourceType"
        - $ref: "#/components/parameters/recommendations-api-materializer-itemsSourceId"
        - name: externalItemId
          in: query
          description: |
            Items provided by an external recommendation model to be returned as recommendation results.

            You can repeat this parameter to pass multiple external items.

            This parameter is used with campaigns of type "external-items".
          required: false
          schema:
            type: string
        - name: itemIdExcluded
          in: query
          description: IDs of items that will be excluded from the generated recommendations. For example, items already added to the basket.
          required: false
          schema:
            type: string
        - name: additionalFilters
          in: query
          required: false
          schema:
            type: string
          description: |
            <hr>
            <strong>IMPORTANT</strong>:

            - The `filtersJoiner` attribute is REQUIRED when `additionalFilters` is included. If `filtersJoiner` is missing, the additional filters do not work.  
            - Do NOT send multiple instances of this parameter.

            <hr>

            Additional filters. These are merged with the campaign's own filters according to the logic in `filtersJoiner`.

            This parameter must include all the additional filters as a single string, for example `additionalFilters=effectivePrice>300 AND effectivePrice<400` (the spaces are required).
          example: effectivePrice>300 AND effectivePrice<400
        - name: filtersJoiner
          in: query
          required: false
          schema:
            type: string
            enum:
              - AND
              - OR
              - REPLACE
          description: |
            Defines the logic of merging `additionalFilters` with the campaign's existing filters.
            - `REPLACE` replaces the campaign's filters with your filters.
            - `AND` matches if both your filters and the campaign filters are met.
            - `OR` matches if at least one of the filters is met.
        - name: additionalElasticFilters
          in: query
          required: false
          schema:
            type: string
          description: |
            <hr>
            <strong>IMPORTANT</strong>:

            - The `elasticFiltersJoiner` attribute is REQUIRED when `additionalElasticFilters` is included. If `elasticFiltersJoiner` is missing, the additional filters do not work.  
            - Do NOT send multiple instances of this parameter.

            <hr>

            Additional elastic filters. These are merged with the campaign's own elastic filters according to the logic in `elasticFiltersJoiner`.

            This parameter must include all the additional filters as a single string, for example `additionalElasticFilters=effectivePrice>300 AND effectivePrice<400` (the spaces are required).
          example: effectivePrice>300 AND effectivePrice<400
        - name: elasticFiltersJoiner
          in: query
          required: false
          schema:
            type: string
            enum:
              - AND
              - OR
              - REPLACE
          description: |
            Defines the logic of merging `additionalElasticFilters` with the campaign's existing elastic filters.
            - `REPLACE` replaces the campaign's filters with your filters.
            - `AND` matches if both your filters and the campaign filters are met.
            - `OR` matches if at least one of the filters is met.
        - name: displayAttribute
          in: query
          required: false
          schema:
            type: string
          description: Item attribute whose value will be returned in the recommendation response. The parameter value will be merged with the configuration of the recommendation. This parameter can be passed multiple times.
        - name: includeContextItems
          in: query
          description: When true, the recommendation response will include context items metadata.
          required: false
          schema:
            type: boolean
        - $ref: "#/components/parameters/recommendations-api-materializer-paramsMaterializer"
      responses:
        "200":
          description: Recommendations for the provided context. The response schema depends on your Workspace configuration. The schema below only includes the static elements.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/recommendations-api-materializer-RecommendationResponseSchemaV2-materializer"
        "404":
          $ref: "#/components/responses/recommendations-api-materializer-404cannotGenerate"
        "500":
          $ref: "#/components/responses/recommendations-api-materializer-500error"
      x-snr-doc-urls:
        - /api-reference/ai-recommendations#tag/Recommendations/operation/GetRecommendationsByCampaignV2
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.synerise.com/recommendations/v2/recommend/campaigns/%7BcampaignIdentifier%7D?clientUUID=SOME_STRING_VALUE&itemId=SOME_STRING_VALUE&inventoryChannelId=SOME_STRING_VALUE&itemsSourceType=SOME_STRING_VALUE&itemsSourceId=SOME_STRING_VALUE&externalItemId=SOME_STRING_VALUE&itemIdExcluded=SOME_STRING_VALUE&additionalFilters=effectivePrice%3E300%20AND%20effectivePrice%3C400&filtersJoiner=SOME_STRING_VALUE&additionalElasticFilters=effectivePrice%3E300%20AND%20effectivePrice%3C400&elasticFiltersJoiner=SOME_STRING_VALUE&displayAttribute=SOME_STRING_VALUE&includeContextItems=SOME_BOOLEAN_VALUE&params=source%3Amobile' \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            headers = { 'Authorization': "Bearer REPLACE_BEARER_TOKEN" }

            conn.request("GET", "/recommendations/v2/recommend/campaigns/%7BcampaignIdentifier%7D?clientUUID=SOME_STRING_VALUE&itemId=SOME_STRING_VALUE&inventoryChannelId=SOME_STRING_VALUE&itemsSourceType=SOME_STRING_VALUE&itemsSourceId=SOME_STRING_VALUE&externalItemId=SOME_STRING_VALUE&itemIdExcluded=SOME_STRING_VALUE&additionalFilters=effectivePrice%3E300%20AND%20effectivePrice%3C400&filtersJoiner=SOME_STRING_VALUE&additionalElasticFilters=effectivePrice%3E300%20AND%20effectivePrice%3C400&elasticFiltersJoiner=SOME_STRING_VALUE&displayAttribute=SOME_STRING_VALUE&includeContextItems=SOME_BOOLEAN_VALUE&params=source%3Amobile", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://api.synerise.com/recommendations/v2/recommend/campaigns/%7BcampaignIdentifier%7D?clientUUID=SOME_STRING_VALUE&itemId=SOME_STRING_VALUE&inventoryChannelId=SOME_STRING_VALUE&itemsSourceType=SOME_STRING_VALUE&itemsSourceId=SOME_STRING_VALUE&externalItemId=SOME_STRING_VALUE&itemIdExcluded=SOME_STRING_VALUE&additionalFilters=effectivePrice%3E300%20AND%20effectivePrice%3C400&filtersJoiner=SOME_STRING_VALUE&additionalElasticFilters=effectivePrice%3E300%20AND%20effectivePrice%3C400&elasticFiltersJoiner=SOME_STRING_VALUE&displayAttribute=SOME_STRING_VALUE&includeContextItems=SOME_BOOLEAN_VALUE&params=source%3Amobile");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/recommendations/v2/recommend/campaigns/%7BcampaignIdentifier%7D?clientUUID=SOME_STRING_VALUE&itemId=SOME_STRING_VALUE&inventoryChannelId=SOME_STRING_VALUE&itemsSourceType=SOME_STRING_VALUE&itemsSourceId=SOME_STRING_VALUE&externalItemId=SOME_STRING_VALUE&itemIdExcluded=SOME_STRING_VALUE&additionalFilters=effectivePrice%3E300%20AND%20effectivePrice%3C400&filtersJoiner=SOME_STRING_VALUE&additionalElasticFilters=effectivePrice%3E300%20AND%20effectivePrice%3C400&elasticFiltersJoiner=SOME_STRING_VALUE&displayAttribute=SOME_STRING_VALUE&includeContextItems=SOME_BOOLEAN_VALUE&params=source%3Amobile",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/recommendations/v2/recommend/campaigns/%7BcampaignIdentifier%7D');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'clientUUID' => 'SOME_STRING_VALUE',
              'itemId' => 'SOME_STRING_VALUE',
              'inventoryChannelId' => 'SOME_STRING_VALUE',
              'itemsSourceType' => 'SOME_STRING_VALUE',
              'itemsSourceId' => 'SOME_STRING_VALUE',
              'externalItemId' => 'SOME_STRING_VALUE',
              'itemIdExcluded' => 'SOME_STRING_VALUE',
              'additionalFilters' => 'effectivePrice>300 AND effectivePrice<400',
              'filtersJoiner' => 'SOME_STRING_VALUE',
              'additionalElasticFilters' => 'effectivePrice>300 AND effectivePrice<400',
              'elasticFiltersJoiner' => 'SOME_STRING_VALUE',
              'displayAttribute' => 'SOME_STRING_VALUE',
              'includeContextItems' => 'SOME_BOOLEAN_VALUE',
              'params' => 'source:mobile'
            ]);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.get("https://api.synerise.com/recommendations/v2/recommend/campaigns/%7BcampaignIdentifier%7D?clientUUID=SOME_STRING_VALUE&itemId=SOME_STRING_VALUE&inventoryChannelId=SOME_STRING_VALUE&itemsSourceType=SOME_STRING_VALUE&itemsSourceId=SOME_STRING_VALUE&externalItemId=SOME_STRING_VALUE&itemIdExcluded=SOME_STRING_VALUE&additionalFilters=effectivePrice%3E300%20AND%20effectivePrice%3C400&filtersJoiner=SOME_STRING_VALUE&additionalElasticFilters=effectivePrice%3E300%20AND%20effectivePrice%3C400&elasticFiltersJoiner=SOME_STRING_VALUE&displayAttribute=SOME_STRING_VALUE&includeContextItems=SOME_BOOLEAN_VALUE&params=source%3Amobile")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
  /recommendations/v2/recommend/campaigns:
    post:
      summary: Get recommendations by campaign
      description: |
        This method allows you to retrieve recommendations based on a campaignID or slug and a context. The context is built based on:

        - campaign ID or slug (one of those is required)
        - profile UUID
        - items (for example, items currently in the basket)
        - item exclusions

        This is the recommended and simplest way to fetch recommendations.

        Before you use this method, you must to create a recommendations campaign in Synerise. All the recommendation filters and parameters will be handled for you automatically according to a campaign's configuration.


        ---

        **API consumers:** <span title="Deprecated">AI API key (legacy)</span>, <a href="/docs/settings/tool/tracking_codes" target="_blank" rel="noopener" title="Pass your tracker key in the request header">Web SDK Tracker</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>

        **API key permission required:** `API_MATERIALIZER_V2_RECOMMEND_CAMPAIGNS_RECOMMENDATIONS_READ`
      operationId: PostRecommendationsByCampaignV2
      security:
        - TrackerKey: []
        - JWT: []
      tags:
        - Recommendations
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/recommendations-api-materializer-PostRecommendationsRequest"
      responses:
        "200":
          description: Recommendations for the provided context. The response schema depends on your Workspace configuration. The schema below only includes the static elements.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/recommendations-api-materializer-RecommendationResponseSchemaV2-materializer"
        "404":
          $ref: "#/components/responses/recommendations-api-materializer-404cannotGenerate"
        "500":
          $ref: "#/components/responses/recommendations-api-materializer-500error"
      x-snr-doc-urls:
        - /api-reference/ai-recommendations#tag/Recommendations/operation/PostRecommendationsByCampaignV2
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/recommendations/v2/recommend/campaigns \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"clientUUID":"string","campaignId":"string","slug":"string","items":["string"],"itemsSource":{"type":"aggregate","id":"string"},"itemsExcluded":["string"],"additionalFilters":"effectivePrice>300 AND effectivePrice<400","filtersJoiner":"AND","additionalElasticFilters":"effectivePrice>300 AND effectivePrice<400","elasticFiltersJoiner":"AND","displayAttributes":["string"],"includeContextItems":true,"recommendedItemsFromExternalModel":[["string"]],"inventoryContext":{"channelIds":["string"]},"params":{"source":"mobile"}}'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            payload = "{\"clientUUID\":\"string\",\"campaignId\":\"string\",\"slug\":\"string\",\"items\":[\"string\"],\"itemsSource\":{\"type\":\"aggregate\",\"id\":\"string\"},\"itemsExcluded\":[\"string\"],\"additionalFilters\":\"effectivePrice>300 AND effectivePrice<400\",\"filtersJoiner\":\"AND\",\"additionalElasticFilters\":\"effectivePrice>300 AND effectivePrice<400\",\"elasticFiltersJoiner\":\"AND\",\"displayAttributes\":[\"string\"],\"includeContextItems\":true,\"recommendedItemsFromExternalModel\":[[\"string\"]],\"inventoryContext\":{\"channelIds\":[\"string\"]},\"params\":{\"source\":\"mobile\"}}"

            headers = {
                'Authorization': "Bearer REPLACE_BEARER_TOKEN",
                'content-type': "application/json"
                }

            conn.request("POST", "/recommendations/v2/recommend/campaigns", payload, headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "clientUUID": "string",
              "campaignId": "string",
              "slug": "string",
              "items": [
                "string"
              ],
              "itemsSource": {
                "type": "aggregate",
                "id": "string"
              },
              "itemsExcluded": [
                "string"
              ],
              "additionalFilters": "effectivePrice>300 AND effectivePrice<400",
              "filtersJoiner": "AND",
              "additionalElasticFilters": "effectivePrice>300 AND effectivePrice<400",
              "elasticFiltersJoiner": "AND",
              "displayAttributes": [
                "string"
              ],
              "includeContextItems": true,
              "recommendedItemsFromExternalModel": [
                [
                  "string"
                ]
              ],
              "inventoryContext": {
                "channelIds": [
                  "string"
                ]
              },
              "params": {
                "source": "mobile"
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://api.synerise.com/recommendations/v2/recommend/campaigns");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/recommendations/v2/recommend/campaigns",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              clientUUID: 'string',
              campaignId: 'string',
              slug: 'string',
              items: ['string'],
              itemsSource: {type: 'aggregate', id: 'string'},
              itemsExcluded: ['string'],
              additionalFilters: 'effectivePrice>300 AND effectivePrice<400',
              filtersJoiner: 'AND',
              additionalElasticFilters: 'effectivePrice>300 AND effectivePrice<400',
              elasticFiltersJoiner: 'AND',
              displayAttributes: ['string'],
              includeContextItems: true,
              recommendedItemsFromExternalModel: [['string']],
              inventoryContext: {channelIds: ['string']},
              params: {source: 'mobile'}
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/recommendations/v2/recommend/campaigns');
            $request->setMethod(HTTP_METH_POST);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN',
              'content-type' => 'application/json'
            ]);

            $request->setBody('{"clientUUID":"string","campaignId":"string","slug":"string","items":["string"],"itemsSource":{"type":"aggregate","id":"string"},"itemsExcluded":["string"],"additionalFilters":"effectivePrice>300 AND effectivePrice<400","filtersJoiner":"AND","additionalElasticFilters":"effectivePrice>300 AND effectivePrice<400","elasticFiltersJoiner":"AND","displayAttributes":["string"],"includeContextItems":true,"recommendedItemsFromExternalModel":[["string"]],"inventoryContext":{"channelIds":["string"]},"params":{"source":"mobile"}}');

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.post("https://api.synerise.com/recommendations/v2/recommend/campaigns")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"clientUUID\":\"string\",\"campaignId\":\"string\",\"slug\":\"string\",\"items\":[\"string\"],\"itemsSource\":{\"type\":\"aggregate\",\"id\":\"string\"},\"itemsExcluded\":[\"string\"],\"additionalFilters\":\"effectivePrice>300 AND effectivePrice<400\",\"filtersJoiner\":\"AND\",\"additionalElasticFilters\":\"effectivePrice>300 AND effectivePrice<400\",\"elasticFiltersJoiner\":\"AND\",\"displayAttributes\":[\"string\"],\"includeContextItems\":true,\"recommendedItemsFromExternalModel\":[[\"string\"]],\"inventoryContext\":{\"channelIds\":[\"string\"]},\"params\":{\"source\":\"mobile\"}}")
              .asString();
  /recommendations/v2/recommend/campaigns/{campaignIdentifier}/by/{identifierName}:
    post:
      summary: Get recommendations by campaign and profile identifier
      description: |
        
        **Before you use this method**: you must [create a recommendations campaign in Synerise](https://help.synerise.com/docs/campaign/recommendations-v2/). All the recommendation filters and parameters will be handled for you automatically according to a campaign's configuration.

        The method allows you to retrieve recommendations based on a campaignID or a slug, profile's identifier name (the value of the identifier is provided in the request body), and a context. The context is built based on:

        - campaign identifier (required)
        - identifierName (required)
        - identifierValue (required)
        - items (for example, items currently in the basket)
        - item exclusions


        ---

        **API consumers:** <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=userLogin" target="_blank" rel="noopener">Synerise User</a>

        **API key permission required:** `API_MATERIALIZER_V2_RECOMMEND_WITH_CUSTOM_ID_RECOMMENDATIONS_READ`

        **User role permission required:** `campaigns_recommendations: read`
      operationId: PostRecommendationsByCampaignAndidentifierNameV2
      security:
        - JWT: []
      tags:
        - Recommendations
      parameters:
        - $ref: "#/components/parameters/recommendations-api-materializer-campaignIdentifier"
        - $ref: "#/components/parameters/recommendations-api-materializer-identifierName"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/recommendations-api-materializer-PostRecommendationsWithIdentifierValueRequest"
      responses:
        "200":
          description: Recommendations for the provided context. The response schema depends on your Workspace configuration. The schema below only includes the static elements.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/recommendations-api-materializer-RecommendationResponseSchemaV2-materializer"
        "404":
          $ref: "#/components/responses/recommendations-api-materializer-404cannotGenerate"
        "500":
          $ref: "#/components/responses/recommendations-api-materializer-500error"
      x-snr-doc-urls:
        - /api-reference/ai-recommendations#tag/Recommendations/operation/PostRecommendationsByCampaignAndidentifierNameV2
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/recommendations/v2/recommend/campaigns/%7BcampaignIdentifier%7D/by/%7BidentifierName%7D \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"identifierValue":"string","items":["string"],"itemsSource":{"type":"aggregate","id":"string"},"itemsExcluded":["string"],"additionalFilters":"effectivePrice>300 AND effectivePrice<400","filtersJoiner":"AND","additionalElasticFilters":"effectivePrice>300 AND effectivePrice<400","elasticFiltersJoiner":"AND","displayAttributes":["string"],"includeContextItems":true,"recommendedItemsFromExternalModel":[["string"]],"inventoryContext":{"channelIds":["string"]},"params":{"source":"mobile"}}'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            payload = "{\"identifierValue\":\"string\",\"items\":[\"string\"],\"itemsSource\":{\"type\":\"aggregate\",\"id\":\"string\"},\"itemsExcluded\":[\"string\"],\"additionalFilters\":\"effectivePrice>300 AND effectivePrice<400\",\"filtersJoiner\":\"AND\",\"additionalElasticFilters\":\"effectivePrice>300 AND effectivePrice<400\",\"elasticFiltersJoiner\":\"AND\",\"displayAttributes\":[\"string\"],\"includeContextItems\":true,\"recommendedItemsFromExternalModel\":[[\"string\"]],\"inventoryContext\":{\"channelIds\":[\"string\"]},\"params\":{\"source\":\"mobile\"}}"

            headers = {
                'Authorization': "Bearer REPLACE_BEARER_TOKEN",
                'content-type': "application/json"
                }

            conn.request("POST", "/recommendations/v2/recommend/campaigns/%7BcampaignIdentifier%7D/by/%7BidentifierName%7D", payload, headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "identifierValue": "string",
              "items": [
                "string"
              ],
              "itemsSource": {
                "type": "aggregate",
                "id": "string"
              },
              "itemsExcluded": [
                "string"
              ],
              "additionalFilters": "effectivePrice>300 AND effectivePrice<400",
              "filtersJoiner": "AND",
              "additionalElasticFilters": "effectivePrice>300 AND effectivePrice<400",
              "elasticFiltersJoiner": "AND",
              "displayAttributes": [
                "string"
              ],
              "includeContextItems": true,
              "recommendedItemsFromExternalModel": [
                [
                  "string"
                ]
              ],
              "inventoryContext": {
                "channelIds": [
                  "string"
                ]
              },
              "params": {
                "source": "mobile"
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://api.synerise.com/recommendations/v2/recommend/campaigns/%7BcampaignIdentifier%7D/by/%7BidentifierName%7D");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/recommendations/v2/recommend/campaigns/%7BcampaignIdentifier%7D/by/%7BidentifierName%7D",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              identifierValue: 'string',
              items: ['string'],
              itemsSource: {type: 'aggregate', id: 'string'},
              itemsExcluded: ['string'],
              additionalFilters: 'effectivePrice>300 AND effectivePrice<400',
              filtersJoiner: 'AND',
              additionalElasticFilters: 'effectivePrice>300 AND effectivePrice<400',
              elasticFiltersJoiner: 'AND',
              displayAttributes: ['string'],
              includeContextItems: true,
              recommendedItemsFromExternalModel: [['string']],
              inventoryContext: {channelIds: ['string']},
              params: {source: 'mobile'}
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/recommendations/v2/recommend/campaigns/%7BcampaignIdentifier%7D/by/%7BidentifierName%7D');
            $request->setMethod(HTTP_METH_POST);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN',
              'content-type' => 'application/json'
            ]);

            $request->setBody('{"identifierValue":"string","items":["string"],"itemsSource":{"type":"aggregate","id":"string"},"itemsExcluded":["string"],"additionalFilters":"effectivePrice>300 AND effectivePrice<400","filtersJoiner":"AND","additionalElasticFilters":"effectivePrice>300 AND effectivePrice<400","elasticFiltersJoiner":"AND","displayAttributes":["string"],"includeContextItems":true,"recommendedItemsFromExternalModel":[["string"]],"inventoryContext":{"channelIds":["string"]},"params":{"source":"mobile"}}');

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.post("https://api.synerise.com/recommendations/v2/recommend/campaigns/%7BcampaignIdentifier%7D/by/%7BidentifierName%7D")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"identifierValue\":\"string\",\"items\":[\"string\"],\"itemsSource\":{\"type\":\"aggregate\",\"id\":\"string\"},\"itemsExcluded\":[\"string\"],\"additionalFilters\":\"effectivePrice>300 AND effectivePrice<400\",\"filtersJoiner\":\"AND\",\"additionalElasticFilters\":\"effectivePrice>300 AND effectivePrice<400\",\"elasticFiltersJoiner\":\"AND\",\"displayAttributes\":[\"string\"],\"includeContextItems\":true,\"recommendedItemsFromExternalModel\":[[\"string\"]],\"inventoryContext\":{\"channelIds\":[\"string\"]},\"params\":{\"source\":\"mobile\"}}")
              .asString();
  /recommendations/v2/recommend/campaigns/preview:
    post:
      summary: Preview campaign recommendations
      description: |
        This method allows you to preview recommendations for a campaign with a given configuration before creating it.

        **Note**: This method is not an alternative to creating recommendations for an existing campaign. It is intended for testing purposes only.

        The recommendation context is built based on:
        - profile UUID
        - items
        - item exclusions


        ---

        **API consumers:** <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=userLogin" target="_blank" rel="noopener">Synerise User</a>

        **API key permission required:** `API_MATERIALIZER_V2_RECOMMEND_CAMPAIGNS_RECOMMENDATIONS_PREVIEW_READ`

        **User role permission required:** `campaigns_recommendations: read`
      operationId: PostPreviewRecommendations
      security:
        - TrackerKey: []
        - JWT: []
      tags:
        - Recommendations
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: "#/components/schemas/recommendations-api-materializer-PreviewRecommendationContext"
                - oneOf:
                    - $ref: "#/components/schemas/recommendations-api-materializer-PreviewSimilarRecommendationCampaignsCreateRequest"
                    - $ref: "#/components/schemas/recommendations-api-materializer-PreviewMetricsRecommendationCampaignsCreateRequest"
                    - $ref: "#/components/schemas/recommendations-api-materializer-PreviewCrossSellRecommendationCampaignsCreateRequest"
                    - $ref: "#/components/schemas/recommendations-api-materializer-PreviewSetComplementRecommendationCampaignsCreateRequest"
                    - $ref: "#/components/schemas/recommendations-api-materializer-PreviewLastViewedRecommendationCampaignsCreateRequest"
                    - $ref: "#/components/schemas/recommendations-api-materializer-PreviewPersonalizedRecommendationCampaignsCreateRequest"
                    - $ref: "#/components/schemas/recommendations-api-materializer-PreviewVisuallySimilarRecommendationCampaignsCreateRequest"
                    - $ref: "#/components/schemas/recommendations-api-materializer-PreviewItemComparisonRecommendationCampaignsCreateRequest"
                    - $ref: "#/components/schemas/recommendations-api-materializer-PreviewRecentInteractionsRecommendationCampaignsCreateRequest"
                    - $ref: "#/components/schemas/recommendations-api-materializer-PreviewSectionRecommendationCampaignsCreateRequest"
                    - $ref: "#/components/schemas/recommendations-api-materializer-PreviewAttributeRecommendationCampaignsCreateRequest"
      responses:
        "200":
          description: Recommendations for the provided context. The response schema depends on your Workspace configuration. The schema below only includes the static elements.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/recommendations-api-materializer-RecommendationResponseSchemaV2-materializer"
        "404":
          $ref: "#/components/responses/recommendations-api-materializer-404cannotGenerate"
        "429":
          $ref: "#/components/responses/recommendations-api-materializer-429toManyRequestsError"
        "500":
          $ref: "#/components/responses/recommendations-api-materializer-500error"
      x-snr-doc-urls:
        - /api-reference/ai-recommendations#tag/Recommendations/operation/PostPreviewRecommendations
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/recommendations/v2/recommend/campaigns/preview \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"clientUUID":"50829d26-5337-410e-9365-b40f7a01bb61","items":["string"],"includeContextItems":false,"params":{"source":"mobile"},"inventoryContext":{"channelIds":["string"]},"type":"similar","parameters":{"additionalResponseAttributes":["string"],"boostMetric":"string","sortMetric":"string","boostMetricStrength":-100,"shuffleNumItems":0,"personalizedBoostingStrength":0},"title":"preview","campaignId":"preview","filterRules":{"excludePurchasedItems":true,"excludePurchasedItemsSinceDays":0,"elasticExcludePurchasedItems":true,"elasticExcludePurchasedItemsSinceDays":0},"itemsCatalogId":"string","slots":[{"name":"string","itemMin":0,"itemMax":0,"filterRules":{"filters":"string","elasticFilters":"string"},"distinctFilter":{"elastic":true,"filters":[{"field":"string","maxNumItems":0,"levelRangeModifier":0}]},"attribute":{"name":"string","levelRangeModifier":0},"numRows":0,"numItems":0}],"keepSlotsOrder":true,"personalizeSlotsOrder":false,"boostingStrategies":[{"name":"string","condition":"string","strength":1}],"itemsSource":{"type":"aggregate","id":"string"}}'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            payload = "{\"clientUUID\":\"50829d26-5337-410e-9365-b40f7a01bb61\",\"items\":[\"string\"],\"includeContextItems\":false,\"params\":{\"source\":\"mobile\"},\"inventoryContext\":{\"channelIds\":[\"string\"]},\"type\":\"similar\",\"parameters\":{\"additionalResponseAttributes\":[\"string\"],\"boostMetric\":\"string\",\"sortMetric\":\"string\",\"boostMetricStrength\":-100,\"shuffleNumItems\":0,\"personalizedBoostingStrength\":0},\"title\":\"preview\",\"campaignId\":\"preview\",\"filterRules\":{\"excludePurchasedItems\":true,\"excludePurchasedItemsSinceDays\":0,\"elasticExcludePurchasedItems\":true,\"elasticExcludePurchasedItemsSinceDays\":0},\"itemsCatalogId\":\"string\",\"slots\":[{\"name\":\"string\",\"itemMin\":0,\"itemMax\":0,\"filterRules\":{\"filters\":\"string\",\"elasticFilters\":\"string\"},\"distinctFilter\":{\"elastic\":true,\"filters\":[{\"field\":\"string\",\"maxNumItems\":0,\"levelRangeModifier\":0}]},\"attribute\":{\"name\":\"string\",\"levelRangeModifier\":0},\"numRows\":0,\"numItems\":0}],\"keepSlotsOrder\":true,\"personalizeSlotsOrder\":false,\"boostingStrategies\":[{\"name\":\"string\",\"condition\":\"string\",\"strength\":1}],\"itemsSource\":{\"type\":\"aggregate\",\"id\":\"string\"}}"

            headers = {
                'Authorization': "Bearer REPLACE_BEARER_TOKEN",
                'content-type': "application/json"
                }

            conn.request("POST", "/recommendations/v2/recommend/campaigns/preview", payload, headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "clientUUID": "50829d26-5337-410e-9365-b40f7a01bb61",
              "items": [
                "string"
              ],
              "includeContextItems": false,
              "params": {
                "source": "mobile"
              },
              "inventoryContext": {
                "channelIds": [
                  "string"
                ]
              },
              "type": "similar",
              "parameters": {
                "additionalResponseAttributes": [
                  "string"
                ],
                "boostMetric": "string",
                "sortMetric": "string",
                "boostMetricStrength": -100,
                "shuffleNumItems": 0,
                "personalizedBoostingStrength": 0
              },
              "title": "preview",
              "campaignId": "preview",
              "filterRules": {
                "excludePurchasedItems": true,
                "excludePurchasedItemsSinceDays": 0,
                "elasticExcludePurchasedItems": true,
                "elasticExcludePurchasedItemsSinceDays": 0
              },
              "itemsCatalogId": "string",
              "slots": [
                {
                  "name": "string",
                  "itemMin": 0,
                  "itemMax": 0,
                  "filterRules": {
                    "filters": "string",
                    "elasticFilters": "string"
                  },
                  "distinctFilter": {
                    "elastic": true,
                    "filters": [
                      {
                        "field": "string",
                        "maxNumItems": 0,
                        "levelRangeModifier": 0
                      }
                    ]
                  },
                  "attribute": {
                    "name": "string",
                    "levelRangeModifier": 0
                  },
                  "numRows": 0,
                  "numItems": 0
                }
              ],
              "keepSlotsOrder": true,
              "personalizeSlotsOrder": false,
              "boostingStrategies": [
                {
                  "name": "string",
                  "condition": "string",
                  "strength": 1
                }
              ],
              "itemsSource": {
                "type": "aggregate",
                "id": "string"
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://api.synerise.com/recommendations/v2/recommend/campaigns/preview");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/recommendations/v2/recommend/campaigns/preview",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              clientUUID: '50829d26-5337-410e-9365-b40f7a01bb61',
              items: ['string'],
              includeContextItems: false,
              params: {source: 'mobile'},
              inventoryContext: {channelIds: ['string']},
              type: 'similar',
              parameters: {
                additionalResponseAttributes: ['string'],
                boostMetric: 'string',
                sortMetric: 'string',
                boostMetricStrength: -100,
                shuffleNumItems: 0,
                personalizedBoostingStrength: 0
              },
              title: 'preview',
              campaignId: 'preview',
              filterRules: {
                excludePurchasedItems: true,
                excludePurchasedItemsSinceDays: 0,
                elasticExcludePurchasedItems: true,
                elasticExcludePurchasedItemsSinceDays: 0
              },
              itemsCatalogId: 'string',
              slots: [
                {
                  name: 'string',
                  itemMin: 0,
                  itemMax: 0,
                  filterRules: {filters: 'string', elasticFilters: 'string'},
                  distinctFilter: {
                    elastic: true,
                    filters: [{field: 'string', maxNumItems: 0, levelRangeModifier: 0}]
                  },
                  attribute: {name: 'string', levelRangeModifier: 0},
                  numRows: 0,
                  numItems: 0
                }
              ],
              keepSlotsOrder: true,
              personalizeSlotsOrder: false,
              boostingStrategies: [{name: 'string', condition: 'string', strength: 1}],
              itemsSource: {type: 'aggregate', id: 'string'}
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/recommendations/v2/recommend/campaigns/preview');
            $request->setMethod(HTTP_METH_POST);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN',
              'content-type' => 'application/json'
            ]);

            $request->setBody('{"clientUUID":"50829d26-5337-410e-9365-b40f7a01bb61","items":["string"],"includeContextItems":false,"params":{"source":"mobile"},"inventoryContext":{"channelIds":["string"]},"type":"similar","parameters":{"additionalResponseAttributes":["string"],"boostMetric":"string","sortMetric":"string","boostMetricStrength":-100,"shuffleNumItems":0,"personalizedBoostingStrength":0},"title":"preview","campaignId":"preview","filterRules":{"excludePurchasedItems":true,"excludePurchasedItemsSinceDays":0,"elasticExcludePurchasedItems":true,"elasticExcludePurchasedItemsSinceDays":0},"itemsCatalogId":"string","slots":[{"name":"string","itemMin":0,"itemMax":0,"filterRules":{"filters":"string","elasticFilters":"string"},"distinctFilter":{"elastic":true,"filters":[{"field":"string","maxNumItems":0,"levelRangeModifier":0}]},"attribute":{"name":"string","levelRangeModifier":0},"numRows":0,"numItems":0}],"keepSlotsOrder":true,"personalizeSlotsOrder":false,"boostingStrategies":[{"name":"string","condition":"string","strength":1}],"itemsSource":{"type":"aggregate","id":"string"}}');

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.post("https://api.synerise.com/recommendations/v2/recommend/campaigns/preview")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"clientUUID\":\"50829d26-5337-410e-9365-b40f7a01bb61\",\"items\":[\"string\"],\"includeContextItems\":false,\"params\":{\"source\":\"mobile\"},\"inventoryContext\":{\"channelIds\":[\"string\"]},\"type\":\"similar\",\"parameters\":{\"additionalResponseAttributes\":[\"string\"],\"boostMetric\":\"string\",\"sortMetric\":\"string\",\"boostMetricStrength\":-100,\"shuffleNumItems\":0,\"personalizedBoostingStrength\":0},\"title\":\"preview\",\"campaignId\":\"preview\",\"filterRules\":{\"excludePurchasedItems\":true,\"excludePurchasedItemsSinceDays\":0,\"elasticExcludePurchasedItems\":true,\"elasticExcludePurchasedItemsSinceDays\":0},\"itemsCatalogId\":\"string\",\"slots\":[{\"name\":\"string\",\"itemMin\":0,\"itemMax\":0,\"filterRules\":{\"filters\":\"string\",\"elasticFilters\":\"string\"},\"distinctFilter\":{\"elastic\":true,\"filters\":[{\"field\":\"string\",\"maxNumItems\":0,\"levelRangeModifier\":0}]},\"attribute\":{\"name\":\"string\",\"levelRangeModifier\":0},\"numRows\":0,\"numItems\":0}],\"keepSlotsOrder\":true,\"personalizeSlotsOrder\":false,\"boostingStrategies\":[{\"name\":\"string\",\"condition\":\"string\",\"strength\":1}],\"itemsSource\":{\"type\":\"aggregate\",\"id\":\"string\"}}")
              .asString();
  /recommendations/v2/recommend/items/users/{clientUuid}:
    get:
      summary: Personalized recommendations
      description: |
        Retrieve item recommendations for a profile.

        **Note:** The definition of an *item* encompasses products, but also articles, images, videos, and any other entities in the item feed.

        ---

        **API consumers:** <span title="Deprecated">AI API key (legacy)</span>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>, <a href="/docs/settings/tool/tracking_codes" target="_blank" rel="noopener" title="Pass your tracker key in the request header">Web SDK Tracker</a>

        **API key permission required:** `RECOMMENDATIONS_V2_PERSONALIZED_RECOMMENDATIONS_READ`
      operationId: RecommendForUserV2
      tags:
        - Recommendations
      security:
        - TrackerKey: []
        - JWT: []
      parameters:
        - $ref: "#/components/parameters/recommendations-rust-all-inPathClientUUID"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsMinNumItems"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsMaxNumItems"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsCampaignId"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsCampaignName"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsExcludePurchasedItems"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsExcludePurchasedItemsSince"
        - $ref: "#/components/parameters/recommendations-rust-all-filterExpr"
        - $ref: "#/components/parameters/recommendations-rust-all-elasticFilterExpr"
        - $ref: "#/components/parameters/recommendations-rust-all-inParamsItemId"
        - $ref: "#/components/parameters/recommendations-rust-all-itemCatalogId"
        - $ref: "#/components/parameters/recommendations-rust-all-distinctFilter"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsIncludeContextItems"
        - $ref: "#/components/parameters/recommendations-rust-all-params"
        - $ref: "#/components/parameters/recommendations-rust-all-inventoryChannelId"
        - $ref: "#/components/parameters/recommendations-rust-all-crossWorkspaceMode"
      responses:
        "200":
          description: Personalized recommendations
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/recommendations-rust-all-RecommendationResponseSchemaV2"
        "404":
          $ref: "#/components/responses/recommendations-rust-all-404-no-recommendation"
        "500":
          $ref: "#/components/responses/recommendations-rust-all-500-error-occurred"
      x-snr-doc-urls:
        - /api-reference/ai-recommendations#tag/Recommendations/operation/RecommendForUserV2
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.synerise.com/recommendations/v2/recommend/items/users/%7BclientUuid%7D?minNumItems=SOME_INTEGER_VALUE&maxNumItems=SOME_INTEGER_VALUE&campaignId=SOME_STRING_VALUE&campaignName=SOME_STRING_VALUE&excludePurchasedItems=SOME_BOOLEAN_VALUE&excludePurchasedItemsSinceDays=SOME_INTEGER_VALUE&filters=SOME_STRING_VALUE&elastic%3Afilters=SOME_STRING_VALUE&itemId=SOME_STRING_VALUE&itemCatalogId=SOME_STRING_VALUE&distinctFilter=SOME_OBJECT_VALUE&includeContextItems=SOME_BOOLEAN_VALUE&params=source%3Amobile&inventoryChannelId=SOME_STRING_VALUE&crossWorkspaceMode=SOME_BOOLEAN_VALUE' \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            headers = { 'Authorization': "Bearer REPLACE_BEARER_TOKEN" }

            conn.request("GET", "/recommendations/v2/recommend/items/users/%7BclientUuid%7D?minNumItems=SOME_INTEGER_VALUE&maxNumItems=SOME_INTEGER_VALUE&campaignId=SOME_STRING_VALUE&campaignName=SOME_STRING_VALUE&excludePurchasedItems=SOME_BOOLEAN_VALUE&excludePurchasedItemsSinceDays=SOME_INTEGER_VALUE&filters=SOME_STRING_VALUE&elastic%3Afilters=SOME_STRING_VALUE&itemId=SOME_STRING_VALUE&itemCatalogId=SOME_STRING_VALUE&distinctFilter=SOME_OBJECT_VALUE&includeContextItems=SOME_BOOLEAN_VALUE&params=source%3Amobile&inventoryChannelId=SOME_STRING_VALUE&crossWorkspaceMode=SOME_BOOLEAN_VALUE", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://api.synerise.com/recommendations/v2/recommend/items/users/%7BclientUuid%7D?minNumItems=SOME_INTEGER_VALUE&maxNumItems=SOME_INTEGER_VALUE&campaignId=SOME_STRING_VALUE&campaignName=SOME_STRING_VALUE&excludePurchasedItems=SOME_BOOLEAN_VALUE&excludePurchasedItemsSinceDays=SOME_INTEGER_VALUE&filters=SOME_STRING_VALUE&elastic%3Afilters=SOME_STRING_VALUE&itemId=SOME_STRING_VALUE&itemCatalogId=SOME_STRING_VALUE&distinctFilter=SOME_OBJECT_VALUE&includeContextItems=SOME_BOOLEAN_VALUE&params=source%3Amobile&inventoryChannelId=SOME_STRING_VALUE&crossWorkspaceMode=SOME_BOOLEAN_VALUE");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/recommendations/v2/recommend/items/users/%7BclientUuid%7D?minNumItems=SOME_INTEGER_VALUE&maxNumItems=SOME_INTEGER_VALUE&campaignId=SOME_STRING_VALUE&campaignName=SOME_STRING_VALUE&excludePurchasedItems=SOME_BOOLEAN_VALUE&excludePurchasedItemsSinceDays=SOME_INTEGER_VALUE&filters=SOME_STRING_VALUE&elastic%3Afilters=SOME_STRING_VALUE&itemId=SOME_STRING_VALUE&itemCatalogId=SOME_STRING_VALUE&distinctFilter=SOME_OBJECT_VALUE&includeContextItems=SOME_BOOLEAN_VALUE&params=source%3Amobile&inventoryChannelId=SOME_STRING_VALUE&crossWorkspaceMode=SOME_BOOLEAN_VALUE",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/recommendations/v2/recommend/items/users/%7BclientUuid%7D');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'minNumItems' => 'SOME_INTEGER_VALUE',
              'maxNumItems' => 'SOME_INTEGER_VALUE',
              'campaignId' => 'SOME_STRING_VALUE',
              'campaignName' => 'SOME_STRING_VALUE',
              'excludePurchasedItems' => 'SOME_BOOLEAN_VALUE',
              'excludePurchasedItemsSinceDays' => 'SOME_INTEGER_VALUE',
              'filters' => 'SOME_STRING_VALUE',
              'elastic:filters' => 'SOME_STRING_VALUE',
              'itemId' => 'SOME_STRING_VALUE',
              'itemCatalogId' => 'SOME_STRING_VALUE',
              'distinctFilter' => 'SOME_OBJECT_VALUE',
              'includeContextItems' => 'SOME_BOOLEAN_VALUE',
              'params' => 'source:mobile',
              'inventoryChannelId' => 'SOME_STRING_VALUE',
              'crossWorkspaceMode' => 'SOME_BOOLEAN_VALUE'
            ]);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.get("https://api.synerise.com/recommendations/v2/recommend/items/users/%7BclientUuid%7D?minNumItems=SOME_INTEGER_VALUE&maxNumItems=SOME_INTEGER_VALUE&campaignId=SOME_STRING_VALUE&campaignName=SOME_STRING_VALUE&excludePurchasedItems=SOME_BOOLEAN_VALUE&excludePurchasedItemsSinceDays=SOME_INTEGER_VALUE&filters=SOME_STRING_VALUE&elastic%3Afilters=SOME_STRING_VALUE&itemId=SOME_STRING_VALUE&itemCatalogId=SOME_STRING_VALUE&distinctFilter=SOME_OBJECT_VALUE&includeContextItems=SOME_BOOLEAN_VALUE&params=source%3Amobile&inventoryChannelId=SOME_STRING_VALUE&crossWorkspaceMode=SOME_BOOLEAN_VALUE")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
    post:
      summary: Personalized recommendations
      description: |
        Retrieve item recommendations for a profile.

        **Note:** The definition of an *item* encompasses products, but also articles, images, videos, and any other entities in the item feed.

        ---

        **API consumers:** <span title="Deprecated">AI API key (legacy)</span>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>, <a href="/docs/settings/tool/tracking_codes" target="_blank" rel="noopener" title="Pass your tracker key in the request header">Web SDK Tracker</a>

        **API key permission required:** `RECOMMENDATIONS_V2_PERSONALIZED_RECOMMENDATIONS_READ`
      operationId: PostRecommendForUserV2
      tags:
        - Recommendations
      security:
        - TrackerKey: []
        - JWT: []
      parameters:
        - $ref: "#/components/parameters/recommendations-rust-all-inPathClientUUID"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/recommendations-rust-all-SlotsBodySchemaV2"
        description: Definition of the requested recommendation
        required: true
      responses:
        "200":
          description: Personalized recommendations
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/recommendations-rust-all-SlotsRecommendationResponseSchemaV2"
        "404":
          $ref: "#/components/responses/recommendations-rust-all-404-no-recommendation"
        "500":
          $ref: "#/components/responses/recommendations-rust-all-500-error-occurred"
      x-snr-doc-urls:
        - /api-reference/ai-recommendations#tag/Recommendations/operation/PostRecommendForUserV2
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/recommendations/v2/recommend/items/users/%7BclientUuid%7D \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"campaignId":"defaultCampaign","campaignName":"string","catalogId":"default","clientUUID":"string","contextItemIds":["string"],"includeContextItems":false,"filterRules":{"excludePurchasedItems":false,"excludePurchasedItemsSinceDays":0,"elasticExcludePurchasedItems":false,"elasticExcludePurchasedItemsSinceDays":0},"displayAttributes":"string","abTestContext":{"experimentId":0,"variantId":"string","requestedCampaignId":"string"},"params":{"source":"mobile"},"inventoryContext":{"channelIds":["string"]},"keepSlotsOrder":true,"personalizeSlotsOrder":false,"sortMetric":"string","boostingParameters":{"metric":"string","strength":0.1,"personalizedBoostingStrength":0},"boostingStrategies":[{"name":"string","condition":"string","strength":1}],"crossWorkspaceMode":{"enabled":true},"slots":[{"name":"string","minNumItems":1,"maxNumItems":5,"shuffleNumItems":1,"filters":"string","elasticFilters":"string","distinctFilter":{"elastic":true,"filters":[{"field":"string","maxNumItems":0,"levelRangeModifier":0}]}}]}'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            payload = "{\"campaignId\":\"defaultCampaign\",\"campaignName\":\"string\",\"catalogId\":\"default\",\"clientUUID\":\"string\",\"contextItemIds\":[\"string\"],\"includeContextItems\":false,\"filterRules\":{\"excludePurchasedItems\":false,\"excludePurchasedItemsSinceDays\":0,\"elasticExcludePurchasedItems\":false,\"elasticExcludePurchasedItemsSinceDays\":0},\"displayAttributes\":\"string\",\"abTestContext\":{\"experimentId\":0,\"variantId\":\"string\",\"requestedCampaignId\":\"string\"},\"params\":{\"source\":\"mobile\"},\"inventoryContext\":{\"channelIds\":[\"string\"]},\"keepSlotsOrder\":true,\"personalizeSlotsOrder\":false,\"sortMetric\":\"string\",\"boostingParameters\":{\"metric\":\"string\",\"strength\":0.1,\"personalizedBoostingStrength\":0},\"boostingStrategies\":[{\"name\":\"string\",\"condition\":\"string\",\"strength\":1}],\"crossWorkspaceMode\":{\"enabled\":true},\"slots\":[{\"name\":\"string\",\"minNumItems\":1,\"maxNumItems\":5,\"shuffleNumItems\":1,\"filters\":\"string\",\"elasticFilters\":\"string\",\"distinctFilter\":{\"elastic\":true,\"filters\":[{\"field\":\"string\",\"maxNumItems\":0,\"levelRangeModifier\":0}]}}]}"

            headers = {
                'Authorization': "Bearer REPLACE_BEARER_TOKEN",
                'content-type': "application/json"
                }

            conn.request("POST", "/recommendations/v2/recommend/items/users/%7BclientUuid%7D", payload, headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "campaignId": "defaultCampaign",
              "campaignName": "string",
              "catalogId": "default",
              "clientUUID": "string",
              "contextItemIds": [
                "string"
              ],
              "includeContextItems": false,
              "filterRules": {
                "excludePurchasedItems": false,
                "excludePurchasedItemsSinceDays": 0,
                "elasticExcludePurchasedItems": false,
                "elasticExcludePurchasedItemsSinceDays": 0
              },
              "displayAttributes": "string",
              "abTestContext": {
                "experimentId": 0,
                "variantId": "string",
                "requestedCampaignId": "string"
              },
              "params": {
                "source": "mobile"
              },
              "inventoryContext": {
                "channelIds": [
                  "string"
                ]
              },
              "keepSlotsOrder": true,
              "personalizeSlotsOrder": false,
              "sortMetric": "string",
              "boostingParameters": {
                "metric": "string",
                "strength": 0.1,
                "personalizedBoostingStrength": 0
              },
              "boostingStrategies": [
                {
                  "name": "string",
                  "condition": "string",
                  "strength": 1
                }
              ],
              "crossWorkspaceMode": {
                "enabled": true
              },
              "slots": [
                {
                  "name": "string",
                  "minNumItems": 1,
                  "maxNumItems": 5,
                  "shuffleNumItems": 1,
                  "filters": "string",
                  "elasticFilters": "string",
                  "distinctFilter": {
                    "elastic": true,
                    "filters": [
                      {
                        "field": "string",
                        "maxNumItems": 0,
                        "levelRangeModifier": 0
                      }
                    ]
                  }
                }
              ]
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://api.synerise.com/recommendations/v2/recommend/items/users/%7BclientUuid%7D");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/recommendations/v2/recommend/items/users/%7BclientUuid%7D",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              campaignId: 'defaultCampaign',
              campaignName: 'string',
              catalogId: 'default',
              clientUUID: 'string',
              contextItemIds: ['string'],
              includeContextItems: false,
              filterRules: {
                excludePurchasedItems: false,
                excludePurchasedItemsSinceDays: 0,
                elasticExcludePurchasedItems: false,
                elasticExcludePurchasedItemsSinceDays: 0
              },
              displayAttributes: 'string',
              abTestContext: {experimentId: 0, variantId: 'string', requestedCampaignId: 'string'},
              params: {source: 'mobile'},
              inventoryContext: {channelIds: ['string']},
              keepSlotsOrder: true,
              personalizeSlotsOrder: false,
              sortMetric: 'string',
              boostingParameters: {metric: 'string', strength: 0.1, personalizedBoostingStrength: 0},
              boostingStrategies: [{name: 'string', condition: 'string', strength: 1}],
              crossWorkspaceMode: {enabled: true},
              slots: [
                {
                  name: 'string',
                  minNumItems: 1,
                  maxNumItems: 5,
                  shuffleNumItems: 1,
                  filters: 'string',
                  elasticFilters: 'string',
                  distinctFilter: {
                    elastic: true,
                    filters: [{field: 'string', maxNumItems: 0, levelRangeModifier: 0}]
                  }
                }
              ]
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/recommendations/v2/recommend/items/users/%7BclientUuid%7D');
            $request->setMethod(HTTP_METH_POST);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN',
              'content-type' => 'application/json'
            ]);

            $request->setBody('{"campaignId":"defaultCampaign","campaignName":"string","catalogId":"default","clientUUID":"string","contextItemIds":["string"],"includeContextItems":false,"filterRules":{"excludePurchasedItems":false,"excludePurchasedItemsSinceDays":0,"elasticExcludePurchasedItems":false,"elasticExcludePurchasedItemsSinceDays":0},"displayAttributes":"string","abTestContext":{"experimentId":0,"variantId":"string","requestedCampaignId":"string"},"params":{"source":"mobile"},"inventoryContext":{"channelIds":["string"]},"keepSlotsOrder":true,"personalizeSlotsOrder":false,"sortMetric":"string","boostingParameters":{"metric":"string","strength":0.1,"personalizedBoostingStrength":0},"boostingStrategies":[{"name":"string","condition":"string","strength":1}],"crossWorkspaceMode":{"enabled":true},"slots":[{"name":"string","minNumItems":1,"maxNumItems":5,"shuffleNumItems":1,"filters":"string","elasticFilters":"string","distinctFilter":{"elastic":true,"filters":[{"field":"string","maxNumItems":0,"levelRangeModifier":0}]}}]}');

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.post("https://api.synerise.com/recommendations/v2/recommend/items/users/%7BclientUuid%7D")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"campaignId\":\"defaultCampaign\",\"campaignName\":\"string\",\"catalogId\":\"default\",\"clientUUID\":\"string\",\"contextItemIds\":[\"string\"],\"includeContextItems\":false,\"filterRules\":{\"excludePurchasedItems\":false,\"excludePurchasedItemsSinceDays\":0,\"elasticExcludePurchasedItems\":false,\"elasticExcludePurchasedItemsSinceDays\":0},\"displayAttributes\":\"string\",\"abTestContext\":{\"experimentId\":0,\"variantId\":\"string\",\"requestedCampaignId\":\"string\"},\"params\":{\"source\":\"mobile\"},\"inventoryContext\":{\"channelIds\":[\"string\"]},\"keepSlotsOrder\":true,\"personalizeSlotsOrder\":false,\"sortMetric\":\"string\",\"boostingParameters\":{\"metric\":\"string\",\"strength\":0.1,\"personalizedBoostingStrength\":0},\"boostingStrategies\":[{\"name\":\"string\",\"condition\":\"string\",\"strength\":1}],\"crossWorkspaceMode\":{\"enabled\":true},\"slots\":[{\"name\":\"string\",\"minNumItems\":1,\"maxNumItems\":5,\"shuffleNumItems\":1,\"filters\":\"string\",\"elasticFilters\":\"string\",\"distinctFilter\":{\"elastic\":true,\"filters\":[{\"field\":\"string\",\"maxNumItems\":0,\"levelRangeModifier\":0}]}}]}")
              .asString();
  /recommendations/v2/recommend/items/users/{clientUuid}/sections:
    post:
      summary: Section recommendations
      description: |
        Retrieve item recommendations grouped by attribute.

        **Note:** The definition of an *item* encompasses products, but also articles, images, videos, and any other entities in the item feed.

        ---

        **API consumers:** <span title="Deprecated">AI API key (legacy)</span>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>, <a href="/docs/settings/tool/tracking_codes" target="_blank" rel="noopener" title="Pass your tracker key in the request header">Web SDK Tracker</a>

        **API key permission required:** `RECOMMENDATIONS_V2_SECTION_RECOMMENDATIONS_READ`
      operationId: PostRecommendSectionsForUserV2
      tags:
        - Recommendations
      security:
        - JWT: []
      parameters:
        - $ref: "#/components/parameters/recommendations-rust-all-pathClientUuid"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/recommendations-rust-all-SectionsSlotsBodySchemaV2"
        description: Definition of the requested recommendation
        required: true
      responses:
        "200":
          description: Section recommendations
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/recommendations-rust-all-SectionsSlotsRecommendationResponseSchemaV2"
        "404":
          $ref: "#/components/responses/recommendations-rust-all-404-no-recommendation"
        "500":
          $ref: "#/components/responses/recommendations-rust-all-500-error-occurred"
      x-snr-doc-urls:
        - /api-reference/ai-recommendations#tag/Recommendations/operation/PostRecommendSectionsForUserV2
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/recommendations/v2/recommend/items/users/%7BclientUuid%7D/sections \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"campaignId":"defaultCampaign","campaignName":"string","catalogId":"default","clientUUID":"string","contextItemIds":["string"],"includeContextItems":false,"filterRules":{"excludePurchasedItems":false,"excludePurchasedItemsSinceDays":0,"elasticExcludePurchasedItems":false,"elasticExcludePurchasedItemsSinceDays":0},"displayAttributes":"string","abTestContext":{"experimentId":0,"variantId":"string","requestedCampaignId":"string"},"params":{"source":"mobile"},"inventoryContext":{"channelIds":["string"]},"metadataCatalogId":"string","slots":[{"name":"string","attribute":{"name":"string","levelRangeModifier":0},"numRows":1,"numItems":1,"filters":"string","elasticFilters":"string"}]}'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            payload = "{\"campaignId\":\"defaultCampaign\",\"campaignName\":\"string\",\"catalogId\":\"default\",\"clientUUID\":\"string\",\"contextItemIds\":[\"string\"],\"includeContextItems\":false,\"filterRules\":{\"excludePurchasedItems\":false,\"excludePurchasedItemsSinceDays\":0,\"elasticExcludePurchasedItems\":false,\"elasticExcludePurchasedItemsSinceDays\":0},\"displayAttributes\":\"string\",\"abTestContext\":{\"experimentId\":0,\"variantId\":\"string\",\"requestedCampaignId\":\"string\"},\"params\":{\"source\":\"mobile\"},\"inventoryContext\":{\"channelIds\":[\"string\"]},\"metadataCatalogId\":\"string\",\"slots\":[{\"name\":\"string\",\"attribute\":{\"name\":\"string\",\"levelRangeModifier\":0},\"numRows\":1,\"numItems\":1,\"filters\":\"string\",\"elasticFilters\":\"string\"}]}"

            headers = {
                'Authorization': "Bearer REPLACE_BEARER_TOKEN",
                'content-type': "application/json"
                }

            conn.request("POST", "/recommendations/v2/recommend/items/users/%7BclientUuid%7D/sections", payload, headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "campaignId": "defaultCampaign",
              "campaignName": "string",
              "catalogId": "default",
              "clientUUID": "string",
              "contextItemIds": [
                "string"
              ],
              "includeContextItems": false,
              "filterRules": {
                "excludePurchasedItems": false,
                "excludePurchasedItemsSinceDays": 0,
                "elasticExcludePurchasedItems": false,
                "elasticExcludePurchasedItemsSinceDays": 0
              },
              "displayAttributes": "string",
              "abTestContext": {
                "experimentId": 0,
                "variantId": "string",
                "requestedCampaignId": "string"
              },
              "params": {
                "source": "mobile"
              },
              "inventoryContext": {
                "channelIds": [
                  "string"
                ]
              },
              "metadataCatalogId": "string",
              "slots": [
                {
                  "name": "string",
                  "attribute": {
                    "name": "string",
                    "levelRangeModifier": 0
                  },
                  "numRows": 1,
                  "numItems": 1,
                  "filters": "string",
                  "elasticFilters": "string"
                }
              ]
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://api.synerise.com/recommendations/v2/recommend/items/users/%7BclientUuid%7D/sections");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/recommendations/v2/recommend/items/users/%7BclientUuid%7D/sections",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              campaignId: 'defaultCampaign',
              campaignName: 'string',
              catalogId: 'default',
              clientUUID: 'string',
              contextItemIds: ['string'],
              includeContextItems: false,
              filterRules: {
                excludePurchasedItems: false,
                excludePurchasedItemsSinceDays: 0,
                elasticExcludePurchasedItems: false,
                elasticExcludePurchasedItemsSinceDays: 0
              },
              displayAttributes: 'string',
              abTestContext: {experimentId: 0, variantId: 'string', requestedCampaignId: 'string'},
              params: {source: 'mobile'},
              inventoryContext: {channelIds: ['string']},
              metadataCatalogId: 'string',
              slots: [
                {
                  name: 'string',
                  attribute: {name: 'string', levelRangeModifier: 0},
                  numRows: 1,
                  numItems: 1,
                  filters: 'string',
                  elasticFilters: 'string'
                }
              ]
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/recommendations/v2/recommend/items/users/%7BclientUuid%7D/sections');
            $request->setMethod(HTTP_METH_POST);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN',
              'content-type' => 'application/json'
            ]);

            $request->setBody('{"campaignId":"defaultCampaign","campaignName":"string","catalogId":"default","clientUUID":"string","contextItemIds":["string"],"includeContextItems":false,"filterRules":{"excludePurchasedItems":false,"excludePurchasedItemsSinceDays":0,"elasticExcludePurchasedItems":false,"elasticExcludePurchasedItemsSinceDays":0},"displayAttributes":"string","abTestContext":{"experimentId":0,"variantId":"string","requestedCampaignId":"string"},"params":{"source":"mobile"},"inventoryContext":{"channelIds":["string"]},"metadataCatalogId":"string","slots":[{"name":"string","attribute":{"name":"string","levelRangeModifier":0},"numRows":1,"numItems":1,"filters":"string","elasticFilters":"string"}]}');

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.post("https://api.synerise.com/recommendations/v2/recommend/items/users/%7BclientUuid%7D/sections")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"campaignId\":\"defaultCampaign\",\"campaignName\":\"string\",\"catalogId\":\"default\",\"clientUUID\":\"string\",\"contextItemIds\":[\"string\"],\"includeContextItems\":false,\"filterRules\":{\"excludePurchasedItems\":false,\"excludePurchasedItemsSinceDays\":0,\"elasticExcludePurchasedItems\":false,\"elasticExcludePurchasedItemsSinceDays\":0},\"displayAttributes\":\"string\",\"abTestContext\":{\"experimentId\":0,\"variantId\":\"string\",\"requestedCampaignId\":\"string\"},\"params\":{\"source\":\"mobile\"},\"inventoryContext\":{\"channelIds\":[\"string\"]},\"metadataCatalogId\":\"string\",\"slots\":[{\"name\":\"string\",\"attribute\":{\"name\":\"string\",\"levelRangeModifier\":0},\"numRows\":1,\"numItems\":1,\"filters\":\"string\",\"elasticFilters\":\"string\"}]}")
              .asString();
  /recommendations/v2/recommend/items/users/{clientUuid}/attributes:
    post:
      summary: Attribute recommendations
      description: |
        Retrieve attribute recommendations.

        **Note:** The definition of an *item* encompasses products, but also articles, images, videos, and any other entities in the item feed.

        ---

        **API consumers:** <span title="Deprecated">AI API key (legacy)</span>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>, <a href="/docs/settings/tool/tracking_codes" target="_blank" rel="noopener" title="Pass your tracker key in the request header">Web SDK Tracker</a>

        **API key permission required:** `RECOMMENDATIONS_V2_ATTRIBUTE_RECOMMENDATIONS_READ`
      operationId: PostRecommendAttributesForUserV2
      tags:
        - Recommendations
      security:
        - JWT: []
      parameters:
        - $ref: "#/components/parameters/recommendations-rust-all-pathClientUuid"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/recommendations-rust-all-AttributesSlotsBodySchemaV2"
        description: Definition of the requested recommendation
        required: true
      responses:
        "200":
          description: Attribute recommendations
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/recommendations-rust-all-SlotsRecommendationResponseSchemaV2"
        "404":
          $ref: "#/components/responses/recommendations-rust-all-404-no-recommendation"
        "500":
          $ref: "#/components/responses/recommendations-rust-all-500-error-occurred"
      x-snr-doc-urls:
        - /api-reference/ai-recommendations#tag/Recommendations/operation/PostRecommendAttributesForUserV2
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/recommendations/v2/recommend/items/users/%7BclientUuid%7D/attributes \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"campaignId":"defaultCampaign","campaignName":"string","catalogId":"default","clientUUID":"string","contextItemIds":["string"],"includeContextItems":false,"filterRules":{"excludePurchasedItems":false,"excludePurchasedItemsSinceDays":0,"elasticExcludePurchasedItems":false,"elasticExcludePurchasedItemsSinceDays":0},"displayAttributes":"string","abTestContext":{"experimentId":0,"variantId":"string","requestedCampaignId":"string"},"params":{"source":"mobile"},"inventoryContext":{"channelIds":["string"]},"metadataCatalogId":"string","slots":[{"name":"string","attribute":{"name":"string","levelRangeModifier":0},"minNumItems":1,"maxNumItems":5,"filters":"string","elasticFilters":"string"}]}'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            payload = "{\"campaignId\":\"defaultCampaign\",\"campaignName\":\"string\",\"catalogId\":\"default\",\"clientUUID\":\"string\",\"contextItemIds\":[\"string\"],\"includeContextItems\":false,\"filterRules\":{\"excludePurchasedItems\":false,\"excludePurchasedItemsSinceDays\":0,\"elasticExcludePurchasedItems\":false,\"elasticExcludePurchasedItemsSinceDays\":0},\"displayAttributes\":\"string\",\"abTestContext\":{\"experimentId\":0,\"variantId\":\"string\",\"requestedCampaignId\":\"string\"},\"params\":{\"source\":\"mobile\"},\"inventoryContext\":{\"channelIds\":[\"string\"]},\"metadataCatalogId\":\"string\",\"slots\":[{\"name\":\"string\",\"attribute\":{\"name\":\"string\",\"levelRangeModifier\":0},\"minNumItems\":1,\"maxNumItems\":5,\"filters\":\"string\",\"elasticFilters\":\"string\"}]}"

            headers = {
                'Authorization': "Bearer REPLACE_BEARER_TOKEN",
                'content-type': "application/json"
                }

            conn.request("POST", "/recommendations/v2/recommend/items/users/%7BclientUuid%7D/attributes", payload, headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "campaignId": "defaultCampaign",
              "campaignName": "string",
              "catalogId": "default",
              "clientUUID": "string",
              "contextItemIds": [
                "string"
              ],
              "includeContextItems": false,
              "filterRules": {
                "excludePurchasedItems": false,
                "excludePurchasedItemsSinceDays": 0,
                "elasticExcludePurchasedItems": false,
                "elasticExcludePurchasedItemsSinceDays": 0
              },
              "displayAttributes": "string",
              "abTestContext": {
                "experimentId": 0,
                "variantId": "string",
                "requestedCampaignId": "string"
              },
              "params": {
                "source": "mobile"
              },
              "inventoryContext": {
                "channelIds": [
                  "string"
                ]
              },
              "metadataCatalogId": "string",
              "slots": [
                {
                  "name": "string",
                  "attribute": {
                    "name": "string",
                    "levelRangeModifier": 0
                  },
                  "minNumItems": 1,
                  "maxNumItems": 5,
                  "filters": "string",
                  "elasticFilters": "string"
                }
              ]
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://api.synerise.com/recommendations/v2/recommend/items/users/%7BclientUuid%7D/attributes");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/recommendations/v2/recommend/items/users/%7BclientUuid%7D/attributes",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              campaignId: 'defaultCampaign',
              campaignName: 'string',
              catalogId: 'default',
              clientUUID: 'string',
              contextItemIds: ['string'],
              includeContextItems: false,
              filterRules: {
                excludePurchasedItems: false,
                excludePurchasedItemsSinceDays: 0,
                elasticExcludePurchasedItems: false,
                elasticExcludePurchasedItemsSinceDays: 0
              },
              displayAttributes: 'string',
              abTestContext: {experimentId: 0, variantId: 'string', requestedCampaignId: 'string'},
              params: {source: 'mobile'},
              inventoryContext: {channelIds: ['string']},
              metadataCatalogId: 'string',
              slots: [
                {
                  name: 'string',
                  attribute: {name: 'string', levelRangeModifier: 0},
                  minNumItems: 1,
                  maxNumItems: 5,
                  filters: 'string',
                  elasticFilters: 'string'
                }
              ]
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/recommendations/v2/recommend/items/users/%7BclientUuid%7D/attributes');
            $request->setMethod(HTTP_METH_POST);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN',
              'content-type' => 'application/json'
            ]);

            $request->setBody('{"campaignId":"defaultCampaign","campaignName":"string","catalogId":"default","clientUUID":"string","contextItemIds":["string"],"includeContextItems":false,"filterRules":{"excludePurchasedItems":false,"excludePurchasedItemsSinceDays":0,"elasticExcludePurchasedItems":false,"elasticExcludePurchasedItemsSinceDays":0},"displayAttributes":"string","abTestContext":{"experimentId":0,"variantId":"string","requestedCampaignId":"string"},"params":{"source":"mobile"},"inventoryContext":{"channelIds":["string"]},"metadataCatalogId":"string","slots":[{"name":"string","attribute":{"name":"string","levelRangeModifier":0},"minNumItems":1,"maxNumItems":5,"filters":"string","elasticFilters":"string"}]}');

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.post("https://api.synerise.com/recommendations/v2/recommend/items/users/%7BclientUuid%7D/attributes")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"campaignId\":\"defaultCampaign\",\"campaignName\":\"string\",\"catalogId\":\"default\",\"clientUUID\":\"string\",\"contextItemIds\":[\"string\"],\"includeContextItems\":false,\"filterRules\":{\"excludePurchasedItems\":false,\"excludePurchasedItemsSinceDays\":0,\"elasticExcludePurchasedItems\":false,\"elasticExcludePurchasedItemsSinceDays\":0},\"displayAttributes\":\"string\",\"abTestContext\":{\"experimentId\":0,\"variantId\":\"string\",\"requestedCampaignId\":\"string\"},\"params\":{\"source\":\"mobile\"},\"inventoryContext\":{\"channelIds\":[\"string\"]},\"metadataCatalogId\":\"string\",\"slots\":[{\"name\":\"string\",\"attribute\":{\"name\":\"string\",\"levelRangeModifier\":0},\"minNumItems\":1,\"maxNumItems\":5,\"filters\":\"string\",\"elasticFilters\":\"string\"}]}")
              .asString();
  /recommendations/v2/recommend/items/users/{clientUuid}/last:
    get:
      summary: Last viewed recommendations
      description: |
        Retrieve recent item recommendations seen by a profile.

        **Note:** The definition of an *item* encompasses products, but also articles, images, videos, and any other entities in the item feed.

        ---

        **API consumers:** <span title="Deprecated">AI API key (legacy)</span>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>, <a href="/docs/settings/tool/tracking_codes" target="_blank" rel="noopener" title="Pass your tracker key in the request header">Web SDK Tracker</a>

        **API key permission required:** `RECOMMENDATIONS_V2_LAST_VIEWED_RECOMMENDATIONS_READ`
      operationId: RecommendLastViewedForUserItems
      tags:
        - Recommendations
      security:
        - TrackerKey: []
        - JWT: []
      parameters:
        - $ref: "#/components/parameters/recommendations-rust-all-pathClientUuid"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsCampaignId"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsCampaignName"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsMinNumItems"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsMaxNumItems"
        - $ref: "#/components/parameters/recommendations-rust-all-distinctFilter"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsIncludeContextItems"
        - $ref: "#/components/parameters/recommendations-rust-all-params"
        - $ref: "#/components/parameters/recommendations-rust-all-inventoryChannelId"
        - $ref: "#/components/parameters/recommendations-rust-all-crossWorkspaceMode"
      responses:
        "200":
          description: Last viewed recommendations
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/recommendations-rust-all-RecommendationResponseSchemaV2"
        "404":
          $ref: "#/components/responses/recommendations-rust-all-404-no-recommendation"
        "500":
          $ref: "#/components/responses/recommendations-rust-all-500-error-occurred"
      x-snr-doc-urls:
        - /api-reference/ai-recommendations#tag/Recommendations/operation/RecommendLastViewedForUserItems
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.synerise.com/recommendations/v2/recommend/items/users/%7BclientUuid%7D/last?campaignId=SOME_STRING_VALUE&campaignName=SOME_STRING_VALUE&minNumItems=SOME_INTEGER_VALUE&maxNumItems=SOME_INTEGER_VALUE&distinctFilter=SOME_OBJECT_VALUE&includeContextItems=SOME_BOOLEAN_VALUE&params=source%3Amobile&inventoryChannelId=SOME_STRING_VALUE&crossWorkspaceMode=SOME_BOOLEAN_VALUE' \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            headers = { 'Authorization': "Bearer REPLACE_BEARER_TOKEN" }

            conn.request("GET", "/recommendations/v2/recommend/items/users/%7BclientUuid%7D/last?campaignId=SOME_STRING_VALUE&campaignName=SOME_STRING_VALUE&minNumItems=SOME_INTEGER_VALUE&maxNumItems=SOME_INTEGER_VALUE&distinctFilter=SOME_OBJECT_VALUE&includeContextItems=SOME_BOOLEAN_VALUE&params=source%3Amobile&inventoryChannelId=SOME_STRING_VALUE&crossWorkspaceMode=SOME_BOOLEAN_VALUE", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://api.synerise.com/recommendations/v2/recommend/items/users/%7BclientUuid%7D/last?campaignId=SOME_STRING_VALUE&campaignName=SOME_STRING_VALUE&minNumItems=SOME_INTEGER_VALUE&maxNumItems=SOME_INTEGER_VALUE&distinctFilter=SOME_OBJECT_VALUE&includeContextItems=SOME_BOOLEAN_VALUE&params=source%3Amobile&inventoryChannelId=SOME_STRING_VALUE&crossWorkspaceMode=SOME_BOOLEAN_VALUE");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/recommendations/v2/recommend/items/users/%7BclientUuid%7D/last?campaignId=SOME_STRING_VALUE&campaignName=SOME_STRING_VALUE&minNumItems=SOME_INTEGER_VALUE&maxNumItems=SOME_INTEGER_VALUE&distinctFilter=SOME_OBJECT_VALUE&includeContextItems=SOME_BOOLEAN_VALUE&params=source%3Amobile&inventoryChannelId=SOME_STRING_VALUE&crossWorkspaceMode=SOME_BOOLEAN_VALUE",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/recommendations/v2/recommend/items/users/%7BclientUuid%7D/last');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'campaignId' => 'SOME_STRING_VALUE',
              'campaignName' => 'SOME_STRING_VALUE',
              'minNumItems' => 'SOME_INTEGER_VALUE',
              'maxNumItems' => 'SOME_INTEGER_VALUE',
              'distinctFilter' => 'SOME_OBJECT_VALUE',
              'includeContextItems' => 'SOME_BOOLEAN_VALUE',
              'params' => 'source:mobile',
              'inventoryChannelId' => 'SOME_STRING_VALUE',
              'crossWorkspaceMode' => 'SOME_BOOLEAN_VALUE'
            ]);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.get("https://api.synerise.com/recommendations/v2/recommend/items/users/%7BclientUuid%7D/last?campaignId=SOME_STRING_VALUE&campaignName=SOME_STRING_VALUE&minNumItems=SOME_INTEGER_VALUE&maxNumItems=SOME_INTEGER_VALUE&distinctFilter=SOME_OBJECT_VALUE&includeContextItems=SOME_BOOLEAN_VALUE&params=source%3Amobile&inventoryChannelId=SOME_STRING_VALUE&crossWorkspaceMode=SOME_BOOLEAN_VALUE")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
    post:
      summary: Last viewed recommendations
      description: |
        Retrieve recent item recommendations seen by a profile.

        **Note:** The definition of an *item* encompasses products, but also articles, images, videos, and any other entities in the item feed.

        ---

        **API consumers:** <span title="Deprecated">AI API key (legacy)</span>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>, <a href="/docs/settings/tool/tracking_codes" target="_blank" rel="noopener" title="Pass your tracker key in the request header">Web SDK Tracker</a>

        **API key permission required:** `RECOMMENDATIONS_V2_LAST_VIEWED_RECOMMENDATIONS_READ`
      operationId: PostRecommendLastViewedForUserItems
      tags:
        - Recommendations
      security:
        - JWT: []
      parameters:
        - $ref: "#/components/parameters/recommendations-rust-all-pathClientUuid"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/recommendations-rust-all-SlotsBodySchemaV2"
        description: Definition of the requested recommendation
        required: true
      responses:
        "200":
          description: Last viewed recommendations
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/recommendations-rust-all-SlotsRecommendationResponseSchemaV2"
        "404":
          $ref: "#/components/responses/recommendations-rust-all-404-no-recommendation"
        "500":
          $ref: "#/components/responses/recommendations-rust-all-500-error-occurred"
      x-snr-doc-urls:
        - /api-reference/ai-recommendations#tag/Recommendations/operation/PostRecommendLastViewedForUserItems
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/recommendations/v2/recommend/items/users/%7BclientUuid%7D/last \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"campaignId":"defaultCampaign","campaignName":"string","catalogId":"default","clientUUID":"string","contextItemIds":["string"],"includeContextItems":false,"filterRules":{"excludePurchasedItems":false,"excludePurchasedItemsSinceDays":0,"elasticExcludePurchasedItems":false,"elasticExcludePurchasedItemsSinceDays":0},"displayAttributes":"string","abTestContext":{"experimentId":0,"variantId":"string","requestedCampaignId":"string"},"params":{"source":"mobile"},"inventoryContext":{"channelIds":["string"]},"keepSlotsOrder":true,"personalizeSlotsOrder":false,"sortMetric":"string","boostingParameters":{"metric":"string","strength":0.1,"personalizedBoostingStrength":0},"boostingStrategies":[{"name":"string","condition":"string","strength":1}],"crossWorkspaceMode":{"enabled":true},"slots":[{"name":"string","minNumItems":1,"maxNumItems":5,"shuffleNumItems":1,"filters":"string","elasticFilters":"string","distinctFilter":{"elastic":true,"filters":[{"field":"string","maxNumItems":0,"levelRangeModifier":0}]}}]}'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            payload = "{\"campaignId\":\"defaultCampaign\",\"campaignName\":\"string\",\"catalogId\":\"default\",\"clientUUID\":\"string\",\"contextItemIds\":[\"string\"],\"includeContextItems\":false,\"filterRules\":{\"excludePurchasedItems\":false,\"excludePurchasedItemsSinceDays\":0,\"elasticExcludePurchasedItems\":false,\"elasticExcludePurchasedItemsSinceDays\":0},\"displayAttributes\":\"string\",\"abTestContext\":{\"experimentId\":0,\"variantId\":\"string\",\"requestedCampaignId\":\"string\"},\"params\":{\"source\":\"mobile\"},\"inventoryContext\":{\"channelIds\":[\"string\"]},\"keepSlotsOrder\":true,\"personalizeSlotsOrder\":false,\"sortMetric\":\"string\",\"boostingParameters\":{\"metric\":\"string\",\"strength\":0.1,\"personalizedBoostingStrength\":0},\"boostingStrategies\":[{\"name\":\"string\",\"condition\":\"string\",\"strength\":1}],\"crossWorkspaceMode\":{\"enabled\":true},\"slots\":[{\"name\":\"string\",\"minNumItems\":1,\"maxNumItems\":5,\"shuffleNumItems\":1,\"filters\":\"string\",\"elasticFilters\":\"string\",\"distinctFilter\":{\"elastic\":true,\"filters\":[{\"field\":\"string\",\"maxNumItems\":0,\"levelRangeModifier\":0}]}}]}"

            headers = {
                'Authorization': "Bearer REPLACE_BEARER_TOKEN",
                'content-type': "application/json"
                }

            conn.request("POST", "/recommendations/v2/recommend/items/users/%7BclientUuid%7D/last", payload, headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "campaignId": "defaultCampaign",
              "campaignName": "string",
              "catalogId": "default",
              "clientUUID": "string",
              "contextItemIds": [
                "string"
              ],
              "includeContextItems": false,
              "filterRules": {
                "excludePurchasedItems": false,
                "excludePurchasedItemsSinceDays": 0,
                "elasticExcludePurchasedItems": false,
                "elasticExcludePurchasedItemsSinceDays": 0
              },
              "displayAttributes": "string",
              "abTestContext": {
                "experimentId": 0,
                "variantId": "string",
                "requestedCampaignId": "string"
              },
              "params": {
                "source": "mobile"
              },
              "inventoryContext": {
                "channelIds": [
                  "string"
                ]
              },
              "keepSlotsOrder": true,
              "personalizeSlotsOrder": false,
              "sortMetric": "string",
              "boostingParameters": {
                "metric": "string",
                "strength": 0.1,
                "personalizedBoostingStrength": 0
              },
              "boostingStrategies": [
                {
                  "name": "string",
                  "condition": "string",
                  "strength": 1
                }
              ],
              "crossWorkspaceMode": {
                "enabled": true
              },
              "slots": [
                {
                  "name": "string",
                  "minNumItems": 1,
                  "maxNumItems": 5,
                  "shuffleNumItems": 1,
                  "filters": "string",
                  "elasticFilters": "string",
                  "distinctFilter": {
                    "elastic": true,
                    "filters": [
                      {
                        "field": "string",
                        "maxNumItems": 0,
                        "levelRangeModifier": 0
                      }
                    ]
                  }
                }
              ]
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://api.synerise.com/recommendations/v2/recommend/items/users/%7BclientUuid%7D/last");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/recommendations/v2/recommend/items/users/%7BclientUuid%7D/last",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              campaignId: 'defaultCampaign',
              campaignName: 'string',
              catalogId: 'default',
              clientUUID: 'string',
              contextItemIds: ['string'],
              includeContextItems: false,
              filterRules: {
                excludePurchasedItems: false,
                excludePurchasedItemsSinceDays: 0,
                elasticExcludePurchasedItems: false,
                elasticExcludePurchasedItemsSinceDays: 0
              },
              displayAttributes: 'string',
              abTestContext: {experimentId: 0, variantId: 'string', requestedCampaignId: 'string'},
              params: {source: 'mobile'},
              inventoryContext: {channelIds: ['string']},
              keepSlotsOrder: true,
              personalizeSlotsOrder: false,
              sortMetric: 'string',
              boostingParameters: {metric: 'string', strength: 0.1, personalizedBoostingStrength: 0},
              boostingStrategies: [{name: 'string', condition: 'string', strength: 1}],
              crossWorkspaceMode: {enabled: true},
              slots: [
                {
                  name: 'string',
                  minNumItems: 1,
                  maxNumItems: 5,
                  shuffleNumItems: 1,
                  filters: 'string',
                  elasticFilters: 'string',
                  distinctFilter: {
                    elastic: true,
                    filters: [{field: 'string', maxNumItems: 0, levelRangeModifier: 0}]
                  }
                }
              ]
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/recommendations/v2/recommend/items/users/%7BclientUuid%7D/last');
            $request->setMethod(HTTP_METH_POST);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN',
              'content-type' => 'application/json'
            ]);

            $request->setBody('{"campaignId":"defaultCampaign","campaignName":"string","catalogId":"default","clientUUID":"string","contextItemIds":["string"],"includeContextItems":false,"filterRules":{"excludePurchasedItems":false,"excludePurchasedItemsSinceDays":0,"elasticExcludePurchasedItems":false,"elasticExcludePurchasedItemsSinceDays":0},"displayAttributes":"string","abTestContext":{"experimentId":0,"variantId":"string","requestedCampaignId":"string"},"params":{"source":"mobile"},"inventoryContext":{"channelIds":["string"]},"keepSlotsOrder":true,"personalizeSlotsOrder":false,"sortMetric":"string","boostingParameters":{"metric":"string","strength":0.1,"personalizedBoostingStrength":0},"boostingStrategies":[{"name":"string","condition":"string","strength":1}],"crossWorkspaceMode":{"enabled":true},"slots":[{"name":"string","minNumItems":1,"maxNumItems":5,"shuffleNumItems":1,"filters":"string","elasticFilters":"string","distinctFilter":{"elastic":true,"filters":[{"field":"string","maxNumItems":0,"levelRangeModifier":0}]}}]}');

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.post("https://api.synerise.com/recommendations/v2/recommend/items/users/%7BclientUuid%7D/last")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"campaignId\":\"defaultCampaign\",\"campaignName\":\"string\",\"catalogId\":\"default\",\"clientUUID\":\"string\",\"contextItemIds\":[\"string\"],\"includeContextItems\":false,\"filterRules\":{\"excludePurchasedItems\":false,\"excludePurchasedItemsSinceDays\":0,\"elasticExcludePurchasedItems\":false,\"elasticExcludePurchasedItemsSinceDays\":0},\"displayAttributes\":\"string\",\"abTestContext\":{\"experimentId\":0,\"variantId\":\"string\",\"requestedCampaignId\":\"string\"},\"params\":{\"source\":\"mobile\"},\"inventoryContext\":{\"channelIds\":[\"string\"]},\"keepSlotsOrder\":true,\"personalizeSlotsOrder\":false,\"sortMetric\":\"string\",\"boostingParameters\":{\"metric\":\"string\",\"strength\":0.1,\"personalizedBoostingStrength\":0},\"boostingStrategies\":[{\"name\":\"string\",\"condition\":\"string\",\"strength\":1}],\"crossWorkspaceMode\":{\"enabled\":true},\"slots\":[{\"name\":\"string\",\"minNumItems\":1,\"maxNumItems\":5,\"shuffleNumItems\":1,\"filters\":\"string\",\"elasticFilters\":\"string\",\"distinctFilter\":{\"elastic\":true,\"filters\":[{\"field\":\"string\",\"maxNumItems\":0,\"levelRangeModifier\":0}]}}]}")
              .asString();
  /recommendations/v2/recommend/items/users/{clientUuid}/aggregates/{aggregateUUID}:
    get:
      summary: Recent interactions recommendations
      description: |
        Retrieve recent interactions recommendations for a profile.

        **Note:** The definition of an *item* encompasses products, but also articles, images, videos, and any other entities in the item feed.

        ---

        **API consumers:** <span title="Deprecated">AI API key (legacy)</span>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>, <a href="/docs/settings/tool/tracking_codes" target="_blank" rel="noopener" title="Pass your tracker key in the request header">Web SDK Tracker</a>

        **API key permission required:** `RECOMMENDATIONS_V2_RECENT_INTERACTIONS_RECOMMENDATIONS_READ`
      operationId: GetRecommendRecentInteractions
      tags:
        - Recommendations
      security:
        - TrackerKey: []
        - JWT: []
      parameters:
        - $ref: "#/components/parameters/recommendations-rust-all-pathClientUuid"
        - $ref: "#/components/parameters/recommendations-rust-all-pathAggregateUuid"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsCampaignId"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsCampaignName"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsMinNumItems"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsMaxNumItems"
        - $ref: "#/components/parameters/recommendations-rust-all-distinctFilter"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsIncludeContextItems"
        - $ref: "#/components/parameters/recommendations-rust-all-params"
        - $ref: "#/components/parameters/recommendations-rust-all-inventoryChannelId"
        - $ref: "#/components/parameters/recommendations-rust-all-crossWorkspaceMode"
      responses:
        "200":
          description: Recent interactions recommendations
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/recommendations-rust-all-RecommendationResponseSchemaV2"
        "404":
          $ref: "#/components/responses/recommendations-rust-all-404-no-recommendation"
        "500":
          $ref: "#/components/responses/recommendations-rust-all-500-error-occurred"
      x-snr-doc-urls:
        - /api-reference/ai-recommendations#tag/Recommendations/operation/GetRecommendRecentInteractions
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.synerise.com/recommendations/v2/recommend/items/users/%7BclientUuid%7D/aggregates/%7BaggregateUUID%7D?campaignId=SOME_STRING_VALUE&campaignName=SOME_STRING_VALUE&minNumItems=SOME_INTEGER_VALUE&maxNumItems=SOME_INTEGER_VALUE&distinctFilter=SOME_OBJECT_VALUE&includeContextItems=SOME_BOOLEAN_VALUE&params=source%3Amobile&inventoryChannelId=SOME_STRING_VALUE&crossWorkspaceMode=SOME_BOOLEAN_VALUE' \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            headers = { 'Authorization': "Bearer REPLACE_BEARER_TOKEN" }

            conn.request("GET", "/recommendations/v2/recommend/items/users/%7BclientUuid%7D/aggregates/%7BaggregateUUID%7D?campaignId=SOME_STRING_VALUE&campaignName=SOME_STRING_VALUE&minNumItems=SOME_INTEGER_VALUE&maxNumItems=SOME_INTEGER_VALUE&distinctFilter=SOME_OBJECT_VALUE&includeContextItems=SOME_BOOLEAN_VALUE&params=source%3Amobile&inventoryChannelId=SOME_STRING_VALUE&crossWorkspaceMode=SOME_BOOLEAN_VALUE", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://api.synerise.com/recommendations/v2/recommend/items/users/%7BclientUuid%7D/aggregates/%7BaggregateUUID%7D?campaignId=SOME_STRING_VALUE&campaignName=SOME_STRING_VALUE&minNumItems=SOME_INTEGER_VALUE&maxNumItems=SOME_INTEGER_VALUE&distinctFilter=SOME_OBJECT_VALUE&includeContextItems=SOME_BOOLEAN_VALUE&params=source%3Amobile&inventoryChannelId=SOME_STRING_VALUE&crossWorkspaceMode=SOME_BOOLEAN_VALUE");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/recommendations/v2/recommend/items/users/%7BclientUuid%7D/aggregates/%7BaggregateUUID%7D?campaignId=SOME_STRING_VALUE&campaignName=SOME_STRING_VALUE&minNumItems=SOME_INTEGER_VALUE&maxNumItems=SOME_INTEGER_VALUE&distinctFilter=SOME_OBJECT_VALUE&includeContextItems=SOME_BOOLEAN_VALUE&params=source%3Amobile&inventoryChannelId=SOME_STRING_VALUE&crossWorkspaceMode=SOME_BOOLEAN_VALUE",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/recommendations/v2/recommend/items/users/%7BclientUuid%7D/aggregates/%7BaggregateUUID%7D');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'campaignId' => 'SOME_STRING_VALUE',
              'campaignName' => 'SOME_STRING_VALUE',
              'minNumItems' => 'SOME_INTEGER_VALUE',
              'maxNumItems' => 'SOME_INTEGER_VALUE',
              'distinctFilter' => 'SOME_OBJECT_VALUE',
              'includeContextItems' => 'SOME_BOOLEAN_VALUE',
              'params' => 'source:mobile',
              'inventoryChannelId' => 'SOME_STRING_VALUE',
              'crossWorkspaceMode' => 'SOME_BOOLEAN_VALUE'
            ]);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.get("https://api.synerise.com/recommendations/v2/recommend/items/users/%7BclientUuid%7D/aggregates/%7BaggregateUUID%7D?campaignId=SOME_STRING_VALUE&campaignName=SOME_STRING_VALUE&minNumItems=SOME_INTEGER_VALUE&maxNumItems=SOME_INTEGER_VALUE&distinctFilter=SOME_OBJECT_VALUE&includeContextItems=SOME_BOOLEAN_VALUE&params=source%3Amobile&inventoryChannelId=SOME_STRING_VALUE&crossWorkspaceMode=SOME_BOOLEAN_VALUE")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
    post:
      summary: Recent interactions recommendations
      description: |
        Retrieve recent interactions recommendations for a profile.

        **Note:** The definition of an *item* encompasses products, but also articles, images, videos, and any other entities in the item feed.

        ---

        **API consumers:** <span title="Deprecated">AI API key (legacy)</span>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>, <a href="/docs/settings/tool/tracking_codes" target="_blank" rel="noopener" title="Pass your tracker key in the request header">Web SDK Tracker</a>

        **API key permission required:** `RECOMMENDATIONS_V2_RECENT_INTERACTIONS_RECOMMENDATIONS_READ`
      operationId: PostRecommendRecentInteractions
      tags:
        - Recommendations
      security:
        - JWT: []
      parameters:
        - $ref: "#/components/parameters/recommendations-rust-all-pathClientUuid"
        - $ref: "#/components/parameters/recommendations-rust-all-pathAggregateUuid"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/recommendations-rust-all-SlotsBodySchemaV2"
        description: Definition of the requested recommendation
        required: true
      responses:
        "200":
          description: Recent interactions recommendations
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/recommendations-rust-all-SlotsRecommendationResponseSchemaV2"
        "404":
          $ref: "#/components/responses/recommendations-rust-all-404-no-recommendation"
        "500":
          $ref: "#/components/responses/recommendations-rust-all-500-error-occurred"
      x-snr-doc-urls:
        - /api-reference/ai-recommendations#tag/Recommendations/operation/PostRecommendRecentInteractions
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/recommendations/v2/recommend/items/users/%7BclientUuid%7D/aggregates/%7BaggregateUUID%7D \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"campaignId":"defaultCampaign","campaignName":"string","catalogId":"default","clientUUID":"string","contextItemIds":["string"],"includeContextItems":false,"filterRules":{"excludePurchasedItems":false,"excludePurchasedItemsSinceDays":0,"elasticExcludePurchasedItems":false,"elasticExcludePurchasedItemsSinceDays":0},"displayAttributes":"string","abTestContext":{"experimentId":0,"variantId":"string","requestedCampaignId":"string"},"params":{"source":"mobile"},"inventoryContext":{"channelIds":["string"]},"keepSlotsOrder":true,"personalizeSlotsOrder":false,"sortMetric":"string","boostingParameters":{"metric":"string","strength":0.1,"personalizedBoostingStrength":0},"boostingStrategies":[{"name":"string","condition":"string","strength":1}],"crossWorkspaceMode":{"enabled":true},"slots":[{"name":"string","minNumItems":1,"maxNumItems":5,"shuffleNumItems":1,"filters":"string","elasticFilters":"string","distinctFilter":{"elastic":true,"filters":[{"field":"string","maxNumItems":0,"levelRangeModifier":0}]}}]}'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            payload = "{\"campaignId\":\"defaultCampaign\",\"campaignName\":\"string\",\"catalogId\":\"default\",\"clientUUID\":\"string\",\"contextItemIds\":[\"string\"],\"includeContextItems\":false,\"filterRules\":{\"excludePurchasedItems\":false,\"excludePurchasedItemsSinceDays\":0,\"elasticExcludePurchasedItems\":false,\"elasticExcludePurchasedItemsSinceDays\":0},\"displayAttributes\":\"string\",\"abTestContext\":{\"experimentId\":0,\"variantId\":\"string\",\"requestedCampaignId\":\"string\"},\"params\":{\"source\":\"mobile\"},\"inventoryContext\":{\"channelIds\":[\"string\"]},\"keepSlotsOrder\":true,\"personalizeSlotsOrder\":false,\"sortMetric\":\"string\",\"boostingParameters\":{\"metric\":\"string\",\"strength\":0.1,\"personalizedBoostingStrength\":0},\"boostingStrategies\":[{\"name\":\"string\",\"condition\":\"string\",\"strength\":1}],\"crossWorkspaceMode\":{\"enabled\":true},\"slots\":[{\"name\":\"string\",\"minNumItems\":1,\"maxNumItems\":5,\"shuffleNumItems\":1,\"filters\":\"string\",\"elasticFilters\":\"string\",\"distinctFilter\":{\"elastic\":true,\"filters\":[{\"field\":\"string\",\"maxNumItems\":0,\"levelRangeModifier\":0}]}}]}"

            headers = {
                'Authorization': "Bearer REPLACE_BEARER_TOKEN",
                'content-type': "application/json"
                }

            conn.request("POST", "/recommendations/v2/recommend/items/users/%7BclientUuid%7D/aggregates/%7BaggregateUUID%7D", payload, headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "campaignId": "defaultCampaign",
              "campaignName": "string",
              "catalogId": "default",
              "clientUUID": "string",
              "contextItemIds": [
                "string"
              ],
              "includeContextItems": false,
              "filterRules": {
                "excludePurchasedItems": false,
                "excludePurchasedItemsSinceDays": 0,
                "elasticExcludePurchasedItems": false,
                "elasticExcludePurchasedItemsSinceDays": 0
              },
              "displayAttributes": "string",
              "abTestContext": {
                "experimentId": 0,
                "variantId": "string",
                "requestedCampaignId": "string"
              },
              "params": {
                "source": "mobile"
              },
              "inventoryContext": {
                "channelIds": [
                  "string"
                ]
              },
              "keepSlotsOrder": true,
              "personalizeSlotsOrder": false,
              "sortMetric": "string",
              "boostingParameters": {
                "metric": "string",
                "strength": 0.1,
                "personalizedBoostingStrength": 0
              },
              "boostingStrategies": [
                {
                  "name": "string",
                  "condition": "string",
                  "strength": 1
                }
              ],
              "crossWorkspaceMode": {
                "enabled": true
              },
              "slots": [
                {
                  "name": "string",
                  "minNumItems": 1,
                  "maxNumItems": 5,
                  "shuffleNumItems": 1,
                  "filters": "string",
                  "elasticFilters": "string",
                  "distinctFilter": {
                    "elastic": true,
                    "filters": [
                      {
                        "field": "string",
                        "maxNumItems": 0,
                        "levelRangeModifier": 0
                      }
                    ]
                  }
                }
              ]
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://api.synerise.com/recommendations/v2/recommend/items/users/%7BclientUuid%7D/aggregates/%7BaggregateUUID%7D");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/recommendations/v2/recommend/items/users/%7BclientUuid%7D/aggregates/%7BaggregateUUID%7D",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              campaignId: 'defaultCampaign',
              campaignName: 'string',
              catalogId: 'default',
              clientUUID: 'string',
              contextItemIds: ['string'],
              includeContextItems: false,
              filterRules: {
                excludePurchasedItems: false,
                excludePurchasedItemsSinceDays: 0,
                elasticExcludePurchasedItems: false,
                elasticExcludePurchasedItemsSinceDays: 0
              },
              displayAttributes: 'string',
              abTestContext: {experimentId: 0, variantId: 'string', requestedCampaignId: 'string'},
              params: {source: 'mobile'},
              inventoryContext: {channelIds: ['string']},
              keepSlotsOrder: true,
              personalizeSlotsOrder: false,
              sortMetric: 'string',
              boostingParameters: {metric: 'string', strength: 0.1, personalizedBoostingStrength: 0},
              boostingStrategies: [{name: 'string', condition: 'string', strength: 1}],
              crossWorkspaceMode: {enabled: true},
              slots: [
                {
                  name: 'string',
                  minNumItems: 1,
                  maxNumItems: 5,
                  shuffleNumItems: 1,
                  filters: 'string',
                  elasticFilters: 'string',
                  distinctFilter: {
                    elastic: true,
                    filters: [{field: 'string', maxNumItems: 0, levelRangeModifier: 0}]
                  }
                }
              ]
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/recommendations/v2/recommend/items/users/%7BclientUuid%7D/aggregates/%7BaggregateUUID%7D');
            $request->setMethod(HTTP_METH_POST);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN',
              'content-type' => 'application/json'
            ]);

            $request->setBody('{"campaignId":"defaultCampaign","campaignName":"string","catalogId":"default","clientUUID":"string","contextItemIds":["string"],"includeContextItems":false,"filterRules":{"excludePurchasedItems":false,"excludePurchasedItemsSinceDays":0,"elasticExcludePurchasedItems":false,"elasticExcludePurchasedItemsSinceDays":0},"displayAttributes":"string","abTestContext":{"experimentId":0,"variantId":"string","requestedCampaignId":"string"},"params":{"source":"mobile"},"inventoryContext":{"channelIds":["string"]},"keepSlotsOrder":true,"personalizeSlotsOrder":false,"sortMetric":"string","boostingParameters":{"metric":"string","strength":0.1,"personalizedBoostingStrength":0},"boostingStrategies":[{"name":"string","condition":"string","strength":1}],"crossWorkspaceMode":{"enabled":true},"slots":[{"name":"string","minNumItems":1,"maxNumItems":5,"shuffleNumItems":1,"filters":"string","elasticFilters":"string","distinctFilter":{"elastic":true,"filters":[{"field":"string","maxNumItems":0,"levelRangeModifier":0}]}}]}');

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.post("https://api.synerise.com/recommendations/v2/recommend/items/users/%7BclientUuid%7D/aggregates/%7BaggregateUUID%7D")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"campaignId\":\"defaultCampaign\",\"campaignName\":\"string\",\"catalogId\":\"default\",\"clientUUID\":\"string\",\"contextItemIds\":[\"string\"],\"includeContextItems\":false,\"filterRules\":{\"excludePurchasedItems\":false,\"excludePurchasedItemsSinceDays\":0,\"elasticExcludePurchasedItems\":false,\"elasticExcludePurchasedItemsSinceDays\":0},\"displayAttributes\":\"string\",\"abTestContext\":{\"experimentId\":0,\"variantId\":\"string\",\"requestedCampaignId\":\"string\"},\"params\":{\"source\":\"mobile\"},\"inventoryContext\":{\"channelIds\":[\"string\"]},\"keepSlotsOrder\":true,\"personalizeSlotsOrder\":false,\"sortMetric\":\"string\",\"boostingParameters\":{\"metric\":\"string\",\"strength\":0.1,\"personalizedBoostingStrength\":0},\"boostingStrategies\":[{\"name\":\"string\",\"condition\":\"string\",\"strength\":1}],\"crossWorkspaceMode\":{\"enabled\":true},\"slots\":[{\"name\":\"string\",\"minNumItems\":1,\"maxNumItems\":5,\"shuffleNumItems\":1,\"filters\":\"string\",\"elasticFilters\":\"string\",\"distinctFilter\":{\"elastic\":true,\"filters\":[{\"field\":\"string\",\"maxNumItems\":0,\"levelRangeModifier\":0}]}}]}")
              .asString();
  /recommendations/v2/recommend/items/metric:
    get:
      summary: Scoring by metric
      description: |
        Returns items with the highest score of a chosen metric. A list of available metrics can be checked by using [this endpoint](https://developers.synerise.com/AnalyticsSuite/AnalyticsSuite.html#operation/ApiGetAvailableMetricsV2).

        **Note:** The definition of an *item* encompasses products, but also articles, images, videos, and any other entities in the item feed.

        ---

        **API consumers:** <span title="Deprecated">AI API key (legacy)</span>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>, <a href="/docs/settings/tool/tracking_codes" target="_blank" rel="noopener" title="Pass your tracker key in the request header">Web SDK Tracker</a>

        **API key permission required:** `RECOMMENDATIONS_V2_METRICS_RECOMMENDATIONS_READ`
      operationId: GetItemsByMetric
      tags:
        - Recommendations
      security:
        - TrackerKey: []
        - JWT: []
      parameters:
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsSortMetric"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsMinNumItems"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsMaxNumItems"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsCampaignId"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsCampaignName"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsClientUUID"
        - $ref: "#/components/parameters/recommendations-rust-all-inParamsItemId"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsExcludePurchasedItems"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsExcludePurchasedItemsSince"
        - $ref: "#/components/parameters/recommendations-rust-all-filterExpr"
        - $ref: "#/components/parameters/recommendations-rust-all-elasticFilterExpr"
        - $ref: "#/components/parameters/recommendations-rust-all-itemCatalogId"
        - $ref: "#/components/parameters/recommendations-rust-all-distinctFilter"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsIncludeContextItems"
        - $ref: "#/components/parameters/recommendations-rust-all-params"
        - $ref: "#/components/parameters/recommendations-rust-all-inventoryChannelId"
        - $ref: "#/components/parameters/recommendations-rust-all-crossWorkspaceMode"
      responses:
        "200":
          description: Items with the highest metric scores
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/recommendations-rust-all-RecommendationResponseSchemaV2"
        "404":
          $ref: "#/components/responses/recommendations-rust-all-404-no-recommendation"
        "500":
          $ref: "#/components/responses/recommendations-rust-all-500-error-occurred"
      x-snr-doc-urls:
        - /api-reference/ai-recommendations#tag/Recommendations/operation/GetItemsByMetric
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.synerise.com/recommendations/v2/recommend/items/metric?sortMetric=SOME_STRING_VALUE&minNumItems=SOME_INTEGER_VALUE&maxNumItems=SOME_INTEGER_VALUE&campaignId=SOME_STRING_VALUE&campaignName=SOME_STRING_VALUE&clientUUID=SOME_STRING_VALUE&itemId=SOME_STRING_VALUE&excludePurchasedItems=SOME_BOOLEAN_VALUE&excludePurchasedItemsSinceDays=SOME_INTEGER_VALUE&filters=SOME_STRING_VALUE&elastic%3Afilters=SOME_STRING_VALUE&itemCatalogId=SOME_STRING_VALUE&distinctFilter=SOME_OBJECT_VALUE&includeContextItems=SOME_BOOLEAN_VALUE&params=source%3Amobile&inventoryChannelId=SOME_STRING_VALUE&crossWorkspaceMode=SOME_BOOLEAN_VALUE' \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            headers = { 'Authorization': "Bearer REPLACE_BEARER_TOKEN" }

            conn.request("GET", "/recommendations/v2/recommend/items/metric?sortMetric=SOME_STRING_VALUE&minNumItems=SOME_INTEGER_VALUE&maxNumItems=SOME_INTEGER_VALUE&campaignId=SOME_STRING_VALUE&campaignName=SOME_STRING_VALUE&clientUUID=SOME_STRING_VALUE&itemId=SOME_STRING_VALUE&excludePurchasedItems=SOME_BOOLEAN_VALUE&excludePurchasedItemsSinceDays=SOME_INTEGER_VALUE&filters=SOME_STRING_VALUE&elastic%3Afilters=SOME_STRING_VALUE&itemCatalogId=SOME_STRING_VALUE&distinctFilter=SOME_OBJECT_VALUE&includeContextItems=SOME_BOOLEAN_VALUE&params=source%3Amobile&inventoryChannelId=SOME_STRING_VALUE&crossWorkspaceMode=SOME_BOOLEAN_VALUE", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://api.synerise.com/recommendations/v2/recommend/items/metric?sortMetric=SOME_STRING_VALUE&minNumItems=SOME_INTEGER_VALUE&maxNumItems=SOME_INTEGER_VALUE&campaignId=SOME_STRING_VALUE&campaignName=SOME_STRING_VALUE&clientUUID=SOME_STRING_VALUE&itemId=SOME_STRING_VALUE&excludePurchasedItems=SOME_BOOLEAN_VALUE&excludePurchasedItemsSinceDays=SOME_INTEGER_VALUE&filters=SOME_STRING_VALUE&elastic%3Afilters=SOME_STRING_VALUE&itemCatalogId=SOME_STRING_VALUE&distinctFilter=SOME_OBJECT_VALUE&includeContextItems=SOME_BOOLEAN_VALUE&params=source%3Amobile&inventoryChannelId=SOME_STRING_VALUE&crossWorkspaceMode=SOME_BOOLEAN_VALUE");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/recommendations/v2/recommend/items/metric?sortMetric=SOME_STRING_VALUE&minNumItems=SOME_INTEGER_VALUE&maxNumItems=SOME_INTEGER_VALUE&campaignId=SOME_STRING_VALUE&campaignName=SOME_STRING_VALUE&clientUUID=SOME_STRING_VALUE&itemId=SOME_STRING_VALUE&excludePurchasedItems=SOME_BOOLEAN_VALUE&excludePurchasedItemsSinceDays=SOME_INTEGER_VALUE&filters=SOME_STRING_VALUE&elastic%3Afilters=SOME_STRING_VALUE&itemCatalogId=SOME_STRING_VALUE&distinctFilter=SOME_OBJECT_VALUE&includeContextItems=SOME_BOOLEAN_VALUE&params=source%3Amobile&inventoryChannelId=SOME_STRING_VALUE&crossWorkspaceMode=SOME_BOOLEAN_VALUE",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/recommendations/v2/recommend/items/metric');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'sortMetric' => 'SOME_STRING_VALUE',
              'minNumItems' => 'SOME_INTEGER_VALUE',
              'maxNumItems' => 'SOME_INTEGER_VALUE',
              'campaignId' => 'SOME_STRING_VALUE',
              'campaignName' => 'SOME_STRING_VALUE',
              'clientUUID' => 'SOME_STRING_VALUE',
              'itemId' => 'SOME_STRING_VALUE',
              'excludePurchasedItems' => 'SOME_BOOLEAN_VALUE',
              'excludePurchasedItemsSinceDays' => 'SOME_INTEGER_VALUE',
              'filters' => 'SOME_STRING_VALUE',
              'elastic:filters' => 'SOME_STRING_VALUE',
              'itemCatalogId' => 'SOME_STRING_VALUE',
              'distinctFilter' => 'SOME_OBJECT_VALUE',
              'includeContextItems' => 'SOME_BOOLEAN_VALUE',
              'params' => 'source:mobile',
              'inventoryChannelId' => 'SOME_STRING_VALUE',
              'crossWorkspaceMode' => 'SOME_BOOLEAN_VALUE'
            ]);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.get("https://api.synerise.com/recommendations/v2/recommend/items/metric?sortMetric=SOME_STRING_VALUE&minNumItems=SOME_INTEGER_VALUE&maxNumItems=SOME_INTEGER_VALUE&campaignId=SOME_STRING_VALUE&campaignName=SOME_STRING_VALUE&clientUUID=SOME_STRING_VALUE&itemId=SOME_STRING_VALUE&excludePurchasedItems=SOME_BOOLEAN_VALUE&excludePurchasedItemsSinceDays=SOME_INTEGER_VALUE&filters=SOME_STRING_VALUE&elastic%3Afilters=SOME_STRING_VALUE&itemCatalogId=SOME_STRING_VALUE&distinctFilter=SOME_OBJECT_VALUE&includeContextItems=SOME_BOOLEAN_VALUE&params=source%3Amobile&inventoryChannelId=SOME_STRING_VALUE&crossWorkspaceMode=SOME_BOOLEAN_VALUE")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
    post:
      summary: Scoring by metric
      description: |
        Returns items with the highest score of a chosen metric. A list of available metrics can be checked by using [this endpoint](https://developers.synerise.com/AnalyticsSuite/AnalyticsSuite.html#operation/ApiGetAvailableMetricsV2).

        **Note:** The definition of an *item* encompasses products, but also articles, images, videos, and any other entities in the item feed.

        ---

        **API consumers:** <span title="Deprecated">AI API key (legacy)</span>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>, <a href="/docs/settings/tool/tracking_codes" target="_blank" rel="noopener" title="Pass your tracker key in the request header">Web SDK Tracker</a>

        **API key permission required:** `RECOMMENDATIONS_V2_METRICS_RECOMMENDATIONS_READ`
      operationId: PostItemsByMetric
      tags:
        - Recommendations
      security:
        - TrackerKey: []
        - JWT: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/recommendations-rust-all-MetricsBodySchemaV2"
        description: Definition of the requested recommendation
        required: true
      responses:
        "200":
          description: Items with the highest metric scores
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/recommendations-rust-all-SlotsRecommendationResponseSchemaV2"
        "404":
          $ref: "#/components/responses/recommendations-rust-all-404-no-recommendation"
        "500":
          $ref: "#/components/responses/recommendations-rust-all-500-error-occurred"
      x-snr-doc-urls:
        - /api-reference/ai-recommendations#tag/Recommendations/operation/PostItemsByMetric
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/recommendations/v2/recommend/items/metric \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"campaignId":"defaultCampaign","campaignName":"string","catalogId":"default","clientUUID":"string","contextItemIds":["string"],"includeContextItems":false,"filterRules":{"excludePurchasedItems":false,"excludePurchasedItemsSinceDays":0,"elasticExcludePurchasedItems":false,"elasticExcludePurchasedItemsSinceDays":0},"displayAttributes":"string","abTestContext":{"experimentId":0,"variantId":"string","requestedCampaignId":"string"},"params":{"source":"mobile"},"inventoryContext":{"channelIds":["string"]},"keepSlotsOrder":true,"personalizeSlotsOrder":false,"sortMetric":"string","boostingParameters":{"metric":"string","strength":0.1,"personalizedBoostingStrength":0},"boostingStrategies":[{"name":"string","condition":"string","strength":1}],"crossWorkspaceMode":{"enabled":true},"slots":[{"name":"string","minNumItems":1,"maxNumItems":5,"shuffleNumItems":1,"filters":"string","elasticFilters":"string","distinctFilter":{"elastic":true,"filters":[{"field":"string","maxNumItems":0,"levelRangeModifier":0}]}}]}'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            payload = "{\"campaignId\":\"defaultCampaign\",\"campaignName\":\"string\",\"catalogId\":\"default\",\"clientUUID\":\"string\",\"contextItemIds\":[\"string\"],\"includeContextItems\":false,\"filterRules\":{\"excludePurchasedItems\":false,\"excludePurchasedItemsSinceDays\":0,\"elasticExcludePurchasedItems\":false,\"elasticExcludePurchasedItemsSinceDays\":0},\"displayAttributes\":\"string\",\"abTestContext\":{\"experimentId\":0,\"variantId\":\"string\",\"requestedCampaignId\":\"string\"},\"params\":{\"source\":\"mobile\"},\"inventoryContext\":{\"channelIds\":[\"string\"]},\"keepSlotsOrder\":true,\"personalizeSlotsOrder\":false,\"sortMetric\":\"string\",\"boostingParameters\":{\"metric\":\"string\",\"strength\":0.1,\"personalizedBoostingStrength\":0},\"boostingStrategies\":[{\"name\":\"string\",\"condition\":\"string\",\"strength\":1}],\"crossWorkspaceMode\":{\"enabled\":true},\"slots\":[{\"name\":\"string\",\"minNumItems\":1,\"maxNumItems\":5,\"shuffleNumItems\":1,\"filters\":\"string\",\"elasticFilters\":\"string\",\"distinctFilter\":{\"elastic\":true,\"filters\":[{\"field\":\"string\",\"maxNumItems\":0,\"levelRangeModifier\":0}]}}]}"

            headers = {
                'Authorization': "Bearer REPLACE_BEARER_TOKEN",
                'content-type': "application/json"
                }

            conn.request("POST", "/recommendations/v2/recommend/items/metric", payload, headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "campaignId": "defaultCampaign",
              "campaignName": "string",
              "catalogId": "default",
              "clientUUID": "string",
              "contextItemIds": [
                "string"
              ],
              "includeContextItems": false,
              "filterRules": {
                "excludePurchasedItems": false,
                "excludePurchasedItemsSinceDays": 0,
                "elasticExcludePurchasedItems": false,
                "elasticExcludePurchasedItemsSinceDays": 0
              },
              "displayAttributes": "string",
              "abTestContext": {
                "experimentId": 0,
                "variantId": "string",
                "requestedCampaignId": "string"
              },
              "params": {
                "source": "mobile"
              },
              "inventoryContext": {
                "channelIds": [
                  "string"
                ]
              },
              "keepSlotsOrder": true,
              "personalizeSlotsOrder": false,
              "sortMetric": "string",
              "boostingParameters": {
                "metric": "string",
                "strength": 0.1,
                "personalizedBoostingStrength": 0
              },
              "boostingStrategies": [
                {
                  "name": "string",
                  "condition": "string",
                  "strength": 1
                }
              ],
              "crossWorkspaceMode": {
                "enabled": true
              },
              "slots": [
                {
                  "name": "string",
                  "minNumItems": 1,
                  "maxNumItems": 5,
                  "shuffleNumItems": 1,
                  "filters": "string",
                  "elasticFilters": "string",
                  "distinctFilter": {
                    "elastic": true,
                    "filters": [
                      {
                        "field": "string",
                        "maxNumItems": 0,
                        "levelRangeModifier": 0
                      }
                    ]
                  }
                }
              ]
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://api.synerise.com/recommendations/v2/recommend/items/metric");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/recommendations/v2/recommend/items/metric",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              campaignId: 'defaultCampaign',
              campaignName: 'string',
              catalogId: 'default',
              clientUUID: 'string',
              contextItemIds: ['string'],
              includeContextItems: false,
              filterRules: {
                excludePurchasedItems: false,
                excludePurchasedItemsSinceDays: 0,
                elasticExcludePurchasedItems: false,
                elasticExcludePurchasedItemsSinceDays: 0
              },
              displayAttributes: 'string',
              abTestContext: {experimentId: 0, variantId: 'string', requestedCampaignId: 'string'},
              params: {source: 'mobile'},
              inventoryContext: {channelIds: ['string']},
              keepSlotsOrder: true,
              personalizeSlotsOrder: false,
              sortMetric: 'string',
              boostingParameters: {metric: 'string', strength: 0.1, personalizedBoostingStrength: 0},
              boostingStrategies: [{name: 'string', condition: 'string', strength: 1}],
              crossWorkspaceMode: {enabled: true},
              slots: [
                {
                  name: 'string',
                  minNumItems: 1,
                  maxNumItems: 5,
                  shuffleNumItems: 1,
                  filters: 'string',
                  elasticFilters: 'string',
                  distinctFilter: {
                    elastic: true,
                    filters: [{field: 'string', maxNumItems: 0, levelRangeModifier: 0}]
                  }
                }
              ]
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/recommendations/v2/recommend/items/metric');
            $request->setMethod(HTTP_METH_POST);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN',
              'content-type' => 'application/json'
            ]);

            $request->setBody('{"campaignId":"defaultCampaign","campaignName":"string","catalogId":"default","clientUUID":"string","contextItemIds":["string"],"includeContextItems":false,"filterRules":{"excludePurchasedItems":false,"excludePurchasedItemsSinceDays":0,"elasticExcludePurchasedItems":false,"elasticExcludePurchasedItemsSinceDays":0},"displayAttributes":"string","abTestContext":{"experimentId":0,"variantId":"string","requestedCampaignId":"string"},"params":{"source":"mobile"},"inventoryContext":{"channelIds":["string"]},"keepSlotsOrder":true,"personalizeSlotsOrder":false,"sortMetric":"string","boostingParameters":{"metric":"string","strength":0.1,"personalizedBoostingStrength":0},"boostingStrategies":[{"name":"string","condition":"string","strength":1}],"crossWorkspaceMode":{"enabled":true},"slots":[{"name":"string","minNumItems":1,"maxNumItems":5,"shuffleNumItems":1,"filters":"string","elasticFilters":"string","distinctFilter":{"elastic":true,"filters":[{"field":"string","maxNumItems":0,"levelRangeModifier":0}]}}]}');

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.post("https://api.synerise.com/recommendations/v2/recommend/items/metric")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"campaignId\":\"defaultCampaign\",\"campaignName\":\"string\",\"catalogId\":\"default\",\"clientUUID\":\"string\",\"contextItemIds\":[\"string\"],\"includeContextItems\":false,\"filterRules\":{\"excludePurchasedItems\":false,\"excludePurchasedItemsSinceDays\":0,\"elasticExcludePurchasedItems\":false,\"elasticExcludePurchasedItemsSinceDays\":0},\"displayAttributes\":\"string\",\"abTestContext\":{\"experimentId\":0,\"variantId\":\"string\",\"requestedCampaignId\":\"string\"},\"params\":{\"source\":\"mobile\"},\"inventoryContext\":{\"channelIds\":[\"string\"]},\"keepSlotsOrder\":true,\"personalizeSlotsOrder\":false,\"sortMetric\":\"string\",\"boostingParameters\":{\"metric\":\"string\",\"strength\":0.1,\"personalizedBoostingStrength\":0},\"boostingStrategies\":[{\"name\":\"string\",\"condition\":\"string\",\"strength\":1}],\"crossWorkspaceMode\":{\"enabled\":true},\"slots\":[{\"name\":\"string\",\"minNumItems\":1,\"maxNumItems\":5,\"shuffleNumItems\":1,\"filters\":\"string\",\"elasticFilters\":\"string\",\"distinctFilter\":{\"elastic\":true,\"filters\":[{\"field\":\"string\",\"maxNumItems\":0,\"levelRangeModifier\":0}]}}]}")
              .asString();
  /recommendations/v2/recommend/items/complementary:
    get:
      summary: Complementary items for a cart
      description: |
        Show recommendations based on the contents of a cart.

        **Note:** The definition of an *item* encompasses products, but also articles, images, videos, and any other entities in the item feed.

        ---

        **API consumers:** <span title="Deprecated">AI API key (legacy)</span>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>, <a href="/docs/settings/tool/tracking_codes" target="_blank" rel="noopener" title="Pass your tracker key in the request header">Web SDK Tracker</a>

        **API key permission required:** `RECOMMENDATIONS_V2_COMPLEMENTARY_RECOMMENDATIONS_READ`
      operationId: ComplementItems
      tags:
        - Recommendations
      security:
        - TrackerKey: []
        - JWT: []
      parameters:
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsClientUUID"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsMinNumItems"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsMaxNumItems"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsCampaignId"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsCampaignName"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsExcludePurchasedItems"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsExcludePurchasedItemsSince"
        - $ref: "#/components/parameters/recommendations-rust-all-filterExpr"
        - $ref: "#/components/parameters/recommendations-rust-all-elasticFilterExpr"
        - $ref: "#/components/parameters/recommendations-rust-all-inParamsItemIdList"
        - $ref: "#/components/parameters/recommendations-rust-all-itemCatalogId"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsBoostMetric"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsSortMetric"
        - $ref: "#/components/parameters/recommendations-rust-all-distinctFilter"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsIncludeContextItems"
        - $ref: "#/components/parameters/recommendations-rust-all-params"
        - $ref: "#/components/parameters/recommendations-rust-all-inventoryChannelId"
        - $ref: "#/components/parameters/recommendations-rust-all-crossWorkspaceMode"
      responses:
        "200":
          description: Cart complementary recommendations
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/recommendations-rust-all-RecommendationResponseSchemaV2"
        "404":
          $ref: "#/components/responses/recommendations-rust-all-404-no-recommendation"
        "500":
          $ref: "#/components/responses/recommendations-rust-all-500-error-occurred"
      x-snr-doc-urls:
        - /api-reference/ai-recommendations#tag/Recommendations/operation/ComplementItems
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.synerise.com/recommendations/v2/recommend/items/complementary?clientUUID=SOME_STRING_VALUE&minNumItems=SOME_INTEGER_VALUE&maxNumItems=SOME_INTEGER_VALUE&campaignId=SOME_STRING_VALUE&campaignName=SOME_STRING_VALUE&excludePurchasedItems=SOME_BOOLEAN_VALUE&excludePurchasedItemsSinceDays=SOME_INTEGER_VALUE&filters=SOME_STRING_VALUE&elastic%3Afilters=SOME_STRING_VALUE&itemId=SOME_ARRAY_VALUE&itemCatalogId=SOME_STRING_VALUE&boostMetric=SOME_STRING_VALUE&sortMetric=SOME_STRING_VALUE&distinctFilter=SOME_OBJECT_VALUE&includeContextItems=SOME_BOOLEAN_VALUE&params=source%3Amobile&inventoryChannelId=SOME_STRING_VALUE&crossWorkspaceMode=SOME_BOOLEAN_VALUE' \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            headers = { 'Authorization': "Bearer REPLACE_BEARER_TOKEN" }

            conn.request("GET", "/recommendations/v2/recommend/items/complementary?clientUUID=SOME_STRING_VALUE&minNumItems=SOME_INTEGER_VALUE&maxNumItems=SOME_INTEGER_VALUE&campaignId=SOME_STRING_VALUE&campaignName=SOME_STRING_VALUE&excludePurchasedItems=SOME_BOOLEAN_VALUE&excludePurchasedItemsSinceDays=SOME_INTEGER_VALUE&filters=SOME_STRING_VALUE&elastic%3Afilters=SOME_STRING_VALUE&itemId=SOME_ARRAY_VALUE&itemCatalogId=SOME_STRING_VALUE&boostMetric=SOME_STRING_VALUE&sortMetric=SOME_STRING_VALUE&distinctFilter=SOME_OBJECT_VALUE&includeContextItems=SOME_BOOLEAN_VALUE&params=source%3Amobile&inventoryChannelId=SOME_STRING_VALUE&crossWorkspaceMode=SOME_BOOLEAN_VALUE", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://api.synerise.com/recommendations/v2/recommend/items/complementary?clientUUID=SOME_STRING_VALUE&minNumItems=SOME_INTEGER_VALUE&maxNumItems=SOME_INTEGER_VALUE&campaignId=SOME_STRING_VALUE&campaignName=SOME_STRING_VALUE&excludePurchasedItems=SOME_BOOLEAN_VALUE&excludePurchasedItemsSinceDays=SOME_INTEGER_VALUE&filters=SOME_STRING_VALUE&elastic%3Afilters=SOME_STRING_VALUE&itemId=SOME_ARRAY_VALUE&itemCatalogId=SOME_STRING_VALUE&boostMetric=SOME_STRING_VALUE&sortMetric=SOME_STRING_VALUE&distinctFilter=SOME_OBJECT_VALUE&includeContextItems=SOME_BOOLEAN_VALUE&params=source%3Amobile&inventoryChannelId=SOME_STRING_VALUE&crossWorkspaceMode=SOME_BOOLEAN_VALUE");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/recommendations/v2/recommend/items/complementary?clientUUID=SOME_STRING_VALUE&minNumItems=SOME_INTEGER_VALUE&maxNumItems=SOME_INTEGER_VALUE&campaignId=SOME_STRING_VALUE&campaignName=SOME_STRING_VALUE&excludePurchasedItems=SOME_BOOLEAN_VALUE&excludePurchasedItemsSinceDays=SOME_INTEGER_VALUE&filters=SOME_STRING_VALUE&elastic%3Afilters=SOME_STRING_VALUE&itemId=SOME_ARRAY_VALUE&itemCatalogId=SOME_STRING_VALUE&boostMetric=SOME_STRING_VALUE&sortMetric=SOME_STRING_VALUE&distinctFilter=SOME_OBJECT_VALUE&includeContextItems=SOME_BOOLEAN_VALUE&params=source%3Amobile&inventoryChannelId=SOME_STRING_VALUE&crossWorkspaceMode=SOME_BOOLEAN_VALUE",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/recommendations/v2/recommend/items/complementary');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'clientUUID' => 'SOME_STRING_VALUE',
              'minNumItems' => 'SOME_INTEGER_VALUE',
              'maxNumItems' => 'SOME_INTEGER_VALUE',
              'campaignId' => 'SOME_STRING_VALUE',
              'campaignName' => 'SOME_STRING_VALUE',
              'excludePurchasedItems' => 'SOME_BOOLEAN_VALUE',
              'excludePurchasedItemsSinceDays' => 'SOME_INTEGER_VALUE',
              'filters' => 'SOME_STRING_VALUE',
              'elastic:filters' => 'SOME_STRING_VALUE',
              'itemId' => 'SOME_ARRAY_VALUE',
              'itemCatalogId' => 'SOME_STRING_VALUE',
              'boostMetric' => 'SOME_STRING_VALUE',
              'sortMetric' => 'SOME_STRING_VALUE',
              'distinctFilter' => 'SOME_OBJECT_VALUE',
              'includeContextItems' => 'SOME_BOOLEAN_VALUE',
              'params' => 'source:mobile',
              'inventoryChannelId' => 'SOME_STRING_VALUE',
              'crossWorkspaceMode' => 'SOME_BOOLEAN_VALUE'
            ]);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.get("https://api.synerise.com/recommendations/v2/recommend/items/complementary?clientUUID=SOME_STRING_VALUE&minNumItems=SOME_INTEGER_VALUE&maxNumItems=SOME_INTEGER_VALUE&campaignId=SOME_STRING_VALUE&campaignName=SOME_STRING_VALUE&excludePurchasedItems=SOME_BOOLEAN_VALUE&excludePurchasedItemsSinceDays=SOME_INTEGER_VALUE&filters=SOME_STRING_VALUE&elastic%3Afilters=SOME_STRING_VALUE&itemId=SOME_ARRAY_VALUE&itemCatalogId=SOME_STRING_VALUE&boostMetric=SOME_STRING_VALUE&sortMetric=SOME_STRING_VALUE&distinctFilter=SOME_OBJECT_VALUE&includeContextItems=SOME_BOOLEAN_VALUE&params=source%3Amobile&inventoryChannelId=SOME_STRING_VALUE&crossWorkspaceMode=SOME_BOOLEAN_VALUE")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
    post:
      summary: Complementary items for a cart
      description: |
        Show recommendations based on the contents of a cart.

        **Note:** The definition of an *item* encompasses products, but also articles, images, videos, and any other entities in the item feed.

        ---

        **API consumers:** <span title="Deprecated">AI API key (legacy)</span>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>, <a href="/docs/settings/tool/tracking_codes" target="_blank" rel="noopener" title="Pass your tracker key in the request header">Web SDK Tracker</a>

        **API key permission required:** `RECOMMENDATIONS_V2_COMPLEMENTARY_RECOMMENDATIONS_READ`
      operationId: PostComplementItems
      tags:
        - Recommendations
      security:
        - JWT: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/recommendations-rust-all-SlotsBodySchemaV2"
        description: Definition of the requested recommendation
        required: true
      responses:
        "200":
          description: Cart complementary recommendations
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/recommendations-rust-all-SlotsRecommendationResponseSchemaV2"
        "404":
          $ref: "#/components/responses/recommendations-rust-all-404-no-recommendation"
        "500":
          $ref: "#/components/responses/recommendations-rust-all-500-error-occurred"
      x-snr-doc-urls:
        - /api-reference/ai-recommendations#tag/Recommendations/operation/PostComplementItems
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/recommendations/v2/recommend/items/complementary \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"campaignId":"defaultCampaign","campaignName":"string","catalogId":"default","clientUUID":"string","contextItemIds":["string"],"includeContextItems":false,"filterRules":{"excludePurchasedItems":false,"excludePurchasedItemsSinceDays":0,"elasticExcludePurchasedItems":false,"elasticExcludePurchasedItemsSinceDays":0},"displayAttributes":"string","abTestContext":{"experimentId":0,"variantId":"string","requestedCampaignId":"string"},"params":{"source":"mobile"},"inventoryContext":{"channelIds":["string"]},"keepSlotsOrder":true,"personalizeSlotsOrder":false,"sortMetric":"string","boostingParameters":{"metric":"string","strength":0.1,"personalizedBoostingStrength":0},"boostingStrategies":[{"name":"string","condition":"string","strength":1}],"crossWorkspaceMode":{"enabled":true},"slots":[{"name":"string","minNumItems":1,"maxNumItems":5,"shuffleNumItems":1,"filters":"string","elasticFilters":"string","distinctFilter":{"elastic":true,"filters":[{"field":"string","maxNumItems":0,"levelRangeModifier":0}]}}]}'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            payload = "{\"campaignId\":\"defaultCampaign\",\"campaignName\":\"string\",\"catalogId\":\"default\",\"clientUUID\":\"string\",\"contextItemIds\":[\"string\"],\"includeContextItems\":false,\"filterRules\":{\"excludePurchasedItems\":false,\"excludePurchasedItemsSinceDays\":0,\"elasticExcludePurchasedItems\":false,\"elasticExcludePurchasedItemsSinceDays\":0},\"displayAttributes\":\"string\",\"abTestContext\":{\"experimentId\":0,\"variantId\":\"string\",\"requestedCampaignId\":\"string\"},\"params\":{\"source\":\"mobile\"},\"inventoryContext\":{\"channelIds\":[\"string\"]},\"keepSlotsOrder\":true,\"personalizeSlotsOrder\":false,\"sortMetric\":\"string\",\"boostingParameters\":{\"metric\":\"string\",\"strength\":0.1,\"personalizedBoostingStrength\":0},\"boostingStrategies\":[{\"name\":\"string\",\"condition\":\"string\",\"strength\":1}],\"crossWorkspaceMode\":{\"enabled\":true},\"slots\":[{\"name\":\"string\",\"minNumItems\":1,\"maxNumItems\":5,\"shuffleNumItems\":1,\"filters\":\"string\",\"elasticFilters\":\"string\",\"distinctFilter\":{\"elastic\":true,\"filters\":[{\"field\":\"string\",\"maxNumItems\":0,\"levelRangeModifier\":0}]}}]}"

            headers = {
                'Authorization': "Bearer REPLACE_BEARER_TOKEN",
                'content-type': "application/json"
                }

            conn.request("POST", "/recommendations/v2/recommend/items/complementary", payload, headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "campaignId": "defaultCampaign",
              "campaignName": "string",
              "catalogId": "default",
              "clientUUID": "string",
              "contextItemIds": [
                "string"
              ],
              "includeContextItems": false,
              "filterRules": {
                "excludePurchasedItems": false,
                "excludePurchasedItemsSinceDays": 0,
                "elasticExcludePurchasedItems": false,
                "elasticExcludePurchasedItemsSinceDays": 0
              },
              "displayAttributes": "string",
              "abTestContext": {
                "experimentId": 0,
                "variantId": "string",
                "requestedCampaignId": "string"
              },
              "params": {
                "source": "mobile"
              },
              "inventoryContext": {
                "channelIds": [
                  "string"
                ]
              },
              "keepSlotsOrder": true,
              "personalizeSlotsOrder": false,
              "sortMetric": "string",
              "boostingParameters": {
                "metric": "string",
                "strength": 0.1,
                "personalizedBoostingStrength": 0
              },
              "boostingStrategies": [
                {
                  "name": "string",
                  "condition": "string",
                  "strength": 1
                }
              ],
              "crossWorkspaceMode": {
                "enabled": true
              },
              "slots": [
                {
                  "name": "string",
                  "minNumItems": 1,
                  "maxNumItems": 5,
                  "shuffleNumItems": 1,
                  "filters": "string",
                  "elasticFilters": "string",
                  "distinctFilter": {
                    "elastic": true,
                    "filters": [
                      {
                        "field": "string",
                        "maxNumItems": 0,
                        "levelRangeModifier": 0
                      }
                    ]
                  }
                }
              ]
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://api.synerise.com/recommendations/v2/recommend/items/complementary");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/recommendations/v2/recommend/items/complementary",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              campaignId: 'defaultCampaign',
              campaignName: 'string',
              catalogId: 'default',
              clientUUID: 'string',
              contextItemIds: ['string'],
              includeContextItems: false,
              filterRules: {
                excludePurchasedItems: false,
                excludePurchasedItemsSinceDays: 0,
                elasticExcludePurchasedItems: false,
                elasticExcludePurchasedItemsSinceDays: 0
              },
              displayAttributes: 'string',
              abTestContext: {experimentId: 0, variantId: 'string', requestedCampaignId: 'string'},
              params: {source: 'mobile'},
              inventoryContext: {channelIds: ['string']},
              keepSlotsOrder: true,
              personalizeSlotsOrder: false,
              sortMetric: 'string',
              boostingParameters: {metric: 'string', strength: 0.1, personalizedBoostingStrength: 0},
              boostingStrategies: [{name: 'string', condition: 'string', strength: 1}],
              crossWorkspaceMode: {enabled: true},
              slots: [
                {
                  name: 'string',
                  minNumItems: 1,
                  maxNumItems: 5,
                  shuffleNumItems: 1,
                  filters: 'string',
                  elasticFilters: 'string',
                  distinctFilter: {
                    elastic: true,
                    filters: [{field: 'string', maxNumItems: 0, levelRangeModifier: 0}]
                  }
                }
              ]
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/recommendations/v2/recommend/items/complementary');
            $request->setMethod(HTTP_METH_POST);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN',
              'content-type' => 'application/json'
            ]);

            $request->setBody('{"campaignId":"defaultCampaign","campaignName":"string","catalogId":"default","clientUUID":"string","contextItemIds":["string"],"includeContextItems":false,"filterRules":{"excludePurchasedItems":false,"excludePurchasedItemsSinceDays":0,"elasticExcludePurchasedItems":false,"elasticExcludePurchasedItemsSinceDays":0},"displayAttributes":"string","abTestContext":{"experimentId":0,"variantId":"string","requestedCampaignId":"string"},"params":{"source":"mobile"},"inventoryContext":{"channelIds":["string"]},"keepSlotsOrder":true,"personalizeSlotsOrder":false,"sortMetric":"string","boostingParameters":{"metric":"string","strength":0.1,"personalizedBoostingStrength":0},"boostingStrategies":[{"name":"string","condition":"string","strength":1}],"crossWorkspaceMode":{"enabled":true},"slots":[{"name":"string","minNumItems":1,"maxNumItems":5,"shuffleNumItems":1,"filters":"string","elasticFilters":"string","distinctFilter":{"elastic":true,"filters":[{"field":"string","maxNumItems":0,"levelRangeModifier":0}]}}]}');

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.post("https://api.synerise.com/recommendations/v2/recommend/items/complementary")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"campaignId\":\"defaultCampaign\",\"campaignName\":\"string\",\"catalogId\":\"default\",\"clientUUID\":\"string\",\"contextItemIds\":[\"string\"],\"includeContextItems\":false,\"filterRules\":{\"excludePurchasedItems\":false,\"excludePurchasedItemsSinceDays\":0,\"elasticExcludePurchasedItems\":false,\"elasticExcludePurchasedItemsSinceDays\":0},\"displayAttributes\":\"string\",\"abTestContext\":{\"experimentId\":0,\"variantId\":\"string\",\"requestedCampaignId\":\"string\"},\"params\":{\"source\":\"mobile\"},\"inventoryContext\":{\"channelIds\":[\"string\"]},\"keepSlotsOrder\":true,\"personalizeSlotsOrder\":false,\"sortMetric\":\"string\",\"boostingParameters\":{\"metric\":\"string\",\"strength\":0.1,\"personalizedBoostingStrength\":0},\"boostingStrategies\":[{\"name\":\"string\",\"condition\":\"string\",\"strength\":1}],\"crossWorkspaceMode\":{\"enabled\":true},\"slots\":[{\"name\":\"string\",\"minNumItems\":1,\"maxNumItems\":5,\"shuffleNumItems\":1,\"filters\":\"string\",\"elasticFilters\":\"string\",\"distinctFilter\":{\"elastic\":true,\"filters\":[{\"field\":\"string\",\"maxNumItems\":0,\"levelRangeModifier\":0}]}}]}")
              .asString();
  /recommendations/v2/recommend/items/{itemId}/complementary:
    get:
      summary: Complementary items
      description: |
        Returns items complementary to the given items.

        **Note:** The definition of an *item* encompasses products, but also articles, images, videos, and any other entities in the item feed.

        ---

        **API consumers:** <span title="Deprecated">AI API key (legacy)</span>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>, <a href="/docs/settings/tool/tracking_codes" target="_blank" rel="noopener" title="Pass your tracker key in the request header">Web SDK Tracker</a>

        **API key permission required:** `RECOMMENDATIONS_V2_COMPLEMENTARY_PRODUCTS_RECOMMENDATIONS_READ`
      operationId: GetComplementaryItems
      tags:
        - Recommendations
      security:
        - TrackerKey: []
        - JWT: []
      parameters:
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsMinNumItems"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsMaxNumItems"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsCampaignId"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsCampaignName"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsClientUUID"
        - $ref: "#/components/parameters/recommendations-rust-all-inPathItemId"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsExcludePurchasedItems"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsExcludePurchasedItemsSince"
        - $ref: "#/components/parameters/recommendations-rust-all-filterExpr"
        - $ref: "#/components/parameters/recommendations-rust-all-elasticFilterExpr"
        - $ref: "#/components/parameters/recommendations-rust-all-itemCatalogId"
        - $ref: "#/components/parameters/recommendations-rust-all-distinctFilter"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsIncludeContextItems"
        - $ref: "#/components/parameters/recommendations-rust-all-params"
        - $ref: "#/components/parameters/recommendations-rust-all-inventoryChannelId"
        - $ref: "#/components/parameters/recommendations-rust-all-crossWorkspaceMode"
      responses:
        "200":
          description: Items complementary to the given item
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/recommendations-rust-all-RecommendationResponseSchemaV2"
        "404":
          $ref: "#/components/responses/recommendations-rust-all-404-no-recommendation"
        "500":
          $ref: "#/components/responses/recommendations-rust-all-500-error-occurred"
      x-snr-doc-urls:
        - /api-reference/ai-recommendations#tag/Recommendations/operation/GetComplementaryItems
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.synerise.com/recommendations/v2/recommend/items/%7BitemId%7D/complementary?minNumItems=SOME_INTEGER_VALUE&maxNumItems=SOME_INTEGER_VALUE&campaignId=SOME_STRING_VALUE&campaignName=SOME_STRING_VALUE&clientUUID=SOME_STRING_VALUE&excludePurchasedItems=SOME_BOOLEAN_VALUE&excludePurchasedItemsSinceDays=SOME_INTEGER_VALUE&filters=SOME_STRING_VALUE&elastic%3Afilters=SOME_STRING_VALUE&itemCatalogId=SOME_STRING_VALUE&distinctFilter=SOME_OBJECT_VALUE&includeContextItems=SOME_BOOLEAN_VALUE&params=source%3Amobile&inventoryChannelId=SOME_STRING_VALUE&crossWorkspaceMode=SOME_BOOLEAN_VALUE' \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            headers = { 'Authorization': "Bearer REPLACE_BEARER_TOKEN" }

            conn.request("GET", "/recommendations/v2/recommend/items/%7BitemId%7D/complementary?minNumItems=SOME_INTEGER_VALUE&maxNumItems=SOME_INTEGER_VALUE&campaignId=SOME_STRING_VALUE&campaignName=SOME_STRING_VALUE&clientUUID=SOME_STRING_VALUE&excludePurchasedItems=SOME_BOOLEAN_VALUE&excludePurchasedItemsSinceDays=SOME_INTEGER_VALUE&filters=SOME_STRING_VALUE&elastic%3Afilters=SOME_STRING_VALUE&itemCatalogId=SOME_STRING_VALUE&distinctFilter=SOME_OBJECT_VALUE&includeContextItems=SOME_BOOLEAN_VALUE&params=source%3Amobile&inventoryChannelId=SOME_STRING_VALUE&crossWorkspaceMode=SOME_BOOLEAN_VALUE", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://api.synerise.com/recommendations/v2/recommend/items/%7BitemId%7D/complementary?minNumItems=SOME_INTEGER_VALUE&maxNumItems=SOME_INTEGER_VALUE&campaignId=SOME_STRING_VALUE&campaignName=SOME_STRING_VALUE&clientUUID=SOME_STRING_VALUE&excludePurchasedItems=SOME_BOOLEAN_VALUE&excludePurchasedItemsSinceDays=SOME_INTEGER_VALUE&filters=SOME_STRING_VALUE&elastic%3Afilters=SOME_STRING_VALUE&itemCatalogId=SOME_STRING_VALUE&distinctFilter=SOME_OBJECT_VALUE&includeContextItems=SOME_BOOLEAN_VALUE&params=source%3Amobile&inventoryChannelId=SOME_STRING_VALUE&crossWorkspaceMode=SOME_BOOLEAN_VALUE");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/recommendations/v2/recommend/items/%7BitemId%7D/complementary?minNumItems=SOME_INTEGER_VALUE&maxNumItems=SOME_INTEGER_VALUE&campaignId=SOME_STRING_VALUE&campaignName=SOME_STRING_VALUE&clientUUID=SOME_STRING_VALUE&excludePurchasedItems=SOME_BOOLEAN_VALUE&excludePurchasedItemsSinceDays=SOME_INTEGER_VALUE&filters=SOME_STRING_VALUE&elastic%3Afilters=SOME_STRING_VALUE&itemCatalogId=SOME_STRING_VALUE&distinctFilter=SOME_OBJECT_VALUE&includeContextItems=SOME_BOOLEAN_VALUE&params=source%3Amobile&inventoryChannelId=SOME_STRING_VALUE&crossWorkspaceMode=SOME_BOOLEAN_VALUE",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/recommendations/v2/recommend/items/%7BitemId%7D/complementary');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'minNumItems' => 'SOME_INTEGER_VALUE',
              'maxNumItems' => 'SOME_INTEGER_VALUE',
              'campaignId' => 'SOME_STRING_VALUE',
              'campaignName' => 'SOME_STRING_VALUE',
              'clientUUID' => 'SOME_STRING_VALUE',
              'excludePurchasedItems' => 'SOME_BOOLEAN_VALUE',
              'excludePurchasedItemsSinceDays' => 'SOME_INTEGER_VALUE',
              'filters' => 'SOME_STRING_VALUE',
              'elastic:filters' => 'SOME_STRING_VALUE',
              'itemCatalogId' => 'SOME_STRING_VALUE',
              'distinctFilter' => 'SOME_OBJECT_VALUE',
              'includeContextItems' => 'SOME_BOOLEAN_VALUE',
              'params' => 'source:mobile',
              'inventoryChannelId' => 'SOME_STRING_VALUE',
              'crossWorkspaceMode' => 'SOME_BOOLEAN_VALUE'
            ]);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.get("https://api.synerise.com/recommendations/v2/recommend/items/%7BitemId%7D/complementary?minNumItems=SOME_INTEGER_VALUE&maxNumItems=SOME_INTEGER_VALUE&campaignId=SOME_STRING_VALUE&campaignName=SOME_STRING_VALUE&clientUUID=SOME_STRING_VALUE&excludePurchasedItems=SOME_BOOLEAN_VALUE&excludePurchasedItemsSinceDays=SOME_INTEGER_VALUE&filters=SOME_STRING_VALUE&elastic%3Afilters=SOME_STRING_VALUE&itemCatalogId=SOME_STRING_VALUE&distinctFilter=SOME_OBJECT_VALUE&includeContextItems=SOME_BOOLEAN_VALUE&params=source%3Amobile&inventoryChannelId=SOME_STRING_VALUE&crossWorkspaceMode=SOME_BOOLEAN_VALUE")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
    post:
      summary: Complementary items
      description: |
        Returns items complementary to the given items.

        **Note:** The definition of an *item* encompasses products, but also articles, images, videos, and any other entities in the item feed.

        ---

        **API consumers:** <span title="Deprecated">AI API key (legacy)</span>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>, <a href="/docs/settings/tool/tracking_codes" target="_blank" rel="noopener" title="Pass your tracker key in the request header">Web SDK Tracker</a>

        **API key permission required:** `RECOMMENDATIONS_V2_COMPLEMENTARY_PRODUCTS_RECOMMENDATIONS_READ`
      operationId: PostComplementaryItems
      tags:
        - Recommendations
      security:
        - TrackerKey: []
        - JWT: []
      parameters:
        - $ref: "#/components/parameters/recommendations-rust-all-inPathItemId"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/recommendations-rust-all-SlotsBodySchemaV2"
        description: Definition of the requested recommendation
        required: true
      responses:
        "200":
          description: Items complementary to the given item
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/recommendations-rust-all-SlotsRecommendationResponseSchemaV2"
        "404":
          $ref: "#/components/responses/recommendations-rust-all-404-no-recommendation"
        "500":
          $ref: "#/components/responses/recommendations-rust-all-500-error-occurred"
      x-snr-doc-urls:
        - /api-reference/ai-recommendations#tag/Recommendations/operation/PostComplementaryItems
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/recommendations/v2/recommend/items/%7BitemId%7D/complementary \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"campaignId":"defaultCampaign","campaignName":"string","catalogId":"default","clientUUID":"string","contextItemIds":["string"],"includeContextItems":false,"filterRules":{"excludePurchasedItems":false,"excludePurchasedItemsSinceDays":0,"elasticExcludePurchasedItems":false,"elasticExcludePurchasedItemsSinceDays":0},"displayAttributes":"string","abTestContext":{"experimentId":0,"variantId":"string","requestedCampaignId":"string"},"params":{"source":"mobile"},"inventoryContext":{"channelIds":["string"]},"keepSlotsOrder":true,"personalizeSlotsOrder":false,"sortMetric":"string","boostingParameters":{"metric":"string","strength":0.1,"personalizedBoostingStrength":0},"boostingStrategies":[{"name":"string","condition":"string","strength":1}],"crossWorkspaceMode":{"enabled":true},"slots":[{"name":"string","minNumItems":1,"maxNumItems":5,"shuffleNumItems":1,"filters":"string","elasticFilters":"string","distinctFilter":{"elastic":true,"filters":[{"field":"string","maxNumItems":0,"levelRangeModifier":0}]}}]}'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            payload = "{\"campaignId\":\"defaultCampaign\",\"campaignName\":\"string\",\"catalogId\":\"default\",\"clientUUID\":\"string\",\"contextItemIds\":[\"string\"],\"includeContextItems\":false,\"filterRules\":{\"excludePurchasedItems\":false,\"excludePurchasedItemsSinceDays\":0,\"elasticExcludePurchasedItems\":false,\"elasticExcludePurchasedItemsSinceDays\":0},\"displayAttributes\":\"string\",\"abTestContext\":{\"experimentId\":0,\"variantId\":\"string\",\"requestedCampaignId\":\"string\"},\"params\":{\"source\":\"mobile\"},\"inventoryContext\":{\"channelIds\":[\"string\"]},\"keepSlotsOrder\":true,\"personalizeSlotsOrder\":false,\"sortMetric\":\"string\",\"boostingParameters\":{\"metric\":\"string\",\"strength\":0.1,\"personalizedBoostingStrength\":0},\"boostingStrategies\":[{\"name\":\"string\",\"condition\":\"string\",\"strength\":1}],\"crossWorkspaceMode\":{\"enabled\":true},\"slots\":[{\"name\":\"string\",\"minNumItems\":1,\"maxNumItems\":5,\"shuffleNumItems\":1,\"filters\":\"string\",\"elasticFilters\":\"string\",\"distinctFilter\":{\"elastic\":true,\"filters\":[{\"field\":\"string\",\"maxNumItems\":0,\"levelRangeModifier\":0}]}}]}"

            headers = {
                'Authorization': "Bearer REPLACE_BEARER_TOKEN",
                'content-type': "application/json"
                }

            conn.request("POST", "/recommendations/v2/recommend/items/%7BitemId%7D/complementary", payload, headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "campaignId": "defaultCampaign",
              "campaignName": "string",
              "catalogId": "default",
              "clientUUID": "string",
              "contextItemIds": [
                "string"
              ],
              "includeContextItems": false,
              "filterRules": {
                "excludePurchasedItems": false,
                "excludePurchasedItemsSinceDays": 0,
                "elasticExcludePurchasedItems": false,
                "elasticExcludePurchasedItemsSinceDays": 0
              },
              "displayAttributes": "string",
              "abTestContext": {
                "experimentId": 0,
                "variantId": "string",
                "requestedCampaignId": "string"
              },
              "params": {
                "source": "mobile"
              },
              "inventoryContext": {
                "channelIds": [
                  "string"
                ]
              },
              "keepSlotsOrder": true,
              "personalizeSlotsOrder": false,
              "sortMetric": "string",
              "boostingParameters": {
                "metric": "string",
                "strength": 0.1,
                "personalizedBoostingStrength": 0
              },
              "boostingStrategies": [
                {
                  "name": "string",
                  "condition": "string",
                  "strength": 1
                }
              ],
              "crossWorkspaceMode": {
                "enabled": true
              },
              "slots": [
                {
                  "name": "string",
                  "minNumItems": 1,
                  "maxNumItems": 5,
                  "shuffleNumItems": 1,
                  "filters": "string",
                  "elasticFilters": "string",
                  "distinctFilter": {
                    "elastic": true,
                    "filters": [
                      {
                        "field": "string",
                        "maxNumItems": 0,
                        "levelRangeModifier": 0
                      }
                    ]
                  }
                }
              ]
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://api.synerise.com/recommendations/v2/recommend/items/%7BitemId%7D/complementary");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/recommendations/v2/recommend/items/%7BitemId%7D/complementary",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              campaignId: 'defaultCampaign',
              campaignName: 'string',
              catalogId: 'default',
              clientUUID: 'string',
              contextItemIds: ['string'],
              includeContextItems: false,
              filterRules: {
                excludePurchasedItems: false,
                excludePurchasedItemsSinceDays: 0,
                elasticExcludePurchasedItems: false,
                elasticExcludePurchasedItemsSinceDays: 0
              },
              displayAttributes: 'string',
              abTestContext: {experimentId: 0, variantId: 'string', requestedCampaignId: 'string'},
              params: {source: 'mobile'},
              inventoryContext: {channelIds: ['string']},
              keepSlotsOrder: true,
              personalizeSlotsOrder: false,
              sortMetric: 'string',
              boostingParameters: {metric: 'string', strength: 0.1, personalizedBoostingStrength: 0},
              boostingStrategies: [{name: 'string', condition: 'string', strength: 1}],
              crossWorkspaceMode: {enabled: true},
              slots: [
                {
                  name: 'string',
                  minNumItems: 1,
                  maxNumItems: 5,
                  shuffleNumItems: 1,
                  filters: 'string',
                  elasticFilters: 'string',
                  distinctFilter: {
                    elastic: true,
                    filters: [{field: 'string', maxNumItems: 0, levelRangeModifier: 0}]
                  }
                }
              ]
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/recommendations/v2/recommend/items/%7BitemId%7D/complementary');
            $request->setMethod(HTTP_METH_POST);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN',
              'content-type' => 'application/json'
            ]);

            $request->setBody('{"campaignId":"defaultCampaign","campaignName":"string","catalogId":"default","clientUUID":"string","contextItemIds":["string"],"includeContextItems":false,"filterRules":{"excludePurchasedItems":false,"excludePurchasedItemsSinceDays":0,"elasticExcludePurchasedItems":false,"elasticExcludePurchasedItemsSinceDays":0},"displayAttributes":"string","abTestContext":{"experimentId":0,"variantId":"string","requestedCampaignId":"string"},"params":{"source":"mobile"},"inventoryContext":{"channelIds":["string"]},"keepSlotsOrder":true,"personalizeSlotsOrder":false,"sortMetric":"string","boostingParameters":{"metric":"string","strength":0.1,"personalizedBoostingStrength":0},"boostingStrategies":[{"name":"string","condition":"string","strength":1}],"crossWorkspaceMode":{"enabled":true},"slots":[{"name":"string","minNumItems":1,"maxNumItems":5,"shuffleNumItems":1,"filters":"string","elasticFilters":"string","distinctFilter":{"elastic":true,"filters":[{"field":"string","maxNumItems":0,"levelRangeModifier":0}]}}]}');

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.post("https://api.synerise.com/recommendations/v2/recommend/items/%7BitemId%7D/complementary")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"campaignId\":\"defaultCampaign\",\"campaignName\":\"string\",\"catalogId\":\"default\",\"clientUUID\":\"string\",\"contextItemIds\":[\"string\"],\"includeContextItems\":false,\"filterRules\":{\"excludePurchasedItems\":false,\"excludePurchasedItemsSinceDays\":0,\"elasticExcludePurchasedItems\":false,\"elasticExcludePurchasedItemsSinceDays\":0},\"displayAttributes\":\"string\",\"abTestContext\":{\"experimentId\":0,\"variantId\":\"string\",\"requestedCampaignId\":\"string\"},\"params\":{\"source\":\"mobile\"},\"inventoryContext\":{\"channelIds\":[\"string\"]},\"keepSlotsOrder\":true,\"personalizeSlotsOrder\":false,\"sortMetric\":\"string\",\"boostingParameters\":{\"metric\":\"string\",\"strength\":0.1,\"personalizedBoostingStrength\":0},\"boostingStrategies\":[{\"name\":\"string\",\"condition\":\"string\",\"strength\":1}],\"crossWorkspaceMode\":{\"enabled\":true},\"slots\":[{\"name\":\"string\",\"minNumItems\":1,\"maxNumItems\":5,\"shuffleNumItems\":1,\"filters\":\"string\",\"elasticFilters\":\"string\",\"distinctFilter\":{\"elastic\":true,\"filters\":[{\"field\":\"string\",\"maxNumItems\":0,\"levelRangeModifier\":0}]}}]}")
              .asString();
  /recommendations/v2/recommend/items/{itemId}/similar:
    get:
      summary: Similar items
      description: |
        Returns items similar to a given item.

        **Note:** The definition of an *item* encompasses products, but also articles, images, videos, and any other entities in the item feed.

        ---

        **API consumers:** <span title="Deprecated">AI API key (legacy)</span>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>, <a href="/docs/settings/tool/tracking_codes" target="_blank" rel="noopener" title="Pass your tracker key in the request header">Web SDK Tracker</a>

        **API key permission required:** `RECOMMENDATIONS_V2_SIMILAR_RECOMMENDATIONS_READ`
      operationId: GetSimilarItems
      tags:
        - Recommendations
      security:
        - TrackerKey: []
        - JWT: []
      parameters:
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsMinNumItems"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsMaxNumItems"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsCampaignId"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsCampaignName"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsClientUUID"
        - $ref: "#/components/parameters/recommendations-rust-all-inPathItemId"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsExcludePurchasedItems"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsExcludePurchasedItemsSince"
        - $ref: "#/components/parameters/recommendations-rust-all-filterExpr"
        - $ref: "#/components/parameters/recommendations-rust-all-elasticFilterExpr"
        - $ref: "#/components/parameters/recommendations-rust-all-itemCatalogId"
        - $ref: "#/components/parameters/recommendations-rust-all-distinctFilter"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsIncludeContextItems"
        - $ref: "#/components/parameters/recommendations-rust-all-params"
        - $ref: "#/components/parameters/recommendations-rust-all-inventoryChannelId"
        - $ref: "#/components/parameters/recommendations-rust-all-crossWorkspaceMode"
      responses:
        "200":
          description: Items similar to the given item
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/recommendations-rust-all-RecommendationResponseSchemaV2"
        "404":
          $ref: "#/components/responses/recommendations-rust-all-404-no-recommendation"
        "500":
          $ref: "#/components/responses/recommendations-rust-all-500-error-occurred"
      x-snr-doc-urls:
        - /api-reference/ai-recommendations#tag/Recommendations/operation/GetSimilarItems
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.synerise.com/recommendations/v2/recommend/items/%7BitemId%7D/similar?minNumItems=SOME_INTEGER_VALUE&maxNumItems=SOME_INTEGER_VALUE&campaignId=SOME_STRING_VALUE&campaignName=SOME_STRING_VALUE&clientUUID=SOME_STRING_VALUE&excludePurchasedItems=SOME_BOOLEAN_VALUE&excludePurchasedItemsSinceDays=SOME_INTEGER_VALUE&filters=SOME_STRING_VALUE&elastic%3Afilters=SOME_STRING_VALUE&itemCatalogId=SOME_STRING_VALUE&distinctFilter=SOME_OBJECT_VALUE&includeContextItems=SOME_BOOLEAN_VALUE&params=source%3Amobile&inventoryChannelId=SOME_STRING_VALUE&crossWorkspaceMode=SOME_BOOLEAN_VALUE' \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            headers = { 'Authorization': "Bearer REPLACE_BEARER_TOKEN" }

            conn.request("GET", "/recommendations/v2/recommend/items/%7BitemId%7D/similar?minNumItems=SOME_INTEGER_VALUE&maxNumItems=SOME_INTEGER_VALUE&campaignId=SOME_STRING_VALUE&campaignName=SOME_STRING_VALUE&clientUUID=SOME_STRING_VALUE&excludePurchasedItems=SOME_BOOLEAN_VALUE&excludePurchasedItemsSinceDays=SOME_INTEGER_VALUE&filters=SOME_STRING_VALUE&elastic%3Afilters=SOME_STRING_VALUE&itemCatalogId=SOME_STRING_VALUE&distinctFilter=SOME_OBJECT_VALUE&includeContextItems=SOME_BOOLEAN_VALUE&params=source%3Amobile&inventoryChannelId=SOME_STRING_VALUE&crossWorkspaceMode=SOME_BOOLEAN_VALUE", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://api.synerise.com/recommendations/v2/recommend/items/%7BitemId%7D/similar?minNumItems=SOME_INTEGER_VALUE&maxNumItems=SOME_INTEGER_VALUE&campaignId=SOME_STRING_VALUE&campaignName=SOME_STRING_VALUE&clientUUID=SOME_STRING_VALUE&excludePurchasedItems=SOME_BOOLEAN_VALUE&excludePurchasedItemsSinceDays=SOME_INTEGER_VALUE&filters=SOME_STRING_VALUE&elastic%3Afilters=SOME_STRING_VALUE&itemCatalogId=SOME_STRING_VALUE&distinctFilter=SOME_OBJECT_VALUE&includeContextItems=SOME_BOOLEAN_VALUE&params=source%3Amobile&inventoryChannelId=SOME_STRING_VALUE&crossWorkspaceMode=SOME_BOOLEAN_VALUE");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/recommendations/v2/recommend/items/%7BitemId%7D/similar?minNumItems=SOME_INTEGER_VALUE&maxNumItems=SOME_INTEGER_VALUE&campaignId=SOME_STRING_VALUE&campaignName=SOME_STRING_VALUE&clientUUID=SOME_STRING_VALUE&excludePurchasedItems=SOME_BOOLEAN_VALUE&excludePurchasedItemsSinceDays=SOME_INTEGER_VALUE&filters=SOME_STRING_VALUE&elastic%3Afilters=SOME_STRING_VALUE&itemCatalogId=SOME_STRING_VALUE&distinctFilter=SOME_OBJECT_VALUE&includeContextItems=SOME_BOOLEAN_VALUE&params=source%3Amobile&inventoryChannelId=SOME_STRING_VALUE&crossWorkspaceMode=SOME_BOOLEAN_VALUE",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/recommendations/v2/recommend/items/%7BitemId%7D/similar');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'minNumItems' => 'SOME_INTEGER_VALUE',
              'maxNumItems' => 'SOME_INTEGER_VALUE',
              'campaignId' => 'SOME_STRING_VALUE',
              'campaignName' => 'SOME_STRING_VALUE',
              'clientUUID' => 'SOME_STRING_VALUE',
              'excludePurchasedItems' => 'SOME_BOOLEAN_VALUE',
              'excludePurchasedItemsSinceDays' => 'SOME_INTEGER_VALUE',
              'filters' => 'SOME_STRING_VALUE',
              'elastic:filters' => 'SOME_STRING_VALUE',
              'itemCatalogId' => 'SOME_STRING_VALUE',
              'distinctFilter' => 'SOME_OBJECT_VALUE',
              'includeContextItems' => 'SOME_BOOLEAN_VALUE',
              'params' => 'source:mobile',
              'inventoryChannelId' => 'SOME_STRING_VALUE',
              'crossWorkspaceMode' => 'SOME_BOOLEAN_VALUE'
            ]);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.get("https://api.synerise.com/recommendations/v2/recommend/items/%7BitemId%7D/similar?minNumItems=SOME_INTEGER_VALUE&maxNumItems=SOME_INTEGER_VALUE&campaignId=SOME_STRING_VALUE&campaignName=SOME_STRING_VALUE&clientUUID=SOME_STRING_VALUE&excludePurchasedItems=SOME_BOOLEAN_VALUE&excludePurchasedItemsSinceDays=SOME_INTEGER_VALUE&filters=SOME_STRING_VALUE&elastic%3Afilters=SOME_STRING_VALUE&itemCatalogId=SOME_STRING_VALUE&distinctFilter=SOME_OBJECT_VALUE&includeContextItems=SOME_BOOLEAN_VALUE&params=source%3Amobile&inventoryChannelId=SOME_STRING_VALUE&crossWorkspaceMode=SOME_BOOLEAN_VALUE")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
    post:
      summary: Similar items
      description: |
        Returns items similar to a given item.

        **Note:** The definition of an *item* encompasses products, but also articles, images, videos, and any other entities in the item feed.

        ---

        **API consumers:** <span title="Deprecated">AI API key (legacy)</span>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>, <a href="/docs/settings/tool/tracking_codes" target="_blank" rel="noopener" title="Pass your tracker key in the request header">Web SDK Tracker</a>

        **API key permission required:** `RECOMMENDATIONS_V2_SIMILAR_RECOMMENDATIONS_READ`
      operationId: PostSimilarItems
      tags:
        - Recommendations
      security:
        - JWT: []
      parameters:
        - $ref: "#/components/parameters/recommendations-rust-all-inPathItemId"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/recommendations-rust-all-SlotsBodySchemaV2"
        description: Definition of the requested recommendation
        required: true
      responses:
        "200":
          description: Items similar to the given item
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/recommendations-rust-all-SlotsRecommendationResponseSchemaV2"
        "404":
          $ref: "#/components/responses/recommendations-rust-all-404-no-recommendation"
        "500":
          $ref: "#/components/responses/recommendations-rust-all-500-error-occurred"
      x-snr-doc-urls:
        - /api-reference/ai-recommendations#tag/Recommendations/operation/PostSimilarItems
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/recommendations/v2/recommend/items/%7BitemId%7D/similar \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"campaignId":"defaultCampaign","campaignName":"string","catalogId":"default","clientUUID":"string","contextItemIds":["string"],"includeContextItems":false,"filterRules":{"excludePurchasedItems":false,"excludePurchasedItemsSinceDays":0,"elasticExcludePurchasedItems":false,"elasticExcludePurchasedItemsSinceDays":0},"displayAttributes":"string","abTestContext":{"experimentId":0,"variantId":"string","requestedCampaignId":"string"},"params":{"source":"mobile"},"inventoryContext":{"channelIds":["string"]},"keepSlotsOrder":true,"personalizeSlotsOrder":false,"sortMetric":"string","boostingParameters":{"metric":"string","strength":0.1,"personalizedBoostingStrength":0},"boostingStrategies":[{"name":"string","condition":"string","strength":1}],"crossWorkspaceMode":{"enabled":true},"slots":[{"name":"string","minNumItems":1,"maxNumItems":5,"shuffleNumItems":1,"filters":"string","elasticFilters":"string","distinctFilter":{"elastic":true,"filters":[{"field":"string","maxNumItems":0,"levelRangeModifier":0}]}}]}'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            payload = "{\"campaignId\":\"defaultCampaign\",\"campaignName\":\"string\",\"catalogId\":\"default\",\"clientUUID\":\"string\",\"contextItemIds\":[\"string\"],\"includeContextItems\":false,\"filterRules\":{\"excludePurchasedItems\":false,\"excludePurchasedItemsSinceDays\":0,\"elasticExcludePurchasedItems\":false,\"elasticExcludePurchasedItemsSinceDays\":0},\"displayAttributes\":\"string\",\"abTestContext\":{\"experimentId\":0,\"variantId\":\"string\",\"requestedCampaignId\":\"string\"},\"params\":{\"source\":\"mobile\"},\"inventoryContext\":{\"channelIds\":[\"string\"]},\"keepSlotsOrder\":true,\"personalizeSlotsOrder\":false,\"sortMetric\":\"string\",\"boostingParameters\":{\"metric\":\"string\",\"strength\":0.1,\"personalizedBoostingStrength\":0},\"boostingStrategies\":[{\"name\":\"string\",\"condition\":\"string\",\"strength\":1}],\"crossWorkspaceMode\":{\"enabled\":true},\"slots\":[{\"name\":\"string\",\"minNumItems\":1,\"maxNumItems\":5,\"shuffleNumItems\":1,\"filters\":\"string\",\"elasticFilters\":\"string\",\"distinctFilter\":{\"elastic\":true,\"filters\":[{\"field\":\"string\",\"maxNumItems\":0,\"levelRangeModifier\":0}]}}]}"

            headers = {
                'Authorization': "Bearer REPLACE_BEARER_TOKEN",
                'content-type': "application/json"
                }

            conn.request("POST", "/recommendations/v2/recommend/items/%7BitemId%7D/similar", payload, headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "campaignId": "defaultCampaign",
              "campaignName": "string",
              "catalogId": "default",
              "clientUUID": "string",
              "contextItemIds": [
                "string"
              ],
              "includeContextItems": false,
              "filterRules": {
                "excludePurchasedItems": false,
                "excludePurchasedItemsSinceDays": 0,
                "elasticExcludePurchasedItems": false,
                "elasticExcludePurchasedItemsSinceDays": 0
              },
              "displayAttributes": "string",
              "abTestContext": {
                "experimentId": 0,
                "variantId": "string",
                "requestedCampaignId": "string"
              },
              "params": {
                "source": "mobile"
              },
              "inventoryContext": {
                "channelIds": [
                  "string"
                ]
              },
              "keepSlotsOrder": true,
              "personalizeSlotsOrder": false,
              "sortMetric": "string",
              "boostingParameters": {
                "metric": "string",
                "strength": 0.1,
                "personalizedBoostingStrength": 0
              },
              "boostingStrategies": [
                {
                  "name": "string",
                  "condition": "string",
                  "strength": 1
                }
              ],
              "crossWorkspaceMode": {
                "enabled": true
              },
              "slots": [
                {
                  "name": "string",
                  "minNumItems": 1,
                  "maxNumItems": 5,
                  "shuffleNumItems": 1,
                  "filters": "string",
                  "elasticFilters": "string",
                  "distinctFilter": {
                    "elastic": true,
                    "filters": [
                      {
                        "field": "string",
                        "maxNumItems": 0,
                        "levelRangeModifier": 0
                      }
                    ]
                  }
                }
              ]
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://api.synerise.com/recommendations/v2/recommend/items/%7BitemId%7D/similar");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/recommendations/v2/recommend/items/%7BitemId%7D/similar",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              campaignId: 'defaultCampaign',
              campaignName: 'string',
              catalogId: 'default',
              clientUUID: 'string',
              contextItemIds: ['string'],
              includeContextItems: false,
              filterRules: {
                excludePurchasedItems: false,
                excludePurchasedItemsSinceDays: 0,
                elasticExcludePurchasedItems: false,
                elasticExcludePurchasedItemsSinceDays: 0
              },
              displayAttributes: 'string',
              abTestContext: {experimentId: 0, variantId: 'string', requestedCampaignId: 'string'},
              params: {source: 'mobile'},
              inventoryContext: {channelIds: ['string']},
              keepSlotsOrder: true,
              personalizeSlotsOrder: false,
              sortMetric: 'string',
              boostingParameters: {metric: 'string', strength: 0.1, personalizedBoostingStrength: 0},
              boostingStrategies: [{name: 'string', condition: 'string', strength: 1}],
              crossWorkspaceMode: {enabled: true},
              slots: [
                {
                  name: 'string',
                  minNumItems: 1,
                  maxNumItems: 5,
                  shuffleNumItems: 1,
                  filters: 'string',
                  elasticFilters: 'string',
                  distinctFilter: {
                    elastic: true,
                    filters: [{field: 'string', maxNumItems: 0, levelRangeModifier: 0}]
                  }
                }
              ]
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/recommendations/v2/recommend/items/%7BitemId%7D/similar');
            $request->setMethod(HTTP_METH_POST);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN',
              'content-type' => 'application/json'
            ]);

            $request->setBody('{"campaignId":"defaultCampaign","campaignName":"string","catalogId":"default","clientUUID":"string","contextItemIds":["string"],"includeContextItems":false,"filterRules":{"excludePurchasedItems":false,"excludePurchasedItemsSinceDays":0,"elasticExcludePurchasedItems":false,"elasticExcludePurchasedItemsSinceDays":0},"displayAttributes":"string","abTestContext":{"experimentId":0,"variantId":"string","requestedCampaignId":"string"},"params":{"source":"mobile"},"inventoryContext":{"channelIds":["string"]},"keepSlotsOrder":true,"personalizeSlotsOrder":false,"sortMetric":"string","boostingParameters":{"metric":"string","strength":0.1,"personalizedBoostingStrength":0},"boostingStrategies":[{"name":"string","condition":"string","strength":1}],"crossWorkspaceMode":{"enabled":true},"slots":[{"name":"string","minNumItems":1,"maxNumItems":5,"shuffleNumItems":1,"filters":"string","elasticFilters":"string","distinctFilter":{"elastic":true,"filters":[{"field":"string","maxNumItems":0,"levelRangeModifier":0}]}}]}');

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.post("https://api.synerise.com/recommendations/v2/recommend/items/%7BitemId%7D/similar")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"campaignId\":\"defaultCampaign\",\"campaignName\":\"string\",\"catalogId\":\"default\",\"clientUUID\":\"string\",\"contextItemIds\":[\"string\"],\"includeContextItems\":false,\"filterRules\":{\"excludePurchasedItems\":false,\"excludePurchasedItemsSinceDays\":0,\"elasticExcludePurchasedItems\":false,\"elasticExcludePurchasedItemsSinceDays\":0},\"displayAttributes\":\"string\",\"abTestContext\":{\"experimentId\":0,\"variantId\":\"string\",\"requestedCampaignId\":\"string\"},\"params\":{\"source\":\"mobile\"},\"inventoryContext\":{\"channelIds\":[\"string\"]},\"keepSlotsOrder\":true,\"personalizeSlotsOrder\":false,\"sortMetric\":\"string\",\"boostingParameters\":{\"metric\":\"string\",\"strength\":0.1,\"personalizedBoostingStrength\":0},\"boostingStrategies\":[{\"name\":\"string\",\"condition\":\"string\",\"strength\":1}],\"crossWorkspaceMode\":{\"enabled\":true},\"slots\":[{\"name\":\"string\",\"minNumItems\":1,\"maxNumItems\":5,\"shuffleNumItems\":1,\"filters\":\"string\",\"elasticFilters\":\"string\",\"distinctFilter\":{\"elastic\":true,\"filters\":[{\"field\":\"string\",\"maxNumItems\":0,\"levelRangeModifier\":0}]}}]}")
              .asString();
  /recommendations/v2/recommend/items/{itemId}/similar/visual:
    get:
      summary: Visually similar
      description: |
        Returns items visually similar to the given items.

        **Note:** The definition of an *item* encompasses products, but also articles, images, videos, and any other entities in the item feed.

        ---

        **API consumers:** <span title="Deprecated">AI API key (legacy)</span>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>, <a href="/docs/settings/tool/tracking_codes" target="_blank" rel="noopener" title="Pass your tracker key in the request header">Web SDK Tracker</a>

        **API key permission required:** `RECOMMENDATIONS_V2_VISUAL_RECOMMENDATIONS_READ`
      operationId: GetSimilarVisualItems
      tags:
        - Recommendations
      security:
        - TrackerKey: []
        - JWT: []
      parameters:
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsMinNumItems"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsMaxNumItems"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsClientUUID"
        - $ref: "#/components/parameters/recommendations-rust-all-inPathItemId"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsExcludePurchasedItems"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsExcludePurchasedItemsSince"
        - $ref: "#/components/parameters/recommendations-rust-all-filterExpr"
        - $ref: "#/components/parameters/recommendations-rust-all-elasticFilterExpr"
        - $ref: "#/components/parameters/recommendations-rust-all-itemCatalogId"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsCampaignId"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsCampaignName"
        - $ref: "#/components/parameters/recommendations-rust-all-distinctFilter"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsIncludeContextItems"
        - $ref: "#/components/parameters/recommendations-rust-all-params"
        - $ref: "#/components/parameters/recommendations-rust-all-inventoryChannelId"
        - $ref: "#/components/parameters/recommendations-rust-all-crossWorkspaceMode"
      responses:
        "200":
          description: Items visually similar to the given item
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/recommendations-rust-all-RecommendationResponseSchemaV2"
        "404":
          $ref: "#/components/responses/recommendations-rust-all-404-no-recommendation"
        "500":
          $ref: "#/components/responses/recommendations-rust-all-500-error-occurred"
      x-snr-doc-urls:
        - /api-reference/ai-recommendations#tag/Recommendations/operation/GetSimilarVisualItems
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.synerise.com/recommendations/v2/recommend/items/%7BitemId%7D/similar/visual?minNumItems=SOME_INTEGER_VALUE&maxNumItems=SOME_INTEGER_VALUE&clientUUID=SOME_STRING_VALUE&excludePurchasedItems=SOME_BOOLEAN_VALUE&excludePurchasedItemsSinceDays=SOME_INTEGER_VALUE&filters=SOME_STRING_VALUE&elastic%3Afilters=SOME_STRING_VALUE&itemCatalogId=SOME_STRING_VALUE&campaignId=SOME_STRING_VALUE&campaignName=SOME_STRING_VALUE&distinctFilter=SOME_OBJECT_VALUE&includeContextItems=SOME_BOOLEAN_VALUE&params=source%3Amobile&inventoryChannelId=SOME_STRING_VALUE&crossWorkspaceMode=SOME_BOOLEAN_VALUE' \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            headers = { 'Authorization': "Bearer REPLACE_BEARER_TOKEN" }

            conn.request("GET", "/recommendations/v2/recommend/items/%7BitemId%7D/similar/visual?minNumItems=SOME_INTEGER_VALUE&maxNumItems=SOME_INTEGER_VALUE&clientUUID=SOME_STRING_VALUE&excludePurchasedItems=SOME_BOOLEAN_VALUE&excludePurchasedItemsSinceDays=SOME_INTEGER_VALUE&filters=SOME_STRING_VALUE&elastic%3Afilters=SOME_STRING_VALUE&itemCatalogId=SOME_STRING_VALUE&campaignId=SOME_STRING_VALUE&campaignName=SOME_STRING_VALUE&distinctFilter=SOME_OBJECT_VALUE&includeContextItems=SOME_BOOLEAN_VALUE&params=source%3Amobile&inventoryChannelId=SOME_STRING_VALUE&crossWorkspaceMode=SOME_BOOLEAN_VALUE", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://api.synerise.com/recommendations/v2/recommend/items/%7BitemId%7D/similar/visual?minNumItems=SOME_INTEGER_VALUE&maxNumItems=SOME_INTEGER_VALUE&clientUUID=SOME_STRING_VALUE&excludePurchasedItems=SOME_BOOLEAN_VALUE&excludePurchasedItemsSinceDays=SOME_INTEGER_VALUE&filters=SOME_STRING_VALUE&elastic%3Afilters=SOME_STRING_VALUE&itemCatalogId=SOME_STRING_VALUE&campaignId=SOME_STRING_VALUE&campaignName=SOME_STRING_VALUE&distinctFilter=SOME_OBJECT_VALUE&includeContextItems=SOME_BOOLEAN_VALUE&params=source%3Amobile&inventoryChannelId=SOME_STRING_VALUE&crossWorkspaceMode=SOME_BOOLEAN_VALUE");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/recommendations/v2/recommend/items/%7BitemId%7D/similar/visual?minNumItems=SOME_INTEGER_VALUE&maxNumItems=SOME_INTEGER_VALUE&clientUUID=SOME_STRING_VALUE&excludePurchasedItems=SOME_BOOLEAN_VALUE&excludePurchasedItemsSinceDays=SOME_INTEGER_VALUE&filters=SOME_STRING_VALUE&elastic%3Afilters=SOME_STRING_VALUE&itemCatalogId=SOME_STRING_VALUE&campaignId=SOME_STRING_VALUE&campaignName=SOME_STRING_VALUE&distinctFilter=SOME_OBJECT_VALUE&includeContextItems=SOME_BOOLEAN_VALUE&params=source%3Amobile&inventoryChannelId=SOME_STRING_VALUE&crossWorkspaceMode=SOME_BOOLEAN_VALUE",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/recommendations/v2/recommend/items/%7BitemId%7D/similar/visual');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'minNumItems' => 'SOME_INTEGER_VALUE',
              'maxNumItems' => 'SOME_INTEGER_VALUE',
              'clientUUID' => 'SOME_STRING_VALUE',
              'excludePurchasedItems' => 'SOME_BOOLEAN_VALUE',
              'excludePurchasedItemsSinceDays' => 'SOME_INTEGER_VALUE',
              'filters' => 'SOME_STRING_VALUE',
              'elastic:filters' => 'SOME_STRING_VALUE',
              'itemCatalogId' => 'SOME_STRING_VALUE',
              'campaignId' => 'SOME_STRING_VALUE',
              'campaignName' => 'SOME_STRING_VALUE',
              'distinctFilter' => 'SOME_OBJECT_VALUE',
              'includeContextItems' => 'SOME_BOOLEAN_VALUE',
              'params' => 'source:mobile',
              'inventoryChannelId' => 'SOME_STRING_VALUE',
              'crossWorkspaceMode' => 'SOME_BOOLEAN_VALUE'
            ]);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.get("https://api.synerise.com/recommendations/v2/recommend/items/%7BitemId%7D/similar/visual?minNumItems=SOME_INTEGER_VALUE&maxNumItems=SOME_INTEGER_VALUE&clientUUID=SOME_STRING_VALUE&excludePurchasedItems=SOME_BOOLEAN_VALUE&excludePurchasedItemsSinceDays=SOME_INTEGER_VALUE&filters=SOME_STRING_VALUE&elastic%3Afilters=SOME_STRING_VALUE&itemCatalogId=SOME_STRING_VALUE&campaignId=SOME_STRING_VALUE&campaignName=SOME_STRING_VALUE&distinctFilter=SOME_OBJECT_VALUE&includeContextItems=SOME_BOOLEAN_VALUE&params=source%3Amobile&inventoryChannelId=SOME_STRING_VALUE&crossWorkspaceMode=SOME_BOOLEAN_VALUE")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
    post:
      summary: Visually similar
      description: |
        Returns items visually similar to the given items.

        **Note:** The definition of an *item* encompasses products, but also articles, images, videos, and any other entities in the item feed.

        ---

        **API consumers:** <span title="Deprecated">AI API key (legacy)</span>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>, <a href="/docs/settings/tool/tracking_codes" target="_blank" rel="noopener" title="Pass your tracker key in the request header">Web SDK Tracker</a>

        **API key permission required:** `RECOMMENDATIONS_V2_VISUAL_RECOMMENDATIONS_READ`
      operationId: PostSimilarVisualItems
      tags:
        - Recommendations
      security:
        - TrackerKey: []
        - JWT: []
      parameters:
        - $ref: "#/components/parameters/recommendations-rust-all-inPathItemId"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/recommendations-rust-all-SlotsBodySchemaV2"
        description: Definition of the requested recommendation
        required: true
      responses:
        "200":
          description: Items visually similar to the given item
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/recommendations-rust-all-SlotsRecommendationResponseSchemaV2"
        "404":
          $ref: "#/components/responses/recommendations-rust-all-404-no-recommendation"
        "500":
          $ref: "#/components/responses/recommendations-rust-all-500-error-occurred"
      x-snr-doc-urls:
        - /api-reference/ai-recommendations#tag/Recommendations/operation/PostSimilarVisualItems
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/recommendations/v2/recommend/items/%7BitemId%7D/similar/visual \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"campaignId":"defaultCampaign","campaignName":"string","catalogId":"default","clientUUID":"string","contextItemIds":["string"],"includeContextItems":false,"filterRules":{"excludePurchasedItems":false,"excludePurchasedItemsSinceDays":0,"elasticExcludePurchasedItems":false,"elasticExcludePurchasedItemsSinceDays":0},"displayAttributes":"string","abTestContext":{"experimentId":0,"variantId":"string","requestedCampaignId":"string"},"params":{"source":"mobile"},"inventoryContext":{"channelIds":["string"]},"keepSlotsOrder":true,"personalizeSlotsOrder":false,"sortMetric":"string","boostingParameters":{"metric":"string","strength":0.1,"personalizedBoostingStrength":0},"boostingStrategies":[{"name":"string","condition":"string","strength":1}],"crossWorkspaceMode":{"enabled":true},"slots":[{"name":"string","minNumItems":1,"maxNumItems":5,"shuffleNumItems":1,"filters":"string","elasticFilters":"string","distinctFilter":{"elastic":true,"filters":[{"field":"string","maxNumItems":0,"levelRangeModifier":0}]}}]}'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            payload = "{\"campaignId\":\"defaultCampaign\",\"campaignName\":\"string\",\"catalogId\":\"default\",\"clientUUID\":\"string\",\"contextItemIds\":[\"string\"],\"includeContextItems\":false,\"filterRules\":{\"excludePurchasedItems\":false,\"excludePurchasedItemsSinceDays\":0,\"elasticExcludePurchasedItems\":false,\"elasticExcludePurchasedItemsSinceDays\":0},\"displayAttributes\":\"string\",\"abTestContext\":{\"experimentId\":0,\"variantId\":\"string\",\"requestedCampaignId\":\"string\"},\"params\":{\"source\":\"mobile\"},\"inventoryContext\":{\"channelIds\":[\"string\"]},\"keepSlotsOrder\":true,\"personalizeSlotsOrder\":false,\"sortMetric\":\"string\",\"boostingParameters\":{\"metric\":\"string\",\"strength\":0.1,\"personalizedBoostingStrength\":0},\"boostingStrategies\":[{\"name\":\"string\",\"condition\":\"string\",\"strength\":1}],\"crossWorkspaceMode\":{\"enabled\":true},\"slots\":[{\"name\":\"string\",\"minNumItems\":1,\"maxNumItems\":5,\"shuffleNumItems\":1,\"filters\":\"string\",\"elasticFilters\":\"string\",\"distinctFilter\":{\"elastic\":true,\"filters\":[{\"field\":\"string\",\"maxNumItems\":0,\"levelRangeModifier\":0}]}}]}"

            headers = {
                'Authorization': "Bearer REPLACE_BEARER_TOKEN",
                'content-type': "application/json"
                }

            conn.request("POST", "/recommendations/v2/recommend/items/%7BitemId%7D/similar/visual", payload, headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "campaignId": "defaultCampaign",
              "campaignName": "string",
              "catalogId": "default",
              "clientUUID": "string",
              "contextItemIds": [
                "string"
              ],
              "includeContextItems": false,
              "filterRules": {
                "excludePurchasedItems": false,
                "excludePurchasedItemsSinceDays": 0,
                "elasticExcludePurchasedItems": false,
                "elasticExcludePurchasedItemsSinceDays": 0
              },
              "displayAttributes": "string",
              "abTestContext": {
                "experimentId": 0,
                "variantId": "string",
                "requestedCampaignId": "string"
              },
              "params": {
                "source": "mobile"
              },
              "inventoryContext": {
                "channelIds": [
                  "string"
                ]
              },
              "keepSlotsOrder": true,
              "personalizeSlotsOrder": false,
              "sortMetric": "string",
              "boostingParameters": {
                "metric": "string",
                "strength": 0.1,
                "personalizedBoostingStrength": 0
              },
              "boostingStrategies": [
                {
                  "name": "string",
                  "condition": "string",
                  "strength": 1
                }
              ],
              "crossWorkspaceMode": {
                "enabled": true
              },
              "slots": [
                {
                  "name": "string",
                  "minNumItems": 1,
                  "maxNumItems": 5,
                  "shuffleNumItems": 1,
                  "filters": "string",
                  "elasticFilters": "string",
                  "distinctFilter": {
                    "elastic": true,
                    "filters": [
                      {
                        "field": "string",
                        "maxNumItems": 0,
                        "levelRangeModifier": 0
                      }
                    ]
                  }
                }
              ]
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://api.synerise.com/recommendations/v2/recommend/items/%7BitemId%7D/similar/visual");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/recommendations/v2/recommend/items/%7BitemId%7D/similar/visual",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              campaignId: 'defaultCampaign',
              campaignName: 'string',
              catalogId: 'default',
              clientUUID: 'string',
              contextItemIds: ['string'],
              includeContextItems: false,
              filterRules: {
                excludePurchasedItems: false,
                excludePurchasedItemsSinceDays: 0,
                elasticExcludePurchasedItems: false,
                elasticExcludePurchasedItemsSinceDays: 0
              },
              displayAttributes: 'string',
              abTestContext: {experimentId: 0, variantId: 'string', requestedCampaignId: 'string'},
              params: {source: 'mobile'},
              inventoryContext: {channelIds: ['string']},
              keepSlotsOrder: true,
              personalizeSlotsOrder: false,
              sortMetric: 'string',
              boostingParameters: {metric: 'string', strength: 0.1, personalizedBoostingStrength: 0},
              boostingStrategies: [{name: 'string', condition: 'string', strength: 1}],
              crossWorkspaceMode: {enabled: true},
              slots: [
                {
                  name: 'string',
                  minNumItems: 1,
                  maxNumItems: 5,
                  shuffleNumItems: 1,
                  filters: 'string',
                  elasticFilters: 'string',
                  distinctFilter: {
                    elastic: true,
                    filters: [{field: 'string', maxNumItems: 0, levelRangeModifier: 0}]
                  }
                }
              ]
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/recommendations/v2/recommend/items/%7BitemId%7D/similar/visual');
            $request->setMethod(HTTP_METH_POST);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN',
              'content-type' => 'application/json'
            ]);

            $request->setBody('{"campaignId":"defaultCampaign","campaignName":"string","catalogId":"default","clientUUID":"string","contextItemIds":["string"],"includeContextItems":false,"filterRules":{"excludePurchasedItems":false,"excludePurchasedItemsSinceDays":0,"elasticExcludePurchasedItems":false,"elasticExcludePurchasedItemsSinceDays":0},"displayAttributes":"string","abTestContext":{"experimentId":0,"variantId":"string","requestedCampaignId":"string"},"params":{"source":"mobile"},"inventoryContext":{"channelIds":["string"]},"keepSlotsOrder":true,"personalizeSlotsOrder":false,"sortMetric":"string","boostingParameters":{"metric":"string","strength":0.1,"personalizedBoostingStrength":0},"boostingStrategies":[{"name":"string","condition":"string","strength":1}],"crossWorkspaceMode":{"enabled":true},"slots":[{"name":"string","minNumItems":1,"maxNumItems":5,"shuffleNumItems":1,"filters":"string","elasticFilters":"string","distinctFilter":{"elastic":true,"filters":[{"field":"string","maxNumItems":0,"levelRangeModifier":0}]}}]}');

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.post("https://api.synerise.com/recommendations/v2/recommend/items/%7BitemId%7D/similar/visual")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"campaignId\":\"defaultCampaign\",\"campaignName\":\"string\",\"catalogId\":\"default\",\"clientUUID\":\"string\",\"contextItemIds\":[\"string\"],\"includeContextItems\":false,\"filterRules\":{\"excludePurchasedItems\":false,\"excludePurchasedItemsSinceDays\":0,\"elasticExcludePurchasedItems\":false,\"elasticExcludePurchasedItemsSinceDays\":0},\"displayAttributes\":\"string\",\"abTestContext\":{\"experimentId\":0,\"variantId\":\"string\",\"requestedCampaignId\":\"string\"},\"params\":{\"source\":\"mobile\"},\"inventoryContext\":{\"channelIds\":[\"string\"]},\"keepSlotsOrder\":true,\"personalizeSlotsOrder\":false,\"sortMetric\":\"string\",\"boostingParameters\":{\"metric\":\"string\",\"strength\":0.1,\"personalizedBoostingStrength\":0},\"boostingStrategies\":[{\"name\":\"string\",\"condition\":\"string\",\"strength\":1}],\"crossWorkspaceMode\":{\"enabled\":true},\"slots\":[{\"name\":\"string\",\"minNumItems\":1,\"maxNumItems\":5,\"shuffleNumItems\":1,\"filters\":\"string\",\"elasticFilters\":\"string\",\"distinctFilter\":{\"elastic\":true,\"filters\":[{\"field\":\"string\",\"maxNumItems\":0,\"levelRangeModifier\":0}]}}]}")
              .asString();
  /recommendations/v2/recommend/items/next-interaction:
    get:
      summary: Next interaction
      description: |
        The "next interaction" model recommends items that are most likely to produce a `page.visit` or `product.buy` event.

        **Note:** The definition of an *item* encompasses products, but also articles, images, videos, and any other entities in the item feed.


        ---

        **API consumers:** <span title="Deprecated">AI API key (legacy)</span>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>, <a href="/docs/settings/tool/tracking_codes" target="_blank" rel="noopener" title="Pass your tracker key in the request header">Web SDK Tracker</a>

        **API key permission required:** `RECOMMENDATIONS_V2_NEXT_INTERACTION_RECOMMENDATIONS_READ`
      operationId: NextInteractionRecommendation
      tags:
        - Recommendations
      security:
        - TrackerKey: []
        - JWT: []
      parameters:
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsClientUUID"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsMinNumItems"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsMaxNumItems"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsCampaignId"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsCampaignName"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsExcludePurchasedItems"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsExcludePurchasedItemsSince"
        - $ref: "#/components/parameters/recommendations-rust-all-filterExpr"
        - $ref: "#/components/parameters/recommendations-rust-all-elasticFilterExpr"
        - $ref: "#/components/parameters/recommendations-rust-all-inParamsItemIdList"
        - $ref: "#/components/parameters/recommendations-rust-all-itemCatalogId"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsBoostMetric"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsSortMetric"
        - $ref: "#/components/parameters/recommendations-rust-all-distinctFilter"
        - $ref: "#/components/parameters/recommendations-rust-all-recommendationsIncludeContextItems"
        - $ref: "#/components/parameters/recommendations-rust-all-params"
      responses:
        "200":
          description: Next interaction recommendation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/recommendations-rust-all-RecommendationResponseSchemaV2"
        "404":
          $ref: "#/components/responses/recommendations-rust-all-404-no-recommendation"
        "500":
          $ref: "#/components/responses/recommendations-rust-all-500-error-occurred"
      x-snr-doc-urls:
        - /api-reference/ai-recommendations#tag/Recommendations/operation/NextInteractionRecommendation
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.synerise.com/recommendations/v2/recommend/items/next-interaction?clientUUID=SOME_STRING_VALUE&minNumItems=SOME_INTEGER_VALUE&maxNumItems=SOME_INTEGER_VALUE&campaignId=SOME_STRING_VALUE&campaignName=SOME_STRING_VALUE&excludePurchasedItems=SOME_BOOLEAN_VALUE&excludePurchasedItemsSinceDays=SOME_INTEGER_VALUE&filters=SOME_STRING_VALUE&elastic%3Afilters=SOME_STRING_VALUE&itemId=SOME_ARRAY_VALUE&itemCatalogId=SOME_STRING_VALUE&boostMetric=SOME_STRING_VALUE&sortMetric=SOME_STRING_VALUE&distinctFilter=SOME_OBJECT_VALUE&includeContextItems=SOME_BOOLEAN_VALUE&params=source%3Amobile' \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            headers = { 'Authorization': "Bearer REPLACE_BEARER_TOKEN" }

            conn.request("GET", "/recommendations/v2/recommend/items/next-interaction?clientUUID=SOME_STRING_VALUE&minNumItems=SOME_INTEGER_VALUE&maxNumItems=SOME_INTEGER_VALUE&campaignId=SOME_STRING_VALUE&campaignName=SOME_STRING_VALUE&excludePurchasedItems=SOME_BOOLEAN_VALUE&excludePurchasedItemsSinceDays=SOME_INTEGER_VALUE&filters=SOME_STRING_VALUE&elastic%3Afilters=SOME_STRING_VALUE&itemId=SOME_ARRAY_VALUE&itemCatalogId=SOME_STRING_VALUE&boostMetric=SOME_STRING_VALUE&sortMetric=SOME_STRING_VALUE&distinctFilter=SOME_OBJECT_VALUE&includeContextItems=SOME_BOOLEAN_VALUE&params=source%3Amobile", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://api.synerise.com/recommendations/v2/recommend/items/next-interaction?clientUUID=SOME_STRING_VALUE&minNumItems=SOME_INTEGER_VALUE&maxNumItems=SOME_INTEGER_VALUE&campaignId=SOME_STRING_VALUE&campaignName=SOME_STRING_VALUE&excludePurchasedItems=SOME_BOOLEAN_VALUE&excludePurchasedItemsSinceDays=SOME_INTEGER_VALUE&filters=SOME_STRING_VALUE&elastic%3Afilters=SOME_STRING_VALUE&itemId=SOME_ARRAY_VALUE&itemCatalogId=SOME_STRING_VALUE&boostMetric=SOME_STRING_VALUE&sortMetric=SOME_STRING_VALUE&distinctFilter=SOME_OBJECT_VALUE&includeContextItems=SOME_BOOLEAN_VALUE&params=source%3Amobile");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/recommendations/v2/recommend/items/next-interaction?clientUUID=SOME_STRING_VALUE&minNumItems=SOME_INTEGER_VALUE&maxNumItems=SOME_INTEGER_VALUE&campaignId=SOME_STRING_VALUE&campaignName=SOME_STRING_VALUE&excludePurchasedItems=SOME_BOOLEAN_VALUE&excludePurchasedItemsSinceDays=SOME_INTEGER_VALUE&filters=SOME_STRING_VALUE&elastic%3Afilters=SOME_STRING_VALUE&itemId=SOME_ARRAY_VALUE&itemCatalogId=SOME_STRING_VALUE&boostMetric=SOME_STRING_VALUE&sortMetric=SOME_STRING_VALUE&distinctFilter=SOME_OBJECT_VALUE&includeContextItems=SOME_BOOLEAN_VALUE&params=source%3Amobile",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/recommendations/v2/recommend/items/next-interaction');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'clientUUID' => 'SOME_STRING_VALUE',
              'minNumItems' => 'SOME_INTEGER_VALUE',
              'maxNumItems' => 'SOME_INTEGER_VALUE',
              'campaignId' => 'SOME_STRING_VALUE',
              'campaignName' => 'SOME_STRING_VALUE',
              'excludePurchasedItems' => 'SOME_BOOLEAN_VALUE',
              'excludePurchasedItemsSinceDays' => 'SOME_INTEGER_VALUE',
              'filters' => 'SOME_STRING_VALUE',
              'elastic:filters' => 'SOME_STRING_VALUE',
              'itemId' => 'SOME_ARRAY_VALUE',
              'itemCatalogId' => 'SOME_STRING_VALUE',
              'boostMetric' => 'SOME_STRING_VALUE',
              'sortMetric' => 'SOME_STRING_VALUE',
              'distinctFilter' => 'SOME_OBJECT_VALUE',
              'includeContextItems' => 'SOME_BOOLEAN_VALUE',
              'params' => 'source:mobile'
            ]);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.get("https://api.synerise.com/recommendations/v2/recommend/items/next-interaction?clientUUID=SOME_STRING_VALUE&minNumItems=SOME_INTEGER_VALUE&maxNumItems=SOME_INTEGER_VALUE&campaignId=SOME_STRING_VALUE&campaignName=SOME_STRING_VALUE&excludePurchasedItems=SOME_BOOLEAN_VALUE&excludePurchasedItemsSinceDays=SOME_INTEGER_VALUE&filters=SOME_STRING_VALUE&elastic%3Afilters=SOME_STRING_VALUE&itemId=SOME_ARRAY_VALUE&itemCatalogId=SOME_STRING_VALUE&boostMetric=SOME_STRING_VALUE&sortMetric=SOME_STRING_VALUE&distinctFilter=SOME_OBJECT_VALUE&includeContextItems=SOME_BOOLEAN_VALUE&params=source%3Amobile")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
    post:
      summary: Next interaction
      description: |
        The "next interaction" model recommends items that are most likely to produce a `page.visit` or `product.buy` event.

        **Note:** The definition of an *item* encompasses products, but also articles, images, videos, and any other entities in the item feed.


        ---

        **API consumers:** <span title="Deprecated">AI API key (legacy)</span>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>, <a href="/docs/settings/tool/tracking_codes" target="_blank" rel="noopener" title="Pass your tracker key in the request header">Web SDK Tracker</a>

        **API key permission required:** `RECOMMENDATIONS_V2_NEXT_INTERACTION_RECOMMENDATIONS_READ`
      operationId: PostNextInteractionRecommendation
      tags:
        - Recommendations
      security:
        - JWT: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/recommendations-rust-all-SlotsBodySchemaV2"
        description: Definition of the requested recommendation
        required: true
      responses:
        "200":
          description: Next interaction recommendations
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/recommendations-rust-all-SlotsRecommendationResponseSchemaV2"
        "404":
          $ref: "#/components/responses/recommendations-rust-all-404-no-recommendation"
        "500":
          $ref: "#/components/responses/recommendations-rust-all-500-error-occurred"
      x-snr-doc-urls:
        - /api-reference/ai-recommendations#tag/Recommendations/operation/PostNextInteractionRecommendation
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/recommendations/v2/recommend/items/next-interaction \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"campaignId":"defaultCampaign","campaignName":"string","catalogId":"default","clientUUID":"string","contextItemIds":["string"],"includeContextItems":false,"filterRules":{"excludePurchasedItems":false,"excludePurchasedItemsSinceDays":0,"elasticExcludePurchasedItems":false,"elasticExcludePurchasedItemsSinceDays":0},"displayAttributes":"string","abTestContext":{"experimentId":0,"variantId":"string","requestedCampaignId":"string"},"params":{"source":"mobile"},"inventoryContext":{"channelIds":["string"]},"keepSlotsOrder":true,"personalizeSlotsOrder":false,"sortMetric":"string","boostingParameters":{"metric":"string","strength":0.1,"personalizedBoostingStrength":0},"boostingStrategies":[{"name":"string","condition":"string","strength":1}],"crossWorkspaceMode":{"enabled":true},"slots":[{"name":"string","minNumItems":1,"maxNumItems":5,"shuffleNumItems":1,"filters":"string","elasticFilters":"string","distinctFilter":{"elastic":true,"filters":[{"field":"string","maxNumItems":0,"levelRangeModifier":0}]}}]}'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            payload = "{\"campaignId\":\"defaultCampaign\",\"campaignName\":\"string\",\"catalogId\":\"default\",\"clientUUID\":\"string\",\"contextItemIds\":[\"string\"],\"includeContextItems\":false,\"filterRules\":{\"excludePurchasedItems\":false,\"excludePurchasedItemsSinceDays\":0,\"elasticExcludePurchasedItems\":false,\"elasticExcludePurchasedItemsSinceDays\":0},\"displayAttributes\":\"string\",\"abTestContext\":{\"experimentId\":0,\"variantId\":\"string\",\"requestedCampaignId\":\"string\"},\"params\":{\"source\":\"mobile\"},\"inventoryContext\":{\"channelIds\":[\"string\"]},\"keepSlotsOrder\":true,\"personalizeSlotsOrder\":false,\"sortMetric\":\"string\",\"boostingParameters\":{\"metric\":\"string\",\"strength\":0.1,\"personalizedBoostingStrength\":0},\"boostingStrategies\":[{\"name\":\"string\",\"condition\":\"string\",\"strength\":1}],\"crossWorkspaceMode\":{\"enabled\":true},\"slots\":[{\"name\":\"string\",\"minNumItems\":1,\"maxNumItems\":5,\"shuffleNumItems\":1,\"filters\":\"string\",\"elasticFilters\":\"string\",\"distinctFilter\":{\"elastic\":true,\"filters\":[{\"field\":\"string\",\"maxNumItems\":0,\"levelRangeModifier\":0}]}}]}"

            headers = {
                'Authorization': "Bearer REPLACE_BEARER_TOKEN",
                'content-type': "application/json"
                }

            conn.request("POST", "/recommendations/v2/recommend/items/next-interaction", payload, headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "campaignId": "defaultCampaign",
              "campaignName": "string",
              "catalogId": "default",
              "clientUUID": "string",
              "contextItemIds": [
                "string"
              ],
              "includeContextItems": false,
              "filterRules": {
                "excludePurchasedItems": false,
                "excludePurchasedItemsSinceDays": 0,
                "elasticExcludePurchasedItems": false,
                "elasticExcludePurchasedItemsSinceDays": 0
              },
              "displayAttributes": "string",
              "abTestContext": {
                "experimentId": 0,
                "variantId": "string",
                "requestedCampaignId": "string"
              },
              "params": {
                "source": "mobile"
              },
              "inventoryContext": {
                "channelIds": [
                  "string"
                ]
              },
              "keepSlotsOrder": true,
              "personalizeSlotsOrder": false,
              "sortMetric": "string",
              "boostingParameters": {
                "metric": "string",
                "strength": 0.1,
                "personalizedBoostingStrength": 0
              },
              "boostingStrategies": [
                {
                  "name": "string",
                  "condition": "string",
                  "strength": 1
                }
              ],
              "crossWorkspaceMode": {
                "enabled": true
              },
              "slots": [
                {
                  "name": "string",
                  "minNumItems": 1,
                  "maxNumItems": 5,
                  "shuffleNumItems": 1,
                  "filters": "string",
                  "elasticFilters": "string",
                  "distinctFilter": {
                    "elastic": true,
                    "filters": [
                      {
                        "field": "string",
                        "maxNumItems": 0,
                        "levelRangeModifier": 0
                      }
                    ]
                  }
                }
              ]
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://api.synerise.com/recommendations/v2/recommend/items/next-interaction");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/recommendations/v2/recommend/items/next-interaction",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              campaignId: 'defaultCampaign',
              campaignName: 'string',
              catalogId: 'default',
              clientUUID: 'string',
              contextItemIds: ['string'],
              includeContextItems: false,
              filterRules: {
                excludePurchasedItems: false,
                excludePurchasedItemsSinceDays: 0,
                elasticExcludePurchasedItems: false,
                elasticExcludePurchasedItemsSinceDays: 0
              },
              displayAttributes: 'string',
              abTestContext: {experimentId: 0, variantId: 'string', requestedCampaignId: 'string'},
              params: {source: 'mobile'},
              inventoryContext: {channelIds: ['string']},
              keepSlotsOrder: true,
              personalizeSlotsOrder: false,
              sortMetric: 'string',
              boostingParameters: {metric: 'string', strength: 0.1, personalizedBoostingStrength: 0},
              boostingStrategies: [{name: 'string', condition: 'string', strength: 1}],
              crossWorkspaceMode: {enabled: true},
              slots: [
                {
                  name: 'string',
                  minNumItems: 1,
                  maxNumItems: 5,
                  shuffleNumItems: 1,
                  filters: 'string',
                  elasticFilters: 'string',
                  distinctFilter: {
                    elastic: true,
                    filters: [{field: 'string', maxNumItems: 0, levelRangeModifier: 0}]
                  }
                }
              ]
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/recommendations/v2/recommend/items/next-interaction');
            $request->setMethod(HTTP_METH_POST);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN',
              'content-type' => 'application/json'
            ]);

            $request->setBody('{"campaignId":"defaultCampaign","campaignName":"string","catalogId":"default","clientUUID":"string","contextItemIds":["string"],"includeContextItems":false,"filterRules":{"excludePurchasedItems":false,"excludePurchasedItemsSinceDays":0,"elasticExcludePurchasedItems":false,"elasticExcludePurchasedItemsSinceDays":0},"displayAttributes":"string","abTestContext":{"experimentId":0,"variantId":"string","requestedCampaignId":"string"},"params":{"source":"mobile"},"inventoryContext":{"channelIds":["string"]},"keepSlotsOrder":true,"personalizeSlotsOrder":false,"sortMetric":"string","boostingParameters":{"metric":"string","strength":0.1,"personalizedBoostingStrength":0},"boostingStrategies":[{"name":"string","condition":"string","strength":1}],"crossWorkspaceMode":{"enabled":true},"slots":[{"name":"string","minNumItems":1,"maxNumItems":5,"shuffleNumItems":1,"filters":"string","elasticFilters":"string","distinctFilter":{"elastic":true,"filters":[{"field":"string","maxNumItems":0,"levelRangeModifier":0}]}}]}');

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.post("https://api.synerise.com/recommendations/v2/recommend/items/next-interaction")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"campaignId\":\"defaultCampaign\",\"campaignName\":\"string\",\"catalogId\":\"default\",\"clientUUID\":\"string\",\"contextItemIds\":[\"string\"],\"includeContextItems\":false,\"filterRules\":{\"excludePurchasedItems\":false,\"excludePurchasedItemsSinceDays\":0,\"elasticExcludePurchasedItems\":false,\"elasticExcludePurchasedItemsSinceDays\":0},\"displayAttributes\":\"string\",\"abTestContext\":{\"experimentId\":0,\"variantId\":\"string\",\"requestedCampaignId\":\"string\"},\"params\":{\"source\":\"mobile\"},\"inventoryContext\":{\"channelIds\":[\"string\"]},\"keepSlotsOrder\":true,\"personalizeSlotsOrder\":false,\"sortMetric\":\"string\",\"boostingParameters\":{\"metric\":\"string\",\"strength\":0.1,\"personalizedBoostingStrength\":0},\"boostingStrategies\":[{\"name\":\"string\",\"condition\":\"string\",\"strength\":1}],\"crossWorkspaceMode\":{\"enabled\":true},\"slots\":[{\"name\":\"string\",\"minNumItems\":1,\"maxNumItems\":5,\"shuffleNumItems\":1,\"filters\":\"string\",\"elasticFilters\":\"string\",\"distinctFilter\":{\"elastic\":true,\"filters\":[{\"field\":\"string\",\"maxNumItems\":0,\"levelRangeModifier\":0}]}}]}")
              .asString();
components:
  securitySchemes:
    JWT:
      type: http
      scheme: bearer
      description: |-
        JWT Bearer token. The header looks like this: `Bearer {JWT}`

        Remember to include the space between 'Bearer' and the token.

        Generate a token via the **Authorization** endpoints.
    TrackerKey:
      type: apiKey
      name: token
      in: query
      description: Authorization by tracker key sent as a query parameter. This is the same key as used in the website tracking code.
  schemas:
    activity-time-estimator-Predictions:
      type: array
      description: |
        An array of predicted probabilities for each hour in the `hours` array.  

        Results at index `0` are for the hours at index `0` in the `hours` array. Result at index `0` is for the hour at index `0`.  

        Higher values mean higher probability.
      example:
        - 0.013318098150193691
        - 0.012947574257850647
        - 0.0123398806899786
      items:
        type: array
        items:
          type: number
          format: float
          example: 0.013318098150193691
    activity-time-estimator-Hours:
      type: array
      description: |
        An array of best hour prediction arrays.  

        The array at index `0` is for the profile at index `0` in the profile list, the array at `1` is for profile `1`, and so on.
      example:
        - 16
        - 32
        - 64
      items:
        type: array
        items:
          type: integer
          example: 17
    activity-time-estimator-ClientUUIDs:
      type: array
      maxItems: 1000
      description: An array of profile UUIDs. To generate predictions for fake profiles, send empty strings as the identifiers.
      items:
        type: string
        description: Profile UUID
        example: 6768085e-5925-43c6-b64f-4b90d02de8f2
    activity-time-estimator-TopN:
      type: integer
      minimum: 1
      maximum: 168
      description: The number of best predictions to return for each profile. If omitted, predictions for every hour of the week are returned.
    activity-time-estimator-TimeIndexExclude:
      type: array
      maxItems: 168
      description: |
        An array of times and time ranges to exclude from the predictions. If empty or omitted, the entire week is included (according to the time selections made in `timeIndex`, if they exist).

        A time range is a two-item array. For example, `[4,7]` is the range from Monday, 03:00 to Monday, 06:59. You can mix hours and time ranges in the request.
      example:
        - - 0
          - 23
        - 24
        - 25
        - 26
      items:
        anyOf:
          - $ref: "#/components/schemas/activity-time-estimator-TimeRange"
          - $ref: "#/components/schemas/activity-time-estimator-TimeIndexValue"
    activity-time-estimator-TimeIndexValue:
      type: integer
      title: Hour
      description: |
        Hour of the week.  
        The count starts from `0` at 00:00 on Monday. The counter changes on a full hour.  
        **Examples**:
          - Monday, 00:00 is `0`
          - Monday, 00:47 is `0`
          - Monday, 01:00 is `1`
          - Monday, 23:59 is `23`
          - Tuesday, 00:00 is `24`
          - Tuesday, 01:15 is `25`
      minimum: 0
      maximum: 167
    activity-time-estimator-TimeRange:
      type: array
      title: Hour range
      description: A range of hours
      minItems: 2
      maxItems: 2
      example:
        - 4
        - 7
      items:
        $ref: "#/components/schemas/activity-time-estimator-TimeIndexValue"
    activity-time-estimator-TimeIndex:
      type: array
      maxItems: 168
      description: |
        An array of times and time ranges to include in the predictions. If empty or omitted, the entire week is included (with the exceptions listed in `timeIndexExclude`, if they exist).

        A time range is a two-item array. For example, `[4,7]` is the range from Monday, 03:00 to Monday, 06:59. You can mix hours and time ranges in the request.
      example:
        - - 0
          - 23
        - 24
        - 25
        - 26
        - - 27
          - 48
      items:
        anyOf:
          - $ref: "#/components/schemas/activity-time-estimator-TimeRange"
          - $ref: "#/components/schemas/activity-time-estimator-TimeIndexValue"
    activity-time-estimator-Mode:
      type: string
      description: The mode name
      default: standard
    activity-time-estimator-ClientIDs:
      type: array
      maxItems: 1000
      description: An array of profile IDs. To generate predictions for fake profiles, send empty strings as the identifiers.
      items:
        type: string
        description: Profile ID
        example: "67346"
    ai-stats-Error:
      type: object
      properties:
        httpStatus:
          type: integer
          example: 500
          description: HTTP status of the error.
        errorCode:
          type: integer
          description: Status code. See [error reference](https://developers.synerise.com/errors.html).
        timestamp:
          type: string
          format: date-time
          description: Time when the error occurred.
        message:
          type: string
          description: Description of the problem.
        traceId:
          type: string
          description: Trace ID for debugging.
        help:
          type: string
          description: Currently unused.
    ai-stats-QueriesSummarySchema:
      type: object
      description: Queries statistics
      properties:
        averageClickPosition:
          $ref: "#/components/schemas/ai-stats-averageClickPosition"
        averageOrderValue:
          $ref: "#/components/schemas/ai-stats-averageOrderValue"
        clickThroughRate:
          $ref: "#/components/schemas/ai-stats-clickThroughRate"
        conversionRate:
          $ref: "#/components/schemas/ai-stats-conversionRate"
        conversions:
          $ref: "#/components/schemas/ai-stats-conversions"
        noResultsCount:
          $ref: "#/components/schemas/ai-stats-noResultsCount"
        revenue:
          $ref: "#/components/schemas/ai-stats-revenue"
        totalClicks:
          $ref: "#/components/schemas/ai-stats-totalClicks"
        totalCount:
          $ref: "#/components/schemas/ai-stats-totalCount"
        totalSuggestionsUsed:
          $ref: "#/components/schemas/ai-stats-totalSuggestionsUsed"
    ai-stats-totalSuggestionsUsed:
      type: integer
      description: The number of times a user accepted a suggestion.
    ai-stats-totalCount:
      type: integer
      description: The number of times the search was performed.
    ai-stats-totalClicks:
      type: integer
      description: The number of times a result was clicked.
    ai-stats-revenue:
      type: number
      format: float
      description: Revenue generated from the search.
    ai-stats-noResultsCount:
      type: integer
      description: The number of searches which returned no results.
    ai-stats-conversions:
      type: integer
      description: The number of successful conversions.
    ai-stats-conversionRate:
      type: number
      format: float
      description: Conversion rate of the search.
    ai-stats-clickThroughRate:
      type: number
      format: float
      description: CTR of the search.
    ai-stats-averageOrderValue:
      type: number
      format: float
      description: The average value of orders resulting from the search.
    ai-stats-averageClickPosition:
      type: number
      format: float
      description: The average position of the clicked item on the list of results.
    ai-stats-QueriesTopSchema:
      type: array
      description: Top queries
      items:
        type: object
        properties:
          query:
            $ref: "#/components/schemas/ai-stats-query"
          count:
            $ref: "#/components/schemas/ai-stats-totalCount"
          clicks:
            $ref: "#/components/schemas/ai-stats-totalClicks"
          clickThroughRate:
            $ref: "#/components/schemas/ai-stats-clickThroughRate"
          revenue:
            $ref: "#/components/schemas/ai-stats-revenue"
          conversions:
            $ref: "#/components/schemas/ai-stats-conversions"
          conversionRate:
            $ref: "#/components/schemas/ai-stats-conversionRate"
    ai-stats-query:
      type: string
      description: Query used for search.
    ai-stats-FiltersSummarySchema:
      type: array
      description: Filters stats
      items:
        type: object
        properties:
          filterName:
            type: string
            description: Name of the filterable attribute
          count:
            type: integer
            description: The number of times the filter was used
    ai-stats-RulesSummarySchema:
      type: array
      description: Rules stats
      items:
        type: object
        properties:
          ruleId:
            type: integer
            description: Applied rule id
          count:
            type: integer
            description: The number of times the rule was applied
    ai-stats-QueriesSummaryMultipleIndicesSchema:
      type: array
      description: Queries statistics for multiple indices
      items:
        type: object
        properties:
          indexId:
            type: string
            description: ID of the index for which the stats are requested
            example: 4add1a1fa877c1651906bb22c9dfd37a1618852272
          stats:
            $ref: "#/components/schemas/ai-stats-QueriesSummarySchema"
    ai-stats-RecoStatsByCampaignSchema:
      type: object
      description: Recommendation campaigns stats.
      properties:
        data:
          type: object
          properties:
            summary:
              $ref: "#/components/schemas/ai-stats-RecoStatsSchema"
            byCampaign:
              type: array
              items:
                $ref: "#/components/schemas/ai-stats-RecoCampaignStatsSchema"
    ai-stats-RecoCampaignStatsSchema:
      type: object
      description: Stats for a single recommendation campaign.
      properties:
        campaignId:
          type: string
          description: Id of the campaign.
        stats:
          $ref: "#/components/schemas/ai-stats-RecoStatsSchema"
    ai-stats-RecoStatsSchema:
      type: object
      description: Recommendation statistics.
      properties:
        views:
          $ref: "#/components/schemas/ai-stats-views"
        revenue:
          $ref: "#/components/schemas/ai-stats-recommendationsRevenue"
        itemPurchases:
          $ref: "#/components/schemas/ai-stats-itemPurchases"
        itemPurchasesPerItemClick:
          $ref: "#/components/schemas/ai-stats-itemPurchasesPerItemClick"
        itemClicks:
          $ref: "#/components/schemas/ai-stats-itemClicks"
        transactions:
          $ref: "#/components/schemas/ai-stats-transactions"
        frameClicks:
          $ref: "#/components/schemas/ai-stats-frameClicks"
        frameClicksPerGeneration:
          $ref: "#/components/schemas/ai-stats-frameClicksPerGeneration"
        frameClicksPerView:
          $ref: "#/components/schemas/ai-stats-frameClicksPerView"
        generations:
          $ref: "#/components/schemas/ai-stats-generations"
        uniqueClients:
          $ref: "#/components/schemas/ai-stats-uniqueClients"
    ai-stats-uniqueClients:
      type: number
      format: integer
      description: Number of unique profiles which generated a recommendation.
    ai-stats-generations:
      type: integer
      description: The number of generated recommendations.
    ai-stats-frameClicksPerView:
      type: number
      format: float
      description: Frame clicks per view ratio.
    ai-stats-frameClicksPerGeneration:
      type: number
      format: float
      description: Frame clicks per generation ratio.
    ai-stats-frameClicks:
      type: number
      format: integer
      description: Number of clicks on a recommendation frame.
    ai-stats-transactions:
      type: integer
      description: The number of transactions resulting from the recommendation.
    ai-stats-itemClicks:
      type: number
      format: integer
      description: Number of clicks on a recommendation item.
    ai-stats-itemPurchasesPerItemClick:
      type: number
      format: float
      description: Item purchases per item click ratio.
    ai-stats-itemPurchases:
      type: integer
      description: The number of individual item purchases.
    ai-stats-recommendationsRevenue:
      type: number
      format: float
      description: Total revenue generated by recommendations.
    ai-stats-views:
      type: integer
      description: The number of recommendation frame views.
    ai-stats-RecoStatsByDateSchema:
      type: object
      description: Recommendation campaigns statistics.
      properties:
        data:
          type: object
          description: The requested statistics.
          properties:
            summary:
              $ref: "#/components/schemas/ai-stats-RecoStatsSchema"
            byDate:
              type: array
              description: Results for individual days.
              items:
                $ref: "#/components/schemas/ai-stats-RecoDateStatsSchema"
    ai-stats-RecoDateStatsSchema:
      type: object
      description: Recommendation campaigns stats for a single date.
      properties:
        date:
          type: string
          description: The date.
          format: date
        stats:
          $ref: "#/components/schemas/ai-stats-RecoStatsSchema"
    ai-stats-RecoTopProductsStatsSchema:
      type: object
      description: The statistics of best-performing products in the campaign, according to the selected metric
      properties:
        data:
          type: array
          description: Each object in the array contains the statistics for one item.
          items:
            $ref: "#/components/schemas/ai-stats-RecoTopProductsEntryStatsSchema"
    ai-stats-RecoTopProductsEntryStatsSchema:
      type: object
      description: Statistics for a single item.
      properties:
        productId:
          type: string
          description: Id of the item.
        stats:
          $ref: "#/components/schemas/ai-stats-RecoStatsSchema"
    items-filter-all-Error:
      type: object
      properties:
        timestamp:
          type: string
          format: date-time
          description: Time when the error occurred
        status:
          type: integer
          description: Status code
        error:
          type: string
          description: Summary of the error
        message:
          type: string
          description: Description of the problem
        path:
          type: string
          description: URL of the requested resource
        requestId:
          type: string
          description: ID of the request which resulted in the error
      required:
        - timestamp
        - status
        - message
    items-filter-all-FilterValidateResponse:
      type: object
      properties:
        filteringString:
          $ref: "#/components/schemas/items-filter-all-FilteringString"
        contextItems:
          $ref: "#/components/schemas/items-filter-all-ContextItems"
        clientUUID:
          $ref: "#/components/schemas/items-filter-all-ClientUUID"
        parserResult:
          $ref: "#/components/schemas/items-filter-all-ParserResult"
        evaluationResult:
          $ref: "#/components/schemas/items-filter-all-EvaluationResult"
        extracts:
          $ref: "#/components/schemas/items-filter-all-Extracts"
        candidateItems:
          type: array
          description: List of validated candidate items
          items:
            type: object
            properties:
              itemId:
                type: string
                description: ID of an item that was tested against the filtering string
                example: "67890"
              valid:
                type: boolean
                description: True if the item meets the conditions of the filtering string
            required:
              - itemId
              - valid
        exampleItems:
          type: array
          items:
            type: string
          description: Array of itemIds that meet the conditions of the filtering string. The size of this array can be controlled by the `exampleItems` query parameter.
      required:
        - filteringString
        - parserResult
    items-filter-all-Extracts:
      type: object
      description: Information about elements that were used anywhere in the filtering string. **Elements are listed only if they were valid.**
      properties:
        clientExtracts:
          type: object
          description: Attributes of the context profile
          properties:
            attributeConstants:
              type: array
              description: Profile attributes used in the query
              items:
                type: string
            segmentationsConstant:
              type: array
              description: Segmentations used in the query
              items:
                type: string
            aggregateConstants:
              type: array
              description: Aggregates used in the query
              items:
                type: string
            expressionConstants:
              type: array
              description: Expressions used in the query
              items:
                type: string
            TagsConstant:
              type: boolean
              description: True if context profile's tags were referenced in the query.
        contextConstants:
          type: array
          description: Context elements used in the query
          items:
            type: string
        variables:
          type: array
          description: Variables used in the query (for example pulled from the context)
          items:
            type: string
    items-filter-all-EvaluationResult:
      type: object
      description: Evaluation including data from the item catalog, configuration, and context items/profiles.
      properties:
        resultSize:
          type: integer
          description: How many items meet the conditions of the IQL filtering string in total
        modifiedFilteringString:
          type: string
          description: Filtering string after application of the filtering context. For example, `title != context.title` becomes `title != "Synerise API Reference"`
        evaluationErrors:
          type: array
          description: List of IQL evaluation errors
          items:
            type: object
            properties:
              filter:
                type: string
                description: Name of variable on which the filter is based
              message:
                type: string
                description: Error message
            required:
              - filter
              - message
      required:
        - resultSize
    items-filter-all-ParserResult:
      type: object
      description: Result of validating the IQL syntax and only the syntax - this result does not inform if the filter returns any results or if the used attributes are filterable.
      properties:
        valid:
          type: boolean
          description: True if IQL expression syntax is valid.
        message:
          type: string
          description: Error message when IQL expression is not valid
        parsedFilteringString:
          type: string
          description: Parsed filtering string
      required:
        - valid
        - parsedFilteringString
    items-filter-all-ClientUUID:
      type: string
      description: UUID of the profile which creates the profile context
      example: 68df2317-0edb-4cc9-8b39-5ab68325f891
    items-filter-all-ContextItems:
      type: array
      items:
        type: string
        example: "12345"
      description: itemIds of the items which create the item context
    items-filter-all-FilteringString:
      type: string
      description: "[IQL](https://help.synerise.com/developers/iql) filtering expression"
      example: IF("abcd" IN client.tags,discount == 0,discount > 0)
    items-filter-all-ValidateItemsFilterRequestBody:
      description: Request for performing IQL validation
      type: object
      properties:
        filteringString:
          $ref: "#/components/schemas/items-filter-all-FilteringString"
        clientUUID:
          $ref: "#/components/schemas/items-filter-all-ClientUUID"
        contextItems:
          $ref: "#/components/schemas/items-filter-all-ContextItems"
        inventoryContext:
          $ref: "#/components/schemas/items-filter-all-InventoryContext"
        candidateItems:
          $ref: "#/components/schemas/items-filter-all-CandidateItems"
      required:
        - filteringString
    items-filter-all-CandidateItems:
      type: array
      items:
        type: string
        example: "67890"
      description: Array of itemIds that will be tested against the IQL expression. You can use this with test items to verify that the query matches the items you expected.
    items-filter-all-InventoryContext:
      description: |
        Inventory context used to evaluate inventory-related filters and boosting strategies.
        Can be either a single inventory context or a multi-inventory context (set of channel IDs per inventory).
      oneOf:
        - $ref: "#/components/schemas/items-filter-all-SingleInventoryContext"
        - $ref: "#/components/schemas/items-filter-all-MultiInventoryContext"
    items-filter-all-MultiInventoryContext:
      type: object
      description: |
        Multi-inventory context where each inventory can have its own set of channel IDs.
      properties:
        inventoryCatalogs:
          type: object
          additionalProperties:
            $ref: "#/components/schemas/items-filter-all-InventoryContextDefinition"
          description: |
            Map of inventory ID to inventory context definition. Each inventory can have its own set of channel IDs.
      required:
        - inventoryCatalogs
    items-filter-all-InventoryContextDefinition:
      type: object
      description: |
        Context definition for a specific inventory.
      properties:
        channelIds:
          type: array
          items:
            type: string
          description: |
            List of channel identifiers for this specific inventory.
    items-filter-all-SingleInventoryContext:
      type: object
      description: |
        Single inventory context.
      properties:
        channelIds:
          type: array
          items:
            type: string
          description: |
            List of channel identifiers used to evaluate inventory-related filters and boosting strategies.
      required:
        - channelIds
    items-search-Error:
      type: object
      properties:
        timestamp:
          type: string
          format: date-time
          description: Time when the error occurred
        status:
          type: integer
          description: Status code
        error:
          type: string
          description: Summary of the error
        message:
          type: string
          description: Description of the problem
        path:
          type: string
          description: URL of the requested resource
      required:
        - timestamp
        - status
        - message
    items-search-VisualSearchResponse:
      type: object
      properties:
        data:
          $ref: "#/components/schemas/items-search-FoundItems"
        extras:
          type: object
          description: Additional information
          properties:
            filteredFacets:
              $ref: "#/components/schemas/items-search-ResultFacets"
            allFacets:
              $ref: "#/components/schemas/items-search-ResultFacets"
            customFilteredFacets:
              allOf:
                - type: object
                  description: Facets resulting from the `customFilteredFacets` setting. Only available in `POST` requests.
                - $ref: "#/components/schemas/items-search-ResultFacets"
            correlationId:
              $ref: "#/components/schemas/items-search-CorrelationIdInResponse"
            searchId:
              $ref: "#/components/schemas/items-search-SearchIdInResponse"
            facetsOrdering:
              $ref: "#/components/schemas/items-search-FacetsOrderingResponse"
        meta:
          $ref: "#/components/schemas/items-search-PaginationMeta"
    items-search-PaginationMeta:
      type: object
      description: Optional metadata, such as pagination. This is returned if the `includeMeta` parameter was set to true in the request.
      properties:
        totalPages:
          type: number
          description: The total number of pages
        totalCount:
          type: number
          description: The total number of search results
        page:
          type: number
          description: The current page
        limit:
          type: number
          description: The maximal number of items on a page
        sortedBy:
          type: string
          description: The column (attribute) that the campaigns were sorted by
        ordering:
          type: string
          description: Sorting order
        code:
          type: number
          description: HTTP response code
        link:
          type: array
          description: Links to neighboring pages, first page, and last page in pagination
          items:
            type: object
            properties:
              url:
                description: Page URL
                type: string
              rel:
                type: string
                description: Position of the linked page
                enum:
                  - first
                  - next
                  - prev
                  - last
    items-search-FacetsOrderingResponse:
      type: array
      description: |
        An ordered list of facet attribute names indicating the display order of facets in the response.
        When `facets=auto`, facets are ordered by coverage (most relevant first) unless `facetsOrderBy=name` is specified.
        When facets are specified explicitly, the ordering is by name.
        Empty when no facets are requested.

        Matching query rules can override the resulting set and order via two consequences:
        - `pinFacets` forces specific facets into the response, optionally at a specific 1-based slot.
          Pinned facets bypass the coverage threshold in `facets=auto`.
        - `hideFacets` removes specific facets from the response, also stripping them from
          `customFilteredFacets`. Hide takes precedence over pin and over explicit `facets=[...]`.

        The corresponding facet values appear in `filteredFacets`, `allFacets`, and `customFilteredFacets`
        only for attributes present in this list.
      items:
        type: string
      example:
        - brand
        - color
        - size
        - price
    items-search-SearchIdInResponse:
      type: string
      deprecated: true
      description: |
        **DEPRECATED - use correlationId instead**

        This ID is used:
        - for search result pagination
        - as `searchId` of the search event in events such as `items.search.click`

        Search results are cached for 10 minutes.

        The cached value will be used if the ID is provided in subsequent calls. This makes search faster and eliminates personalization non-determinism.
    items-search-CorrelationIdInResponse:
      type: string
      description: |
        This ID is used:
        - for search result pagination
        - as `correlationId` of the search event in events such as `items.search.click`

        Search results are cached for 10 minutes.

        The cached value will be used if the ID is provided in subsequent calls. This makes search faster and eliminates personalization non-determinism.
    items-search-ResultFacets:
      type: object
      description: Facet value mappings
      example:
        brand:
          X-brand: 1
          Y-brand: 3
        salePrice.value:
          max: 201.99
          min: 14.99
      additionalProperties:
        description: The type of facet, for example `category`
        type: object
        additionalProperties:
          description: 'The values for keys in this facet type, for example `"Home Appliances>Fridges": 12`'
          type: integer
    items-search-FoundItems:
      type: array
      description: A page of matching items as objects. The parameters of each item's object depend on the configuration of displayable attributes.
      items:
        type: object
        properties:
          _promotedByRules:
            type: array
            items:
              type: integer
              description: Rule id
            description: List of applied rules that had an effect in promoting this item. This field exists if and only if the item was promoted.
        additionalProperties:
          description: The names and value types of the item's properties depend on the configuration.
        example:
          itemName: TV
          itemId: 87257843345
          _promotedByRules:
            - 475
            - 477
    items-search-Params:
      type: object
      example:
        source: mobile
      description: Extra parameters that will be added to the `item.search` event. The total size must not exceed 500 bytes.
      additionalProperties: true
    items-search-ExcludeQueryRules:
      type: array
      example:
        - 2
        - 5
      items:
        type: integer
      description: List of query rules that will not be applied.
    items-search-IgnoreQueryRules:
      type: boolean
      description: If set to `true`, query rules are not applied.
      default: false
    items-search-DisplayAttributes:
      type: array
      description: List of ad hoc attributes that will be returned for each found item
      example:
        - title
        - price
      items:
        type: string
    items-search-Context:
      type: array
      description: List of context strings for a search query
      example:
        - mobile
        - listing
      items:
        type: string
    items-search-FacetsOrdering:
      type: string
      enum:
        - coverage
        - name
      description: |
        Controls the ordering of facets in the response.  
        When `facets=auto`, the default ordering is by coverage (most relevant facets first).  
        When facets are specified explicitly, the default ordering is by name.  
        When two facets have equal coverage, ties are resolved by name.
    items-search-IncludeFacets:
      type: string
      default: filtered
      enum:
        - all
        - filtered
        - unfiltered
        - none
      description: |
        Determines which groups of facets will be returned: both filtered and unfiltered; just filtered; just unfiltered; or no group at at all.

        To determine which attributes should be returned as facets in each group, use the `facets` and `customFilteredFacets` parameters.
    items-search-CaseSensitiveFacetValues:
      type: boolean
      default: false
      description: |
        Specifies whether facets aggregation should be case sensitive.
    items-search-MaxValuesPerFacet:
      type: integer
      default: 50
      minimum: 1
      maximum: 1000
      description: |
        Determines how many values will be retrieved per facet.
    items-search-FacetsSize:
      type: integer
      default: 2000
      minimum: 1
      maximum: 10000
      description: |
        Determines how many items will be used for facets aggregation.
    items-search-Facets:
      type: array
      description: |
        A list of attributes for which facets will be returned.
        - A single `*` value matches all facetable attributes.
        - A single `auto` value enables automatic facet selection based on the result set — the system picks the most relevant facets using the index's `dynamicFacets` configuration.

        To determine which groups of facets should be returned, use the `includeFacets` parameter.
      items:
        type: string
    items-search-Filters:
      type: string
      description: IQL query string. For details, see the [Help Center](https://help.synerise.com/developers/iql/).
    items-search-FilterAnchor:
      type: string
      example: 0.2,0.8
      description: |
        Anchor (`{width},{height}`) by which the visual results data will be filtered.
        `{width},{height}` correspond to normalized image coordinates, i.e. they are in range [0,1].
        Anchor (0,0) corresponds to the top-left pixel of an image.
    items-search-FilterAroundRadius:
      type: integer
      format: int32
      example: 2000
      default: 1000
      description: Radius in meters to be used when filtering using geo-location. Can only be used when filtering by a single geo-point.
    items-search-FilterGeoPoints:
      type: array
      example:
        - 34.052235,-118.243685
        - 15.0,65.0
      items:
        type: string
      description: |
        The definition of a geographical area to filter by.

        Given one geo-point, the results will be limited to a radius around a point. To override the default radius (1000 meters), provide the `filterAroundRadius` parameter.
        **Example input:** `["34.052235,-118.243685"]`

        Given two geo-points, the results will be limited to a rectangular area.
        **Example input:** `["50,-100", "25,150"]`

        Given three or more geo-points, the results will be limited to a polygonal area.
        **Example input:** `["50,0", "40,20", "-20,10"]`
    items-search-SortByGeoPoint:
      type: string
      example: 34.052235,-118.243685
      description: |
        <span style='color:red'><strong>IMPORTANT:</strong></span> Sorting disables boosting, elastic filters, and promoting search results.

        Geo-point (`{latitude},{longitude}`) for data sorting. Results are sorted by distance from this point. `ordering: asc` means "closest first".'
    items-search-SortByMetric:
      type: string
      enum:
        - TransactionsPopularity
        - PageVisitsPopularity
      description: |
        <span style='color:red'><strong>IMPORTANT:</strong></span> Sorting disables boosting, elastic filters, and promoting search results.

        Name of the metric by which the data will be sorted.
    items-search-SearchId:
      type: string
      deprecated: true
      description: |
        **DEPRECATED - use correlationId instead**

        Search ID for pagination. If a search with the ID was performed recently (last 10 minutes), the cached results will be used.

        Do not send this if sortBy/filters/sorting order, etc. have changed - the cached results may have different order or may match different filters.
    items-search-CorrelationId:
      type: string
      description: |
        Correlation ID for pagination. If a search with the ID was performed recently (last 10 minutes), the cached results will be used.

        Do not send this if sortBy/filters/sorting order, etc. have changed - the cached results may have different order or may match different filters.
    items-search-ClientUUID:
      type: string
      description: UUID of the profile for which the search is performed
    items-search-PaginationIncludeMeta:
      type: boolean
      description: |
        
        When `true`, pagination metadata is included in the response body.

        When `false`, the data is included in the response headers:

        - Link: links to neighbors, first, and last pages in pagination.

        - X-Pagination-Total-Count: total number of items on all pages

        - X-Pagination-Total-Pages: total number of pages

        - X-Pagination-Page: current page

        - X-Pagination-Limit: maximum number of items on a page

        - X-Pagination-Sorted-By: parameter that the items were sorted by

        - X-Pagination-Ordering: sorting direction
    items-search-PaginationOrdering:
      type: string
      default: asc
      enum:
        - desc
        - asc
      description: Sorting order
    items-search-PaginationSortBy:
      type: string
      description: |
        <span style='color:red'><strong>IMPORTANT:</strong></span> Sorting disables boosting, elastic filters, and promoting search results.

        Name of the attribute by which the data will be sorted.
    items-search-PaginationLimit:
      type: integer
      format: int32
      example: 10
      default: 20
      maximum: 500
      minimum: 0
      description: The number of items to return per page
    items-search-PaginationPage:
      type: integer
      format: int32
      description: Page number to return for pagination. The first page has the index `1`.
    items-search-VisualSearchRequest:
      type: object
      properties:
        url:
          $ref: "#/components/schemas/items-search-ImageUrl"
        page:
          $ref: "#/components/schemas/items-search-PaginationPage"
        limit:
          $ref: "#/components/schemas/items-search-PaginationLimit"
        sortBy:
          $ref: "#/components/schemas/items-search-PaginationSortBy"
        ordering:
          $ref: "#/components/schemas/items-search-PaginationOrdering"
        includeMeta:
          $ref: "#/components/schemas/items-search-PaginationIncludeMeta"
        clientUUID:
          $ref: "#/components/schemas/items-search-ClientUUID"
        personalize:
          $ref: "#/components/schemas/items-search-Personalize"
        correlationId:
          $ref: "#/components/schemas/items-search-CorrelationId"
        searchId:
          $ref: "#/components/schemas/items-search-SearchId"
        sortByMetric:
          $ref: "#/components/schemas/items-search-SortByMetric"
        sortByGeoPoints:
          $ref: "#/components/schemas/items-search-SortByGeoPoint"
        filterGeoPoints:
          $ref: "#/components/schemas/items-search-FilterGeoPoints"
        filterAroundRadius:
          $ref: "#/components/schemas/items-search-FilterAroundRadius"
        filterAnchor:
          $ref: "#/components/schemas/items-search-FilterAnchor"
        filters:
          $ref: "#/components/schemas/items-search-Filters"
        facets:
          $ref: "#/components/schemas/items-search-Facets"
        customFilteredFacets:
          $ref: "#/components/schemas/items-search-CustomFilteredFacets"
        facetsSize:
          $ref: "#/components/schemas/items-search-FacetsSize"
        maxValuesPerFacet:
          $ref: "#/components/schemas/items-search-MaxValuesPerFacet"
        caseSensitiveFacetValues:
          $ref: "#/components/schemas/items-search-CaseSensitiveFacetValues"
        includeFacets:
          $ref: "#/components/schemas/items-search-IncludeFacets"
        facetsOrderBy:
          $ref: "#/components/schemas/items-search-FacetsOrdering"
        context:
          $ref: "#/components/schemas/items-search-Context"
        displayAttributes:
          $ref: "#/components/schemas/items-search-DisplayAttributes"
        ignoreQueryRules:
          $ref: "#/components/schemas/items-search-IgnoreQueryRules"
        excludeQueryRules:
          $ref: "#/components/schemas/items-search-ExcludeQueryRules"
        params:
          $ref: "#/components/schemas/items-search-Params"
      required:
        - url
    items-search-CustomFilteredFacets:
      type: object
      description: |
        A key-value map that takes attributes as keys and IQL query strings as values.

        For each key a facet is returned that includes only the items filtered by the provided IQL query string.
      additionalProperties:
        name: value
        $ref: "#/components/schemas/items-search-Filters"
      example:
        brand: price > 100
        price: brand == foo
    items-search-Personalize:
      type: boolean
      description: If set to `false`, the search result is not personalized.
      default: true
    items-search-ImageUrl:
      type: string
      description: URL of the image to be used in the visual search
    items-search-VisualSearchResponseWithExplanation:
      type: object
      properties:
        data:
          $ref: "#/components/schemas/items-search-FoundItemsWithExplanation"
        extras:
          type: object
          description: Additional information
          properties:
            filteredFacets:
              $ref: "#/components/schemas/items-search-ResultFacets"
            allFacets:
              $ref: "#/components/schemas/items-search-ResultFacets"
            customFilteredFacets:
              allOf:
                - type: object
                  description: Facets resulting from the `customFilteredFacets` setting. Only available in `POST` requests.
                - $ref: "#/components/schemas/items-search-ResultFacets"
            correlationId:
              $ref: "#/components/schemas/items-search-CorrelationIdInResponse"
            searchId:
              $ref: "#/components/schemas/items-search-SearchIdInResponse"
            facetsOrdering:
              $ref: "#/components/schemas/items-search-FacetsOrderingResponse"
            explanation:
              $ref: "#/components/schemas/items-search-Explanation"
        meta:
          $ref: "#/components/schemas/items-search-PaginationMeta"
    items-search-Explanation:
      type: object
      description: Explanation for performed search.
      properties:
        rulesConsequences:
          $ref: "#/components/schemas/items-search-RulesConsequencesExplanation"
        sortDetails:
          oneOf:
            - $ref: "#/components/schemas/items-search-SortedByMetric"
            - $ref: "#/components/schemas/items-search-SortedByAttribute"
            - $ref: "#/components/schemas/items-search-SortedByGeoPoint"
          description: Applied sorting details.
        query:
          $ref: "#/components/schemas/items-search-FinalQuery"
        personalized:
          type: boolean
          description: Indicates whether the search results were personalized.
        promotedItemsCount:
          type: integer
          description: Promoted items count.
        wasFallbackMatchingUsed:
          type: boolean
          description: "`true` if fallback matching was used."
        facetSelectionExplanation:
          $ref: "#/components/schemas/items-search-FacetSelectionExplanation"
    items-search-FacetSelectionExplanation:
      type: object
      description: |
        Explanation of automatic facet selection. Only present when `facets=auto` is used on an `/explain` endpoint.
        Contains the raw coverage data from the result set that was used to select and rank facets.
        To compute coverage percentage, divide each value by the response's `total` field.
      properties:
        facetCoverage:
          type: object
          description: |
            Map of facetable attribute names to the number of results that have a value for that attribute.
            Includes all candidate facets (not just the ones that were returned in the item's data), so you can see what was considered and why some were excluded by `maxFacets`.
          additionalProperties:
            type: integer
          example:
            brand: 4800
            color: 4500
            price: 4900
            size: 3200
            material: 400
    items-search-FinalQuery:
      type: object
      properties:
        finalQuery:
          type: string
          description: Query that was ultimately used to perform the search.
        synonyms:
          type: array
          description: Used synonyms.
          items:
            type: object
            properties:
              word:
                type: string
                description: Phrase that the synonyms relate to.
              synonyms:
                type: array
                description: List of the synonyms.
                items:
                  type: string
    items-search-SortedByGeoPoint:
      type: object
      properties:
        point:
          type: string
          description: Point used to sort the items.
          example: 34.052235,-118.243685
        ordering:
          type: string
          description: Applied ordering.
          enum:
            - asc
            - desc
    items-search-SortedByAttribute:
      type: object
      properties:
        attribute:
          type: string
          description: Name of the attribute used to sort the items.
        ordering:
          type: string
          description: Applied ordering.
          enum:
            - asc
            - desc
        ruleId:
          type: integer
          description: Id of a query rule that set the sort, if applicable.
    items-search-SortedByMetric:
      type: object
      properties:
        metric:
          type: string
          description: Metric used to sort the items.
          enum:
            - TransactionsPopularity
            - PageVisitsPopularity
        ordering:
          type: string
          description: Applied ordering.
          enum:
            - asc
            - desc
    items-search-RulesConsequencesExplanation:
      type: object
      description: Applied rules consequences.
      properties:
        query:
          $ref: "#/components/schemas/items-search-TransformedQuery"
        hiddenHits:
          type: array
          items:
            $ref: "#/components/schemas/items-search-HideHit"
        filters:
          type: array
          items:
            $ref: "#/components/schemas/items-search-ExplanationFilters"
        boostFilters:
          type: array
          items:
            $ref: "#/components/schemas/items-search-ExplanationBoostFilters"
        returnNoData:
          $ref: "#/components/schemas/items-search-ReturnNoData"
        pinFacets:
          type: array
          description: |
            Per-rule pin facet consequences contributing to the final `facetsOrdering`.
            Reflects what the rules engine emitted; the contributing rule ids are also present in `appliedRules`.
          items:
            $ref: "#/components/schemas/items-search-ExplanationPinFacet"
        hideFacets:
          type: array
          description: |
            Per-attribute hide facet consequences contributing to the final `facetsOrdering`.
            Each entry lists every rule that hid that attribute.
          items:
            $ref: "#/components/schemas/items-search-ExplanationHideFacet"
    items-search-ExplanationHideFacet:
      type: object
      description: A single hide-facet consequence aggregated across all rules that hid the same attribute.
      properties:
        attribute:
          type: string
          description: Name of the hidden facet attribute.
          example: material
        ruleIds:
          type: array
          description: Ids of every query rule that hid this attribute.
          items:
            type: integer
    items-search-ExplanationPinFacet:
      type: object
      description: A single pin-facet consequence emitted by a matched query rule.
      properties:
        attribute:
          type: string
          description: Name of the pinned facet attribute.
          example: size
        position:
          type: integer
          minimum: 1
          maximum: 100
          description: |
            1-based slot the rule requested. Omitted when the rule pinned the attribute without a position.
          example: 1
        ruleId:
          type: integer
          description: Id of the query rule that emitted this pin.
    items-search-ReturnNoData:
      type: object
      description: Indicates if no data consequence is activated.
      properties:
        enabled:
          type: boolean
          description: Indicates if the consequence is enabled.
        ruleIds:
          type: array
          description: Ids of the query rules which activated the consequence.
          items:
            type: integer
    items-search-ExplanationBoostFilters:
      type: object
      description: Used boost filter.
      properties:
        filters:
          $ref: "#/components/schemas/items-search-QueryRuleFilters"
        weight:
          type: number
          description: Weight of the filter.
        ruleId:
          type: integer
          description: Id of the query rule from which the filter come.
    items-search-QueryRuleFilters:
      type: object
      description: Filters from query rules.
      properties:
        textFilters:
          type: array
          description: Text-type filters
          items:
            type: object
            properties:
              attribute:
                type: string
                description: Attribute to be filtered
              mode:
                type: string
                description: |
                  Information whether to include or exclude filtered results.

                  - `include`: includes filtered results
                  - `exclude`: excludes filtered results
                enum:
                  - include
                  - exclude
                example: include
              values:
                type: array
                description: Values to be used during filtering.
                example:
                  - A-Brand
                  - B-Brand
                items:
                  type: string
        rangeFilters:
          type: array
          description: Range-type filters
          items:
            type: object
            properties:
              attribute:
                type: string
                description: Attribute to be filtered
                example: price
              operator:
                type: string
                description: |
                  Operator to be used during filtering.

                  - `gt`: greater than
                  - `gte`: greater or equal
                  - `lt`: less than
                  - `lte`: less than or equal
                  - `eq`/`neq`: equal/not equal
                enum:
                  - gt
                  - gte
                  - lt
                  - lte
                  - eq
                  - neq
              value:
                description: Value to use during filtering
                type: number
                example: 19.99
    items-search-ExplanationFilters:
      type: object
      description: Used filter.
      properties:
        filters:
          $ref: "#/components/schemas/items-search-QueryRuleFilters"
        ruleId:
          type: integer
          description: Id of the query rule from which the filter come.
    items-search-HideHit:
      type: object
      properties:
        id:
          type: string
          description: Hidden item item.
        ruleIds:
          type: array
          description: Ids of query rules which caused the item to be hidden.
          items:
            type: integer
    items-search-TransformedQuery:
      type: object
      description: Query changes applied due to query rules.
      properties:
        originalQuery:
          type: string
          description: Query before applying query rules.
        finalQuery:
          type: string
          description: Query after applying query rules.
        modifications:
          type: array
          items:
            $ref: "#/components/schemas/items-search-QueryModification"
    items-search-QueryModification:
      type: object
      description: Describes a change in query.
      properties:
        slice:
          description: Query slice that was modified.
          allOf:
            - $ref: "#/components/schemas/items-search-QuerySlice"
        transformedSlice:
          description: Resulting query slice. Not present if the modification only removes words.
          allOf:
            - $ref: "#/components/schemas/items-search-QuerySlice"
        ruleId:
          type: integer
          description: Id of the query rule which caused this change.
    items-search-QuerySlice:
      type: object
      description: Describes a slice of query.
      properties:
        from:
          type: integer
          description: Number of the first word (zero-indexed, inclusive).
        to:
          type: integer
          description: Number of the last word (zero-indexed, inclusive).
    items-search-FoundItemsWithExplanation:
      type: array
      description: A page of matching items as objects with explanation included. The parameters of each item's object depend on the configuration of displayable attributes.
      items:
        type: object
        properties:
          _promotedByRules:
            type: array
            items:
              type: integer
              description: Rule id
            description: List of applied rules that had an effect in promoting this item. This field exists if and only if the item was promoted.
          _explanation:
            $ref: "#/components/schemas/items-search-PerItemExplanation"
        additionalProperties:
          description: The names and value types of the item's properties depend on the configuration.
        example:
          itemName: TV
          itemId: 87257843345
          _promotedByRules:
            - 475
            - 477
    items-search-PerItemExplanation:
      type: object
      description: Explanation of the scoring of this item
      properties:
        extendedScoreFactors:
          $ref: "#/components/schemas/items-search-ExtendedScores"
        scoreFactors:
          $ref: "#/components/schemas/items-search-ScoreFactors"
        score:
          type: number
          description: Final score.
        matchedElasticFilter:
          type: boolean
          description: Indicates if the item was matched by an elastic filter.
        sortValue:
          oneOf:
            - type: string
            - type: number
          description: Value used to sort the items, if applicable.
    items-search-ScoreFactors:
      type: object
      description: Influence of historical data and behavioral analysis.
      properties:
        pageVisitsPopularity:
          type: number
          description: Normalized page views popularity.
        transactionsPopularity:
          type: number
          description: Normalized transactions popularity.
        personalization:
          type: number
          description: Normalized value of personalization coefficient, if applicable.
        pageVisitsInfluence:
          type: number
          description: Page views impact on score.
        transactionsInfluence:
          type: number
          description: Purchases impact on score.
        personalizationInfluence:
          type: number
          description: Personalization impact on score, if applicable.
    items-search-ExtendedScores:
      type: object
      description: Extended score factors. Only included if it is possible to gather them.
      properties:
        attributes:
          type: object
          description: |
            Attribute values which influenced the score.  
            This object is separated into low/medium/high importance values (corresponding to attribute importance configuration in the search index configuration).  
            For each type, `token` is the search query (may be modified by query rules, suggestions, etc.) that matched an attribute or attributes of that importance.  
          properties:
            low:
              description: Low importance attributes score.
              allOf:
                - $ref: "#/components/schemas/items-search-TokenWithScore"
            medium:
              description: Medium importance attributes score.
              allOf:
                - $ref: "#/components/schemas/items-search-TokenWithScore"
            high:
              description: High importance attributes score.
              allOf:
                - $ref: "#/components/schemas/items-search-TokenWithScore"
        boostFilters:
          type: array
          description: Matched boost filters.
          items:
            type: object
            properties:
              filters:
                $ref: "#/components/schemas/items-search-QueryRuleFilters"
              weight:
                type: number
                description: Weight of the filter.
    items-search-TokenWithScore:
      type: object
      description: Token with its corresponding score.
      properties:
        token:
          type: string
          description: Token value.
        score:
          type: number
          description: Score of the token.
    items-search-CrossWorkspaceMode:
      type: object
      description: Cross-workspace personalization mode. When provided, overrides the index configuration setting.
      properties:
        enabled:
          type: boolean
          description: Whether cross-workspace personalization is enabled.
      required:
        - enabled
    items-search-SuggestionResponse:
      type: object
      title: Suggestion search
      properties:
        data:
          type: array
          description: A page of search query suggestions
          items:
            type: object
            description: A search suggestion
            properties:
              suggestion:
                type: string
                description: The suggested search phrase
        extras:
          type: object
          description: Additional information
          properties:
            correlationId:
              $ref: "#/components/schemas/items-search-CorrelationIdInResponse"
            searchId:
              $ref: "#/components/schemas/items-search-SearchIdInResponse"
            facetsOrdering:
              $ref: "#/components/schemas/items-search-FacetsOrderingResponse"
        meta:
          $ref: "#/components/schemas/items-search-PaginationMeta"
    items-search-FullTextSearchResponse:
      type: object
      title: Item search
      properties:
        data:
          $ref: "#/components/schemas/items-search-FoundItems"
        extras:
          type: object
          description: Additional information
          properties:
            filteredFacets:
              $ref: "#/components/schemas/items-search-ResultFacets"
            allFacets:
              $ref: "#/components/schemas/items-search-ResultFacets"
            customFilteredFacets:
              allOf:
                - type: object
                  description: Facets resulting from the `customFilteredFacets` setting. Only available in `POST` requests.
                - $ref: "#/components/schemas/items-search-ResultFacets"
            correlationId:
              $ref: "#/components/schemas/items-search-CorrelationIdInResponse"
            searchId:
              $ref: "#/components/schemas/items-search-SearchIdInResponse"
            facetsOrdering:
              $ref: "#/components/schemas/items-search-FacetsOrderingResponse"
            suggestions:
              type: array
              description: A list of search suggestions
              items:
                $ref: "#/components/schemas/items-search-FullTextSuggestionSchema"
            usedSuggestion:
              $ref: "#/components/schemas/items-search-UsedSuggestion"
        meta:
          $ref: "#/components/schemas/items-search-PaginationMeta"
    items-search-UsedSuggestion:
      type: object
      description: If the query did not return any matches, the AI engine tries to find an alternative similar query and use it for the search instead. If that happens, the `usedSuggestion` object contains information about that alternative query offered by the AI engine and used in the search.
      allOf:
        - $ref: "#/components/schemas/items-search-FullTextSuggestionSchema"
    items-search-FullTextSuggestionSchema:
      type: object
      description: If the query from the request doesn't return any matches (for example due to a spelling error in the query), the AI engine may suggest a similar query and use it instead. This object is included in the response only if that mechanism was triggered.
      properties:
        text:
          type: string
          description: The suggested text query
        highlighted:
          type: string
          description: The suggested text query with the HTML emphasis tag added
        score:
          type: number
          description: Estimated accuracy of the suggestion. `1.0` means 100%.
          format: float
          maximum: 1
    items-search-FullTextSearchRequest:
      type: object
      properties:
        query:
          $ref: "#/components/schemas/items-search-SearchQuery"
        page:
          $ref: "#/components/schemas/items-search-PaginationPage"
        limit:
          $ref: "#/components/schemas/items-search-PaginationLimit"
        sortBy:
          $ref: "#/components/schemas/items-search-PaginationSortBy"
        ordering:
          $ref: "#/components/schemas/items-search-PaginationOrdering"
        includeMeta:
          $ref: "#/components/schemas/items-search-PaginationIncludeMeta"
        clientUUID:
          $ref: "#/components/schemas/items-search-ClientUUID"
        personalize:
          $ref: "#/components/schemas/items-search-Personalize"
        correlationId:
          $ref: "#/components/schemas/items-search-CorrelationId"
        searchId:
          $ref: "#/components/schemas/items-search-SearchId"
        sortByMetric:
          $ref: "#/components/schemas/items-search-SortByMetric"
        sortByGeoPoints:
          $ref: "#/components/schemas/items-search-SortByGeoPoint"
        filterGeoPoints:
          $ref: "#/components/schemas/items-search-FilterGeoPoints"
        filterAroundRadius:
          $ref: "#/components/schemas/items-search-FilterAroundRadius"
        filters:
          $ref: "#/components/schemas/items-search-Filters"
        facets:
          $ref: "#/components/schemas/items-search-Facets"
        customFilteredFacets:
          $ref: "#/components/schemas/items-search-CustomFilteredFacets"
        facetsSize:
          $ref: "#/components/schemas/items-search-FacetsSize"
        maxValuesPerFacet:
          $ref: "#/components/schemas/items-search-MaxValuesPerFacet"
        caseSensitiveFacetValues:
          $ref: "#/components/schemas/items-search-CaseSensitiveFacetValues"
        includeFacets:
          $ref: "#/components/schemas/items-search-IncludeFacets"
        facetsOrderBy:
          $ref: "#/components/schemas/items-search-FacetsOrdering"
        context:
          $ref: "#/components/schemas/items-search-Context"
        displayAttributes:
          $ref: "#/components/schemas/items-search-DisplayAttributes"
        distinctFilter:
          $ref: "#/components/schemas/items-search-DistinctFilterSearch"
        ignoreQueryRules:
          $ref: "#/components/schemas/items-search-IgnoreQueryRules"
        excludeQueryRules:
          $ref: "#/components/schemas/items-search-ExcludeQueryRules"
        params:
          $ref: "#/components/schemas/items-search-Params"
        disableQueryClassification:
          $ref: "#/components/schemas/items-search-DisableQueryClassification"
        disableDynamicReranker:
          $ref: "#/components/schemas/items-search-DisableDynamicReranker"
      required:
        - query
    items-search-DisableDynamicReranker:
      type: boolean
      description: If set to `true`, q dynamic reranker is not applied.
      default: false
    items-search-DisableQueryClassification:
      type: boolean
      description: If set to `true`, query classification is not applied.
      default: false
    items-search-DistinctFilterSearch:
      type: object
      description: Distinct filters regulate how many items with the same value of a particular attribute can be returned.
      properties:
        attribute:
          type: string
          description: Name of the attribute to be used for distinct filter
        maxNumItems:
          type: integer
          description: Maximum number of items to be returned per each distinct attribute value
          minimum: 1
        levelRangeModifier:
          type: integer
          description: Level of the category, if the category attribute was used for distinct filter
          minimum: 0
      required:
        - attribute
        - maxNumItems
    items-search-SearchQuery:
      type: string
      description: Query text to use in the search
    items-search-SuggestionResponseWithExplanation:
      type: object
      title: Suggestion search
      properties:
        data:
          type: array
          description: A page of search query suggestions
          items:
            type: object
            description: A search suggestion
            properties:
              _explanation:
                type: object
                description: Explanation of the result
                properties:
                  origin:
                    type: array
                    description: The type of suggestion
                    items:
                      type: string
                      enum:
                        - Manual
                        - Attribute
                        - Event
                  popularityScore:
                    type: number
                    description: Popularity of the suggestion
                  score:
                    type: number
                    description: Score of the suggestion
              suggestion:
                type: string
                description: The suggested search phrase
        extras:
          type: object
          description: Additional information
          properties:
            correlationId:
              $ref: "#/components/schemas/items-search-CorrelationIdInResponse"
            searchId:
              $ref: "#/components/schemas/items-search-SearchIdInResponse"
            facetsOrdering:
              $ref: "#/components/schemas/items-search-FacetsOrderingResponse"
        meta:
          $ref: "#/components/schemas/items-search-PaginationMeta"
    items-search-FullTextSearchResponseWithExplanation:
      type: object
      title: Item search
      properties:
        data:
          $ref: "#/components/schemas/items-search-FoundItemsWithExplanation"
        extras:
          type: object
          description: Additional information
          properties:
            filteredFacets:
              $ref: "#/components/schemas/items-search-ResultFacets"
            allFacets:
              $ref: "#/components/schemas/items-search-ResultFacets"
            customFilteredFacets:
              allOf:
                - type: object
                  description: Facets resulting from the `customFilteredFacets` setting. Only available in `POST` requests.
                - $ref: "#/components/schemas/items-search-ResultFacets"
            correlationId:
              $ref: "#/components/schemas/items-search-CorrelationIdInResponse"
            searchId:
              $ref: "#/components/schemas/items-search-SearchIdInResponse"
            facetsOrdering:
              $ref: "#/components/schemas/items-search-FacetsOrderingResponse"
            suggestions:
              type: array
              description: A list of search suggestions
              items:
                $ref: "#/components/schemas/items-search-FullTextSuggestionSchema"
            usedSuggestion:
              $ref: "#/components/schemas/items-search-UsedSuggestion"
            explanation:
              $ref: "#/components/schemas/items-search-SearchExplanationWithRerankerExplanation"
        meta:
          $ref: "#/components/schemas/items-search-PaginationMeta"
    items-search-SearchExplanationWithRerankerExplanation:
      allOf:
        - $ref: "#/components/schemas/items-search-Explanation"
        - type: object
          properties:
            reranker:
              $ref: "#/components/schemas/items-search-RerankerExplanation"
    items-search-RerankerExplanation:
      type: object
      properties:
        queryClassificationApplied:
          type: boolean
          description: "`true` if query classification was applied."
        dynamicRerankerApplied:
          type: boolean
          description: "`true` if dynamic reranker was applied."
        queryClassificationResult:
          $ref: "#/components/schemas/items-search-QueryClassificationCategories"
    items-search-QueryClassificationCategories:
      type: array
      description: A list of predicted categories and their scores
      items:
        type: object
        properties:
          category:
            type: string
            description: The predicted category.
          score:
            type: number
            description: The score of the predicted category.
          ctr:
            type: number
            description: The CTR of the predicted category.
            format: float
          actions:
            type: array
            items:
              $ref: "#/components/schemas/items-search-SearchResultAction"
          reliabilityLevel:
            $ref: "#/components/schemas/items-search-ReliabilityLevel"
    items-search-ReliabilityLevel:
      type: string
      description: The reliability level indicates how confident we are that a given prediction is the best choice.
      enum:
        - certain
        - veryHigh
        - high
        - medium
        - low
    items-search-SearchResultAction:
      type: string
      description: |
        The action to perform when the reliability level from `minReliabilityLevel` is reached.
        - `staticFilter` will apply a static filter to limit the search results to the predicted category.
        - `elasticFilter` will apply an elastic filter - if there are not enough results from the predicted category, the AI engine will pick items from other categories to meet the minimum number of results.
        - `boosting` will increase the scores of items from the predicted category.

        If reliability levels are met for multiple actions, the priority is:
        1. static filter
        2. elastic filter
        3. boosting
      enum:
        - staticFilter
        - elasticFilter
        - boosting
    items-search-AutocompleteResponse:
      type: object
      title: Item search
      properties:
        data:
          $ref: "#/components/schemas/items-search-FoundItems"
        extras:
          type: object
          description: Additional information
          properties:
            filteredFacets:
              $ref: "#/components/schemas/items-search-ResultFacets"
            allFacets:
              $ref: "#/components/schemas/items-search-ResultFacets"
            customFilteredFacets:
              allOf:
                - type: object
                  description: Facets resulting from the `customFilteredFacets` setting. Only available in `POST` requests.
                - $ref: "#/components/schemas/items-search-ResultFacets"
            correlationId:
              $ref: "#/components/schemas/items-search-CorrelationIdInResponse"
            searchId:
              $ref: "#/components/schemas/items-search-SearchIdInResponse"
            facetsOrdering:
              $ref: "#/components/schemas/items-search-FacetsOrderingResponse"
            suggestions:
              type: array
              description: A list of search suggestions
              items:
                $ref: "#/components/schemas/items-search-FullTextSuggestionSchema"
            usedSuggestion:
              $ref: "#/components/schemas/items-search-UsedSuggestion"
        meta:
          $ref: "#/components/schemas/items-search-PaginationMeta"
    items-search-AutocompleteRequest:
      type: object
      properties:
        query:
          $ref: "#/components/schemas/items-search-SearchQuery"
        page:
          $ref: "#/components/schemas/items-search-PaginationPage"
        limit:
          $ref: "#/components/schemas/items-search-PaginationLimit"
        sortBy:
          $ref: "#/components/schemas/items-search-PaginationSortBy"
        ordering:
          $ref: "#/components/schemas/items-search-PaginationOrdering"
        includeMeta:
          $ref: "#/components/schemas/items-search-PaginationIncludeMeta"
        clientUUID:
          $ref: "#/components/schemas/items-search-ClientUUID"
        sortByMetric:
          $ref: "#/components/schemas/items-search-SortByMetric"
        sortByGeoPoints:
          $ref: "#/components/schemas/items-search-SortByGeoPoint"
        filterGeoPoints:
          $ref: "#/components/schemas/items-search-FilterGeoPoints"
        filterAroundRadius:
          $ref: "#/components/schemas/items-search-FilterAroundRadius"
        filters:
          $ref: "#/components/schemas/items-search-Filters"
        facets:
          $ref: "#/components/schemas/items-search-Facets"
        customFilteredFacets:
          $ref: "#/components/schemas/items-search-CustomFilteredFacets"
        facetsSize:
          $ref: "#/components/schemas/items-search-FacetsSize"
        maxValuesPerFacet:
          $ref: "#/components/schemas/items-search-MaxValuesPerFacet"
        caseSensitiveFacetValues:
          $ref: "#/components/schemas/items-search-CaseSensitiveFacetValues"
        includeFacets:
          $ref: "#/components/schemas/items-search-IncludeFacets"
        facetsOrderBy:
          $ref: "#/components/schemas/items-search-FacetsOrdering"
        context:
          $ref: "#/components/schemas/items-search-Context"
        displayAttributes:
          $ref: "#/components/schemas/items-search-DisplayAttributes"
        distinctFilter:
          $ref: "#/components/schemas/items-search-DistinctFilterSearch"
        ignoreQueryRules:
          $ref: "#/components/schemas/items-search-IgnoreQueryRules"
        excludeQueryRules:
          $ref: "#/components/schemas/items-search-ExcludeQueryRules"
        params:
          $ref: "#/components/schemas/items-search-Params"
        disableQueryClassification:
          $ref: "#/components/schemas/items-search-DisableQueryClassification"
        disableDynamicReranker:
          $ref: "#/components/schemas/items-search-DisableDynamicReranker"
      required:
        - query
    items-search-AutocompleteResponseWithExplanation:
      type: object
      title: Item search
      properties:
        data:
          $ref: "#/components/schemas/items-search-FoundItemsWithExplanation"
        extras:
          type: object
          description: Additional information
          properties:
            filteredFacets:
              $ref: "#/components/schemas/items-search-ResultFacets"
            allFacets:
              $ref: "#/components/schemas/items-search-ResultFacets"
            customFilteredFacets:
              allOf:
                - type: object
                  description: Facets resulting from the `customFilteredFacets` setting. Only available in `POST` requests.
                - $ref: "#/components/schemas/items-search-ResultFacets"
            correlationId:
              $ref: "#/components/schemas/items-search-CorrelationIdInResponse"
            searchId:
              $ref: "#/components/schemas/items-search-SearchIdInResponse"
            facetsOrdering:
              $ref: "#/components/schemas/items-search-FacetsOrderingResponse"
            suggestions:
              type: array
              description: A list of search suggestions
              items:
                $ref: "#/components/schemas/items-search-FullTextSuggestionSchema"
            usedSuggestion:
              $ref: "#/components/schemas/items-search-UsedSuggestion"
            explanation:
              $ref: "#/components/schemas/items-search-SearchExplanationWithRerankerExplanation"
        meta:
          $ref: "#/components/schemas/items-search-PaginationMeta"
    items-search-SearchableAttributesMatchResponse:
      type: object
      title: Searchable attributes match
      properties:
        query:
          type: object
          description: Search query with tokens
          properties:
            value:
              type: string
              description: Search query
            tokens:
              type: array
              description: A list of search query tokens and their positions
              items:
                $ref: "#/components/schemas/items-search-SearchQueryTokens"
        attributes:
          $ref: "#/components/schemas/items-search-ExplainMatchSearchableAttributes"
    items-search-ExplainMatchSearchableAttributes:
      type: array
      description: A list of searchable attributes with value and matched tokens
      items:
        type: object
        properties:
          attribute:
            type: string
            description: Attribute name
          value:
            description: Attribute value
            type: string
          tokens:
            type: array
            description: A list of matched tokens
            items:
              type: object
              properties:
                queryToken:
                  type: string
                  description: Matched token
                type:
                  description: Token type
                  type: string
                  enum:
                    - word
                    - synonym
                start:
                  type: number
                  description: Start position
                end:
                  type: number
                  description: Start position
    items-search-SearchQueryTokens:
      type: object
      title: Search query tokens
      properties:
        token:
          type: string
          description: Search query token
        positions:
          type: array
          description: A list of query token positions
          items:
            type: object
            properties:
              start:
                type: number
                description: Start position
              end:
                type: number
                description: Start position
    items-search-recent-Error:
      type: object
      properties:
        timestamp:
          type: string
          format: date-time
          description: Time when the error occurred
        status:
          type: integer
          description: Status code
        error:
          type: string
          description: Summary of the error
        message:
          type: string
          description: Description of the problem
        path:
          type: string
          description: URL of the requested resource
      required:
        - timestamp
        - status
        - message
    items-search-recent-DeletedSearch:
      type: object
      properties:
        query:
          type: string
          description: Deleted search query. Required if `match` field is set to `query`.
        match:
          type: string
          description: |
            Tells how to match this deleted search on recent searches.

            - `query`: matches only recent searches with provided query
            - `all`: matches all recent searches
          default: query
        timestamp:
          type: string
          format: date-time
          description: Time when the search was deleted. If not present current time is taken.
    recommendation-campaigns-Error:
      type: object
      properties:
        timestamp:
          type: string
          format: date-time
          description: Time when the error occurred
        status:
          type: integer
          description: Status code
        error:
          type: string
          description: Summary of the error
        message:
          type: string
          description: Description of the problem
        path:
          type: string
          description: URL of the requested resource
      required:
        - timestamp
        - status
        - message
    recommendation-campaigns-RecommendationCampaignsResponseV2:
      type: object
      properties:
        meta:
          type: object
          description: Pagination metadata
          properties:
            totalPages:
              type: number
              description: The total number of pages
            totalCount:
              type: number
              description: The total number of campaigns
            page:
              type: number
              description: The current page
            limit:
              type: number
              description: The maximal number of items on a page
            sortedBy:
              type: string
              description: The column (attribute) that the campaigns were sorted by
            ordering:
              type: string
              description: Sorting order
            code:
              type: number
              description: HTTP response code
            link:
              type: array
              description: Links to neighboring pages, first page, and last page in pagination
              items:
                type: object
                properties:
                  url:
                    description: Page URL
                    type: string
                  rel:
                    type: string
                    description: Position of the linked page
                    enum:
                      - first
                      - next
                      - prev
                      - last
        data:
          type: array
          description: Campaign details
          items:
            $ref: "#/components/schemas/recommendation-campaigns-RecommendationCampaignDefinitionV2"
        extras:
          type: object
          properties:
            states:
              type: object
              description: Number of campaigns in particular state after applying filters
              properties:
                active:
                  type: number
                draft:
                  type: number
                paused:
                  type: number
    recommendation-campaigns-RecommendationCampaignDefinitionV2:
      title: Campaign definition
      oneOf:
        - $ref: "#/components/schemas/recommendation-campaigns-SimilarRecommendationCampaignsDefinitionV2"
        - $ref: "#/components/schemas/recommendation-campaigns-MetricsRecommendationCampaignsDefinitionV2"
        - $ref: "#/components/schemas/recommendation-campaigns-CrossSellRecommendationCampaignsDefinitionV2"
        - $ref: "#/components/schemas/recommendation-campaigns-SetComplementRecommendationCampaignsDefinitionV2"
        - $ref: "#/components/schemas/recommendation-campaigns-LastViewedRecommendationCampaignsDefinitionV2"
        - $ref: "#/components/schemas/recommendation-campaigns-PersonalizedRecommendationCampaignsDefinitionV2"
        - $ref: "#/components/schemas/recommendation-campaigns-VisuallySimilarRecommendationCampaignsDefinitionV2"
        - $ref: "#/components/schemas/recommendation-campaigns-ItemComparisonRecommendationCampaignsDefinitionV2"
        - $ref: "#/components/schemas/recommendation-campaigns-RecentInteractionsRecommendationCampaignsDefinitionV2"
        - $ref: "#/components/schemas/recommendation-campaigns-SectionRecommendationCampaignsDefinitionV2"
        - $ref: "#/components/schemas/recommendation-campaigns-AttributeRecommendationCampaignsDefinitionV2"
        - $ref: "#/components/schemas/recommendation-campaigns-NextInteractionRecommendationCampaignsDefinitionV2"
        - $ref: "#/components/schemas/recommendation-campaigns-ExternalItemsRecommendationCampaignsDefinitionV2"
    recommendation-campaigns-ExternalItemsRecommendationCampaignsDefinitionV2:
      title: External items
      allOf:
        - type: object
          required:
            - type
          properties:
            type:
              $ref: "#/components/schemas/recommendation-campaigns-CampaignTypeExternalItems"
            parameters:
              $ref: "#/components/schemas/recommendation-campaigns-WithMetricsRecommendationsCampaignParameters"
        - $ref: "#/components/schemas/recommendation-campaigns-BaseRecommendationCampaignsDefinitionV2"
    recommendation-campaigns-BaseRecommendationCampaignsDefinitionV2:
      type: object
      properties:
        campaignId:
          type: string
          description: Campaign ID
        title:
          $ref: "#/components/schemas/recommendation-campaigns-CampaignTitle"
        slug:
          $ref: "#/components/schemas/recommendation-campaigns-Slug"
        description:
          $ref: "#/components/schemas/recommendation-campaigns-CampaignDescription"
        startDate:
          $ref: "#/components/schemas/recommendation-campaigns-StartDate"
        endDate:
          $ref: "#/components/schemas/recommendation-campaigns-EndDate"
        createdAt:
          type: string
          description: Date when the campaign was created
        updatedAt:
          type: string
          description: Date when the campaign was last updated
        state:
          $ref: "#/components/schemas/recommendation-campaigns-State"
        filterRules:
          $ref: "#/components/schemas/recommendation-campaigns-RecommendationsCampaignFilterRules"
        itemsCatalogId:
          $ref: "#/components/schemas/recommendation-campaigns-ItemsCatalogId"
        additionalResponseAttributes:
          type: array
          description: An array of addtional response attributes.
          items:
            type: string
        slots:
          $ref: "#/components/schemas/recommendation-campaigns-Slots"
        keepSlotsOrder:
          $ref: "#/components/schemas/recommendation-campaigns-KeepSlotsOrder"
        personalizeSlotsOrder:
          $ref: "#/components/schemas/recommendation-campaigns-PersonalizeSlotsOrder"
        boostingStrategies:
          $ref: "#/components/schemas/recommendation-campaigns-BoostingStrategies"
        itemsSource:
          $ref: "#/components/schemas/recommendation-campaigns-ItemsSource"
        abTest:
          $ref: "#/components/schemas/recommendation-campaigns-ABTestInfo"
        crossWorkspaceMode:
          $ref: "#/components/schemas/recommendation-campaigns-CrossWorkspaceMode"
      required:
        - title
        - type
        - startDate
        - state
        - itemsCatalogId
    recommendation-campaigns-CrossWorkspaceMode:
      type: object
      properties:
        enabled:
          type: boolean
          description: Specifies if campaign should support multibrand cross workspace segmentation.
    recommendation-campaigns-ABTestInfo:
      type: object
      description: Information whether campaign is part of an a/b test
      properties:
        experimentId:
          type: integer
          description: Experiment ID
        variantId:
          type: integer
          description: Variant ID
        status:
          type: string
          enum:
            - NotStarted
            - Running
            - Paused
            - Finished
          description: Status
        isBaseline:
          type: boolean
          description: Information whether campaign is a baseline.
    recommendation-campaigns-ItemsSource:
      type: object
      description: |
        The source of item ID or IDs for the recommendation context. This parameter can be passed in all recommendations. In recommendations which don't use item context as part of the recommendation model, the context item can be used only to create filters.

        The item ID source (aggregate or expression) should return a string or an array of strings. If it returns numerical values, the recommendations engine attempts to convert them into strings while processing the request.

        Alternatively, you can pass the `itemId` or `itemsSource` parameter when making a request to generate a recommendation from this campaign. The parameter overrides the settings defined here.
      properties:
        type:
          type: string
          enum:
            - aggregate
            - expression
          description: |
            Type of the source of item ID or IDs for the recommendation context. 

            If the items' source type is 'aggregate', the aggregate result will be used as context items. If the items' source type is 'expression', the expression result will be used as context items.
        id:
          type: string
          description: |
            ID of the items' source for the recommendation context. If the source's type is 'aggregate', this is the aggregate's ID. If the source's type is 'expression', this is the expression's ID.
    recommendation-campaigns-BoostingStrategies:
      type: array
      description: Recommendation boosting strategies
      items:
        $ref: "#/components/schemas/recommendation-campaigns-BoostingStrategy"
    recommendation-campaigns-BoostingStrategy:
      type: object
      description: Boosting strategy allows you to promote or demote specific types of products in recommendation scoring
      properties:
        name:
          type: string
          description: Boosting strategy name
        condition:
          type: string
          description: The condition that indicates on which items the boost will be performed. The condition must comply with the rules of creating filters.
        strength:
          type: number
          description: How much influence the strategy has. Values less than 1.0 allow you to degrade items that meet the condition, values greater than 1.0 allow you to promote items that meet the condition. A strength with a value of 1.0 does not change the scoring.
          format: float
          minimum: 0
          maximum: 2
          default: 1
      required:
        - name
        - condition
        - strength
    recommendation-campaigns-PersonalizeSlotsOrder:
      type: boolean
      default: false
      description: |
        Sort the slots by average personalized slot score. This parameter applies only to personalized and attribute recommendation campaigns.

        If you want to set `personalizeSlotsOrder` to `true`, `keepSlotsOrder` must also be `true`.
    recommendation-campaigns-KeepSlotsOrder:
      type: boolean
      default: true
      description: |
        - When `true`, the `data` array in the response is sorted according to slots. Within each slot, the items are sorted by their score (default) or metric (if selected). For example, if you have 3 slots of 2 items each, the first 2 items in `data` are from the first slot, the second 2 are from the second slot, and the last 2 are from the third slot.
        - When `false`, the `data` array in the response is sorted only according to score (default) or metric (if selected). Slots have no effect.

        The additional `extras.slots` object always shows slots and items as if this setting was `true`.

        If you want to set `personalizeSlotsOrder` to `true`, `keepSlotsOrder` must also be `true`.
    recommendation-campaigns-Slots:
      type: array
      minLength: 1
      description: Recommendation slots. Must contain at least one slot with a non-empty `name`.
      items:
        $ref: "#/components/schemas/recommendation-campaigns-Slot"
    recommendation-campaigns-Slot:
      type: object
      description: Slot allows you to define a separate recommendation frame with its filters and other parameters
      properties:
        name:
          $ref: "#/components/schemas/recommendation-campaigns-SlotName"
        itemMin:
          $ref: "#/components/schemas/recommendation-campaigns-ItemMin"
        itemMax:
          $ref: "#/components/schemas/recommendation-campaigns-ItemMax"
        filterRules:
          $ref: "#/components/schemas/recommendation-campaigns-RecommendationsCampaignSlotFilterRules"
        distinctFilter:
          $ref: "#/components/schemas/recommendation-campaigns-DistinctFilter"
        attribute:
          type: object
          description: The attribute for rows grouping in the section and attribute recommendation campaign.
          properties:
            name:
              description: Name of attribute for rows grouping.
              type: string
            levelRangeModifier:
              description: Restricts the range of products in recommendations to a particular attribute level.
              type: integer
        numRows:
          type: integer
          description: The number of rows in the section recommendation campaign.
        numItems:
          type: integer
          description: The number of products in each row in the section recommendation campaign.
        useDefaultDistinctFilters:
          type: boolean
          description: Specify if slot should override distinctFilter and use defaultDistinctFiltersConfiguration specified for the feed instead.
        useDefaultItemFilters:
          type: boolean
          description: Specify if slot should override item filters and use defaultItemFilters specified for the feed instead.
      required:
        - name
    recommendation-campaigns-DistinctFilter:
      type: object
      description: Distinct filter allows to specify how many recommended items can have the same value of specified attributes.
      properties:
        elastic:
          type: boolean
          description: It allows to complete the recommended items with items which don't meet the distinct filter criteria.
        filters:
          type: array
          minItems: 1
          maxItems: 5
          description: Array of distinct filters
          items:
            type: object
            properties:
              field:
                type: string
                description: Attribute name
              maxNumItems:
                type: number
                format: integer
                description: Max number of items with the same value of the attribute
              levelRangeModifier:
                type: number
                format: integer
                description: Parameter used (for the `category` field) to specify how many categories to cut off from the end
            required:
              - field
              - maxNumItems
      required:
        - elastic
        - filters
    recommendation-campaigns-RecommendationsCampaignSlotFilterRules:
      type: object
      description: Filters that apply to this campaign
      properties:
        filters:
          type: string
          description: Filtering string
        elasticFilters:
          type: string
          description: Filtering string for Elastic filter
    recommendation-campaigns-ItemMax:
      type: integer
      description: The maximal number of items in the campaign or the maximal number of attribute values in the attribute recommendation campaign.
    recommendation-campaigns-ItemMin:
      type: integer
      description: The minimal number of items in the campaign or the minimal number of attribute values in the attribute recommendation campaign.
    recommendation-campaigns-SlotName:
      type: string
      description: Slot name
    recommendation-campaigns-ItemsCatalogId:
      type: string
      description: Only items from this catalog will be recommended.
    recommendation-campaigns-RecommendationsCampaignFilterRules:
      type: object
      description: Filters that apply to this campaign. If the filters contain an attribute used in the default filters of the recommendation model ([**Settings > AI Configuration**](https://help.synerise.com/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-recommendations/#selecting-recommendation-types-and-default-filters)), that default filter is ignored.
      properties:
        excludePurchasedItems:
          type: boolean
          description: When true, the recommendation results will include only items that the profile hasn't purchased before.
        excludePurchasedItemsSinceDays:
          type: number
          format: integer
          description: Limits the application of the `excludePurchasedItems` filter to a specified number of days.
        elasticExcludePurchasedItems:
          type: boolean
          description: This is a setting for Elastic filters.<br>When true, the recommendation results will include only items that the profile hasn't purchased before.
        elasticExcludePurchasedItemsSinceDays:
          type: number
          format: integer
          description: This is a setting for Elastic filters.<br>Limits the application of the `elasticExcludePurchasedItemsSinceDays` filter to a specified number of days.
    recommendation-campaigns-State:
      type: string
      description: Campaign status
      enum:
        - draft
        - active
        - paused
        - deleted
    recommendation-campaigns-EndDate:
      type: string
      description: End date for the campaign
    recommendation-campaigns-StartDate:
      type: string
      description: Start date for the campaign
    recommendation-campaigns-CampaignDescription:
      type: string
      description: Campaign description
    recommendation-campaigns-Slug:
      type: string
      description: Unique identifier of the campaign. Can be used for fetching campaigns instead of the ID. Create meaningful, human-readable slugs for easier work with recommendation campaigns.
    recommendation-campaigns-CampaignTitle:
      type: string
      description: Campaign title
    recommendation-campaigns-WithMetricsRecommendationsCampaignParameters:
      allOf:
        - $ref: "#/components/schemas/recommendation-campaigns-BaseRecommendationsCampaignParameters"
        - type: object
          properties:
            boostMetric:
              type: string
              description: ID of the metric to boost the results by. Metric scores will be combined with recommendation scores, favoring the best-performing results.
            sortMetric:
              type: string
              description: ID of the metric to sort the results by.
            boostMetricStrength:
              type: number
              description: How much influence the `boostMetric` has. Values less than 0 allow you to demote items that have high metric score, values greater than 0 allow you to promote items that have high metric score. A strength with a value of 0 does not change the scoring.
              format: float
              minimum: -100
              maximum: 100
            shuffleNumItems:
              $ref: "#/components/schemas/recommendation-campaigns-ShuffleNumItems"
    recommendation-campaigns-ShuffleNumItems:
      type: integer
      description: When this parameter is provided, this many best item recommendations are provided. A number of them, no more than the value of `itemMax`, are chosen randomly for recommendation.
    recommendation-campaigns-BaseRecommendationsCampaignParameters:
      type: object
      description: Parameters that apply to this campaign
      properties:
        additionalResponseAttributes:
          type: array
          items:
            type: string
          description: An array of additional response attributes.
    recommendation-campaigns-CampaignTypeExternalItems:
      type: string
      description: Campaign type
      enum:
        - external-items
    recommendation-campaigns-NextInteractionRecommendationCampaignsDefinitionV2:
      title: Next interaction
      allOf:
        - type: object
          required:
            - type
          properties:
            type:
              $ref: "#/components/schemas/recommendation-campaigns-CampaignTypeNextInteraction"
            parameters:
              $ref: "#/components/schemas/recommendation-campaigns-WithMetricsRecommendationsCampaignParameters"
        - $ref: "#/components/schemas/recommendation-campaigns-BaseRecommendationCampaignsDefinitionV2"
    recommendation-campaigns-CampaignTypeNextInteraction:
      type: string
      description: Campaign type
      enum:
        - next-interaction
    recommendation-campaigns-AttributeRecommendationCampaignsDefinitionV2:
      title: Attribute
      allOf:
        - type: object
          required:
            - type
          properties:
            type:
              $ref: "#/components/schemas/recommendation-campaigns-CampaignTypeAttribute"
            parameters:
              $ref: "#/components/schemas/recommendation-campaigns-AttributeRecommendationsCampaignParameters"
        - $ref: "#/components/schemas/recommendation-campaigns-BaseRecommendationCampaignsDefinitionV2"
    recommendation-campaigns-AttributeRecommendationsCampaignParameters:
      allOf:
        - $ref: "#/components/schemas/recommendation-campaigns-BaseRecommendationsCampaignParameters"
        - type: object
          properties:
            metadataCatalogId:
              type: string
              description: The id of catalog containing attributes metadata.
    recommendation-campaigns-CampaignTypeAttribute:
      type: string
      description: Campaign type
      enum:
        - attribute
    recommendation-campaigns-SectionRecommendationCampaignsDefinitionV2:
      title: Section
      allOf:
        - type: object
          required:
            - type
          properties:
            type:
              $ref: "#/components/schemas/recommendation-campaigns-CampaignTypeSection"
            parameters:
              $ref: "#/components/schemas/recommendation-campaigns-SectionRecommendationsCampaignParameters"
        - $ref: "#/components/schemas/recommendation-campaigns-BaseRecommendationCampaignsDefinitionV2"
    recommendation-campaigns-SectionRecommendationsCampaignParameters:
      allOf:
        - $ref: "#/components/schemas/recommendation-campaigns-BaseRecommendationsCampaignParameters"
        - type: object
          properties:
            metadataCatalogId:
              type: string
    recommendation-campaigns-CampaignTypeSection:
      type: string
      description: Campaign type
      enum:
        - section
    recommendation-campaigns-RecentInteractionsRecommendationCampaignsDefinitionV2:
      title: Recent interactions
      allOf:
        - type: object
          required:
            - type
          properties:
            type:
              $ref: "#/components/schemas/recommendation-campaigns-CampaignTypeRecentInteractions"
            parameters:
              $ref: "#/components/schemas/recommendation-campaigns-RecentInteractionsRecommendationsCampaignParameters"
        - $ref: "#/components/schemas/recommendation-campaigns-BaseRecommendationCampaignsDefinitionV2"
    recommendation-campaigns-RecentInteractionsRecommendationsCampaignParameters:
      allOf:
        - $ref: "#/components/schemas/recommendation-campaigns-BaseRecommendationsCampaignParameters"
        - type: object
          properties:
            aggregateId:
              type: string
              description: Id of the aggregate which provides events as a base of recommendations.
            personalizedBoostingStrength:
              $ref: "#/components/schemas/recommendation-campaigns-PersonalizedBoostingStrength"
    recommendation-campaigns-PersonalizedBoostingStrength:
      type: number
      description: How much influence the personalized scoring has. Greater values allow you to promote items that have high personalized score. A strength with a value of 0 does not change the scoring.
      format: float
      minimum: 0
      maximum: 100
      default: 0
    recommendation-campaigns-CampaignTypeRecentInteractions:
      type: string
      description: Campaign type
      enum:
        - recent-interactions
    recommendation-campaigns-ItemComparisonRecommendationCampaignsDefinitionV2:
      title: Comparison
      allOf:
        - type: object
          required:
            - type
          properties:
            type:
              $ref: "#/components/schemas/recommendation-campaigns-CampaignTypeItemComparison"
            parameters:
              $ref: "#/components/schemas/recommendation-campaigns-WithMetricsRecommendationsCampaignParameters"
        - $ref: "#/components/schemas/recommendation-campaigns-BaseRecommendationCampaignsDefinitionV2"
    recommendation-campaigns-CampaignTypeItemComparison:
      type: string
      description: Campaign type
      enum:
        - item-comparison
    recommendation-campaigns-VisuallySimilarRecommendationCampaignsDefinitionV2:
      title: Visually similar
      allOf:
        - type: object
          required:
            - type
          properties:
            type:
              $ref: "#/components/schemas/recommendation-campaigns-CampaignTypeVisuallySimilar"
            parameters:
              $ref: "#/components/schemas/recommendation-campaigns-WithMetricsRecommendationsCampaignParameters"
        - $ref: "#/components/schemas/recommendation-campaigns-BaseRecommendationCampaignsDefinitionV2"
    recommendation-campaigns-CampaignTypeVisuallySimilar:
      type: string
      description: Campaign type
      enum:
        - visually-similar
    recommendation-campaigns-PersonalizedRecommendationCampaignsDefinitionV2:
      title: Personalized
      allOf:
        - type: object
          required:
            - type
          properties:
            type:
              $ref: "#/components/schemas/recommendation-campaigns-CampaignTypePersonalized"
            parameters:
              $ref: "#/components/schemas/recommendation-campaigns-BaseRecommendationsCampaignParameters"
        - $ref: "#/components/schemas/recommendation-campaigns-BaseRecommendationCampaignsDefinitionV2"
    recommendation-campaigns-CampaignTypePersonalized:
      type: string
      description: Campaign type
      enum:
        - personalized
    recommendation-campaigns-LastViewedRecommendationCampaignsDefinitionV2:
      title: Last viewed
      allOf:
        - type: object
          required:
            - type
          properties:
            type:
              $ref: "#/components/schemas/recommendation-campaigns-CampaignTypeLastViewed"
            parameters:
              $ref: "#/components/schemas/recommendation-campaigns-BaseRecommendationsCampaignParameters"
        - $ref: "#/components/schemas/recommendation-campaigns-BaseRecommendationCampaignsDefinitionV2"
    recommendation-campaigns-CampaignTypeLastViewed:
      type: string
      description: Campaign type
      enum:
        - last-viewed
    recommendation-campaigns-SetComplementRecommendationCampaignsDefinitionV2:
      title: Complementary
      allOf:
        - type: object
          required:
            - type
          properties:
            type:
              $ref: "#/components/schemas/recommendation-campaigns-CampaignTypeComplementary"
            parameters:
              $ref: "#/components/schemas/recommendation-campaigns-SetComplementRecommendationsCampaignParameters"
        - $ref: "#/components/schemas/recommendation-campaigns-BaseRecommendationCampaignsDefinitionV2"
    recommendation-campaigns-SetComplementRecommendationsCampaignParameters:
      allOf:
        - $ref: "#/components/schemas/recommendation-campaigns-BaseRecommendationsCampaignParameters"
        - type: object
          properties:
            itemSimilarity:
              type: integer
              minimum: 0
              maximum: 5
              description: Similarity between items in the cart and the recommended items. Higher values decrease the similarity.
            recommendationVariety:
              type: number
              format: float
              minimum: 0
              maximum: 0.9
              description: Similarity between recommended items - higher values will result in more variety within the recommended item set.
            personalizedBoostingStrength:
              $ref: "#/components/schemas/recommendation-campaigns-PersonalizedBoostingStrength"
    recommendation-campaigns-CampaignTypeComplementary:
      type: string
      description: Campaign type
      enum:
        - set-complement
    recommendation-campaigns-CrossSellRecommendationCampaignsDefinitionV2:
      title: Cross-sell
      allOf:
        - type: object
          required:
            - type
          properties:
            type:
              $ref: "#/components/schemas/recommendation-campaigns-CampaignTypeCrossSell"
            parameters:
              $ref: "#/components/schemas/recommendation-campaigns-WithMetricsRecommendationsCampaignParameters"
        - $ref: "#/components/schemas/recommendation-campaigns-BaseRecommendationCampaignsDefinitionV2"
    recommendation-campaigns-CampaignTypeCrossSell:
      type: string
      description: Campaign type
      enum:
        - cross-sell
    recommendation-campaigns-MetricsRecommendationCampaignsDefinitionV2:
      title: Top items
      allOf:
        - type: object
          required:
            - type
          properties:
            type:
              $ref: "#/components/schemas/recommendation-campaigns-CampaignTypeMetrics"
            parameters:
              $ref: "#/components/schemas/recommendation-campaigns-MetricsRecommendationsCampaignParameters"
        - $ref: "#/components/schemas/recommendation-campaigns-BaseRecommendationCampaignsDefinitionV2"
    recommendation-campaigns-MetricsRecommendationsCampaignParameters:
      allOf:
        - $ref: "#/components/schemas/recommendation-campaigns-WithMetricsRecommendationsCampaignParameters"
        - type: object
          properties:
            personalizedBoostingStrength:
              $ref: "#/components/schemas/recommendation-campaigns-PersonalizedBoostingStrength"
          required:
            - sortMetric
    recommendation-campaigns-CampaignTypeMetrics:
      type: string
      description: Campaign type
      enum:
        - metrics
    recommendation-campaigns-SimilarRecommendationCampaignsDefinitionV2:
      title: Similar
      allOf:
        - type: object
          required:
            - type
          properties:
            type:
              $ref: "#/components/schemas/recommendation-campaigns-CampaignTypeSimilar"
            parameters:
              $ref: "#/components/schemas/recommendation-campaigns-WithMetricsRecommendationsCampaignParameters"
        - $ref: "#/components/schemas/recommendation-campaigns-BaseRecommendationCampaignsDefinitionV2"
    recommendation-campaigns-CampaignTypeSimilar:
      type: string
      description: Campaign type
      enum:
        - similar
    recommendation-campaigns-NextInteractionRecommendationCampaignsCreateRequestV2:
      title: Next interaction
      allOf:
        - type: object
          required:
            - type
          properties:
            type:
              $ref: "#/components/schemas/recommendation-campaigns-CampaignTypeNextInteraction"
            parameters:
              allOf:
                - $ref: "#/components/schemas/recommendation-campaigns-WithMetricsRecommendationsCampaignParameters"
                - type: object
                  properties:
                    personalizedBoostingStrength:
                      $ref: "#/components/schemas/recommendation-campaigns-PersonalizedBoostingStrength"
        - $ref: "#/components/schemas/recommendation-campaigns-BaseRecommendationCampaignsCreateRequestV2"
    recommendation-campaigns-BaseRecommendationCampaignsCreateRequestV2:
      type: object
      properties:
        title:
          $ref: "#/components/schemas/recommendation-campaigns-CampaignTitle"
        slug:
          $ref: "#/components/schemas/recommendation-campaigns-Slug"
        description:
          $ref: "#/components/schemas/recommendation-campaigns-CampaignDescription"
        startDate:
          $ref: "#/components/schemas/recommendation-campaigns-StartDate"
        endDate:
          $ref: "#/components/schemas/recommendation-campaigns-EndDate"
        state:
          $ref: "#/components/schemas/recommendation-campaigns-State"
        filterRules:
          $ref: "#/components/schemas/recommendation-campaigns-RecommendationsCampaignFilterRules"
        itemsCatalogId:
          $ref: "#/components/schemas/recommendation-campaigns-ItemsCatalogId"
        slots:
          $ref: "#/components/schemas/recommendation-campaigns-Slots"
        keepSlotsOrder:
          $ref: "#/components/schemas/recommendation-campaigns-KeepSlotsOrder"
        personalizeSlotsOrder:
          $ref: "#/components/schemas/recommendation-campaigns-PersonalizeSlotsOrder"
        boostingStrategies:
          $ref: "#/components/schemas/recommendation-campaigns-BoostingStrategies"
        itemsSource:
          $ref: "#/components/schemas/recommendation-campaigns-ItemsSource"
      required:
        - title
        - type
        - itemsCatalogId
        - slots
    recommendation-campaigns-ExternalItemsRecommendationCampaignCreateRequestV2:
      title: External items
      allOf:
        - type: object
          required:
            - type
          properties:
            type:
              $ref: "#/components/schemas/recommendation-campaigns-CampaignTypeExternalItems"
            parameters:
              allOf:
                - $ref: "#/components/schemas/recommendation-campaigns-WithMetricsRecommendationsCampaignParameters"
                - type: object
                  properties:
                    personalizedBoostingStrength:
                      $ref: "#/components/schemas/recommendation-campaigns-PersonalizedBoostingStrength"
        - $ref: "#/components/schemas/recommendation-campaigns-BaseRecommendationCampaignsCreateRequestV2"
    recommendation-campaigns-AttributeRecommendationCampaignsCreateRequestV2:
      title: Attribute
      allOf:
        - type: object
          required:
            - type
          properties:
            type:
              $ref: "#/components/schemas/recommendation-campaigns-CampaignTypeAttribute"
            parameters:
              $ref: "#/components/schemas/recommendation-campaigns-AttributeRecommendationsCampaignParameters"
        - $ref: "#/components/schemas/recommendation-campaigns-BaseRecommendationCampaignsCreateRequestV2"
    recommendation-campaigns-SectionRecommendationCampaignsCreateRequestV2:
      title: Section
      allOf:
        - type: object
          required:
            - type
          properties:
            type:
              $ref: "#/components/schemas/recommendation-campaigns-CampaignTypeSection"
            parameters:
              $ref: "#/components/schemas/recommendation-campaigns-SectionRecommendationsCampaignParameters"
        - $ref: "#/components/schemas/recommendation-campaigns-BaseRecommendationCampaignsCreateRequestV2"
    recommendation-campaigns-RecentInteractionsRecommendationCampaignsCreateRequestV2:
      title: Recent interactions
      allOf:
        - type: object
          required:
            - type
          properties:
            type:
              $ref: "#/components/schemas/recommendation-campaigns-CampaignTypeRecentInteractions"
            parameters:
              $ref: "#/components/schemas/recommendation-campaigns-RecentInteractionsRecommendationsCampaignParameters"
        - $ref: "#/components/schemas/recommendation-campaigns-BaseRecommendationCampaignsCreateRequestV2"
    recommendation-campaigns-ItemComparisonRecommendationCampaignsCreateRequestV2:
      title: Comparison
      allOf:
        - type: object
          required:
            - type
          properties:
            type:
              $ref: "#/components/schemas/recommendation-campaigns-CampaignTypeItemComparison"
            parameters:
              allOf:
                - $ref: "#/components/schemas/recommendation-campaigns-WithMetricsRecommendationsCampaignParameters"
                - type: object
                  properties:
                    personalizedBoostingStrength:
                      $ref: "#/components/schemas/recommendation-campaigns-PersonalizedBoostingStrength"
        - $ref: "#/components/schemas/recommendation-campaigns-BaseRecommendationCampaignsCreateRequestV2"
    recommendation-campaigns-VisuallySimilarRecommendationCampaignsCreateRequestV2:
      title: Visually similar
      allOf:
        - type: object
          required:
            - type
          properties:
            type:
              $ref: "#/components/schemas/recommendation-campaigns-CampaignTypeVisuallySimilar"
            parameters:
              allOf:
                - $ref: "#/components/schemas/recommendation-campaigns-WithMetricsRecommendationsCampaignParameters"
                - type: object
                  properties:
                    personalizedBoostingStrength:
                      $ref: "#/components/schemas/recommendation-campaigns-PersonalizedBoostingStrength"
        - $ref: "#/components/schemas/recommendation-campaigns-BaseRecommendationCampaignsCreateRequestV2"
    recommendation-campaigns-PersonalizedRecommendationCampaignsCreateRequestV2:
      title: Personalized
      allOf:
        - type: object
          required:
            - type
          properties:
            type:
              $ref: "#/components/schemas/recommendation-campaigns-CampaignTypePersonalized"
            parameters:
              $ref: "#/components/schemas/recommendation-campaigns-BaseRecommendationsCampaignParameters"
        - $ref: "#/components/schemas/recommendation-campaigns-BaseRecommendationCampaignsCreateRequestV2"
    recommendation-campaigns-LastViewedRecommendationCampaignsCreateRequestV2:
      title: Last viewed
      allOf:
        - type: object
          required:
            - type
          properties:
            type:
              $ref: "#/components/schemas/recommendation-campaigns-CampaignTypeLastViewed"
            parameters:
              allOf:
                - $ref: "#/components/schemas/recommendation-campaigns-BaseRecommendationsCampaignParameters"
                - type: object
                  properties:
                    personalizedBoostingStrength:
                      $ref: "#/components/schemas/recommendation-campaigns-PersonalizedBoostingStrength"
        - $ref: "#/components/schemas/recommendation-campaigns-BaseRecommendationCampaignsCreateRequestV2"
    recommendation-campaigns-SetComplementRecommendationCampaignsCreateRequestV2:
      title: Complementary
      allOf:
        - type: object
          required:
            - type
          properties:
            type:
              $ref: "#/components/schemas/recommendation-campaigns-CampaignTypeComplementary"
            parameters:
              $ref: "#/components/schemas/recommendation-campaigns-SetComplementRecommendationsCampaignParameters"
        - $ref: "#/components/schemas/recommendation-campaigns-BaseRecommendationCampaignsCreateRequestV2"
    recommendation-campaigns-CrossSellRecommendationCampaignsCreateRequestV2:
      title: Cross-sell
      allOf:
        - type: object
          required:
            - type
          properties:
            type:
              $ref: "#/components/schemas/recommendation-campaigns-CampaignTypeCrossSell"
            parameters:
              allOf:
                - $ref: "#/components/schemas/recommendation-campaigns-WithMetricsRecommendationsCampaignParameters"
                - type: object
                  properties:
                    personalizedBoostingStrength:
                      $ref: "#/components/schemas/recommendation-campaigns-PersonalizedBoostingStrength"
        - $ref: "#/components/schemas/recommendation-campaigns-BaseRecommendationCampaignsCreateRequestV2"
    recommendation-campaigns-MetricsRecommendationCampaignsCreateRequestV2:
      title: Top items
      allOf:
        - type: object
          required:
            - type
          properties:
            type:
              $ref: "#/components/schemas/recommendation-campaigns-CampaignTypeMetrics"
            parameters:
              $ref: "#/components/schemas/recommendation-campaigns-MetricsRecommendationsCampaignParameters"
        - $ref: "#/components/schemas/recommendation-campaigns-BaseRecommendationCampaignsCreateRequestV2"
    recommendation-campaigns-SimilarRecommendationCampaignsCreateRequestV2:
      title: Similar
      allOf:
        - type: object
          required:
            - type
          properties:
            type:
              $ref: "#/components/schemas/recommendation-campaigns-CampaignTypeSimilar"
            parameters:
              allOf:
                - $ref: "#/components/schemas/recommendation-campaigns-WithMetricsRecommendationsCampaignParameters"
                - type: object
                  properties:
                    personalizedBoostingStrength:
                      $ref: "#/components/schemas/recommendation-campaigns-PersonalizedBoostingStrength"
        - $ref: "#/components/schemas/recommendation-campaigns-BaseRecommendationCampaignsCreateRequestV2"
    recommendation-campaigns-RecommendationCampaignUpdateRequest:
      oneOf:
        - $ref: "#/components/schemas/recommendation-campaigns-RecommendationCampaignDefinitionV2"
        - $ref: "#/components/schemas/recommendation-campaigns-RecommendationCampaignUpdateFromAnotherCampaign"
    recommendation-campaigns-RecommendationCampaignUpdateFromAnotherCampaign:
      title: Copy from another campaign
      type: object
      properties:
        copyConfigurationFrom:
          type: string
          description: |
            Source campaign ID.

            When you copy from another campaign:
            - the following campaign data is NOT updated:
              - `title`
              - `state`
              - `start_date`
              - `end_date`
              - `campaignId`
              - `createdAt`
            - `modified_by_user_id` changes to the user who performed the update
      required:
        - copyConfigurationFrom
    recommendation-campaigns-RecommendationStateChangeResponseV2:
      type: array
      description: Array of updated campaigns IDs.
      items:
        type: string
    recommendation-campaigns-RecommendationStateChangeRequestV2:
      type: object
      properties:
        state:
          $ref: "#/components/schemas/recommendation-campaigns-State"
        ids:
          type: array
          minItems: 1
          maxItems: 10
          description: An array of campaign IDs.
          items:
            type: string
      required:
        - state
        - ids
    recommendation-campaigns-SimpleRecommendationCampaignsV2:
      type: array
      items:
        type: object
        properties:
          campaignId:
            type: string
            description: Campaign ID
          title:
            type: string
            description: Campaign title
          type:
            type: string
            description: Campaign type
    recommendations-api-materializer-Error:
      type: object
      properties:
        timestamp:
          type: string
          format: date-time
          description: Time when the error occurred
        status:
          type: integer
          description: Status code
        error:
          type: string
          description: Summary of the error
        message:
          type: string
          description: Description of the problem
        path:
          type: string
          description: URL of the requested resource
      required:
        - timestamp
        - status
        - message
    recommendations-api-materializer-RecommendationResponseSchemaV2-materializer:
      type: object
      properties:
        data:
          type: array
          description: Recommended items
          items:
            type: object
            properties:
              itemId:
                type: string
                description: Item identifier
            required:
              - itemId
        extras:
          type: object
          description: Additional data
          properties:
            correlationId:
              type: string
              description: Correlation identifier of a recommendation request
            contextItems:
              type: array
              description: A list of context items provided in request
              items:
                type: object
                properties:
                  itemId:
                    type: string
                    description: Item identifier (`itemId` in item catalog)
                additionalProperties: {}
                required:
                  - itemId
            slots:
              type: array
              description: A list of slots data
              items:
                type: object
                properties:
                  id:
                    type: integer
                    description: Slot identifier. Matches the index (zero-based numbering) of the slot provided in request
                  name:
                    type: string
                    description: Slot name provided in request
                  itemIds:
                    type: array
                    description: A list of item ids that meet the slot criteria
                    items:
                      type: string
                      description: Item identifier (`itemId` in item catalog)
                  error:
                    $ref: "#/components/schemas/recommendations-api-materializer-SlotError"
                required:
                  - id
                  - itemIds
          required:
            - correlationId
            - slots
    recommendations-api-materializer-SlotError:
      type: object
      description: Error details, if applicable
      properties:
        status:
          type: integer
          description: Status code
        error:
          type: string
          description: Summary of the error
        message:
          type: string
          description: Description of the problem
      required:
        - status
        - error
        - message
    recommendations-api-materializer-PostRecommendationsRequest:
      allOf:
        - type: object
          properties:
            clientUUID:
              type: string
              description: |
                Profile UUID. This parameter is required for these recommendation types:
                  - Personalized
                  - Last seen
                  - Recent interactions
                  - Section
                  - Attribute

                This parameter can be passed in all recommendations. In recommendations which don't require the customer context, it can still be used to create filters.
            campaignId:
              type: string
              description: Recommendation campaign ID for establishing the context
            slug:
              type: string
              description: Recommendation campaign slug for establishing the context
        - $ref: "#/components/schemas/recommendations-api-materializer-BasePostRecommendationsRequest"
    recommendations-api-materializer-BasePostRecommendationsRequest:
      type: object
      properties:
        items:
          type: array
          description: |
            An array of item identifiers (`itemId` in the item feed) for the context. This could be, for example, the current basket, or the item that is currently being viewed.  

            This overrides the `itemsSource` settings of the campaign definition.

            This parameter can be passed in all recommendations. In recommendations which don't use the context item as part of the recommendation model, the context item can only be used to create filters.

            Alternatively, you can use the `itemsSource` object to get item IDs from an aggregate or expression. `items` and `itemsSource` can't be used at the same time.
          items:
            type: string
            description: "`itemId` from the item feed"
        itemsSource:
          type: object
          description: |
            Source of the Item ID or item IDs for the recommendation context.

            This overrides the `itemsSource` settings of the campaign definition.

            This parameter can be passed in all recommendations. In recommendations which don't use the context item as part of the recommendation model, the context item can only be used to create filters.

            The item ID source (aggregate or expression) should return a string or an array of strings. If it returns numerical values, the recommendations engine attempts to convert them into strings while processing the request.

            Alternatively, you can pass the `itemId` parameter to define context items directly. Only one of these options is allowed at the same time.
          properties:
            type:
              $ref: "#/components/schemas/recommendations-api-materializer-RecommendationRequestItemsSourceType"
            id:
              $ref: "#/components/schemas/recommendations-api-materializer-RecommendationRequestItemsSourceId"
        itemsExcluded:
          type: array
          minItems: 0
          description: Items (identified by `itemId` in the item feed) that will be excluded from the generated recommendations. For example, items already added to the basket.
          items:
            type: string
            description: Items (identified by `itemId` in the item feed) that will be excluded from the generated recommendations. For example, items already added to the basket.
        additionalFilters:
          type: string
          description: |
            <hr>
            <strong>IMPORTANT</strong>:

            - The `filtersJoiner` attribute is REQUIRED when `additionalFilters` is included. If `filtersJoiner` is missing, the additional filters do not work.  
            - Do NOT send multiple instances of this parameter.

            <hr>

            Additional filters. These are merged with the campaign's own filters according to the logic in `filtersJoiner`.

            This parameter must include all the additional filters as a single string, for example `additionalFilters=effectivePrice>300 AND effectivePrice<400` (the spaces are required).
          example: effectivePrice>300 AND effectivePrice<400
        filtersJoiner:
          type: string
          enum:
            - AND
            - OR
            - REPLACE
          description: |
            Defines the logic of merging `additionalFilters` with the campaign's existing filters.
            - `REPLACE` replaces the campaign's filters with your filters.
            - `AND` matches if both your filters and the campaign filters are met.
            - `OR` matches if at least one of the filters is met.
        additionalElasticFilters:
          type: string
          description: |
            <hr>
            <strong>IMPORTANT</strong>:

            - The `elasticFiltersJoiner` attribute is REQUIRED when `additionalElasticFilters` is included. If `elasticFiltersJoiner` is missing, the additional filters do not work.  
            - Do NOT send multiple instances of this parameter.

            <hr>

            Additional elastic filters. These are merged with the campaign's own elastic filters according to the logic in `elasticFiltersJoiner`.

            This parameter must include all the additional filters as a single string, for example `additionalElasticFilters=effectivePrice>300 AND effectivePrice<400` (the spaces are required).
          example: effectivePrice>300 AND effectivePrice<400
        elasticFiltersJoiner:
          type: string
          enum:
            - AND
            - OR
            - REPLACE
          description: |
            Defines the logic of merging `additionalElasticFilters` with the campaign's existing elastic filters.
            - `REPLACE` replaces the campaign's filters with your filters.
            - `AND` matches if both your filters and the campaign filters are met.
            - `OR` matches if at least one of the filters is met.
        displayAttributes:
          type: array
          minItems: 0
          items:
            type: string
          description: An array of item attributes which value will be returned in a recommendation response. The array will be merged together with the configuration of the recommendation.
        includeContextItems:
          type: boolean
          description: When true, the recommendation response will include context items metadata.
        recommendedItemsFromExternalModel:
          type: array
          minItems: 0
          items:
            type: array
            items:
              type: string
          description: |
            Items provided by an external recommendation model to be returned as recommendation results.

            This parameter is used with campaigns of type "external-items".
        inventoryContext:
          $ref: "#/components/schemas/recommendations-api-materializer-InventoryContext"
        params:
          $ref: "#/components/schemas/recommendations-api-materializer-ParamsMaterializer"
    recommendations-api-materializer-ParamsMaterializer:
      type: object
      example:
        source: mobile
      description: Extra parameters that will be added to the `recommendation.generated` event. The total size must not exceed 500 bytes.
      additionalProperties: true
    recommendations-api-materializer-InventoryContext:
      description: |
        Inventory context used to evaluate inventory-related filters and boosting strategies.
        Can be either a single inventory context or
        a multi-inventory context (set of channel IDs per inventory).
      oneOf:
        - $ref: "#/components/schemas/recommendations-api-materializer-SingleInventoryContext"
        - $ref: "#/components/schemas/recommendations-api-materializer-MultiInventoryContext"
    recommendations-api-materializer-MultiInventoryContext:
      type: object
      description: |
        Multi-inventory context where each inventory can have its own set of channel IDs.
      properties:
        inventoryCatalogs:
          type: object
          additionalProperties:
            $ref: "#/components/schemas/recommendations-api-materializer-InventoryContextDefinition"
          description: |
            Map of inventory ID to inventory context definition. Each inventory can have its own set of channel IDs.
      required:
        - inventoryCatalogs
    recommendations-api-materializer-InventoryContextDefinition:
      type: object
      description: |
        Context definition for a specific inventory.
      properties:
        channelIds:
          type: array
          items:
            type: string
          description: |
            List of channel identifiers for this specific inventory.
    recommendations-api-materializer-SingleInventoryContext:
      type: object
      description: |
        Single inventory context.
      properties:
        channelIds:
          type: array
          items:
            type: string
          description: |
            List of channel identifiers used to evaluate inventory-related filters and boosting strategies.
      required:
        - channelIds
    recommendations-api-materializer-RecommendationRequestItemsSourceId:
      type: string
      description: ID of the items' source (aggregate or expression)
    recommendations-api-materializer-RecommendationRequestItemsSourceType:
      type: string
      enum:
        - aggregate
        - expression
      description: Type of the items' source.
    recommendations-api-materializer-PostRecommendationsWithIdentifierValueRequest:
      allOf:
        - type: object
          required:
            - identifierValue
          properties:
            identifierValue:
              type: string
              description: Value of the identifier selected in the path attributes
        - $ref: "#/components/schemas/recommendations-api-materializer-BasePostRecommendationsRequest"
    recommendations-api-materializer-PreviewAttributeRecommendationCampaignsCreateRequest:
      title: Attribute
      allOf:
        - type: object
          required:
            - type
          properties:
            type:
              $ref: "#/components/schemas/recommendations-api-materializer-CampaignTypeAttribute"
            parameters:
              $ref: "#/components/schemas/recommendations-api-materializer-AttributeRecommendationsCampaignParameters"
        - $ref: "#/components/schemas/recommendations-api-materializer-BaseRecommendationCampaignsPreviewRequest"
    recommendations-api-materializer-BaseRecommendationCampaignsPreviewRequest:
      type: object
      properties:
        title:
          $ref: "#/components/schemas/recommendations-api-materializer-CampaignTitle"
        campaignId:
          $ref: "#/components/schemas/recommendations-api-materializer-CampaignId"
        filterRules:
          $ref: "#/components/schemas/recommendations-api-materializer-RecommendationsCampaignFilterRules"
        itemsCatalogId:
          $ref: "#/components/schemas/recommendations-api-materializer-ItemsCatalogId"
        slots:
          $ref: "#/components/schemas/recommendations-api-materializer-Slots"
        keepSlotsOrder:
          $ref: "#/components/schemas/recommendations-api-materializer-KeepSlotsOrder"
        personalizeSlotsOrder:
          $ref: "#/components/schemas/recommendations-api-materializer-PersonalizeSlotsOrder"
        boostingStrategies:
          $ref: "#/components/schemas/recommendations-api-materializer-BoostingStrategies"
        itemsSource:
          $ref: "#/components/schemas/recommendations-api-materializer-ItemsSource"
      required:
        - type
        - itemsCatalogId
        - slots
    recommendations-api-materializer-ItemsSource:
      type: object
      description: |
        The source of item ID or IDs for the recommendation context. This parameter can be passed in all recommendations. In recommendations which don't use item context as part of the recommendation model, the context item can be used only to create filters.

        The item ID source (aggregate or expression) should return a string or an array of strings. If it returns numerical values, the recommendations engine attempts to convert them into strings while processing the request.

        Alternatively, you can pass the `itemId` or `itemsSource` parameter when making a request to generate a recommendation from this campaign. The parameter overrides the settings defined here.
      properties:
        type:
          type: string
          enum:
            - aggregate
            - expression
          description: |
            Type of the source of item ID or IDs for the recommendation context. 

            If the items' source type is 'aggregate', the aggregate result will be used as context items. If the items' source type is 'expression', the expression result will be used as context items.
        id:
          type: string
          description: |
            ID of the items' source for the recommendation context. If the source's type is 'aggregate', this is the aggregate's ID. If the source's type is 'expression', this is the expression's ID.
    recommendations-api-materializer-BoostingStrategies:
      type: array
      description: Recommendation boosting strategies
      items:
        $ref: "#/components/schemas/recommendations-api-materializer-BoostingStrategy"
    recommendations-api-materializer-BoostingStrategy:
      type: object
      description: Boosting strategy allows you to promote or demote specific types of products in recommendation scoring
      properties:
        name:
          type: string
          description: Boosting strategy name
        condition:
          type: string
          description: The condition that indicates on which items the boost will be performed. The condition must comply with the rules of creating filters.
        strength:
          type: number
          description: How much influence the strategy has. Values less than 1.0 allow you to degrade items that meet the condition, values greater than 1.0 allow you to promote items that meet the condition. A strength with a value of 1.0 does not change the scoring.
          format: float
          minimum: 0
          maximum: 2
          default: 1
      required:
        - name
        - condition
        - strength
    recommendations-api-materializer-PersonalizeSlotsOrder:
      type: boolean
      default: false
      description: |
        Sort the slots by average personalized slot score. This parameter applies only to personalized and attribute recommendation campaigns.

        If you want to set `personalizeSlotsOrder` to `true`, `keepSlotsOrder` must also be `true`.
    recommendations-api-materializer-KeepSlotsOrder:
      type: boolean
      default: true
      description: |
        - When `true`, the `data` array in the response is sorted according to slots. Within each slot, the items are sorted by their score (default) or metric (if selected). For example, if you have 3 slots of 2 items each, the first 2 items in `data` are from the first slot, the second 2 are from the second slot, and the last 2 are from the third slot.
        - When `false`, the `data` array in the response is sorted only according to score (default) or metric (if selected). Slots have no effect.

        The additional `extras.slots` object always shows slots and items as if this setting was `true`.

        If you want to set `personalizeSlotsOrder` to `true`, `keepSlotsOrder` must also be `true`.
    recommendations-api-materializer-Slots:
      type: array
      minLength: 1
      description: Recommendation slots. Must contain at least one slot with a non-empty `name`.
      items:
        $ref: "#/components/schemas/recommendations-api-materializer-Slot"
    recommendations-api-materializer-Slot:
      type: object
      description: Slot allows you to define a separate recommendation frame with its filters and other parameters
      properties:
        name:
          $ref: "#/components/schemas/recommendations-api-materializer-SlotName"
        itemMin:
          $ref: "#/components/schemas/recommendations-api-materializer-ItemMin"
        itemMax:
          $ref: "#/components/schemas/recommendations-api-materializer-ItemMax"
        filterRules:
          $ref: "#/components/schemas/recommendations-api-materializer-RecommendationsCampaignSlotFilterRules"
        distinctFilter:
          $ref: "#/components/schemas/recommendations-api-materializer-DistinctFilter"
        attribute:
          type: object
          description: The attribute for rows grouping in the section and attribute recommendation campaign.
          properties:
            name:
              description: Name of attribute for rows grouping.
              type: string
            levelRangeModifier:
              description: Restricts the range of products in recommendations to a particular attribute level.
              type: integer
        numRows:
          type: integer
          description: The number of rows in the section recommendation campaign.
        numItems:
          type: integer
          description: The number of products in each row in the section recommendation campaign.
      required:
        - name
    recommendations-api-materializer-DistinctFilter:
      type: object
      description: Distinct filter allows to specify how many recommended items can have the same value of specified attributes.
      properties:
        elastic:
          type: boolean
          description: It allows to complete the recommended items with items which don't meet the distinct filter criteria.
        filters:
          type: array
          minItems: 1
          maxItems: 5
          description: Array of distinct filters
          items:
            type: object
            properties:
              field:
                type: string
                description: Attribute name
              maxNumItems:
                type: number
                format: integer
                description: Max number of items with the same value of the attribute
              levelRangeModifier:
                type: number
                format: integer
                description: Parameter used (for the `category` field) to specify how many categories to cut off from the end
            required:
              - field
              - maxNumItems
      required:
        - elastic
        - filters
    recommendations-api-materializer-RecommendationsCampaignSlotFilterRules:
      type: object
      description: Filters that apply to this campaign
      properties:
        filters:
          type: string
          description: Filtering string
        elasticFilters:
          type: string
          description: Filtering string for Elastic filter
    recommendations-api-materializer-ItemMax:
      type: integer
      description: The maximal number of items in the campaign or the maximal number of attribute values in the attribute recommendation campaign.
    recommendations-api-materializer-ItemMin:
      type: integer
      description: The minimal number of items in the campaign or the minimal number of attribute values in the attribute recommendation campaign.
    recommendations-api-materializer-SlotName:
      type: string
      description: Slot name
    recommendations-api-materializer-ItemsCatalogId:
      type: string
      description: Only items from this catalog will be recommended.
    recommendations-api-materializer-RecommendationsCampaignFilterRules:
      type: object
      description: Filters that apply to this campaign. If the filters contain an attribute used in the default filters of the recommendation model ([**Settings > AI Configuration**](https://help.synerise.com/docs/settings/configuration/ai-engine-configuration/engine-configuration-for-recommendations/#selecting-recommendation-types-and-default-filters)), that default filter is ignored.
      properties:
        excludePurchasedItems:
          type: boolean
          description: When true, the recommendation results will include only items that the profile hasn't purchased before.
        excludePurchasedItemsSinceDays:
          type: number
          format: integer
          description: Limits the application of the `excludePurchasedItems` filter to a specified number of days.
        elasticExcludePurchasedItems:
          type: boolean
          description: This is a setting for Elastic filters.<br>When true, the recommendation results will include only items that the profile hasn't purchased before.
        elasticExcludePurchasedItemsSinceDays:
          type: number
          format: integer
          description: This is a setting for Elastic filters.<br>Limits the application of the `elasticExcludePurchasedItemsSinceDays` filter to a specified number of days.
    recommendations-api-materializer-CampaignId:
      type: string
      description: ID of the campaign used in the preview.
      default: preview
    recommendations-api-materializer-CampaignTitle:
      type: string
      description: Title of the campaign used in the preview.
      default: preview
    recommendations-api-materializer-AttributeRecommendationsCampaignParameters:
      allOf:
        - $ref: "#/components/schemas/recommendations-api-materializer-BaseRecommendationsCampaignParameters"
        - type: object
          properties:
            metadataCatalogId:
              type: string
              description: The id of catalog containing attributes metadata.
    recommendations-api-materializer-BaseRecommendationsCampaignParameters:
      type: object
      description: Parameters that apply to this campaign
      properties:
        additionalResponseAttributes:
          type: array
          items:
            type: string
          description: An array of additional response attributes.
    recommendations-api-materializer-CampaignTypeAttribute:
      type: string
      description: Campaign type
      enum:
        - attribute
    recommendations-api-materializer-PreviewSectionRecommendationCampaignsCreateRequest:
      title: Section
      allOf:
        - type: object
          required:
            - type
          properties:
            type:
              $ref: "#/components/schemas/recommendations-api-materializer-CampaignTypeSection"
            parameters:
              $ref: "#/components/schemas/recommendations-api-materializer-SectionRecommendationsCampaignParameters"
        - $ref: "#/components/schemas/recommendations-api-materializer-BaseRecommendationCampaignsPreviewRequest"
    recommendations-api-materializer-SectionRecommendationsCampaignParameters:
      allOf:
        - $ref: "#/components/schemas/recommendations-api-materializer-BaseRecommendationsCampaignParameters"
        - type: object
          properties:
            metadataCatalogId:
              type: string
    recommendations-api-materializer-CampaignTypeSection:
      type: string
      description: Campaign type
      enum:
        - section
    recommendations-api-materializer-PreviewRecentInteractionsRecommendationCampaignsCreateRequest:
      title: Recent interactions
      allOf:
        - type: object
          required:
            - type
          properties:
            type:
              $ref: "#/components/schemas/recommendations-api-materializer-CampaignTypeRecentInteractions"
            parameters:
              $ref: "#/components/schemas/recommendations-api-materializer-RecentInteractionsRecommendationsCampaignParameters"
        - $ref: "#/components/schemas/recommendations-api-materializer-BaseRecommendationCampaignsPreviewRequest"
    recommendations-api-materializer-RecentInteractionsRecommendationsCampaignParameters:
      allOf:
        - $ref: "#/components/schemas/recommendations-api-materializer-BaseRecommendationsCampaignParameters"
        - type: object
          properties:
            aggregateId:
              type: string
              description: Id of the aggregate which provides events as a base of recommendations.
            personalizedBoostingStrength:
              $ref: "#/components/schemas/recommendations-api-materializer-PersonalizedBoostingStrength"
    recommendations-api-materializer-PersonalizedBoostingStrength:
      type: number
      description: How much influence the personalized scoring has. Greater values allow you to promote items that have high personalized score. A strength with a value of 0 does not change the scoring.
      format: float
      minimum: 0
      maximum: 100
      default: 0
    recommendations-api-materializer-CampaignTypeRecentInteractions:
      type: string
      description: Campaign type
      enum:
        - recent-interactions
    recommendations-api-materializer-PreviewItemComparisonRecommendationCampaignsCreateRequest:
      title: Comparison
      allOf:
        - type: object
          required:
            - type
          properties:
            type:
              $ref: "#/components/schemas/recommendations-api-materializer-CampaignTypeItemComparison"
            parameters:
              allOf:
                - $ref: "#/components/schemas/recommendations-api-materializer-WithMetricsRecommendationsCampaignParameters"
                - type: object
                  properties:
                    personalizedBoostingStrength:
                      $ref: "#/components/schemas/recommendations-api-materializer-PersonalizedBoostingStrength"
        - $ref: "#/components/schemas/recommendations-api-materializer-BaseRecommendationCampaignsPreviewRequest"
    recommendations-api-materializer-WithMetricsRecommendationsCampaignParameters:
      allOf:
        - $ref: "#/components/schemas/recommendations-api-materializer-BaseRecommendationsCampaignParameters"
        - type: object
          properties:
            boostMetric:
              type: string
              description: ID of the metric to boost the results by. Metric scores will be combined with recommendation scores, favoring the best-performing results.
            sortMetric:
              type: string
              description: ID of the metric to sort the results by.
            boostMetricStrength:
              type: number
              description: How much influence the `boostMetric` has. Values less than 0 allow you to demote items that have high metric score, values greater than 0 allow you to promote items that have high metric score. A strength with a value of 0 does not change the scoring.
              format: float
              minimum: -100
              maximum: 100
            shuffleNumItems:
              $ref: "#/components/schemas/recommendations-api-materializer-ShuffleNumItems"
    recommendations-api-materializer-ShuffleNumItems:
      type: integer
      description: When this parameter is provided, this many best item recommendations are provided. A number of them, no more than the value of `itemMax`, are chosen randomly for recommendation.
    recommendations-api-materializer-CampaignTypeItemComparison:
      type: string
      description: Campaign type
      enum:
        - item-comparison
    recommendations-api-materializer-PreviewVisuallySimilarRecommendationCampaignsCreateRequest:
      title: Visually similar
      allOf:
        - type: object
          required:
            - type
          properties:
            type:
              $ref: "#/components/schemas/recommendations-api-materializer-CampaignTypeVisuallySimilar"
            parameters:
              allOf:
                - $ref: "#/components/schemas/recommendations-api-materializer-WithMetricsRecommendationsCampaignParameters"
                - type: object
                  properties:
                    personalizedBoostingStrength:
                      $ref: "#/components/schemas/recommendations-api-materializer-PersonalizedBoostingStrength"
        - $ref: "#/components/schemas/recommendations-api-materializer-BaseRecommendationCampaignsPreviewRequest"
    recommendations-api-materializer-CampaignTypeVisuallySimilar:
      type: string
      description: Campaign type
      enum:
        - visually-similar
    recommendations-api-materializer-PreviewPersonalizedRecommendationCampaignsCreateRequest:
      title: Personalized
      allOf:
        - type: object
          required:
            - type
          properties:
            type:
              $ref: "#/components/schemas/recommendations-api-materializer-CampaignTypePersonalized"
            parameters:
              $ref: "#/components/schemas/recommendations-api-materializer-BaseRecommendationsCampaignParameters"
        - $ref: "#/components/schemas/recommendations-api-materializer-BaseRecommendationCampaignsPreviewRequest"
    recommendations-api-materializer-CampaignTypePersonalized:
      type: string
      description: Campaign type
      enum:
        - personalized
    recommendations-api-materializer-PreviewLastViewedRecommendationCampaignsCreateRequest:
      title: Last viewed
      allOf:
        - type: object
          required:
            - type
          properties:
            type:
              $ref: "#/components/schemas/recommendations-api-materializer-CampaignTypeLastViewed"
            parameters:
              allOf:
                - $ref: "#/components/schemas/recommendations-api-materializer-BaseRecommendationsCampaignParameters"
                - type: object
                  properties:
                    personalizedBoostingStrength:
                      $ref: "#/components/schemas/recommendations-api-materializer-PersonalizedBoostingStrength"
        - $ref: "#/components/schemas/recommendations-api-materializer-BaseRecommendationCampaignsPreviewRequest"
    recommendations-api-materializer-CampaignTypeLastViewed:
      type: string
      description: Campaign type
      enum:
        - last-viewed
    recommendations-api-materializer-PreviewSetComplementRecommendationCampaignsCreateRequest:
      title: Complementary
      allOf:
        - type: object
          required:
            - type
          properties:
            type:
              $ref: "#/components/schemas/recommendations-api-materializer-CampaignTypeComplementary"
            parameters:
              $ref: "#/components/schemas/recommendations-api-materializer-SetComplementRecommendationsCampaignParameters"
        - $ref: "#/components/schemas/recommendations-api-materializer-BaseRecommendationCampaignsPreviewRequest"
    recommendations-api-materializer-SetComplementRecommendationsCampaignParameters:
      allOf:
        - $ref: "#/components/schemas/recommendations-api-materializer-BaseRecommendationsCampaignParameters"
        - type: object
          properties:
            itemSimilarity:
              type: integer
              minimum: 0
              maximum: 5
              description: Similarity between items in the cart and the recommended items. Higher values decrease the similarity.
            recommendationVariety:
              type: number
              format: float
              minimum: 0
              maximum: 0.9
              description: Similarity between recommended items - higher values will result in more variety within the recommended item set.
            personalizedBoostingStrength:
              $ref: "#/components/schemas/recommendations-api-materializer-PersonalizedBoostingStrength"
    recommendations-api-materializer-CampaignTypeComplementary:
      type: string
      description: Campaign type
      enum:
        - set-complement
    recommendations-api-materializer-PreviewCrossSellRecommendationCampaignsCreateRequest:
      title: Cross-sell
      allOf:
        - type: object
          required:
            - type
          properties:
            type:
              $ref: "#/components/schemas/recommendations-api-materializer-CampaignTypeCrossSell"
            parameters:
              allOf:
                - $ref: "#/components/schemas/recommendations-api-materializer-WithMetricsRecommendationsCampaignParameters"
                - type: object
                  properties:
                    personalizedBoostingStrength:
                      $ref: "#/components/schemas/recommendations-api-materializer-PersonalizedBoostingStrength"
        - $ref: "#/components/schemas/recommendations-api-materializer-BaseRecommendationCampaignsPreviewRequest"
    recommendations-api-materializer-CampaignTypeCrossSell:
      type: string
      description: Campaign type
      enum:
        - cross-sell
    recommendations-api-materializer-PreviewMetricsRecommendationCampaignsCreateRequest:
      title: Top items
      allOf:
        - type: object
          required:
            - type
          properties:
            type:
              $ref: "#/components/schemas/recommendations-api-materializer-CampaignTypeMetrics"
            parameters:
              $ref: "#/components/schemas/recommendations-api-materializer-MetricsRecommendationsCampaignParameters"
        - $ref: "#/components/schemas/recommendations-api-materializer-BaseRecommendationCampaignsPreviewRequest"
    recommendations-api-materializer-MetricsRecommendationsCampaignParameters:
      allOf:
        - $ref: "#/components/schemas/recommendations-api-materializer-WithMetricsRecommendationsCampaignParameters"
        - type: object
          properties:
            personalizedBoostingStrength:
              $ref: "#/components/schemas/recommendations-api-materializer-PersonalizedBoostingStrength"
          required:
            - sortMetric
    recommendations-api-materializer-CampaignTypeMetrics:
      type: string
      description: Campaign type
      enum:
        - metrics
    recommendations-api-materializer-PreviewSimilarRecommendationCampaignsCreateRequest:
      title: Similar
      allOf:
        - type: object
          required:
            - type
          properties:
            type:
              $ref: "#/components/schemas/recommendations-api-materializer-CampaignTypeSimilar"
            parameters:
              allOf:
                - $ref: "#/components/schemas/recommendations-api-materializer-WithMetricsRecommendationsCampaignParameters"
                - type: object
                  properties:
                    personalizedBoostingStrength:
                      $ref: "#/components/schemas/recommendations-api-materializer-PersonalizedBoostingStrength"
        - $ref: "#/components/schemas/recommendations-api-materializer-BaseRecommendationCampaignsPreviewRequest"
    recommendations-api-materializer-CampaignTypeSimilar:
      type: string
      description: Campaign type
      enum:
        - similar
    recommendations-api-materializer-PreviewRecommendationContext:
      type: object
      properties:
        clientUUID:
          $ref: "#/components/schemas/recommendations-api-materializer-ClientUUID"
        items:
          $ref: "#/components/schemas/recommendations-api-materializer-Items"
        includeContextItems:
          $ref: "#/components/schemas/recommendations-api-materializer-IncludeContextItems"
        params:
          $ref: "#/components/schemas/recommendations-api-materializer-ParamsReco"
        inventoryContext:
          $ref: "#/components/schemas/recommendations-api-materializer-InventoryContext"
    recommendations-api-materializer-ParamsReco:
      type: object
      example:
        source: mobile
      description: Extra parameters that will be added to the `recommendation.generated` event. The total size must not exceed 500 bytes.
    recommendations-api-materializer-IncludeContextItems:
      type: boolean
      default: false
      description: The recommendation results will include context items from the request.
    recommendations-api-materializer-Items:
      type: array
      description: "A list of itemIds for building the context. Alternatively, you can use the `itemsSource` parameter to provide the context. Item context is required by these recommendation types: `similar`, `cross-sell`, `set-complement`, `visually-similar`, `item-comparison`. In other recommendation types, the item context is optional, but may be used by the model when scoring items."
      items:
        $ref: "#/components/schemas/recommendations-api-materializer-Item"
    recommendations-api-materializer-Item:
      type: string
      description: ID of an entity in the item feed
    recommendations-api-materializer-ClientUUID:
      description: UUID of the client
      type: string
      format: uuid
    recommendations-rust-all-Error:
      type: object
      description: Details of an error, if applicable
      properties:
        timestamp:
          type: string
          format: date-time
          description: Time when the error occurred
        status:
          type: integer
          description: Status code
        error:
          type: string
          description: Summary of the error
        message:
          type: string
          description: Description of the problem
        path:
          type: string
          description: URL of the requested resource
      required:
        - timestamp
        - status
        - message
    recommendations-rust-all-RecommendationResponseSchemaV2:
      type: object
      properties:
        extras:
          type: object
          description: Additional data
          properties:
            correlationId:
              type: string
              description: Correlation ID that allows you to link the "item clicked" events with the "recommendation generated" event that's created for each recommendation result.
            contextItems:
              type: array
              nullable: true
              description: A list of context items provided in the request
              items:
                type: object
                properties:
                  itemId:
                    type: string
                    description: Item identifier (`itemId` in item catalog)
                additionalProperties: true
                required:
                  - itemId
            campaignId:
              type: string
              description: ID of the context campaign
              nullable: true
        data:
          type: array
          description: A list of recommended items
          items:
            type: object
            properties:
              itemId:
                type: string
                description: Item identifier (`itemId` in item catalog)
            additionalProperties: {}
            required:
              - itemId
    recommendations-rust-all-SlotsRecommendationResponseSchemaV2:
      allOf:
        - $ref: "#/components/schemas/recommendations-rust-all-RecommendationResponseSchemaV2"
        - type: object
          properties:
            extras:
              type: object
              properties:
                slots:
                  type: array
                  description: A list of slots data
                  items:
                    type: object
                    properties:
                      id:
                        type: integer
                        description: Slot identifier. Matches the index (zero-based numbering) of the slot provided in request
                      name:
                        type: string
                        description: Slot name provided in request
                      itemIds:
                        type: array
                        description: A list of item ids that meet the slot criteria
                        items:
                          type: string
                          description: Item identifier (`itemId` in item catalog)
                      error:
                        $ref: "#/components/schemas/recommendations-rust-all-Error"
                    required:
                      - id
              required:
                - slots
    recommendations-rust-all-SlotsBodySchemaV2:
      allOf:
        - $ref: "#/components/schemas/recommendations-rust-all-BaseBodySchemaV2"
        - type: object
          properties:
            keepSlotsOrder:
              type: boolean
              default: true
              description: |
                - When `true`, the `data` array in the response is sorted according to slots. Within each slot, the items are sorted by their score (default) or metric (if selected). For example, if you have 3 slots of 2 items each, the first 2 items in `data` are from the first slot, the second 2 are from the second slot, and the last 2 are from the third slot.
                - When `false`, the `data` array in the response is sorted only according to score (default) or metric (if selected). Slots have no effect.

                The additional `extras.slots` object always shows slots and items as if this setting was `true`.

                If you want to set `personalizeSlotsOrder` to `true`, `keepSlotsOrder` must also be `true`.
            personalizeSlotsOrder:
              type: boolean
              default: false
              description: |
                Sort the slots by average personalized slot score. This parameter applies only to personalized and attribute recommendation campaigns.

                If you want to set `personalizeSlotsOrder` to `true`, `keepSlotsOrder` must also be `true`.
            sortMetric:
              type: string
              description: ID of the metric to sort the results by. The list of available metrics can be checked by using [this endpoint](https://developers.synerise.com/AnalyticsSuite/AnalyticsSuite.html#operation/ApiGetAvailableMetricsV2).
            boostingParameters:
              $ref: "#/components/schemas/recommendations-rust-all-BoostingParametersV2"
            boostingStrategies:
              type: array
              description: Boosting strategies
              items:
                $ref: "#/components/schemas/recommendations-rust-all-BoostingStrategyV2"
            crossWorkspaceMode:
              $ref: "#/components/schemas/recommendations-rust-all-CrossWorkspaceMode"
            slots:
              type: array
              description: Slot definitions. To apply default values and fetch all the results as a single slot, send `slots` as an array with one empty object.
              minItems: 1
              items:
                $ref: "#/components/schemas/recommendations-rust-all-SlotSchemaV2Rust"
          required:
            - slots
    recommendations-rust-all-SlotSchemaV2Rust:
      type: object
      properties:
        name:
          type: string
          description: Slot name
        minNumItems:
          $ref: "#/components/schemas/recommendations-rust-all-MinNumItems"
        maxNumItems:
          $ref: "#/components/schemas/recommendations-rust-all-MaxNumItems"
        shuffleNumItems:
          $ref: "#/components/schemas/recommendations-rust-all-ShuffleNumItemsRust"
        filters:
          $ref: "#/components/schemas/recommendations-rust-all-Filter"
        elasticFilters:
          $ref: "#/components/schemas/recommendations-rust-all-ElasticFilter"
        distinctFilter:
          $ref: "#/components/schemas/recommendations-rust-all-DistinctFilterReco"
    recommendations-rust-all-DistinctFilterReco:
      type: object
      description: Distinct filters allow you to specify how many recommended items can have the same value of specified attributes.
      properties:
        elastic:
          type: boolean
          description: When TRUE, allows to complete the recommended items with items which don't meet the distinct filter criteria.
        filters:
          type: array
          minItems: 1
          maxItems: 5
          description: Array of distinct filters
          items:
            type: object
            properties:
              field:
                type: string
                description: Attribute name
              maxNumItems:
                type: number
                format: integer
                description: Max number of items with the same value of the attribute
              levelRangeModifier:
                type: number
                format: integer
                description: Parameter used (for the `category` field) to specify how many categories to cut off from the end
            required:
              - field
              - maxNumItems
      required:
        - elastic
        - filters
    recommendations-rust-all-ElasticFilter:
      description: |
        This string defines the criteria that an item must meet in order to be considered for recommendation. The Elastic filter may be dropped if not enough products meet the required criteria.
        For information on building filters, see ["Items Query Language (IQL)" in the Developer Guide](https://hub.synerise.com/developers/iql/).
      type: string
    recommendations-rust-all-Filter:
      type: string
      description: |
        This string defines the criteria that an item must meet in order to be considered for recommendation.  
        For information on building filters, see ["Items Query Language (IQL)" in the Developer Guide](https://hub.synerise.com/developers/iql/).
    recommendations-rust-all-ShuffleNumItemsRust:
      type: integer
      description: When this parameter is provided, this many best item recommendations are provided. A number of them, no more than the value of `maxItemNums`, are chosen randomly for recommendation.
      minimum: 1
      maximum: 200
    recommendations-rust-all-MaxNumItems:
      type: integer
      description: The maximal number of returned item recommendations.
      maximum: 100
      default: 5
    recommendations-rust-all-MinNumItems:
      type: integer
      description: The minimal number of returned item recommendations. If the service is not able to return at least this many recommendations, it will return an error.
      default: 1
      minimum: 1
    recommendations-rust-all-CrossWorkspaceMode:
      type: object
      description: Specifies if recommendation should use cross-workspace mode and personalize recommendations with events from other members of workspace group if they are available.
      properties:
        enabled:
          type: boolean
          description: Defines if cross-workspace mode is enabled.
    recommendations-rust-all-BoostingStrategyV2:
      type: object
      description: Boosting strategy allows you to promote or demote specific types of products in recommendation scoring
      properties:
        name:
          type: string
          description: Boosting strategy name
        condition:
          type: string
          description: The condition that indicates on which items the boost will be performed. The condition must comply with the rules of creating filters.
        strength:
          type: number
          description: How much influence the strategy has. Values less than 1.0 allow you to demote items that meet the condition, values greater than 1.0 allow you to promote items that meet the condition. A strength with a value of 1.0 does not change the scoring.
          format: float
          minimum: 0
          maximum: 2
          default: 1
      required:
        - name
        - condition
        - strength
    recommendations-rust-all-BoostingParametersV2:
      type: object
      description: Result boosting parameters
      properties:
        metric:
          type: string
          description: ID of the metric to boost the results by. Metric scores will be combined with recommendation scores, favoring the best-performing results. The list of available metrics can be checked by using [this endpoint](https://developers.synerise.com/AnalyticsSuite/AnalyticsSuite.html#operation/ApiGetAvailableMetricsV2).
        strength:
          type: number
          description: How much influence the `boostMetric` has. Values less than 0 allow you to demote items that have high metric score, values greater than 0 allow you to promote items that have high metric score. A strength with a value of 0 does not change the scoring.
          format: float
        personalizedBoostingStrength:
          type: number
          description: How much influence the personalized scoring has. Greater values allow you to promote items that have high personalized score. A strength with a value of 0 does not change the scoring.
          format: float
          minimum: 0
          maximum: 100
          default: 0
    recommendations-rust-all-BaseBodySchemaV2:
      type: object
      properties:
        campaignId:
          type: string
          description: The campaignId which will be passed as *utm_campaign* in a link to the recommended item.
          default: defaultCampaign
        campaignName:
          type: string
          description: The campaign name which will be included in the recommendation.generated event.
        catalogId:
          type: string
          description: ID (_not_ name) of the item feed to use in the request. The requested recommendation type (model) must be ready for this item feed.
          default: default
        clientUUID:
          type: string
          description: |
            Profile UUID. This parameter is required for these recommendation types:
              - Personalized
              - Last seen
              - Recent interactions
              - Section
              - Attribute

            This parameter can be passed in all recommendations. In recommendations which don't require the customer context, it can still be used to create filters.
        contextItemIds:
          type: array
          description: Item identifiers, equal to `itemId` from the *item feed*. They can be used to define the item context of the query.
          items:
            type: string
            description: Item identifier (`itemId` in item catalog)
        includeContextItems:
          type: boolean
          default: false
          description: The recommendation results will include context items from the request.
        filterRules:
          $ref: "#/components/schemas/recommendations-rust-all-FilterRulesV2"
        displayAttributes:
          type: string
          description: Attributes to be returned
        abTestContext:
          $ref: "#/components/schemas/recommendations-rust-all-AbTestContext"
        params:
          $ref: "#/components/schemas/recommendations-rust-all-ParamsReco"
        inventoryContext:
          $ref: "#/components/schemas/recommendations-rust-all-InventoryContext"
    recommendations-rust-all-InventoryContext:
      description: |
        Inventory context used to evaluate inventory-related filters and boosting strategies.
        Can be either a single inventory context or
        a multi-inventory context (set of channel IDs per inventory).
      oneOf:
        - $ref: "#/components/schemas/recommendations-rust-all-SingleInventoryContext"
        - $ref: "#/components/schemas/recommendations-rust-all-MultiInventoryContext"
    recommendations-rust-all-MultiInventoryContext:
      type: object
      description: |
        Multi-inventory context where each inventory can have its own set of channel IDs.
      properties:
        inventoryCatalogs:
          type: object
          additionalProperties:
            $ref: "#/components/schemas/recommendations-rust-all-InventoryContextDefinition"
          description: |
            Map of inventory ID to inventory context definition. Each inventory can have its own set of channel IDs.
      required:
        - inventoryCatalogs
    recommendations-rust-all-InventoryContextDefinition:
      type: object
      description: |
        Context definition for a specific inventory.
      properties:
        channelIds:
          type: array
          items:
            type: string
          description: |
            List of channel identifiers for this specific inventory.
      required:
        - channelIds
    recommendations-rust-all-SingleInventoryContext:
      type: object
      description: |
        Single inventory context.
      properties:
        channelIds:
          type: array
          items:
            type: string
          description: |
            List of channel identifiers used to evaluate inventory-related filters and boosting strategies.
      required:
        - channelIds
    recommendations-rust-all-ParamsReco:
      type: object
      example:
        source: mobile
      description: Extra parameters that will be added to the `recommendation.generated` event. The total size must not exceed 500 bytes.
    recommendations-rust-all-AbTestContext:
      type: object
      description: A/B test context.
      properties:
        experimentId:
          type: integer
          description: Experiment ID which will be included in the `recommendation.generated` event.
        variantId:
          type: string
          description: Campaign variant ID which will be included in the `recommendation.generated` event.
        requestedCampaignId:
          type: string
          description: Requested campaign ID which will be included in the `recommendation.generated` event.
    recommendations-rust-all-FilterRulesV2:
      type: object
      description: Filter configuration
      properties:
        excludePurchasedItems:
          $ref: "#/components/schemas/recommendations-rust-all-ExcludePurchasedItems"
        excludePurchasedItemsSinceDays:
          $ref: "#/components/schemas/recommendations-rust-all-ExcludePurchasedItemsSince"
        elasticExcludePurchasedItems:
          $ref: "#/components/schemas/recommendations-rust-all-ExcludePurchasedItems"
        elasticExcludePurchasedItemsSinceDays:
          $ref: "#/components/schemas/recommendations-rust-all-ExcludePurchasedItemsSince"
    recommendations-rust-all-ExcludePurchasedItemsSince:
      description: Limits the application of the `excludePurchasedItems` filter to a specified number of days.
      type: integer
    recommendations-rust-all-ExcludePurchasedItems:
      description: |
        When true, the recommendation results will include only items that the Profile hasn't purchased before.  
        **IMPORTANT**: Only the last 250 purchased items are taken into account. Items further back in the purchase history may be included in the recommendation.
      type: boolean
      default: false
    recommendations-rust-all-SectionsSlotsRecommendationResponseSchemaV2:
      allOf:
        - $ref: "#/components/schemas/recommendations-rust-all-RecommendationResponseSchemaV2"
        - type: object
          properties:
            extras:
              type: object
              properties:
                slots:
                  type: array
                  description: A list of slots data
                  items:
                    type: object
                    properties:
                      id:
                        type: integer
                        description: Slot identifier. Matches the index (zero-based numbering) of the slot provided in request
                      name:
                        type: string
                        description: Slot name provided in request
                      rows:
                        type: array
                        description: A list of rows that groups items with the same attribute value
                        items:
                          type: object
                          properties:
                            attributeValue:
                              type: string
                              description: The attribute value used to group items in the row
                            itemIds:
                              type: array
                              description: A list of item ids that meet the slot and row criteria
                              items:
                                type: string
                                description: Item identifier (`itemId` in item catalog)
                            metadata:
                              type: object
                              description: Metadata catalog attributes
                              properties:
                                itemId:
                                  type: string
                                  description: Item identifier (`itemId` in item metadata catalog)
                              additionalProperties: {}
                              required:
                                - itemId
                      error:
                        $ref: "#/components/schemas/recommendations-rust-all-Error"
                    required:
                      - id
              required:
                - slots
    recommendations-rust-all-SectionsSlotsBodySchemaV2:
      allOf:
        - $ref: "#/components/schemas/recommendations-rust-all-BaseBodySchemaV2"
        - type: object
          properties:
            metadataCatalogId:
              $ref: "#/components/schemas/recommendations-rust-all-MetadataCatalogId"
            slots:
              type: array
              description: Slots data
              items:
                $ref: "#/components/schemas/recommendations-rust-all-SectionSlotSchemaV2"
          required:
            - slots
    recommendations-rust-all-SectionSlotSchemaV2:
      type: object
      properties:
        name:
          type: string
          description: Slot name
        attribute:
          $ref: "#/components/schemas/recommendations-rust-all-Attribute"
        numRows:
          $ref: "#/components/schemas/recommendations-rust-all-NumRows"
        numItems:
          $ref: "#/components/schemas/recommendations-rust-all-NumItems"
        filters:
          $ref: "#/components/schemas/recommendations-rust-all-Filter"
        elasticFilters:
          $ref: "#/components/schemas/recommendations-rust-all-ElasticFilter"
      required:
        - attribute
        - numRows
        - numItems
    recommendations-rust-all-NumItems:
      type: integer
      description: The number of items in each row in the slot.
      minimum: 1
      maximum: 100
    recommendations-rust-all-NumRows:
      type: integer
      description: The number of rows in the slot.
      minimum: 1
      maximum: 10
    recommendations-rust-all-Attribute:
      type: object
      description: The attribute for grouping rows in the section and attribute recommendations.
      properties:
        name:
          description: Name of the attribute
          type: string
        levelRangeModifier:
          description: Restricts the range of items in recommendations to a particular attribute level.
          type: integer
      required:
        - name
    recommendations-rust-all-MetadataCatalogId:
      type: string
      description: ID of the catalog which stores attribute metadata
    recommendations-rust-all-AttributesSlotsBodySchemaV2:
      allOf:
        - $ref: "#/components/schemas/recommendations-rust-all-BaseBodySchemaV2"
        - type: object
          properties:
            metadataCatalogId:
              $ref: "#/components/schemas/recommendations-rust-all-MetadataCatalogId"
            slots:
              type: array
              description: Slots data
              items:
                $ref: "#/components/schemas/recommendations-rust-all-AttributeSlotSchemaV2"
          required:
            - slots
    recommendations-rust-all-AttributeSlotSchemaV2:
      type: object
      properties:
        name:
          type: string
          description: Slot name
        attribute:
          $ref: "#/components/schemas/recommendations-rust-all-Attribute"
        minNumItems:
          $ref: "#/components/schemas/recommendations-rust-all-MinNumItems"
        maxNumItems:
          $ref: "#/components/schemas/recommendations-rust-all-MaxNumItems"
        filters:
          $ref: "#/components/schemas/recommendations-rust-all-Filter"
        elasticFilters:
          $ref: "#/components/schemas/recommendations-rust-all-ElasticFilter"
      required:
        - attribute
    recommendations-rust-all-MetricsBodySchemaV2:
      allOf:
        - $ref: "#/components/schemas/recommendations-rust-all-SlotsBodySchemaV2"
        - type: object
          required:
            - sortMetric
            - clientUUID
  parameters:
    ai-stats-searchGroupBy:
      name: groupBy
      in: query
      required: false
      description: Attribute for which retrieved stats will be grouped.
      schema:
        type: string
        enum:
          - date
    ai-stats-searchType:
      name: searchType
      in: query
      required: false
      description: Search type for which stats will be retrieved.
      schema:
        type: string
        default: all
        enum:
          - fullTextSearch
          - autocomplete
          - listing
          - visual
          - all
    ai-stats-query:
      name: query
      in: query
      required: false
      description: Query for which stats will be returned. If not provided, the results are returned for the most popular queries.
      schema:
        type: string
    ai-stats-dateTo:
      name: dateTo
      in: query
      required: false
      description: |
        Lower bound of the interval for which the statistics will be retrieved.
        If not specified, the interval is last 7 days.
      schema:
        type: string
        format: date
    ai-stats-dateFrom:
      name: dateFrom
      in: query
      required: false
      description: |
        Upper bound of the interval for which the statistics will be retrieved.  
        Must be provided with `to`, otherwise the filter is treated as unspecified.  
        If not specified, the interval is last 7 days.
      schema:
        type: string
        format: date
    ai-stats-indexId:
      name: indexId
      in: path
      required: true
      description: ID of the index for which the stats are requested
      schema:
        type: string
        example: 4add1a1fa877c1651906bb22c9dfd37a1618852272
    ai-stats-searchOrdering:
      name: ordering
      in: query
      required: false
      description: Sort order direction.
      schema:
        type: string
        default: desc
        enum:
          - asc
          - desc
    ai-stats-searchSortBy:
      name: SortBy
      in: query
      required: false
      description: Field by which results should be sorted.
      schema:
        type: string
        default: count
        enum:
          - count
          - clicks
          - conversions
          - clickThroughRate
          - revenue
          - conversionRate
    ai-stats-withFilters:
      name: withFilters
      in: query
      required: false
      description: Switch to display search statistics with enabled filters or without filters.
      schema:
        type: string
        enum:
          - true
          - false
    ai-stats-queryFilter:
      name: queryFilter
      in: query
      required: false
      description: Queries for which stats will be retrieved.
      schema:
        type: string
        default: queries
        enum:
          - queries
          - queriesWithNoResults
          - queriesWithUsedSuggestions
    ai-stats-filterName:
      name: filterName
      in: query
      required: false
      description: Name of the filterable attribute. If present top values of this filter are returned.
      schema:
        type: string
        example: brand
    ai-stats-indexIdArray:
      name: indexId
      in: query
      required: true
      description: List of indices ids for which the stats are requested.
      schema:
        type: array
        items:
          type: string
    ai-stats-timeZone:
      name: timeZone
      in: query
      required: false
      description: Time zone identifier.
      schema:
        type: string
        default: UTC
      example: Europe/Warsaw
    ai-stats-to:
      name: to
      in: query
      required: false
      description: |
        Lower bound of the interval for which the statistics will be retrieved.
        If not specified, the interval is last 7 days.
      schema:
        type: string
        format: date
    ai-stats-from:
      name: from
      in: query
      required: false
      description: |
        Upper bound of the interval for which the statistics will be retrieved.  
        Must be provided with `from`, otherwise the filter is treated as unspecified.  
        If not specified, the interval is last 7 days.
      schema:
        type: string
        format: date
    ai-stats-campaignIdPath:
      name: campaignId
      in: path
      required: true
      description: ID of the recommendation campaign
      schema:
        type: string
        example: 50NCGoRK0VRb
    ai-stats-productMetricName:
      name: metric
      in: query
      required: false
      description: |
        The response will include statistics for up to 10 top-performing items according to the selected metric, sorted from best to worst.
        If not specified, the default metric is `views`.
        - views - the number of displayed recommendation frames.
        - generations - the number of generated recommendation frames.
        - clicks - the number of times an item in a recommendation frame was clicked.
        - charges - the number of transactions caused by the recommendation.
        - revenue - the revenue generated by the recommendation.
      schema:
        type: string
        default: views
        enum:
          - views
          - clicks
          - revenue
          - generations
          - charges
    items-filter-all-exampleItems:
      name: exampleItems
      in: query
      required: false
      description: Controls how many example items will be returned
      schema:
        type: integer
        default: 10
    items-filter-all-itemsCatalogId:
      name: itemsCatalogId
      in: query
      required: false
      description: |
        ID of the item catalog that contains the items tested in the request. If not provided, "default" is assumed - however, the "default" catalog may not exist in your workspace.

        **NOTE:** This ID is available in the details the search index or recommendation campaign you want to make test requests for.
      schema:
        type: string
        default: default
    items-search-params:
      name: params
      in: query
      required: false
      description: |
        List of extra params that will be added to the `item.search` event. They must be in the `name:value` format. The total size must not exceed 500 bytes when written as a JSON object.
      example:
        - source:mobile
      schema:
        type: array
        items:
          type: string
    items-search-excludeQueryRules:
      name: excludeQueryRules
      in: query
      required: false
      description: |
        List of query rules that will not be applied.
      example:
        - 2
        - 5
      schema:
        type: array
        items:
          type: integer
    items-search-ignoreQueryRules:
      name: ignoreQueryRules
      in: query
      required: false
      description: |
        If set to `true`, query rules are not applied.
      schema:
        type: boolean
        default: false
    items-search-paginationIncludeMeta:
      name: includeMeta
      in: query
      required: false
      description: |
        
        When `true`, pagination metadata is included in the response body.

        When `false`, the data is included in the response headers:

        - Link: links to neighbors, first, and last pages in pagination.

        - X-Pagination-Total-Count: total number of items on all pages

        - X-Pagination-Total-Pages: total number of pages

        - X-Pagination-Page: current page

        - X-Pagination-Limit: maximum number of items on a page

        - X-Pagination-Sorted-By: parameter that the items were sorted by

        - X-Pagination-Ordering: sorting direction
      schema:
        type: boolean
        default: false
    items-search-paginationOrdering:
      name: ordering
      in: query
      required: false
      description: Sorting order
      schema:
        type: string
        default: asc
        enum:
          - desc
          - asc
    items-search-paginationSortBy:
      name: sortBy
      in: query
      required: false
      description: |
        <span style='color:red'><strong>IMPORTANT:</strong></span> Sorting disables boosting, elastic filters, and promoting search results.

        Name of the attribute by which the data will be sorted.      
      schema:
        type: string
    items-search-paginationLimit:
      name: limit
      in: query
      description: The number of items to return per page
      required: false
      schema:
        type: integer
        format: int32
        example: 10
        default: 20
        minimum: 0
        maximum: 500
    items-search-paginationPage:
      name: page
      in: query
      description: Page number to return for pagination. The first page has the index `1`.
      required: false
      schema:
        type: integer
        format: int32
        example: 4
        default: 1
    items-search-facetsOrderBy:
      name: facetsOrderBy
      in: query
      required: false
      description: |
        Controls the ordering of facets in the response.  
        When `facets=auto`, the default ordering is by coverage (most relevant facets first).  
        When facets are specified explicitly, the default ordering is by name.  
        When two facets have equal coverage, ties are resolved by name.
      schema:
        type: string
        enum:
          - coverage
          - name
    items-search-includeFacets:
      name: includeFacets
      in: query
      required: false
      description: |
        Determines which groups of facets will be returned: both filtered and unfiltered; just filtered; just unfiltered; or no group at at all.

        To determine which attributes should be returned as facets in each group, use the `facets` parameter.
      schema:
        type: string
        default: filtered
        enum:
          - all
          - filtered
          - unfiltered
          - none
    items-search-context:
      name: context
      in: query
      required: false
      description: List of context strings for a search query
      example:
        - mobile
        - listing
      schema:
        type: array
        items:
          type: string
    items-search-displayAttributes:
      name: displayAttributes
      in: query
      required: false
      description: List of ad hoc attributes that will be returned for each found item
      example:
        - title
        - price
      schema:
        type: array
        items:
          type: string
    items-search-caseSensitiveFacetValues:
      name: caseSensitiveFacetValues
      in: query
      required: false
      description: |
        Specifies whether facets aggregation should be case sensitive.
      schema:
        type: boolean
        default: false
    items-search-maxValuesPerFacet:
      name: maxValuesPerFacet
      in: query
      required: false
      description: |
        Determines how many values will be retrieved per facet.
      schema:
        type: integer
        default: 50
        minimum: 1
        maximum: 1000
    items-search-facetsSize:
      name: facetsSize
      in: query
      required: false
      description: |
        Determines how many items will be used for facets aggregation.
      schema:
        type: integer
        default: 2000
        minimum: 1
        maximum: 10000
    items-search-facets:
      name: facets
      in: query
      required: false
      description: |
        A list of attributes for which facets will be returned. A single `*` value matches all facetable attributes.
        A single `auto` value enables automatic facet selection based on the result set — the system picks the most relevant facets using the index's `dynamicFacets` configuration.

        To determine which groups of facets should be returned, use the `includeFacets` parameter.
      schema:
        type: array
        items:
          type: string
    items-search-filters:
      name: filters
      in: query
      required: false
      description: IQL query string. For details, see the [Help Center](https://help.synerise.com/developers/iql/).
      schema:
        type: string
    items-search-filterAnchor:
      name: filterAnchor
      in: query
      required: false
      description: |
        Anchor (`{width},{height}`) by which the visual results data will be filtered.
        `{width},{height}` correspond to normalized image coordinates, i.e. they are in range [0,1].
        Anchor (0,0) corresponds to the top-left pixel of an image.
      schema:
        type: string
        example: 0.2,0.8
    items-search-filterAroundRadius:
      name: filterAroundRadius
      in: query
      required: false
      description: Radius in meters to be used when filtering using geo-location. Can only be used when filtering by a single geo-point.
      schema:
        type: integer
        format: int32
        example: 5000
        default: 1000
    items-search-filterGeoPoints:
      name: filterGeoPoints
      in: query
      required: false
      description: |
        The definition of a geographical area to filter by.

        Given one geo-point, the results will be limited to a radius around a point. To override the default radius (1000 meters), provide the `filterAroundRadius` parameter.
        **Example input:** `["34.052235,-118.243685"]`

        Given two geo-points, the results will be limited to a rectangular area.
        **Example input:** `["50,-100", "25,150"]`

        Given three or more geo-points, the results will be limited to a polygonal area.
        **Example input:** `["50,0", "40,20", "-20,10"]`
      schema:
        type: array
        example:
          - 34.052235,-118.243685
          - 15.0,65.0
        items:
          type: string
    items-search-sortByGeoPoint:
      name: sortByGeoPoint
      in: query
      required: false
      description: |
        <span style='color:red'><strong>IMPORTANT:</strong></span> Sorting disables boosting, elastic filters, and promoting search results.

        Geo-point (`{latitude},{longitude}`) for data sorting. Results are sorted by distance from this point. `ordering: asc` means "closest first".'
      schema:
        type: string
        example: 34.052235,-118.243685
    items-search-sortByMetric:
      name: sortByMetric
      in: query
      required: false
      description: |
        <span style='color:red'><strong>IMPORTANT:</strong></span> Sorting disables boosting, elastic filters, and promoting search results.

        Name of the metric by which the data will be sorted.
      schema:
        type: string
        enum:
          - TransactionsPopularity
          - PageVisitsPopularity
    items-search-searchId:
      name: searchId
      in: query
      required: false
      deprecated: true
      description: |
        **DEPRECATED - use correlationId instead**

        Search ID for pagination. If a search with the ID was performed recently (last 10 minutes), the cached results will be used.

        Do not send this if sortBy/filters/sorting order, etc. have changed - the cached results may have different order or may match different filters.
      schema:
        type: string
    items-search-correlationId:
      name: correlationId
      in: query
      required: false
      description: |
        Correlation ID for pagination. If a search with the ID was performed recently (last 10 minutes), the cached results will be used.

        Do not send this if sortBy/filters/sorting order, etc. have changed - the cached results may have different order or may match different filters.
      schema:
        type: string
    items-search-personalize:
      name: personalize
      in: query
      required: false
      description: |
        If set to `false`, the search result is not personalized.
      schema:
        type: boolean
        default: true
    items-search-clientUUID:
      name: clientUUID
      in: query
      required: false
      description: UUID of the profile for which the search is performed
      schema:
        type: string
    items-search-inPathIndexId:
      name: indexId
      in: path
      required: true
      description: ID of the index to be used in the search operation
      schema:
        type: string
    items-search-imageUrl:
      name: url
      in: query
      required: true
      description: URL of the image to be used in the visual search
      schema:
        type: string
    items-search-crossWorkspaceModeEnabled:
      name: crossWorkspaceModeEnabled
      in: query
      required: false
      description: |
        If set, overrides the cross-workspace mode from the index configuration. When `true`, cross-workspace personalization is enabled. When `false`, it is disabled.
      schema:
        type: boolean
    items-search-disableDynamicReranker:
      name: disableDynamicReranker
      in: query
      required: false
      description: |
        If set to `true`, dynamic reranker is not applied.
      schema:
        type: boolean
        default: false
    items-search-disableQueryClassification:
      name: disableQueryClassification
      in: query
      required: false
      description: |
        If set to `true`, query classification is not applied.
      schema:
        type: boolean
        default: false
    items-search-distinctFilter:
      name: distinctFilter
      in: query
      required: false
      schema:
        type: string
        example: '{"attribute": "color", "maxNumItems": 3}'
      description: |
        DistinctFilter JSON as an URL-encoded string
    items-search-searchQuery:
      name: query
      in: query
      required: true
      description: Query text to use in the search
      schema:
        type: string
    items-search-itemId:
      name: itemId
      in: query
      required: true
      description: Item ID
      schema:
        type: string
    items-search-recent-clientUUID:
      name: clientUUID
      in: query
      required: true
      description: UUID of the profile for which the query is performed
      schema:
        type: string
        example: e0097757-d1e2-44ac-ba3c-d97979a354c1
    items-search-recent-indexId:
      name: indexId
      in: path
      required: true
      description: ID of the index that the query relates to
      schema:
        type: string
        example: 4add1a1fa877c1651906bb22c9dfd37a1618852272
    items-search-recent-timeValue:
      name: timeValue
      in: query
      required: false
      description: The amount of time units. Used in conjunction with `timeUnit`.<br><strong>NOTE:</strong><br> The provided query parameter has priority over the configuration provided in [this endpoint](#operation/postIndexConfigV2). If the parameter is not provided, the default value does **not** override the configuration.
      schema:
        type: integer
        minimum: 1
        default: 30
    items-search-recent-timeUnit:
      name: timeUnit
      in: query
      required: false
      description: The time unit. Used in conjunction with `timeValue`.<br><strong>NOTE:</strong><br> The provided query parameter has priority over the configuration provided in [this endpoint](#operation/postIndexConfigV2). If the parameter is not provided, the default value does **not** override the configuration.
      schema:
        type: string
        default: DAYS
        enum:
          - YEARS
          - MONTHS
          - WEEKS
          - DAYS
          - HOURS
          - MINUTES
          - SECONDS
    items-search-recent-windowSize:
      name: windowSize
      in: query
      required: false
      description: Maximum number of recent searches to be returned. <br><strong>NOTE:</strong><br> The provided query parameter has priority over the configuration provided in [this endpoint](#operation/postIndexConfigV2). If the parameter is not provided, the default value does **not** override the configuration.
      schema:
        type: integer
        minimum: 1
        default: 15
    recommendation-campaigns-campaignId:
      name: campaignId
      in: path
      description: ID of the campaign
      required: true
      schema:
        type: string
    recommendations-api-materializer-paramsMaterializer:
      name: params
      in: query
      required: false
      description: |
        List of extra params that will be added to the `recommendation.generated` event. They must be in the `name:value` format. The total size must not exceed 500 bytes when written as a JSON object.
      example:
        - source:mobile
      schema:
        type: array
        items:
          type: string
    recommendations-api-materializer-itemsSourceId:
      in: query
      name: itemsSourceId
      description: |
        Source of item IDs for the recommendation context. In recommendations whose models doesn't use the item context, the attributes of those items can only be used in filters.

        Must be used with `itemsSourceType`.

        If the items' source type is 'aggregate', this is the aggregate's ID. If the items' source type is 'expression', this is the expression's ID.

        The item ID source (aggregate or expression) should return a string or an array of strings. If it returns numerical values, the recommendations engine attempts to convert them into strings while processing the request.

        Alternatively, you can pass the `itemId` parameter to define context items directly. Only one of these options is allowed at the same time.
      required: false
      schema:
        type: string
    recommendations-api-materializer-itemsSourceType:
      in: query
      name: itemsSourceType
      description: |
        Item ID or item IDs source type for the recommendation context.

        Must be used with `itemSourceId`. This overrides the `itemsSource` settings of the campaign definition.

        In recommendations whose models doesn't use the item context, the attributes of those items can only be used in filters.  

        If the items' source type is 'aggregate', the aggregate result will be used as context items. If the items' source type is 'expression', the expression result will be used as context items.

        The item ID source (aggregate or expression) should return a string or an array of strings. If it returns numerical values, the recommendations engine attempts to convert them into strings while processing the request.

        Alternatively, you can pass the `itemId` parameter to define context items directly. Only one of these options is allowed at the same time.
      required: false
      schema:
        type: string
        enum:
          - aggregate
          - expression
    recommendations-api-materializer-campaignIdentifier:
      name: campaignIdentifier
      in: path
      description: Recommendation campaign identifier - a campaignID or a slug
      required: true
      schema:
        type: string
    recommendations-api-materializer-identifierName:
      name: identifierName
      in: path
      description: The name of the profile identifier to use for the request. By default, the allowed identifier types are `id`, `uuid`, `email`, and `custom_identify`. This may be changed in the workspace configuration.
      required: true
      schema:
        type: string
        enum:
          - id
          - uuid
          - email
          - custom_identify
    recommendations-rust-all-crossWorkspaceMode:
      name: crossWorkspaceMode
      in: query
      required: false
      description: |
        Specifies if recommendation should use cross-workspace mode and personalize recommendations with events from other members of workspace group if they are available.
      schema:
        type: boolean
    recommendations-rust-all-inventoryChannelId:
      name: inventoryChannelId
      in: query
      required: false
      description: |
        Inventory context identifier used to evaluate inventory-related filters and boosting strategies. If not provided, no inventory context will be applied.
      schema:
        type: string
    recommendations-rust-all-params:
      name: params
      in: query
      required: false
      description: |
        List of extra params that will be added to the `recommendation.generated` event. They must be in the `name:value` format. The total size must not exceed 500 bytes when written as a JSON object.
      example:
        - source:mobile
      schema:
        type: array
        items:
          type: string
    recommendations-rust-all-recommendationsIncludeContextItems:
      name: includeContextItems
      in: query
      required: false
      description: The recommendation results will include context items from the request.
      schema:
        type: boolean
    recommendations-rust-all-distinctFilter:
      in: query
      name: distinctFilter
      required: false
      schema:
        type: object
        description: Distinct filters allow you to specify how many recommended items can have the same value of specified attributes.
        properties:
          elastic:
            type: boolean
            description: When TRUE, allows to complete the recommended items with items which don't meet the distinct filter criteria.
          filters:
            type: array
            minItems: 1
            maxItems: 5
            description: Array of distinct filters
            items:
              type: object
              properties:
                field:
                  type: string
                  description: Attribute name
                maxNumItems:
                  type: number
                  format: integer
                  description: Max number of items with the same value of the attribute
                levelRangeModifier:
                  type: number
                  format: integer
                  description: Parameter used (for the `category` field) to specify how many categories to cut off from the end
              required:
                - field
                - maxNumItems
        required:
          - elastic
          - filters
    recommendations-rust-all-itemCatalogId:
      name: itemCatalogId
      in: query
      required: false
      description: ID (_not_ name) of the item feed to use in the request. The requested recommendation type (model) must be ready for this item feed.
      schema:
        type: string
        default: default
    recommendations-rust-all-inParamsItemId:
      name: itemId
      in: query
      required: false
      description: Item identifier, equal to `itemId` from the *item feed*. It can be used to define the item context of the query.
      schema:
        type: string
    recommendations-rust-all-elasticFilterExpr:
      name: elastic:filters
      in: query
      required: false
      description: |
        This string defines the criteria that an item must meet in order to be considered for recommendation. The Elastic filter may be dropped if not enough products meet the required criteria.  
        For information on building filters, see ["Items Query Language (IQL)" in the Developer Guide](https://hub.synerise.com/developers/iql/).
      schema:
        type: string
    recommendations-rust-all-filterExpr:
      name: filters
      in: query
      required: false
      description: |
        This string defines the criteria that an item must meet in order to be considered for recommendation.  
        For information on building filters, see ["Items Query Language (IQL)" in the Developer Guide](https://hub.synerise.com/developers/iql/).
      schema:
        type: string
    recommendations-rust-all-recommendationsExcludePurchasedItemsSince:
      name: excludePurchasedItemsSinceDays
      in: query
      required: false
      description: Limits the application of the `excludePurchasedItems` filter to a specified number of days.
      schema:
        description: Limits the application of the `excludePurchasedItems` filter to a specified number of days.
        type: integer
    recommendations-rust-all-recommendationsExcludePurchasedItems:
      name: excludePurchasedItems
      in: query
      required: false
      description: |
        When true, the recommendation results will include only items that the profile hasn't purchased before.  
        **IMPORTANT**: Only the last 250 purchased items are taken into account. Items further back in the purchase history may be included in the recommendation.
      schema:
        description: |
          When true, the recommendation results will include only items that the Profile hasn't purchased before.  
          **IMPORTANT**: Only the last 250 purchased items are taken into account. Items further back in the purchase history may be included in the recommendation.
        type: boolean
        default: false
    recommendations-rust-all-recommendationsCampaignName:
      name: campaignName
      in: query
      required: false
      description: The campaign name which will be included in the recommendation.generated event.
      schema:
        type: string
    recommendations-rust-all-recommendationsCampaignId:
      name: campaignId
      in: query
      required: false
      description: The campaignId which will be passed as *utm_campaign* in a link to the recommended item.
      schema:
        type: string
        default: defaultCampaign
    recommendations-rust-all-recommendationsMaxNumItems:
      name: maxNumItems
      in: query
      required: false
      description: The maximal number of returned item recommendations.
      schema:
        type: integer
        description: The maximal number of returned item recommendations.
        maximum: 100
        default: 5
    recommendations-rust-all-recommendationsMinNumItems:
      name: minNumItems
      in: query
      required: false
      description: The minimal number of returned item recommendations. If the service is not able to return at least this many recommendations, it will return an error.
      schema:
        type: integer
        description: The minimal number of returned item recommendations. If the service is not able to return at least this many recommendations, it will return an error.
        default: 1
        minimum: 1
    recommendations-rust-all-inPathClientUUID:
      name: clientUuid
      in: path
      description: Recommendations will be generated for the provided profile UUID.
      required: true
      schema:
        type: string
    recommendations-rust-all-pathClientUuid:
      name: clientUuid
      in: path
      description: Information will be shown for the provided profile UUID.
      required: true
      schema:
        type: string
    recommendations-rust-all-pathAggregateUuid:
      name: aggregateUUID
      in: path
      description: Information will be shown for the provided aggregate UUID.
      required: true
      schema:
        type: string
    recommendations-rust-all-recommendationsClientUUID:
      name: clientUUID
      in: query
      description: |
        Profile UUID. This parameter is required for these recommendation types:
          - Personalized
          - Last seen
          - Recent interactions
          - Section
          - Attribute

        This parameter can be passed in all recommendations. In recommendations which don't require the customer context, it can still be used to create filters.
      required: false
      schema:
        type: string
    recommendations-rust-all-recommendationsSortMetric:
      name: sortMetric
      in: query
      required: false
      description: ID of the metric to sort the results by. The list of available metrics can be checked by using [this endpoint](https://developers.synerise.com/AnalyticsSuite/AnalyticsSuite.html#operation/ApiGetAvailableMetricsV2).
      schema:
        type: string
    recommendations-rust-all-recommendationsBoostMetric:
      name: boostMetric
      in: query
      required: false
      description: ID of the metric to boost the results by. Metric scores will be combined with recommendation scores, favoring the best-performing results. The list of available metrics can be checked by using [this endpoint](https://developers.synerise.com/AnalyticsSuite/AnalyticsSuite.html#operation/ApiGetAvailableMetricsV2).
      schema:
        type: string
    recommendations-rust-all-inParamsItemIdList:
      name: itemId
      in: query
      required: false
      description: Item identifiers, equal to `itemId` from the *item feed*. They can be used to define the item context of the query.
      schema:
        type: array
        items:
          type: string
          description: Item identifier, equal to `itemId` from the *item feed*. It can be used to define the item context of the query.
    recommendations-rust-all-inPathItemId:
      in: path
      name: itemId
      required: true
      description: Item identifier, equal to `itemId` from the *item feed*.
      schema:
        type: string
  responses:
    items-search-FullTextSearchResponse200:
      description: Search result
      content:
        application/json:
          schema:
            oneOf:
              - $ref: "#/components/schemas/items-search-FullTextSearchResponse"
              - $ref: "#/components/schemas/items-search-SuggestionResponse"
    items-search-FullTextSearchResponse200WithExplanation:
      description: Search result
      content:
        application/json:
          schema:
            oneOf:
              - $ref: "#/components/schemas/items-search-FullTextSearchResponseWithExplanation"
              - $ref: "#/components/schemas/items-search-SuggestionResponseWithExplanation"
    items-search-AutocompleteSearchResponse200:
      description: Search result
      content:
        application/json:
          schema:
            oneOf:
              - $ref: "#/components/schemas/items-search-AutocompleteResponse"
              - $ref: "#/components/schemas/items-search-SuggestionResponse"
    items-search-AutocompleteSearchResponse200WithExplanation:
      description: Search result
      content:
        application/json:
          schema:
            oneOf:
              - $ref: "#/components/schemas/items-search-AutocompleteResponseWithExplanation"
              - $ref: "#/components/schemas/items-search-SuggestionResponseWithExplanation"
    items-search-SearchableAttributesMatchResponse200:
      description: Searchable attributes match result
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/items-search-SearchableAttributesMatchResponse"
    recommendations-api-materializer-500error:
      description: An error occurred
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/recommendations-api-materializer-Error"
    recommendations-api-materializer-404cannotGenerate:
      description: No recommendations could be generated for the specified campaign and context.
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/recommendations-api-materializer-Error"
    recommendations-api-materializer-429toManyRequestsError:
      description: The user has sent too many requests in a given amount of time ("rate limiting").
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/recommendations-api-materializer-Error"
    recommendations-rust-all-500-error-occurred:
      description: An error occurred
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/recommendations-rust-all-Error"
    recommendations-rust-all-404-no-recommendation:
      description: No recommendations could be generated for the specified profile and filters
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/recommendations-rust-all-Error"
