openapi: 3.0.0
info:
  title: AI Recommendations - 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
x-tagGroups:
  - name: AI Recommendations
    tags:
      - Recommendation campaigns
      - Recommendation statistics
      - Recommendations
paths:
  /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();
  /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:
    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-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"
    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-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
    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:
    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"
