openapi: 3.0.0
info:
  title: Analytics Suite - Synerise Public API
  version: 1.9.0
servers:
  - url: https://api.synerise.com
    description: Microsoft Azure EU
  - url: https://api.azu.synerise.com
    description: Microsoft Azure USA
  - url: https://api.geb.synerise.com
    description: Google Cloud Platform
tags:
  - name: "Analytics: Expressions"
  - name: "Analytics: Aggregates"
  - name: "Analytics: Funnels"
  - name: "Analytics: Histograms"
  - name: "Analytics: Metrics"
  - name: "AI: Metrics"
  - name: "Analytics: Reports"
  - name: "Analytics: Sankeys"
  - name: "Analytics: Segmentations"
  - name: "Analytics: Trends"
  - name: "Analytics: Management"
x-tagGroups:
  - name: Analytics Suite
    tags:
      - "Analytics: Expressions"
      - "Analytics: Aggregates"
      - "Analytics: Funnels"
      - "Analytics: Histograms"
      - "Analytics: Metrics"
      - "AI: Metrics"
      - "Analytics: Reports"
      - "Analytics: Sankeys"
      - "Analytics: Segmentations"
      - "Analytics: Trends"
      - "Analytics: Management"
paths:
  /analytics/analytics/batch-delete:
    post:
      tags:
        - "Analytics: Management"
      summary: Delete multiple analyses
      description: |
        Deletes many analytics in a single request

        ---

        **API consumer:** <a href="/api-reference/authorization?tag=Authorization&amp;operationId=userLogin" target="_blank" rel="noopener">Synerise User</a>

        **User role permission required:** `analytics: delete`
      operationId: analytics2-analytics-batch-delete
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/analytics-AnalyticsBatchDeleteRequest"
        required: true
      responses:
        "204":
          description: Analytics deleted
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Management/operation/analytics2-analytics-batch-delete
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/analytics/analytics/batch-delete \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"funnelIds":["497f6eca-6276-4993-bfeb-53cbbbba6f08"],"segmentationIds":["497f6eca-6276-4993-bfeb-53cbbbba6f08"],"trendIds":["497f6eca-6276-4993-bfeb-53cbbbba6f08"],"metricIds":["497f6eca-6276-4993-bfeb-53cbbbba6f08"],"histogramIds":["497f6eca-6276-4993-bfeb-53cbbbba6f08"],"reportIds":["497f6eca-6276-4993-bfeb-53cbbbba6f08"],"aggregateIds":["497f6eca-6276-4993-bfeb-53cbbbba6f08"],"expressionIds":["497f6eca-6276-4993-bfeb-53cbbbba6f08"],"sankeyIds":["497f6eca-6276-4993-bfeb-53cbbbba6f08"]}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"funnelIds\":[\"497f6eca-6276-4993-bfeb-53cbbbba6f08\"],\"segmentationIds\":[\"497f6eca-6276-4993-bfeb-53cbbbba6f08\"],\"trendIds\":[\"497f6eca-6276-4993-bfeb-53cbbbba6f08\"],\"metricIds\":[\"497f6eca-6276-4993-bfeb-53cbbbba6f08\"],\"histogramIds\":[\"497f6eca-6276-4993-bfeb-53cbbbba6f08\"],\"reportIds\":[\"497f6eca-6276-4993-bfeb-53cbbbba6f08\"],\"aggregateIds\":[\"497f6eca-6276-4993-bfeb-53cbbbba6f08\"],\"expressionIds\":[\"497f6eca-6276-4993-bfeb-53cbbbba6f08\"],\"sankeyIds\":[\"497f6eca-6276-4993-bfeb-53cbbbba6f08\"]}"

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

            conn.request("POST", "/analytics/analytics/batch-delete", payload, headers)

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

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "funnelIds": [
                "497f6eca-6276-4993-bfeb-53cbbbba6f08"
              ],
              "segmentationIds": [
                "497f6eca-6276-4993-bfeb-53cbbbba6f08"
              ],
              "trendIds": [
                "497f6eca-6276-4993-bfeb-53cbbbba6f08"
              ],
              "metricIds": [
                "497f6eca-6276-4993-bfeb-53cbbbba6f08"
              ],
              "histogramIds": [
                "497f6eca-6276-4993-bfeb-53cbbbba6f08"
              ],
              "reportIds": [
                "497f6eca-6276-4993-bfeb-53cbbbba6f08"
              ],
              "aggregateIds": [
                "497f6eca-6276-4993-bfeb-53cbbbba6f08"
              ],
              "expressionIds": [
                "497f6eca-6276-4993-bfeb-53cbbbba6f08"
              ],
              "sankeyIds": [
                "497f6eca-6276-4993-bfeb-53cbbbba6f08"
              ]
            });

            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/analytics/analytics/batch-delete");
            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": "/analytics/analytics/batch-delete",
              "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({
              funnelIds: ['497f6eca-6276-4993-bfeb-53cbbbba6f08'],
              segmentationIds: ['497f6eca-6276-4993-bfeb-53cbbbba6f08'],
              trendIds: ['497f6eca-6276-4993-bfeb-53cbbbba6f08'],
              metricIds: ['497f6eca-6276-4993-bfeb-53cbbbba6f08'],
              histogramIds: ['497f6eca-6276-4993-bfeb-53cbbbba6f08'],
              reportIds: ['497f6eca-6276-4993-bfeb-53cbbbba6f08'],
              aggregateIds: ['497f6eca-6276-4993-bfeb-53cbbbba6f08'],
              expressionIds: ['497f6eca-6276-4993-bfeb-53cbbbba6f08'],
              sankeyIds: ['497f6eca-6276-4993-bfeb-53cbbbba6f08']
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/analytics/analytics/batch-delete');
            $request->setMethod(HTTP_METH_POST);

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

            $request->setBody('{"funnelIds":["497f6eca-6276-4993-bfeb-53cbbbba6f08"],"segmentationIds":["497f6eca-6276-4993-bfeb-53cbbbba6f08"],"trendIds":["497f6eca-6276-4993-bfeb-53cbbbba6f08"],"metricIds":["497f6eca-6276-4993-bfeb-53cbbbba6f08"],"histogramIds":["497f6eca-6276-4993-bfeb-53cbbbba6f08"],"reportIds":["497f6eca-6276-4993-bfeb-53cbbbba6f08"],"aggregateIds":["497f6eca-6276-4993-bfeb-53cbbbba6f08"],"expressionIds":["497f6eca-6276-4993-bfeb-53cbbbba6f08"],"sankeyIds":["497f6eca-6276-4993-bfeb-53cbbbba6f08"]}');

            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/analytics/analytics/batch-delete")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"funnelIds\":[\"497f6eca-6276-4993-bfeb-53cbbbba6f08\"],\"segmentationIds\":[\"497f6eca-6276-4993-bfeb-53cbbbba6f08\"],\"trendIds\":[\"497f6eca-6276-4993-bfeb-53cbbbba6f08\"],\"metricIds\":[\"497f6eca-6276-4993-bfeb-53cbbbba6f08\"],\"histogramIds\":[\"497f6eca-6276-4993-bfeb-53cbbbba6f08\"],\"reportIds\":[\"497f6eca-6276-4993-bfeb-53cbbbba6f08\"],\"aggregateIds\":[\"497f6eca-6276-4993-bfeb-53cbbbba6f08\"],\"expressionIds\":[\"497f6eca-6276-4993-bfeb-53cbbbba6f08\"],\"sankeyIds\":[\"497f6eca-6276-4993-bfeb-53cbbbba6f08\"]}")
              .asString();
  /analytics/{Namespace}/metrics:
    get:
      tags:
        - "Analytics: Metrics"
      summary: List metrics
      description: |
        Returns a paginated list of metrics.

        ---

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

        **API key permission required:** `ANALYTICS_BACKEND_METRICS_LIST_READ`

        **User role permission required:** `analytics: read`
      operationId: analytics2-metrics-list
      parameters:
        - $ref: "#/components/parameters/analytics-page"
        - $ref: "#/components/parameters/analytics-limit"
        - $ref: "#/components/parameters/analytics-search"
        - $ref: "#/components/parameters/analytics-sortBy"
        - $ref: "#/components/parameters/analytics-pathNamespace"
        - $ref: "#/components/parameters/analytics-directoryId"
        - $ref: "#/components/parameters/analytics-ids"
        - $ref: "#/components/parameters/analytics-isHistogramMetric"
        - $ref: "#/components/parameters/analytics-isReportMetric"
      responses:
        "200":
          description: List of metrics
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    description: Array of metrics
                    items:
                      $ref: "#/components/schemas/analytics-MetricListItem"
                  meta:
                    $ref: "#/components/schemas/analytics-Meta"
                required:
                  - data
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Metrics/operation/analytics2-metrics-list
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.synerise.com/analytics/%7BNamespace%7D/metrics?page=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sortBy=name%3Aasc&directoryId=SOME_STRING_VALUE&ids=SOME_STRING_VALUE&isHistogramMetric=SOME_BOOLEAN_VALUE&isReportMetric=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", "/analytics/%7BNamespace%7D/metrics?page=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sortBy=name%3Aasc&directoryId=SOME_STRING_VALUE&ids=SOME_STRING_VALUE&isHistogramMetric=SOME_BOOLEAN_VALUE&isReportMetric=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/analytics/%7BNamespace%7D/metrics?page=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sortBy=name%3Aasc&directoryId=SOME_STRING_VALUE&ids=SOME_STRING_VALUE&isHistogramMetric=SOME_BOOLEAN_VALUE&isReportMetric=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": "/analytics/%7BNamespace%7D/metrics?page=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sortBy=name%3Aasc&directoryId=SOME_STRING_VALUE&ids=SOME_STRING_VALUE&isHistogramMetric=SOME_BOOLEAN_VALUE&isReportMetric=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/analytics/%7BNamespace%7D/metrics');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'page' => 'SOME_INTEGER_VALUE',
              'limit' => 'SOME_INTEGER_VALUE',
              'search' => 'SOME_STRING_VALUE',
              'sortBy' => 'name:asc',
              'directoryId' => 'SOME_STRING_VALUE',
              'ids' => 'SOME_STRING_VALUE',
              'isHistogramMetric' => 'SOME_BOOLEAN_VALUE',
              'isReportMetric' => '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/analytics/%7BNamespace%7D/metrics?page=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sortBy=name%3Aasc&directoryId=SOME_STRING_VALUE&ids=SOME_STRING_VALUE&isHistogramMetric=SOME_BOOLEAN_VALUE&isReportMetric=SOME_BOOLEAN_VALUE")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
    post:
      tags:
        - "Analytics: Metrics"
      summary: Create metric analysis
      operationId: analytics2-metrics-create
      parameters:
        - $ref: "#/components/parameters/analytics-pathNamespace"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/analytics-MetricRequest"
      responses:
        "200":
          description: ID of the created analysis
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/analytics-Id"
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Metrics/operation/analytics2-metrics-create
      description: |
        

        ---

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

        **API key permissions required (at least one):** `ANALYTICS_BACKEND_METRICS_CREATE`, `ANALYTICS_BACKEND_METRIC_CREATE`

        **User role permission required:** `analytics: create`
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/analytics/%7BNamespace%7D/metrics \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"analysis":{"id":"5370bf3c-2dfa-4e89-98ff-07100cffee6c","title":"string","description":"string","format":{"compactNumbers":false,"currency":"EUR","dataFormat":"cash","fixedLength":0,"useSeparator":false},"comparison":{"dateFilter":{"type":"ABSOLUTE","from":"2019-08-24T14:15:22Z","to":"2019-08-24T14:15:22Z","filter":{"type":"DAILY","nestingType":"IN_PLACE","from":"string","to":"string","inverted":false}}},"metricType":"SIMPLE","expression":{"type":"VALUE","value":{"type":"NUMBER","value":100}},"isVisibleForClientProfile":true,"allowNull":true,"grouping":[{"type":"TOP","top":0}]},"inlineAnalytics":[{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","analyticType":"EXPRESSION","analysis":{"type":"EVENT","action":{"id":0,"name":"page.visit"},"name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}}}]}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"analysis\":{\"id\":\"5370bf3c-2dfa-4e89-98ff-07100cffee6c\",\"title\":\"string\",\"description\":\"string\",\"format\":{\"compactNumbers\":false,\"currency\":\"EUR\",\"dataFormat\":\"cash\",\"fixedLength\":0,\"useSeparator\":false},\"comparison\":{\"dateFilter\":{\"type\":\"ABSOLUTE\",\"from\":\"2019-08-24T14:15:22Z\",\"to\":\"2019-08-24T14:15:22Z\",\"filter\":{\"type\":\"DAILY\",\"nestingType\":\"IN_PLACE\",\"from\":\"string\",\"to\":\"string\",\"inverted\":false}}},\"metricType\":\"SIMPLE\",\"expression\":{\"type\":\"VALUE\",\"value\":{\"type\":\"NUMBER\",\"value\":100}},\"isVisibleForClientProfile\":true,\"allowNull\":true,\"grouping\":[{\"type\":\"TOP\",\"top\":0}]},\"inlineAnalytics\":[{\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\"analyticType\":\"EXPRESSION\",\"analysis\":{\"type\":\"EVENT\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}}}]}"

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

            conn.request("POST", "/analytics/%7BNamespace%7D/metrics", payload, headers)

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

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "analysis": {
                "id": "5370bf3c-2dfa-4e89-98ff-07100cffee6c",
                "title": "string",
                "description": "string",
                "format": {
                  "compactNumbers": false,
                  "currency": "EUR",
                  "dataFormat": "cash",
                  "fixedLength": 0,
                  "useSeparator": false
                },
                "comparison": {
                  "dateFilter": {
                    "type": "ABSOLUTE",
                    "from": "2019-08-24T14:15:22Z",
                    "to": "2019-08-24T14:15:22Z",
                    "filter": {
                      "type": "DAILY",
                      "nestingType": "IN_PLACE",
                      "from": "string",
                      "to": "string",
                      "inverted": false
                    }
                  }
                },
                "metricType": "SIMPLE",
                "expression": {
                  "type": "VALUE",
                  "value": {
                    "type": "NUMBER",
                    "value": 100
                  }
                },
                "isVisibleForClientProfile": true,
                "allowNull": true,
                "grouping": [
                  {
                    "type": "TOP",
                    "top": 0
                  }
                ]
              },
              "inlineAnalytics": [
                {
                  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
                  "analyticType": "EXPRESSION",
                  "analysis": {
                    "type": "EVENT",
                    "action": {
                      "id": 0,
                      "name": "page.visit"
                    },
                    "name": "string",
                    "description": "string",
                    "expression": {
                      "type": "VALUE",
                      "title": "title",
                      "value": {
                        "type": "CONSTANT",
                        "constant": 10
                      }
                    }
                  }
                }
              ]
            });

            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/analytics/%7BNamespace%7D/metrics");
            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": "/analytics/%7BNamespace%7D/metrics",
              "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({
              analysis: {
                id: '5370bf3c-2dfa-4e89-98ff-07100cffee6c',
                title: 'string',
                description: 'string',
                format: {
                  compactNumbers: false,
                  currency: 'EUR',
                  dataFormat: 'cash',
                  fixedLength: 0,
                  useSeparator: false
                },
                comparison: {
                  dateFilter: {
                    type: 'ABSOLUTE',
                    from: '2019-08-24T14:15:22Z',
                    to: '2019-08-24T14:15:22Z',
                    filter: {
                      type: 'DAILY',
                      nestingType: 'IN_PLACE',
                      from: 'string',
                      to: 'string',
                      inverted: false
                    }
                  }
                },
                metricType: 'SIMPLE',
                expression: {type: 'VALUE', value: {type: 'NUMBER', value: 100}},
                isVisibleForClientProfile: true,
                allowNull: true,
                grouping: [{type: 'TOP', top: 0}]
              },
              inlineAnalytics: [
                {
                  id: '497f6eca-6276-4993-bfeb-53cbbbba6f08',
                  analyticType: 'EXPRESSION',
                  analysis: {
                    type: 'EVENT',
                    action: {id: 0, name: 'page.visit'},
                    name: 'string',
                    description: 'string',
                    expression: {type: 'VALUE', title: 'title', value: {type: 'CONSTANT', constant: 10}}
                  }
                }
              ]
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/analytics/%7BNamespace%7D/metrics');
            $request->setMethod(HTTP_METH_POST);

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

            $request->setBody('{"analysis":{"id":"5370bf3c-2dfa-4e89-98ff-07100cffee6c","title":"string","description":"string","format":{"compactNumbers":false,"currency":"EUR","dataFormat":"cash","fixedLength":0,"useSeparator":false},"comparison":{"dateFilter":{"type":"ABSOLUTE","from":"2019-08-24T14:15:22Z","to":"2019-08-24T14:15:22Z","filter":{"type":"DAILY","nestingType":"IN_PLACE","from":"string","to":"string","inverted":false}}},"metricType":"SIMPLE","expression":{"type":"VALUE","value":{"type":"NUMBER","value":100}},"isVisibleForClientProfile":true,"allowNull":true,"grouping":[{"type":"TOP","top":0}]},"inlineAnalytics":[{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","analyticType":"EXPRESSION","analysis":{"type":"EVENT","action":{"id":0,"name":"page.visit"},"name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}}}]}');

            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/analytics/%7BNamespace%7D/metrics")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"analysis\":{\"id\":\"5370bf3c-2dfa-4e89-98ff-07100cffee6c\",\"title\":\"string\",\"description\":\"string\",\"format\":{\"compactNumbers\":false,\"currency\":\"EUR\",\"dataFormat\":\"cash\",\"fixedLength\":0,\"useSeparator\":false},\"comparison\":{\"dateFilter\":{\"type\":\"ABSOLUTE\",\"from\":\"2019-08-24T14:15:22Z\",\"to\":\"2019-08-24T14:15:22Z\",\"filter\":{\"type\":\"DAILY\",\"nestingType\":\"IN_PLACE\",\"from\":\"string\",\"to\":\"string\",\"inverted\":false}}},\"metricType\":\"SIMPLE\",\"expression\":{\"type\":\"VALUE\",\"value\":{\"type\":\"NUMBER\",\"value\":100}},\"isVisibleForClientProfile\":true,\"allowNull\":true,\"grouping\":[{\"type\":\"TOP\",\"top\":0}]},\"inlineAnalytics\":[{\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\"analyticType\":\"EXPRESSION\",\"analysis\":{\"type\":\"EVENT\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}}}]}")
              .asString();
  /analytics/{Namespace}/metrics/{AnalysisId}:
    get:
      tags:
        - "Analytics: Metrics"
      summary: Get metric details
      description: |
        Retrieve the details of a metric definition.

        ---

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

        **API key permissions required (at least one):** `ANALYTICS_BACKEND_METRICS_READ`, `ANALYTICS_BACKEND_METRIC_READ`

        **User role permission required:** `analytics: read`
      operationId: analytics2-metrics-get
      parameters:
        - $ref: "#/components/parameters/analytics-AnalyticIdPathParam"
        - $ref: "#/components/parameters/analytics-pathNamespace"
      responses:
        "200":
          description: Metric details
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/analytics-MetricView"
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Metrics/operation/analytics2-metrics-get
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url https://api.synerise.com/analytics/%7BNamespace%7D/metrics/%7BAnalysisId%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", "/analytics/%7BNamespace%7D/metrics/%7BAnalysisId%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/analytics/%7BNamespace%7D/metrics/%7BAnalysisId%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": "/analytics/%7BNamespace%7D/metrics/%7BAnalysisId%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/analytics/%7BNamespace%7D/metrics/%7BAnalysisId%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/analytics/%7BNamespace%7D/metrics/%7BAnalysisId%7D")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
    put:
      tags:
        - "Analytics: Metrics"
      summary: Update metric
      description: |
        Update an existing metric definition.

        ---

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

        **API key permissions required (at least one):** `ANALYTICS_BACKEND_METRICS_UPDATE`, `ANALYTICS_BACKEND_METRIC_UPDATE`

        **User role permission required:** `analytics: update`
      operationId: analytics2-metrics-update
      parameters:
        - $ref: "#/components/parameters/analytics-AnalyticIdPathParam"
        - $ref: "#/components/parameters/analytics-pathNamespace"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/analytics-MetricRequest"
      responses:
        "200":
          description: Metric details
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/analytics-MetricView"
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Metrics/operation/analytics2-metrics-update
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request PUT \
              --url https://api.synerise.com/analytics/%7BNamespace%7D/metrics/%7BAnalysisId%7D \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"analysis":{"id":"5370bf3c-2dfa-4e89-98ff-07100cffee6c","title":"string","description":"string","format":{"compactNumbers":false,"currency":"EUR","dataFormat":"cash","fixedLength":0,"useSeparator":false},"comparison":{"dateFilter":{"type":"ABSOLUTE","from":"2019-08-24T14:15:22Z","to":"2019-08-24T14:15:22Z","filter":{"type":"DAILY","nestingType":"IN_PLACE","from":"string","to":"string","inverted":false}}},"metricType":"SIMPLE","expression":{"type":"VALUE","value":{"type":"NUMBER","value":100}},"isVisibleForClientProfile":true,"allowNull":true,"grouping":[{"type":"TOP","top":0}]},"inlineAnalytics":[{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","analyticType":"EXPRESSION","analysis":{"type":"EVENT","action":{"id":0,"name":"page.visit"},"name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}}}]}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"analysis\":{\"id\":\"5370bf3c-2dfa-4e89-98ff-07100cffee6c\",\"title\":\"string\",\"description\":\"string\",\"format\":{\"compactNumbers\":false,\"currency\":\"EUR\",\"dataFormat\":\"cash\",\"fixedLength\":0,\"useSeparator\":false},\"comparison\":{\"dateFilter\":{\"type\":\"ABSOLUTE\",\"from\":\"2019-08-24T14:15:22Z\",\"to\":\"2019-08-24T14:15:22Z\",\"filter\":{\"type\":\"DAILY\",\"nestingType\":\"IN_PLACE\",\"from\":\"string\",\"to\":\"string\",\"inverted\":false}}},\"metricType\":\"SIMPLE\",\"expression\":{\"type\":\"VALUE\",\"value\":{\"type\":\"NUMBER\",\"value\":100}},\"isVisibleForClientProfile\":true,\"allowNull\":true,\"grouping\":[{\"type\":\"TOP\",\"top\":0}]},\"inlineAnalytics\":[{\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\"analyticType\":\"EXPRESSION\",\"analysis\":{\"type\":\"EVENT\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}}}]}"

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

            conn.request("PUT", "/analytics/%7BNamespace%7D/metrics/%7BAnalysisId%7D", payload, headers)

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

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "analysis": {
                "id": "5370bf3c-2dfa-4e89-98ff-07100cffee6c",
                "title": "string",
                "description": "string",
                "format": {
                  "compactNumbers": false,
                  "currency": "EUR",
                  "dataFormat": "cash",
                  "fixedLength": 0,
                  "useSeparator": false
                },
                "comparison": {
                  "dateFilter": {
                    "type": "ABSOLUTE",
                    "from": "2019-08-24T14:15:22Z",
                    "to": "2019-08-24T14:15:22Z",
                    "filter": {
                      "type": "DAILY",
                      "nestingType": "IN_PLACE",
                      "from": "string",
                      "to": "string",
                      "inverted": false
                    }
                  }
                },
                "metricType": "SIMPLE",
                "expression": {
                  "type": "VALUE",
                  "value": {
                    "type": "NUMBER",
                    "value": 100
                  }
                },
                "isVisibleForClientProfile": true,
                "allowNull": true,
                "grouping": [
                  {
                    "type": "TOP",
                    "top": 0
                  }
                ]
              },
              "inlineAnalytics": [
                {
                  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
                  "analyticType": "EXPRESSION",
                  "analysis": {
                    "type": "EVENT",
                    "action": {
                      "id": 0,
                      "name": "page.visit"
                    },
                    "name": "string",
                    "description": "string",
                    "expression": {
                      "type": "VALUE",
                      "title": "title",
                      "value": {
                        "type": "CONSTANT",
                        "constant": 10
                      }
                    }
                  }
                }
              ]
            });

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

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

            xhr.open("PUT", "https://api.synerise.com/analytics/%7BNamespace%7D/metrics/%7BAnalysisId%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": "PUT",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/analytics/%7BNamespace%7D/metrics/%7BAnalysisId%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({
              analysis: {
                id: '5370bf3c-2dfa-4e89-98ff-07100cffee6c',
                title: 'string',
                description: 'string',
                format: {
                  compactNumbers: false,
                  currency: 'EUR',
                  dataFormat: 'cash',
                  fixedLength: 0,
                  useSeparator: false
                },
                comparison: {
                  dateFilter: {
                    type: 'ABSOLUTE',
                    from: '2019-08-24T14:15:22Z',
                    to: '2019-08-24T14:15:22Z',
                    filter: {
                      type: 'DAILY',
                      nestingType: 'IN_PLACE',
                      from: 'string',
                      to: 'string',
                      inverted: false
                    }
                  }
                },
                metricType: 'SIMPLE',
                expression: {type: 'VALUE', value: {type: 'NUMBER', value: 100}},
                isVisibleForClientProfile: true,
                allowNull: true,
                grouping: [{type: 'TOP', top: 0}]
              },
              inlineAnalytics: [
                {
                  id: '497f6eca-6276-4993-bfeb-53cbbbba6f08',
                  analyticType: 'EXPRESSION',
                  analysis: {
                    type: 'EVENT',
                    action: {id: 0, name: 'page.visit'},
                    name: 'string',
                    description: 'string',
                    expression: {type: 'VALUE', title: 'title', value: {type: 'CONSTANT', constant: 10}}
                  }
                }
              ]
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/analytics/%7BNamespace%7D/metrics/%7BAnalysisId%7D');
            $request->setMethod(HTTP_METH_PUT);

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

            $request->setBody('{"analysis":{"id":"5370bf3c-2dfa-4e89-98ff-07100cffee6c","title":"string","description":"string","format":{"compactNumbers":false,"currency":"EUR","dataFormat":"cash","fixedLength":0,"useSeparator":false},"comparison":{"dateFilter":{"type":"ABSOLUTE","from":"2019-08-24T14:15:22Z","to":"2019-08-24T14:15:22Z","filter":{"type":"DAILY","nestingType":"IN_PLACE","from":"string","to":"string","inverted":false}}},"metricType":"SIMPLE","expression":{"type":"VALUE","value":{"type":"NUMBER","value":100}},"isVisibleForClientProfile":true,"allowNull":true,"grouping":[{"type":"TOP","top":0}]},"inlineAnalytics":[{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","analyticType":"EXPRESSION","analysis":{"type":"EVENT","action":{"id":0,"name":"page.visit"},"name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}}}]}');

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

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.put("https://api.synerise.com/analytics/%7BNamespace%7D/metrics/%7BAnalysisId%7D")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"analysis\":{\"id\":\"5370bf3c-2dfa-4e89-98ff-07100cffee6c\",\"title\":\"string\",\"description\":\"string\",\"format\":{\"compactNumbers\":false,\"currency\":\"EUR\",\"dataFormat\":\"cash\",\"fixedLength\":0,\"useSeparator\":false},\"comparison\":{\"dateFilter\":{\"type\":\"ABSOLUTE\",\"from\":\"2019-08-24T14:15:22Z\",\"to\":\"2019-08-24T14:15:22Z\",\"filter\":{\"type\":\"DAILY\",\"nestingType\":\"IN_PLACE\",\"from\":\"string\",\"to\":\"string\",\"inverted\":false}}},\"metricType\":\"SIMPLE\",\"expression\":{\"type\":\"VALUE\",\"value\":{\"type\":\"NUMBER\",\"value\":100}},\"isVisibleForClientProfile\":true,\"allowNull\":true,\"grouping\":[{\"type\":\"TOP\",\"top\":0}]},\"inlineAnalytics\":[{\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\"analyticType\":\"EXPRESSION\",\"analysis\":{\"type\":\"EVENT\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}}}]}")
              .asString();
    delete:
      tags:
        - "Analytics: Metrics"
      summary: Delete metric analysis
      operationId: analytics2-metrics-delete
      parameters:
        - $ref: "#/components/parameters/analytics-AnalyticIdPathParam"
        - $ref: "#/components/parameters/analytics-pathNamespace"
      responses:
        "204":
          description: Metric deleted
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Metrics/operation/analytics2-metrics-delete
      description: |
        

        ---

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

        **API key permissions required (at least one):** `ANALYTICS_BACKEND_METRICS_DELETE`, `ANALYTICS_BACKEND_METRIC_DELETE`

        **User role permission required:** `analytics: delete`
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request DELETE \
              --url https://api.synerise.com/analytics/%7BNamespace%7D/metrics/%7BAnalysisId%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", "/analytics/%7BNamespace%7D/metrics/%7BAnalysisId%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/analytics/%7BNamespace%7D/metrics/%7BAnalysisId%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": "/analytics/%7BNamespace%7D/metrics/%7BAnalysisId%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/analytics/%7BNamespace%7D/metrics/%7BAnalysisId%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/analytics/%7BNamespace%7D/metrics/%7BAnalysisId%7D")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
  /analytics/analytics/v4/reports/{AnalysisId}/recalculate/override:
    post:
      tags:
        - "Analytics: Reports"
      summary: Calculate report with override
      description: |
        Calculate a report with new parameters and/or variables (dynamic keys)

        ---

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

        **API key permission required:** `ANALYTICS_BACKEND_REPORT_READ`

        **User role permission required:** `analytics: read`
      operationId: analytics2-recalculate-report-override
      parameters:
        - $ref: "#/components/parameters/analytics-AnalyticIdPathParam"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/analytics-OverrideQueryRequest"
      responses:
        "200":
          description: Report calculation result
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/analytics-ReportCalculationResponse"
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Reports/operation/analytics2-recalculate-report-override
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/analytics/analytics/v4/reports/%7BAnalysisId%7D/recalculate/override \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"title":"string","dateFilter":{"type":"ABSOLUTE","from":"2019-08-24T14:15:22Z","to":"2019-08-24T14:15:22Z","filter":{"type":"DAILY","nestingType":"IN_PLACE","from":"string","to":"string","inverted":false}},"aggregateDataBy":{"type":"YEARS","value":0},"filter":{"matching":true,"expressions":[{"type":"ATTRIBUTE","name":"string","matching":true,"attribute":{"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]}}],"expression":{"type":"EMPTY"},"groupBy":[{"type":"CONSTANT","constant":"string"}]},"variables":[{"name":"string","value":"example-string-value"}],"overrideNested":false}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"title\":\"string\",\"dateFilter\":{\"type\":\"ABSOLUTE\",\"from\":\"2019-08-24T14:15:22Z\",\"to\":\"2019-08-24T14:15:22Z\",\"filter\":{\"type\":\"DAILY\",\"nestingType\":\"IN_PLACE\",\"from\":\"string\",\"to\":\"string\",\"inverted\":false}},\"aggregateDataBy\":{\"type\":\"YEARS\",\"value\":0},\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"ATTRIBUTE\",\"name\":\"string\",\"matching\":true,\"attribute\":{\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}}],\"expression\":{\"type\":\"EMPTY\"},\"groupBy\":[{\"type\":\"CONSTANT\",\"constant\":\"string\"}]},\"variables\":[{\"name\":\"string\",\"value\":\"example-string-value\"}],\"overrideNested\":false}"

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

            conn.request("POST", "/analytics/analytics/v4/reports/%7BAnalysisId%7D/recalculate/override", payload, headers)

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

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "title": "string",
              "dateFilter": {
                "type": "ABSOLUTE",
                "from": "2019-08-24T14:15:22Z",
                "to": "2019-08-24T14:15:22Z",
                "filter": {
                  "type": "DAILY",
                  "nestingType": "IN_PLACE",
                  "from": "string",
                  "to": "string",
                  "inverted": false
                }
              },
              "aggregateDataBy": {
                "type": "YEARS",
                "value": 0
              },
              "filter": {
                "matching": true,
                "expressions": [
                  {
                    "type": "ATTRIBUTE",
                    "name": "string",
                    "matching": true,
                    "attribute": {
                      "expressions": [
                        {
                          "constraint": {
                            "type": "BOOL",
                            "logic": "IS_TRUE"
                          },
                          "attribute": {
                            "type": "PARAM",
                            "param": "string"
                          }
                        }
                      ]
                    }
                  }
                ],
                "expression": {
                  "type": "EMPTY"
                },
                "groupBy": [
                  {
                    "type": "CONSTANT",
                    "constant": "string"
                  }
                ]
              },
              "variables": [
                {
                  "name": "string",
                  "value": "example-string-value"
                }
              ],
              "overrideNested": false
            });

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

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

            xhr.open("POST", "https://api.synerise.com/analytics/analytics/v4/reports/%7BAnalysisId%7D/recalculate/override");
            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": "/analytics/analytics/v4/reports/%7BAnalysisId%7D/recalculate/override",
              "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({
              title: 'string',
              dateFilter: {
                type: 'ABSOLUTE',
                from: '2019-08-24T14:15:22Z',
                to: '2019-08-24T14:15:22Z',
                filter: {
                  type: 'DAILY',
                  nestingType: 'IN_PLACE',
                  from: 'string',
                  to: 'string',
                  inverted: false
                }
              },
              aggregateDataBy: {type: 'YEARS', value: 0},
              filter: {
                matching: true,
                expressions: [
                  {
                    type: 'ATTRIBUTE',
                    name: 'string',
                    matching: true,
                    attribute: {
                      expressions: [
                        {
                          constraint: {type: 'BOOL', logic: 'IS_TRUE'},
                          attribute: {type: 'PARAM', param: 'string'}
                        }
                      ]
                    }
                  }
                ],
                expression: {type: 'EMPTY'},
                groupBy: [{type: 'CONSTANT', constant: 'string'}]
              },
              variables: [{name: 'string', value: 'example-string-value'}],
              overrideNested: false
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/analytics/analytics/v4/reports/%7BAnalysisId%7D/recalculate/override');
            $request->setMethod(HTTP_METH_POST);

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

            $request->setBody('{"title":"string","dateFilter":{"type":"ABSOLUTE","from":"2019-08-24T14:15:22Z","to":"2019-08-24T14:15:22Z","filter":{"type":"DAILY","nestingType":"IN_PLACE","from":"string","to":"string","inverted":false}},"aggregateDataBy":{"type":"YEARS","value":0},"filter":{"matching":true,"expressions":[{"type":"ATTRIBUTE","name":"string","matching":true,"attribute":{"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]}}],"expression":{"type":"EMPTY"},"groupBy":[{"type":"CONSTANT","constant":"string"}]},"variables":[{"name":"string","value":"example-string-value"}],"overrideNested":false}');

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

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.post("https://api.synerise.com/analytics/analytics/v4/reports/%7BAnalysisId%7D/recalculate/override")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"title\":\"string\",\"dateFilter\":{\"type\":\"ABSOLUTE\",\"from\":\"2019-08-24T14:15:22Z\",\"to\":\"2019-08-24T14:15:22Z\",\"filter\":{\"type\":\"DAILY\",\"nestingType\":\"IN_PLACE\",\"from\":\"string\",\"to\":\"string\",\"inverted\":false}},\"aggregateDataBy\":{\"type\":\"YEARS\",\"value\":0},\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"ATTRIBUTE\",\"name\":\"string\",\"matching\":true,\"attribute\":{\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}}],\"expression\":{\"type\":\"EMPTY\"},\"groupBy\":[{\"type\":\"CONSTANT\",\"constant\":\"string\"}]},\"variables\":[{\"name\":\"string\",\"value\":\"example-string-value\"}],\"overrideNested\":false}")
              .asString();
  /analytics/analytics/v4/reports/{AnalysisId}/recalculate:
    post:
      tags:
        - "Analytics: Reports"
      summary: Recalculate report
      description: |
        Retrieve the results of a previously-created report.

        ---

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

        **API key permission required:** `ANALYTICS_BACKEND_REPORT_READ`

        **User role permission required:** `analytics: read`
      operationId: analytics2-recalculate-report
      parameters:
        - $ref: "#/components/parameters/analytics-AnalyticIdPathParam"
      responses:
        "200":
          description: Report calculation result
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/analytics-ReportCalculationResponse"
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Reports/operation/analytics2-recalculate-report
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/analytics/analytics/v4/reports/%7BAnalysisId%7D/recalculate \
              --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", "/analytics/analytics/v4/reports/%7BAnalysisId%7D/recalculate", 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/analytics/analytics/v4/reports/%7BAnalysisId%7D/recalculate");
            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": "/analytics/analytics/v4/reports/%7BAnalysisId%7D/recalculate",
              "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/analytics/analytics/v4/reports/%7BAnalysisId%7D/recalculate');
            $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/analytics/analytics/v4/reports/%7BAnalysisId%7D/recalculate")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
  /analytics/analytics/v4/reports/preview:
    post:
      tags:
        - "Analytics: Reports"
      summary: Preview report
      description: |
        Retrieve the results of a report. This request doesn't save the report.

        ---

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

        **API key permission required:** `ANALYTICS_BACKEND_REPORT_READ`

        **User role permission required:** `analytics: read`
      operationId: analytics2-preview-report
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/analytics-ReportPreviewRequest"
      responses:
        "200":
          description: Report calculation result
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/analytics-ReportCalculationResponse"
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Reports/operation/analytics2-preview-report
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/analytics/analytics/v4/reports/preview \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"allowNull":true,"analysis":{"id":"5370bf3c-2dfa-4e89-98ff-07100cffee6c","title":"string","description":"string","reportMetrics":[{"metricId":"c2cc9ad9-a69d-40a3-8e01-a95e09e71978","dateFilter":{"type":"ABSOLUTE","from":"2019-08-24T14:15:22Z","to":"2019-08-24T14:15:22Z","filter":{"type":"DAILY","nestingType":"IN_PLACE","from":"string","to":"string","inverted":false}},"action":{"id":0,"name":"page.visit"},"actions":[{"id":0,"name":"page.visit"}],"format":{"compactNumbers":false,"currency":"EUR","dataFormat":"cash","fixedLength":0,"useSeparator":false},"columnName":"string","grouping":{"type":"TOP","top":0},"groups":[{"title":"string","format":{"compactNumbers":false,"currency":"EUR","dataFormat":"cash","fixedLength":0,"useSeparator":false},"type":"CLIENT","attribute":{"type":"PARAM","param":"string"}}]}],"filter":{"matching":true,"expressions":[{"type":"ATTRIBUTE","name":"string","matching":true,"attribute":{"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]}}],"expression":{"type":"EMPTY"},"groupBy":[{"type":"CONSTANT","constant":"string"}]}},"inlineAnalytics":[{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","analyticType":"EXPRESSION","analysis":{"type":"EVENT","action":{"id":0,"name":"page.visit"},"name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}}}]}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"allowNull\":true,\"analysis\":{\"id\":\"5370bf3c-2dfa-4e89-98ff-07100cffee6c\",\"title\":\"string\",\"description\":\"string\",\"reportMetrics\":[{\"metricId\":\"c2cc9ad9-a69d-40a3-8e01-a95e09e71978\",\"dateFilter\":{\"type\":\"ABSOLUTE\",\"from\":\"2019-08-24T14:15:22Z\",\"to\":\"2019-08-24T14:15:22Z\",\"filter\":{\"type\":\"DAILY\",\"nestingType\":\"IN_PLACE\",\"from\":\"string\",\"to\":\"string\",\"inverted\":false}},\"action\":{\"id\":0,\"name\":\"page.visit\"},\"actions\":[{\"id\":0,\"name\":\"page.visit\"}],\"format\":{\"compactNumbers\":false,\"currency\":\"EUR\",\"dataFormat\":\"cash\",\"fixedLength\":0,\"useSeparator\":false},\"columnName\":\"string\",\"grouping\":{\"type\":\"TOP\",\"top\":0},\"groups\":[{\"title\":\"string\",\"format\":{\"compactNumbers\":false,\"currency\":\"EUR\",\"dataFormat\":\"cash\",\"fixedLength\":0,\"useSeparator\":false},\"type\":\"CLIENT\",\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}],\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"ATTRIBUTE\",\"name\":\"string\",\"matching\":true,\"attribute\":{\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}}],\"expression\":{\"type\":\"EMPTY\"},\"groupBy\":[{\"type\":\"CONSTANT\",\"constant\":\"string\"}]}},\"inlineAnalytics\":[{\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\"analyticType\":\"EXPRESSION\",\"analysis\":{\"type\":\"EVENT\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}}}]}"

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

            conn.request("POST", "/analytics/analytics/v4/reports/preview", payload, headers)

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

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "allowNull": true,
              "analysis": {
                "id": "5370bf3c-2dfa-4e89-98ff-07100cffee6c",
                "title": "string",
                "description": "string",
                "reportMetrics": [
                  {
                    "metricId": "c2cc9ad9-a69d-40a3-8e01-a95e09e71978",
                    "dateFilter": {
                      "type": "ABSOLUTE",
                      "from": "2019-08-24T14:15:22Z",
                      "to": "2019-08-24T14:15:22Z",
                      "filter": {
                        "type": "DAILY",
                        "nestingType": "IN_PLACE",
                        "from": "string",
                        "to": "string",
                        "inverted": false
                      }
                    },
                    "action": {
                      "id": 0,
                      "name": "page.visit"
                    },
                    "actions": [
                      {
                        "id": 0,
                        "name": "page.visit"
                      }
                    ],
                    "format": {
                      "compactNumbers": false,
                      "currency": "EUR",
                      "dataFormat": "cash",
                      "fixedLength": 0,
                      "useSeparator": false
                    },
                    "columnName": "string",
                    "grouping": {
                      "type": "TOP",
                      "top": 0
                    },
                    "groups": [
                      {
                        "title": "string",
                        "format": {
                          "compactNumbers": false,
                          "currency": "EUR",
                          "dataFormat": "cash",
                          "fixedLength": 0,
                          "useSeparator": false
                        },
                        "type": "CLIENT",
                        "attribute": {
                          "type": "PARAM",
                          "param": "string"
                        }
                      }
                    ]
                  }
                ],
                "filter": {
                  "matching": true,
                  "expressions": [
                    {
                      "type": "ATTRIBUTE",
                      "name": "string",
                      "matching": true,
                      "attribute": {
                        "expressions": [
                          {
                            "constraint": {
                              "type": "BOOL",
                              "logic": "IS_TRUE"
                            },
                            "attribute": {
                              "type": "PARAM",
                              "param": "string"
                            }
                          }
                        ]
                      }
                    }
                  ],
                  "expression": {
                    "type": "EMPTY"
                  },
                  "groupBy": [
                    {
                      "type": "CONSTANT",
                      "constant": "string"
                    }
                  ]
                }
              },
              "inlineAnalytics": [
                {
                  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
                  "analyticType": "EXPRESSION",
                  "analysis": {
                    "type": "EVENT",
                    "action": {
                      "id": 0,
                      "name": "page.visit"
                    },
                    "name": "string",
                    "description": "string",
                    "expression": {
                      "type": "VALUE",
                      "title": "title",
                      "value": {
                        "type": "CONSTANT",
                        "constant": 10
                      }
                    }
                  }
                }
              ]
            });

            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/analytics/analytics/v4/reports/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": "/analytics/analytics/v4/reports/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({
              allowNull: true,
              analysis: {
                id: '5370bf3c-2dfa-4e89-98ff-07100cffee6c',
                title: 'string',
                description: 'string',
                reportMetrics: [
                  {
                    metricId: 'c2cc9ad9-a69d-40a3-8e01-a95e09e71978',
                    dateFilter: {
                      type: 'ABSOLUTE',
                      from: '2019-08-24T14:15:22Z',
                      to: '2019-08-24T14:15:22Z',
                      filter: {
                        type: 'DAILY',
                        nestingType: 'IN_PLACE',
                        from: 'string',
                        to: 'string',
                        inverted: false
                      }
                    },
                    action: {id: 0, name: 'page.visit'},
                    actions: [{id: 0, name: 'page.visit'}],
                    format: {
                      compactNumbers: false,
                      currency: 'EUR',
                      dataFormat: 'cash',
                      fixedLength: 0,
                      useSeparator: false
                    },
                    columnName: 'string',
                    grouping: {type: 'TOP', top: 0},
                    groups: [
                      {
                        title: 'string',
                        format: {
                          compactNumbers: false,
                          currency: 'EUR',
                          dataFormat: 'cash',
                          fixedLength: 0,
                          useSeparator: false
                        },
                        type: 'CLIENT',
                        attribute: {type: 'PARAM', param: 'string'}
                      }
                    ]
                  }
                ],
                filter: {
                  matching: true,
                  expressions: [
                    {
                      type: 'ATTRIBUTE',
                      name: 'string',
                      matching: true,
                      attribute: {
                        expressions: [
                          {
                            constraint: {type: 'BOOL', logic: 'IS_TRUE'},
                            attribute: {type: 'PARAM', param: 'string'}
                          }
                        ]
                      }
                    }
                  ],
                  expression: {type: 'EMPTY'},
                  groupBy: [{type: 'CONSTANT', constant: 'string'}]
                }
              },
              inlineAnalytics: [
                {
                  id: '497f6eca-6276-4993-bfeb-53cbbbba6f08',
                  analyticType: 'EXPRESSION',
                  analysis: {
                    type: 'EVENT',
                    action: {id: 0, name: 'page.visit'},
                    name: 'string',
                    description: 'string',
                    expression: {type: 'VALUE', title: 'title', value: {type: 'CONSTANT', constant: 10}}
                  }
                }
              ]
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/analytics/analytics/v4/reports/preview');
            $request->setMethod(HTTP_METH_POST);

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

            $request->setBody('{"allowNull":true,"analysis":{"id":"5370bf3c-2dfa-4e89-98ff-07100cffee6c","title":"string","description":"string","reportMetrics":[{"metricId":"c2cc9ad9-a69d-40a3-8e01-a95e09e71978","dateFilter":{"type":"ABSOLUTE","from":"2019-08-24T14:15:22Z","to":"2019-08-24T14:15:22Z","filter":{"type":"DAILY","nestingType":"IN_PLACE","from":"string","to":"string","inverted":false}},"action":{"id":0,"name":"page.visit"},"actions":[{"id":0,"name":"page.visit"}],"format":{"compactNumbers":false,"currency":"EUR","dataFormat":"cash","fixedLength":0,"useSeparator":false},"columnName":"string","grouping":{"type":"TOP","top":0},"groups":[{"title":"string","format":{"compactNumbers":false,"currency":"EUR","dataFormat":"cash","fixedLength":0,"useSeparator":false},"type":"CLIENT","attribute":{"type":"PARAM","param":"string"}}]}],"filter":{"matching":true,"expressions":[{"type":"ATTRIBUTE","name":"string","matching":true,"attribute":{"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]}}],"expression":{"type":"EMPTY"},"groupBy":[{"type":"CONSTANT","constant":"string"}]}},"inlineAnalytics":[{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","analyticType":"EXPRESSION","analysis":{"type":"EVENT","action":{"id":0,"name":"page.visit"},"name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}}}]}');

            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/analytics/analytics/v4/reports/preview")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"allowNull\":true,\"analysis\":{\"id\":\"5370bf3c-2dfa-4e89-98ff-07100cffee6c\",\"title\":\"string\",\"description\":\"string\",\"reportMetrics\":[{\"metricId\":\"c2cc9ad9-a69d-40a3-8e01-a95e09e71978\",\"dateFilter\":{\"type\":\"ABSOLUTE\",\"from\":\"2019-08-24T14:15:22Z\",\"to\":\"2019-08-24T14:15:22Z\",\"filter\":{\"type\":\"DAILY\",\"nestingType\":\"IN_PLACE\",\"from\":\"string\",\"to\":\"string\",\"inverted\":false}},\"action\":{\"id\":0,\"name\":\"page.visit\"},\"actions\":[{\"id\":0,\"name\":\"page.visit\"}],\"format\":{\"compactNumbers\":false,\"currency\":\"EUR\",\"dataFormat\":\"cash\",\"fixedLength\":0,\"useSeparator\":false},\"columnName\":\"string\",\"grouping\":{\"type\":\"TOP\",\"top\":0},\"groups\":[{\"title\":\"string\",\"format\":{\"compactNumbers\":false,\"currency\":\"EUR\",\"dataFormat\":\"cash\",\"fixedLength\":0,\"useSeparator\":false},\"type\":\"CLIENT\",\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}],\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"ATTRIBUTE\",\"name\":\"string\",\"matching\":true,\"attribute\":{\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}}],\"expression\":{\"type\":\"EMPTY\"},\"groupBy\":[{\"type\":\"CONSTANT\",\"constant\":\"string\"}]}},\"inlineAnalytics\":[{\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\"analyticType\":\"EXPRESSION\",\"analysis\":{\"type\":\"EVENT\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}}}]}")
              .asString();
  /analytics/analytics/v4/reports/preview-csv:
    post:
      tags:
        - "Analytics: Reports"
      summary: Preview report as CSV
      description: |
        Retrieve the results of a report as CSV. This request doesn't save the report.

        ---

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

        **API key permission required:** `ANALYTICS_BACKEND_REPORT_READ`

        **User role permission required:** `analytics: read`
      operationId: analytics2-preview-csv-report
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/analytics-ReportPreviewRequest"
      responses:
        "200":
          description: CSV data
          content:
            text/csv:
              schema:
                type: string
                description: |
                  Results for groupings. Each grouping is a CSV row, with the first row being the column headers.

                  **Example**: if the dimensions of your report are _firstname_ and _title_ in a page visit event, this may be the result:

                  ```
                  "firstname";"title";"Value"
                  "John";"Discounted Product Page";"26.0"
                  "Steve";"Discounted Product Page";"12.0"
                  "Steve";"New product pre-order";"117.0"
                  ```

                  This means that 26 profiles named John visited a page titled "Discounted Product Page". The same page was visited by 12 profiles named Steve. Profiles named Steve visited "New product pre-order" page 117 times.
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Reports/operation/analytics2-preview-csv-report
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/analytics/analytics/v4/reports/preview-csv \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"allowNull":true,"analysis":{"id":"5370bf3c-2dfa-4e89-98ff-07100cffee6c","title":"string","description":"string","reportMetrics":[{"metricId":"c2cc9ad9-a69d-40a3-8e01-a95e09e71978","dateFilter":{"type":"ABSOLUTE","from":"2019-08-24T14:15:22Z","to":"2019-08-24T14:15:22Z","filter":{"type":"DAILY","nestingType":"IN_PLACE","from":"string","to":"string","inverted":false}},"action":{"id":0,"name":"page.visit"},"actions":[{"id":0,"name":"page.visit"}],"format":{"compactNumbers":false,"currency":"EUR","dataFormat":"cash","fixedLength":0,"useSeparator":false},"columnName":"string","grouping":{"type":"TOP","top":0},"groups":[{"title":"string","format":{"compactNumbers":false,"currency":"EUR","dataFormat":"cash","fixedLength":0,"useSeparator":false},"type":"CLIENT","attribute":{"type":"PARAM","param":"string"}}]}],"filter":{"matching":true,"expressions":[{"type":"ATTRIBUTE","name":"string","matching":true,"attribute":{"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]}}],"expression":{"type":"EMPTY"},"groupBy":[{"type":"CONSTANT","constant":"string"}]}},"inlineAnalytics":[{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","analyticType":"EXPRESSION","analysis":{"type":"EVENT","action":{"id":0,"name":"page.visit"},"name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}}}]}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"allowNull\":true,\"analysis\":{\"id\":\"5370bf3c-2dfa-4e89-98ff-07100cffee6c\",\"title\":\"string\",\"description\":\"string\",\"reportMetrics\":[{\"metricId\":\"c2cc9ad9-a69d-40a3-8e01-a95e09e71978\",\"dateFilter\":{\"type\":\"ABSOLUTE\",\"from\":\"2019-08-24T14:15:22Z\",\"to\":\"2019-08-24T14:15:22Z\",\"filter\":{\"type\":\"DAILY\",\"nestingType\":\"IN_PLACE\",\"from\":\"string\",\"to\":\"string\",\"inverted\":false}},\"action\":{\"id\":0,\"name\":\"page.visit\"},\"actions\":[{\"id\":0,\"name\":\"page.visit\"}],\"format\":{\"compactNumbers\":false,\"currency\":\"EUR\",\"dataFormat\":\"cash\",\"fixedLength\":0,\"useSeparator\":false},\"columnName\":\"string\",\"grouping\":{\"type\":\"TOP\",\"top\":0},\"groups\":[{\"title\":\"string\",\"format\":{\"compactNumbers\":false,\"currency\":\"EUR\",\"dataFormat\":\"cash\",\"fixedLength\":0,\"useSeparator\":false},\"type\":\"CLIENT\",\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}],\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"ATTRIBUTE\",\"name\":\"string\",\"matching\":true,\"attribute\":{\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}}],\"expression\":{\"type\":\"EMPTY\"},\"groupBy\":[{\"type\":\"CONSTANT\",\"constant\":\"string\"}]}},\"inlineAnalytics\":[{\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\"analyticType\":\"EXPRESSION\",\"analysis\":{\"type\":\"EVENT\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}}}]}"

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

            conn.request("POST", "/analytics/analytics/v4/reports/preview-csv", payload, headers)

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

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "allowNull": true,
              "analysis": {
                "id": "5370bf3c-2dfa-4e89-98ff-07100cffee6c",
                "title": "string",
                "description": "string",
                "reportMetrics": [
                  {
                    "metricId": "c2cc9ad9-a69d-40a3-8e01-a95e09e71978",
                    "dateFilter": {
                      "type": "ABSOLUTE",
                      "from": "2019-08-24T14:15:22Z",
                      "to": "2019-08-24T14:15:22Z",
                      "filter": {
                        "type": "DAILY",
                        "nestingType": "IN_PLACE",
                        "from": "string",
                        "to": "string",
                        "inverted": false
                      }
                    },
                    "action": {
                      "id": 0,
                      "name": "page.visit"
                    },
                    "actions": [
                      {
                        "id": 0,
                        "name": "page.visit"
                      }
                    ],
                    "format": {
                      "compactNumbers": false,
                      "currency": "EUR",
                      "dataFormat": "cash",
                      "fixedLength": 0,
                      "useSeparator": false
                    },
                    "columnName": "string",
                    "grouping": {
                      "type": "TOP",
                      "top": 0
                    },
                    "groups": [
                      {
                        "title": "string",
                        "format": {
                          "compactNumbers": false,
                          "currency": "EUR",
                          "dataFormat": "cash",
                          "fixedLength": 0,
                          "useSeparator": false
                        },
                        "type": "CLIENT",
                        "attribute": {
                          "type": "PARAM",
                          "param": "string"
                        }
                      }
                    ]
                  }
                ],
                "filter": {
                  "matching": true,
                  "expressions": [
                    {
                      "type": "ATTRIBUTE",
                      "name": "string",
                      "matching": true,
                      "attribute": {
                        "expressions": [
                          {
                            "constraint": {
                              "type": "BOOL",
                              "logic": "IS_TRUE"
                            },
                            "attribute": {
                              "type": "PARAM",
                              "param": "string"
                            }
                          }
                        ]
                      }
                    }
                  ],
                  "expression": {
                    "type": "EMPTY"
                  },
                  "groupBy": [
                    {
                      "type": "CONSTANT",
                      "constant": "string"
                    }
                  ]
                }
              },
              "inlineAnalytics": [
                {
                  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
                  "analyticType": "EXPRESSION",
                  "analysis": {
                    "type": "EVENT",
                    "action": {
                      "id": 0,
                      "name": "page.visit"
                    },
                    "name": "string",
                    "description": "string",
                    "expression": {
                      "type": "VALUE",
                      "title": "title",
                      "value": {
                        "type": "CONSTANT",
                        "constant": 10
                      }
                    }
                  }
                }
              ]
            });

            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/analytics/analytics/v4/reports/preview-csv");
            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": "/analytics/analytics/v4/reports/preview-csv",
              "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({
              allowNull: true,
              analysis: {
                id: '5370bf3c-2dfa-4e89-98ff-07100cffee6c',
                title: 'string',
                description: 'string',
                reportMetrics: [
                  {
                    metricId: 'c2cc9ad9-a69d-40a3-8e01-a95e09e71978',
                    dateFilter: {
                      type: 'ABSOLUTE',
                      from: '2019-08-24T14:15:22Z',
                      to: '2019-08-24T14:15:22Z',
                      filter: {
                        type: 'DAILY',
                        nestingType: 'IN_PLACE',
                        from: 'string',
                        to: 'string',
                        inverted: false
                      }
                    },
                    action: {id: 0, name: 'page.visit'},
                    actions: [{id: 0, name: 'page.visit'}],
                    format: {
                      compactNumbers: false,
                      currency: 'EUR',
                      dataFormat: 'cash',
                      fixedLength: 0,
                      useSeparator: false
                    },
                    columnName: 'string',
                    grouping: {type: 'TOP', top: 0},
                    groups: [
                      {
                        title: 'string',
                        format: {
                          compactNumbers: false,
                          currency: 'EUR',
                          dataFormat: 'cash',
                          fixedLength: 0,
                          useSeparator: false
                        },
                        type: 'CLIENT',
                        attribute: {type: 'PARAM', param: 'string'}
                      }
                    ]
                  }
                ],
                filter: {
                  matching: true,
                  expressions: [
                    {
                      type: 'ATTRIBUTE',
                      name: 'string',
                      matching: true,
                      attribute: {
                        expressions: [
                          {
                            constraint: {type: 'BOOL', logic: 'IS_TRUE'},
                            attribute: {type: 'PARAM', param: 'string'}
                          }
                        ]
                      }
                    }
                  ],
                  expression: {type: 'EMPTY'},
                  groupBy: [{type: 'CONSTANT', constant: 'string'}]
                }
              },
              inlineAnalytics: [
                {
                  id: '497f6eca-6276-4993-bfeb-53cbbbba6f08',
                  analyticType: 'EXPRESSION',
                  analysis: {
                    type: 'EVENT',
                    action: {id: 0, name: 'page.visit'},
                    name: 'string',
                    description: 'string',
                    expression: {type: 'VALUE', title: 'title', value: {type: 'CONSTANT', constant: 10}}
                  }
                }
              ]
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/analytics/analytics/v4/reports/preview-csv');
            $request->setMethod(HTTP_METH_POST);

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

            $request->setBody('{"allowNull":true,"analysis":{"id":"5370bf3c-2dfa-4e89-98ff-07100cffee6c","title":"string","description":"string","reportMetrics":[{"metricId":"c2cc9ad9-a69d-40a3-8e01-a95e09e71978","dateFilter":{"type":"ABSOLUTE","from":"2019-08-24T14:15:22Z","to":"2019-08-24T14:15:22Z","filter":{"type":"DAILY","nestingType":"IN_PLACE","from":"string","to":"string","inverted":false}},"action":{"id":0,"name":"page.visit"},"actions":[{"id":0,"name":"page.visit"}],"format":{"compactNumbers":false,"currency":"EUR","dataFormat":"cash","fixedLength":0,"useSeparator":false},"columnName":"string","grouping":{"type":"TOP","top":0},"groups":[{"title":"string","format":{"compactNumbers":false,"currency":"EUR","dataFormat":"cash","fixedLength":0,"useSeparator":false},"type":"CLIENT","attribute":{"type":"PARAM","param":"string"}}]}],"filter":{"matching":true,"expressions":[{"type":"ATTRIBUTE","name":"string","matching":true,"attribute":{"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]}}],"expression":{"type":"EMPTY"},"groupBy":[{"type":"CONSTANT","constant":"string"}]}},"inlineAnalytics":[{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","analyticType":"EXPRESSION","analysis":{"type":"EVENT","action":{"id":0,"name":"page.visit"},"name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}}}]}');

            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/analytics/analytics/v4/reports/preview-csv")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"allowNull\":true,\"analysis\":{\"id\":\"5370bf3c-2dfa-4e89-98ff-07100cffee6c\",\"title\":\"string\",\"description\":\"string\",\"reportMetrics\":[{\"metricId\":\"c2cc9ad9-a69d-40a3-8e01-a95e09e71978\",\"dateFilter\":{\"type\":\"ABSOLUTE\",\"from\":\"2019-08-24T14:15:22Z\",\"to\":\"2019-08-24T14:15:22Z\",\"filter\":{\"type\":\"DAILY\",\"nestingType\":\"IN_PLACE\",\"from\":\"string\",\"to\":\"string\",\"inverted\":false}},\"action\":{\"id\":0,\"name\":\"page.visit\"},\"actions\":[{\"id\":0,\"name\":\"page.visit\"}],\"format\":{\"compactNumbers\":false,\"currency\":\"EUR\",\"dataFormat\":\"cash\",\"fixedLength\":0,\"useSeparator\":false},\"columnName\":\"string\",\"grouping\":{\"type\":\"TOP\",\"top\":0},\"groups\":[{\"title\":\"string\",\"format\":{\"compactNumbers\":false,\"currency\":\"EUR\",\"dataFormat\":\"cash\",\"fixedLength\":0,\"useSeparator\":false},\"type\":\"CLIENT\",\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}],\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"ATTRIBUTE\",\"name\":\"string\",\"matching\":true,\"attribute\":{\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}}],\"expression\":{\"type\":\"EMPTY\"},\"groupBy\":[{\"type\":\"CONSTANT\",\"constant\":\"string\"}]}},\"inlineAnalytics\":[{\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\"analyticType\":\"EXPRESSION\",\"analysis\":{\"type\":\"EVENT\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}}}]}")
              .asString();
  /analytics/directories:
    get:
      tags:
        - "Analytics: Management"
      summary: List directories
      description: |
        Returns a list of directories for a given analytic type.

        ---

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

        **API key permission required:** `ANALYTICS_DESCRIPTION_ANALYTICS_READ`

        **User role permission required:** `analytics: read`
      operationId: analytics2-directories-list
      parameters:
        - name: analyticType
          in: query
          description: Type of object
          required: true
          style: form
          explode: true
          schema:
            type: string
            enum:
              - EXPRESSION
              - AGGREGATE
              - SEGMENTATION
              - METRIC
              - FUNNEL
              - SANKEY
              - TREND
              - HISTOGRAM
              - REPORT
              - ANALYTICS_QUERY
              - ANALYTICS_DASHBOARD
      responses:
        "200":
          description: List of directories
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/analytics-Directory"
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Management/operation/analytics2-directories-list
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.synerise.com/analytics/directories?analyticType=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", "/analytics/directories?analyticType=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/analytics/directories?analyticType=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": "/analytics/directories?analyticType=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/analytics/directories');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'analyticType' => '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/analytics/directories?analyticType=SOME_STRING_VALUE")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
    post:
      tags:
        - "Analytics: Management"
      summary: Create directory
      description: |
        Creates a new directory

        ---

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

        **API key permission required:** `ANALYTICS_DESCRIPTION_ANALYTICS_CREATE`

        **User role permission required:** `analytics: create`
      operationId: analytics2-directories-create
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/analytics-DirectoryCreateRequest"
      responses:
        "201":
          description: ID of the created directory
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    $ref: "#/components/schemas/analytics-Id"
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Management/operation/analytics2-directories-create
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/analytics/directories \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"name":"string","analyticType":"EXPRESSION"}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"name\":\"string\",\"analyticType\":\"EXPRESSION\"}"

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

            conn.request("POST", "/analytics/directories", payload, headers)

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

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "name": "string",
              "analyticType": "EXPRESSION"
            });

            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/analytics/directories");
            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": "/analytics/directories",
              "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({name: 'string', analyticType: 'EXPRESSION'}));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

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

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

            $request->setBody('{"name":"string","analyticType":"EXPRESSION"}');

            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/analytics/directories")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"name\":\"string\",\"analyticType\":\"EXPRESSION\"}")
              .asString();
  /analytics/directories/{DirectoryId}:
    patch:
      tags:
        - "Analytics: Management"
      summary: Rename directory
      description: |
        Renames a directory

        ---

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

        **API key permission required:** `ANALYTICS_DESCRIPTION_ANALYTICS_UPDATE`

        **User role permission required:** `analytics: update`
      operationId: analytics2-directories-rename
      parameters:
        - $ref: "#/components/parameters/analytics-DirectoryIdPathParam"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/analytics-DirectoryRenameRequest"
      responses:
        "204":
          description: Directory renamed
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Management/operation/analytics2-directories-rename
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request PATCH \
              --url https://api.synerise.com/analytics/directories/%7BDirectoryId%7D \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"newName":"string"}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"newName\":\"string\"}"

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

            conn.request("PATCH", "/analytics/directories/%7BDirectoryId%7D", payload, headers)

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

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "newName": "string"
            });

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

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

            xhr.open("PATCH", "https://api.synerise.com/analytics/directories/%7BDirectoryId%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": "PATCH",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/analytics/directories/%7BDirectoryId%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({newName: 'string'}));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            HttpRequest::methodRegister('PATCH');
            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/analytics/directories/%7BDirectoryId%7D');
            $request->setMethod(HttpRequest::HTTP_METH_PATCH);

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

            $request->setBody('{"newName":"string"}');

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

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.patch("https://api.synerise.com/analytics/directories/%7BDirectoryId%7D")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"newName\":\"string\"}")
              .asString();
    delete:
      tags:
        - "Analytics: Management"
      summary: Delete directory
      description: |
        Deletes a directory. If the directory contains any analyses, they are moved to the default directory.

        ---

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

        **API key permission required:** `ANALYTICS_DESCRIPTION_ANALYTICS_DELETE`

        **User role permission required:** `analytics: delete`
      operationId: analytics2-directories-delete
      parameters:
        - $ref: "#/components/parameters/analytics-DirectoryIdPathParam"
      responses:
        "204":
          description: Directory deleted
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Management/operation/analytics2-directories-delete
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request DELETE \
              --url https://api.synerise.com/analytics/directories/%7BDirectoryId%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", "/analytics/directories/%7BDirectoryId%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/analytics/directories/%7BDirectoryId%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": "/analytics/directories/%7BDirectoryId%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/analytics/directories/%7BDirectoryId%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/analytics/directories/%7BDirectoryId%7D")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
  /analytics/directories/change/{AnalysisId}:
    patch:
      tags:
        - "Analytics: Management"
      summary: Change Directory
      description: |
        Moves an analysis to another directory

        ---

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

        **API key permission required:** `ANALYTICS_DESCRIPTION_ANALYTICS_UPDATE`

        **User role permission required:** `analytics: update`
      operationId: analytics2-directories-change
      parameters:
        - $ref: "#/components/parameters/analytics-AnalyticIdPathParam"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/analytics-DirectoryChangeRequest"
      responses:
        "204":
          description: Analysis moved
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Management/operation/analytics2-directories-change
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request PATCH \
              --url https://api.synerise.com/analytics/directories/change/%7BAnalysisId%7D \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"newDir":"927cf82e-bfcc-4026-ba0d-96408cda03cb","analyticType":"EXPRESSION"}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"newDir\":\"927cf82e-bfcc-4026-ba0d-96408cda03cb\",\"analyticType\":\"EXPRESSION\"}"

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

            conn.request("PATCH", "/analytics/directories/change/%7BAnalysisId%7D", payload, headers)

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

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "newDir": "927cf82e-bfcc-4026-ba0d-96408cda03cb",
              "analyticType": "EXPRESSION"
            });

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

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

            xhr.open("PATCH", "https://api.synerise.com/analytics/directories/change/%7BAnalysisId%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": "PATCH",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/analytics/directories/change/%7BAnalysisId%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({newDir: '927cf82e-bfcc-4026-ba0d-96408cda03cb', analyticType: 'EXPRESSION'}));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            HttpRequest::methodRegister('PATCH');
            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/analytics/directories/change/%7BAnalysisId%7D');
            $request->setMethod(HttpRequest::HTTP_METH_PATCH);

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

            $request->setBody('{"newDir":"927cf82e-bfcc-4026-ba0d-96408cda03cb","analyticType":"EXPRESSION"}');

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

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.patch("https://api.synerise.com/analytics/directories/change/%7BAnalysisId%7D")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"newDir\":\"927cf82e-bfcc-4026-ba0d-96408cda03cb\",\"analyticType\":\"EXPRESSION\"}")
              .asString();
  /analytics/analytics/v3/metrics/preview:
    post:
      tags:
        - "Analytics: Metrics"
      summary: Preview metric
      description: |
        Get the results of a metric. This request doesn't save the metric to the database.

        ---

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

        **API key permission required:** `ANALYTICS_BACKEND_METRIC_READ`

        **User role permission required:** `analytics: read`
      operationId: analytics2-preview-metric-legacy
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/analytics-MetricLegacyPreview"
      responses:
        "200":
          description: Metric preview result
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/analytics-MetricCalculationResponse"
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Metrics/operation/analytics2-preview-metric-legacy
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/analytics/analytics/v3/metrics/preview \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"analysis":{"id":"5370bf3c-2dfa-4e89-98ff-07100cffee6c","title":"string","description":"string","format":{"compactNumbers":false,"currency":"EUR","dataFormat":"cash","fixedLength":0,"useSeparator":false},"comparison":{"dateFilter":{"type":"ABSOLUTE","from":"2019-08-24T14:15:22Z","to":"2019-08-24T14:15:22Z","filter":{"type":"DAILY","nestingType":"IN_PLACE","from":"string","to":"string","inverted":false}}},"metricType":"SIMPLE","expression":{"type":"VALUE","value":{"type":"NUMBER","value":100}},"isVisibleForClientProfile":true,"allowNull":true,"grouping":[{"type":"TOP","top":0}]},"inlineAnalytics":[{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","analyticType":"EXPRESSION","analysis":{"type":"EVENT","action":{"id":0,"name":"page.visit"},"name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}}}]}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"analysis\":{\"id\":\"5370bf3c-2dfa-4e89-98ff-07100cffee6c\",\"title\":\"string\",\"description\":\"string\",\"format\":{\"compactNumbers\":false,\"currency\":\"EUR\",\"dataFormat\":\"cash\",\"fixedLength\":0,\"useSeparator\":false},\"comparison\":{\"dateFilter\":{\"type\":\"ABSOLUTE\",\"from\":\"2019-08-24T14:15:22Z\",\"to\":\"2019-08-24T14:15:22Z\",\"filter\":{\"type\":\"DAILY\",\"nestingType\":\"IN_PLACE\",\"from\":\"string\",\"to\":\"string\",\"inverted\":false}}},\"metricType\":\"SIMPLE\",\"expression\":{\"type\":\"VALUE\",\"value\":{\"type\":\"NUMBER\",\"value\":100}},\"isVisibleForClientProfile\":true,\"allowNull\":true,\"grouping\":[{\"type\":\"TOP\",\"top\":0}]},\"inlineAnalytics\":[{\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\"analyticType\":\"EXPRESSION\",\"analysis\":{\"type\":\"EVENT\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}}}]}"

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

            conn.request("POST", "/analytics/analytics/v3/metrics/preview", payload, headers)

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

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "analysis": {
                "id": "5370bf3c-2dfa-4e89-98ff-07100cffee6c",
                "title": "string",
                "description": "string",
                "format": {
                  "compactNumbers": false,
                  "currency": "EUR",
                  "dataFormat": "cash",
                  "fixedLength": 0,
                  "useSeparator": false
                },
                "comparison": {
                  "dateFilter": {
                    "type": "ABSOLUTE",
                    "from": "2019-08-24T14:15:22Z",
                    "to": "2019-08-24T14:15:22Z",
                    "filter": {
                      "type": "DAILY",
                      "nestingType": "IN_PLACE",
                      "from": "string",
                      "to": "string",
                      "inverted": false
                    }
                  }
                },
                "metricType": "SIMPLE",
                "expression": {
                  "type": "VALUE",
                  "value": {
                    "type": "NUMBER",
                    "value": 100
                  }
                },
                "isVisibleForClientProfile": true,
                "allowNull": true,
                "grouping": [
                  {
                    "type": "TOP",
                    "top": 0
                  }
                ]
              },
              "inlineAnalytics": [
                {
                  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
                  "analyticType": "EXPRESSION",
                  "analysis": {
                    "type": "EVENT",
                    "action": {
                      "id": 0,
                      "name": "page.visit"
                    },
                    "name": "string",
                    "description": "string",
                    "expression": {
                      "type": "VALUE",
                      "title": "title",
                      "value": {
                        "type": "CONSTANT",
                        "constant": 10
                      }
                    }
                  }
                }
              ]
            });

            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/analytics/analytics/v3/metrics/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": "/analytics/analytics/v3/metrics/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({
              analysis: {
                id: '5370bf3c-2dfa-4e89-98ff-07100cffee6c',
                title: 'string',
                description: 'string',
                format: {
                  compactNumbers: false,
                  currency: 'EUR',
                  dataFormat: 'cash',
                  fixedLength: 0,
                  useSeparator: false
                },
                comparison: {
                  dateFilter: {
                    type: 'ABSOLUTE',
                    from: '2019-08-24T14:15:22Z',
                    to: '2019-08-24T14:15:22Z',
                    filter: {
                      type: 'DAILY',
                      nestingType: 'IN_PLACE',
                      from: 'string',
                      to: 'string',
                      inverted: false
                    }
                  }
                },
                metricType: 'SIMPLE',
                expression: {type: 'VALUE', value: {type: 'NUMBER', value: 100}},
                isVisibleForClientProfile: true,
                allowNull: true,
                grouping: [{type: 'TOP', top: 0}]
              },
              inlineAnalytics: [
                {
                  id: '497f6eca-6276-4993-bfeb-53cbbbba6f08',
                  analyticType: 'EXPRESSION',
                  analysis: {
                    type: 'EVENT',
                    action: {id: 0, name: 'page.visit'},
                    name: 'string',
                    description: 'string',
                    expression: {type: 'VALUE', title: 'title', value: {type: 'CONSTANT', constant: 10}}
                  }
                }
              ]
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/analytics/analytics/v3/metrics/preview');
            $request->setMethod(HTTP_METH_POST);

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

            $request->setBody('{"analysis":{"id":"5370bf3c-2dfa-4e89-98ff-07100cffee6c","title":"string","description":"string","format":{"compactNumbers":false,"currency":"EUR","dataFormat":"cash","fixedLength":0,"useSeparator":false},"comparison":{"dateFilter":{"type":"ABSOLUTE","from":"2019-08-24T14:15:22Z","to":"2019-08-24T14:15:22Z","filter":{"type":"DAILY","nestingType":"IN_PLACE","from":"string","to":"string","inverted":false}}},"metricType":"SIMPLE","expression":{"type":"VALUE","value":{"type":"NUMBER","value":100}},"isVisibleForClientProfile":true,"allowNull":true,"grouping":[{"type":"TOP","top":0}]},"inlineAnalytics":[{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","analyticType":"EXPRESSION","analysis":{"type":"EVENT","action":{"id":0,"name":"page.visit"},"name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}}}]}');

            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/analytics/analytics/v3/metrics/preview")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"analysis\":{\"id\":\"5370bf3c-2dfa-4e89-98ff-07100cffee6c\",\"title\":\"string\",\"description\":\"string\",\"format\":{\"compactNumbers\":false,\"currency\":\"EUR\",\"dataFormat\":\"cash\",\"fixedLength\":0,\"useSeparator\":false},\"comparison\":{\"dateFilter\":{\"type\":\"ABSOLUTE\",\"from\":\"2019-08-24T14:15:22Z\",\"to\":\"2019-08-24T14:15:22Z\",\"filter\":{\"type\":\"DAILY\",\"nestingType\":\"IN_PLACE\",\"from\":\"string\",\"to\":\"string\",\"inverted\":false}}},\"metricType\":\"SIMPLE\",\"expression\":{\"type\":\"VALUE\",\"value\":{\"type\":\"NUMBER\",\"value\":100}},\"isVisibleForClientProfile\":true,\"allowNull\":true,\"grouping\":[{\"type\":\"TOP\",\"top\":0}]},\"inlineAnalytics\":[{\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\"analyticType\":\"EXPRESSION\",\"analysis\":{\"type\":\"EVENT\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}}}]}")
              .asString();
  /analytics/analytics/v3/metrics/{AnalysisId}/recalculate/override:
    post:
      tags:
        - "Analytics: Metrics"
      summary: Calculate metric with parameter override
      description: |
        Recalculate a metric with new parameters and/or variable (dynamic key) values.

        ---

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

        **API key permission required:** `ANALYTICS_BACKEND_METRIC_READ`

        **User role permission required:** `analytics: read`
      operationId: analytics2-calculate-metric-with-override
      parameters:
        - $ref: "#/components/parameters/analytics-AnalyticIdPathParam"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/analytics-OverrideQueryRequest"
      responses:
        "200":
          description: Metric calculation result
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/analytics-MetricCalculationResponse"
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Metrics/operation/analytics2-calculate-metric-with-override
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/analytics/analytics/v3/metrics/%7BAnalysisId%7D/recalculate/override \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"title":"string","dateFilter":{"type":"ABSOLUTE","from":"2019-08-24T14:15:22Z","to":"2019-08-24T14:15:22Z","filter":{"type":"DAILY","nestingType":"IN_PLACE","from":"string","to":"string","inverted":false}},"aggregateDataBy":{"type":"YEARS","value":0},"filter":{"matching":true,"expressions":[{"type":"ATTRIBUTE","name":"string","matching":true,"attribute":{"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]}}],"expression":{"type":"EMPTY"},"groupBy":[{"type":"CONSTANT","constant":"string"}]},"variables":[{"name":"string","value":"example-string-value"}],"overrideNested":false}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"title\":\"string\",\"dateFilter\":{\"type\":\"ABSOLUTE\",\"from\":\"2019-08-24T14:15:22Z\",\"to\":\"2019-08-24T14:15:22Z\",\"filter\":{\"type\":\"DAILY\",\"nestingType\":\"IN_PLACE\",\"from\":\"string\",\"to\":\"string\",\"inverted\":false}},\"aggregateDataBy\":{\"type\":\"YEARS\",\"value\":0},\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"ATTRIBUTE\",\"name\":\"string\",\"matching\":true,\"attribute\":{\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}}],\"expression\":{\"type\":\"EMPTY\"},\"groupBy\":[{\"type\":\"CONSTANT\",\"constant\":\"string\"}]},\"variables\":[{\"name\":\"string\",\"value\":\"example-string-value\"}],\"overrideNested\":false}"

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

            conn.request("POST", "/analytics/analytics/v3/metrics/%7BAnalysisId%7D/recalculate/override", payload, headers)

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

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "title": "string",
              "dateFilter": {
                "type": "ABSOLUTE",
                "from": "2019-08-24T14:15:22Z",
                "to": "2019-08-24T14:15:22Z",
                "filter": {
                  "type": "DAILY",
                  "nestingType": "IN_PLACE",
                  "from": "string",
                  "to": "string",
                  "inverted": false
                }
              },
              "aggregateDataBy": {
                "type": "YEARS",
                "value": 0
              },
              "filter": {
                "matching": true,
                "expressions": [
                  {
                    "type": "ATTRIBUTE",
                    "name": "string",
                    "matching": true,
                    "attribute": {
                      "expressions": [
                        {
                          "constraint": {
                            "type": "BOOL",
                            "logic": "IS_TRUE"
                          },
                          "attribute": {
                            "type": "PARAM",
                            "param": "string"
                          }
                        }
                      ]
                    }
                  }
                ],
                "expression": {
                  "type": "EMPTY"
                },
                "groupBy": [
                  {
                    "type": "CONSTANT",
                    "constant": "string"
                  }
                ]
              },
              "variables": [
                {
                  "name": "string",
                  "value": "example-string-value"
                }
              ],
              "overrideNested": false
            });

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

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

            xhr.open("POST", "https://api.synerise.com/analytics/analytics/v3/metrics/%7BAnalysisId%7D/recalculate/override");
            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": "/analytics/analytics/v3/metrics/%7BAnalysisId%7D/recalculate/override",
              "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({
              title: 'string',
              dateFilter: {
                type: 'ABSOLUTE',
                from: '2019-08-24T14:15:22Z',
                to: '2019-08-24T14:15:22Z',
                filter: {
                  type: 'DAILY',
                  nestingType: 'IN_PLACE',
                  from: 'string',
                  to: 'string',
                  inverted: false
                }
              },
              aggregateDataBy: {type: 'YEARS', value: 0},
              filter: {
                matching: true,
                expressions: [
                  {
                    type: 'ATTRIBUTE',
                    name: 'string',
                    matching: true,
                    attribute: {
                      expressions: [
                        {
                          constraint: {type: 'BOOL', logic: 'IS_TRUE'},
                          attribute: {type: 'PARAM', param: 'string'}
                        }
                      ]
                    }
                  }
                ],
                expression: {type: 'EMPTY'},
                groupBy: [{type: 'CONSTANT', constant: 'string'}]
              },
              variables: [{name: 'string', value: 'example-string-value'}],
              overrideNested: false
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/analytics/analytics/v3/metrics/%7BAnalysisId%7D/recalculate/override');
            $request->setMethod(HTTP_METH_POST);

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

            $request->setBody('{"title":"string","dateFilter":{"type":"ABSOLUTE","from":"2019-08-24T14:15:22Z","to":"2019-08-24T14:15:22Z","filter":{"type":"DAILY","nestingType":"IN_PLACE","from":"string","to":"string","inverted":false}},"aggregateDataBy":{"type":"YEARS","value":0},"filter":{"matching":true,"expressions":[{"type":"ATTRIBUTE","name":"string","matching":true,"attribute":{"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]}}],"expression":{"type":"EMPTY"},"groupBy":[{"type":"CONSTANT","constant":"string"}]},"variables":[{"name":"string","value":"example-string-value"}],"overrideNested":false}');

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

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.post("https://api.synerise.com/analytics/analytics/v3/metrics/%7BAnalysisId%7D/recalculate/override")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"title\":\"string\",\"dateFilter\":{\"type\":\"ABSOLUTE\",\"from\":\"2019-08-24T14:15:22Z\",\"to\":\"2019-08-24T14:15:22Z\",\"filter\":{\"type\":\"DAILY\",\"nestingType\":\"IN_PLACE\",\"from\":\"string\",\"to\":\"string\",\"inverted\":false}},\"aggregateDataBy\":{\"type\":\"YEARS\",\"value\":0},\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"ATTRIBUTE\",\"name\":\"string\",\"matching\":true,\"attribute\":{\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}}],\"expression\":{\"type\":\"EMPTY\"},\"groupBy\":[{\"type\":\"CONSTANT\",\"constant\":\"string\"}]},\"variables\":[{\"name\":\"string\",\"value\":\"example-string-value\"}],\"overrideNested\":false}")
              .asString();
  /analytics/analytics/v3/metrics/{AnalysisId}/recalculate:
    post:
      tags:
        - "Analytics: Metrics"
      summary: Calculate metric
      description: |
        Calculate a metric that was created earlier.

        ---

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

        **API key permission required:** `ANALYTICS_BACKEND_METRIC_READ`

        **User role permission required:** `analytics: read`
      operationId: analytics2-calculate-metric
      parameters:
        - $ref: "#/components/parameters/analytics-AnalyticIdPathParam"
      responses:
        "200":
          description: Metric calculation result
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/analytics-MetricCalculationResponse"
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Metrics/operation/analytics2-calculate-metric
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/analytics/analytics/v3/metrics/%7BAnalysisId%7D/recalculate \
              --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", "/analytics/analytics/v3/metrics/%7BAnalysisId%7D/recalculate", 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/analytics/analytics/v3/metrics/%7BAnalysisId%7D/recalculate");
            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": "/analytics/analytics/v3/metrics/%7BAnalysisId%7D/recalculate",
              "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/analytics/analytics/v3/metrics/%7BAnalysisId%7D/recalculate');
            $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/analytics/analytics/v3/metrics/%7BAnalysisId%7D/recalculate")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
  /analytics/analytics/v3/metrics/{AnalysisId}/dynamic/value:
    post:
      tags:
        - "Analytics: Metrics"
      summary: Calculate dynamic metric
      description: |
        Calculate a metric that includes variables (dynamic keys).

        ---

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

        **API key permission required:** `ANALYTICS_BACKEND_METRIC_READ`

        **User role permission required:** `analytics: read`
      operationId: analytics2-calculate-metric-override-variables
      parameters:
        - $ref: "#/components/parameters/analytics-AnalyticIdPathParam"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/analytics-DynamicVariablesRequest"
      responses:
        "200":
          description: Metric calculation result
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/analytics-MetricCalculationResponse"
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Metrics/operation/analytics2-calculate-metric-override-variables
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/analytics/analytics/v3/metrics/%7BAnalysisId%7D/dynamic/value \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"variables":[{"name":"string","value":"example-string-value"}]}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"variables\":[{\"name\":\"string\",\"value\":\"example-string-value\"}]}"

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

            conn.request("POST", "/analytics/analytics/v3/metrics/%7BAnalysisId%7D/dynamic/value", payload, headers)

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

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "variables": [
                {
                  "name": "string",
                  "value": "example-string-value"
                }
              ]
            });

            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/analytics/analytics/v3/metrics/%7BAnalysisId%7D/dynamic/value");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
            xhr.setRequestHeader("content-type", "application/json");

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

            const options = {
              "method": "POST",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/analytics/analytics/v3/metrics/%7BAnalysisId%7D/dynamic/value",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN",
                "content-type": "application/json"
              }
            };

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

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

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

            req.write(JSON.stringify({variables: [{name: 'string', value: 'example-string-value'}]}));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/analytics/analytics/v3/metrics/%7BAnalysisId%7D/dynamic/value');
            $request->setMethod(HTTP_METH_POST);

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

            $request->setBody('{"variables":[{"name":"string","value":"example-string-value"}]}');

            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/analytics/analytics/v3/metrics/%7BAnalysisId%7D/dynamic/value")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"variables\":[{\"name\":\"string\",\"value\":\"example-string-value\"}]}")
              .asString();
  /analytics/{Namespace}/expressions/visible-for-client/by/{IdentifierType}:
    post:
      tags:
        - "Analytics: Expressions"
      summary: Get expressions for profile card
      description: |
        Retrieve expressions to display on a profile's card in the Profiles module (`"isVisibleForClientProfile": true` in the [expression config](https://developers.synerise.com/AnalyticsSuite/AnalyticsSuite.html#operation/addExpressionPOST)).


        ---

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

        **API key permission required:** `ANALYTICS_BACKEND_EXPRESSION_FOR_CLIENT_READ`

        **User role permission required (at least one):** `analytics: read`, `client_analytics_preview: read`
      operationId: analytics2-client-card-expressions-get
      parameters:
        - $ref: "#/components/parameters/analytics-pathIdentifierType"
        - $ref: "#/components/parameters/analytics-pathNamespace"
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                identifierValue:
                  $ref: "#/components/schemas/analytics-IdentifierValue"
              required:
                - identifierValue
      responses:
        "200":
          description: List of calculated expressions configured as visible on the profile card
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/analytics-BatchCalculationResult"
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/data-management#tag/Analytics:-Expressions/operation/analytics2-client-card-expressions-get
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/analytics/%7BNamespace%7D/expressions/visible-for-client/by/%7BIdentifierType%7D \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"identifierValue":"string"}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"identifierValue\":\"string\"}"

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

            conn.request("POST", "/analytics/%7BNamespace%7D/expressions/visible-for-client/by/%7BIdentifierType%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"
            });

            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/analytics/%7BNamespace%7D/expressions/visible-for-client/by/%7BIdentifierType%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": "/analytics/%7BNamespace%7D/expressions/visible-for-client/by/%7BIdentifierType%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'}));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/analytics/%7BNamespace%7D/expressions/visible-for-client/by/%7BIdentifierType%7D');
            $request->setMethod(HTTP_METH_POST);

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

            $request->setBody('{"identifierValue":"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/analytics/%7BNamespace%7D/expressions/visible-for-client/by/%7BIdentifierType%7D")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"identifierValue\":\"string\"}")
              .asString();
  /analytics/{Namespace}/expressions/{AnalysisId}/calculate/by/{IdentifierType}:
    post:
      tags:
        - "Analytics: Expressions"
      summary: Calculate expression for profile
      description: |
        Calculate the result of an expression in context of a single profile.

        ---

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

        **API key permission required:** `ANALYTICS_BACKEND_EXPRESSION_FOR_CLIENT_READ`

        **User role permission required:** `analytics: read`
      operationId: analytics2-expression-calculate
      parameters:
        - $ref: "#/components/parameters/analytics-pathNamespace"
        - $ref: "#/components/parameters/analytics-AnalyticIdPathParam"
        - $ref: "#/components/parameters/analytics-pathIdentifierType"
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                identifierValue:
                  $ref: "#/components/schemas/analytics-IdentifierValue"
              required:
                - identifierValue
      responses:
        "200":
          description: Expression result
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/analytics-ExpressionResult"
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/data-management#tag/Analytics:-Expressions/operation/analytics2-expression-calculate
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/analytics/%7BNamespace%7D/expressions/%7BAnalysisId%7D/calculate/by/%7BIdentifierType%7D \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"identifierValue":"string"}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"identifierValue\":\"string\"}"

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

            conn.request("POST", "/analytics/%7BNamespace%7D/expressions/%7BAnalysisId%7D/calculate/by/%7BIdentifierType%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"
            });

            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/analytics/%7BNamespace%7D/expressions/%7BAnalysisId%7D/calculate/by/%7BIdentifierType%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": "/analytics/%7BNamespace%7D/expressions/%7BAnalysisId%7D/calculate/by/%7BIdentifierType%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'}));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/analytics/%7BNamespace%7D/expressions/%7BAnalysisId%7D/calculate/by/%7BIdentifierType%7D');
            $request->setMethod(HTTP_METH_POST);

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

            $request->setBody('{"identifierValue":"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/analytics/%7BNamespace%7D/expressions/%7BAnalysisId%7D/calculate/by/%7BIdentifierType%7D")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"identifierValue\":\"string\"}")
              .asString();
  /analytics/{Namespace}/expressions:
    get:
      tags:
        - "Analytics: Expressions"
      summary: List expressions
      description: |
        Returns a paginated list of expressions.

        ---

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

        **API key permission required:** `ANALYTICS_BACKEND_EXPRESSIONS_LIST_READ`

        **User role permission required:** `analytics: read`
      operationId: analytics2-expressions-list
      parameters:
        - $ref: "#/components/parameters/analytics-page"
        - $ref: "#/components/parameters/analytics-limit"
        - $ref: "#/components/parameters/analytics-search"
        - $ref: "#/components/parameters/analytics-sortBy"
        - $ref: "#/components/parameters/analytics-pathNamespace"
        - $ref: "#/components/parameters/analytics-directoryId"
        - $ref: "#/components/parameters/analytics-ids"
        - $ref: "#/components/parameters/analytics-expressionType"
        - $ref: "#/components/parameters/analytics-actionName"
      responses:
        "200":
          description: List of expressions
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    description: Array of expressions
                    items:
                      $ref: "#/components/schemas/analytics-ExpressionListItem"
                  meta:
                    $ref: "#/components/schemas/analytics-Meta"
                required:
                  - data
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/data-management#tag/Analytics:-Expressions/operation/analytics2-expressions-list
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.synerise.com/analytics/%7BNamespace%7D/expressions?page=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sortBy=name%3Aasc&directoryId=SOME_STRING_VALUE&ids=SOME_STRING_VALUE&type=SOME_STRING_VALUE&actionName=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", "/analytics/%7BNamespace%7D/expressions?page=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sortBy=name%3Aasc&directoryId=SOME_STRING_VALUE&ids=SOME_STRING_VALUE&type=SOME_STRING_VALUE&actionName=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/analytics/%7BNamespace%7D/expressions?page=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sortBy=name%3Aasc&directoryId=SOME_STRING_VALUE&ids=SOME_STRING_VALUE&type=SOME_STRING_VALUE&actionName=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": "/analytics/%7BNamespace%7D/expressions?page=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sortBy=name%3Aasc&directoryId=SOME_STRING_VALUE&ids=SOME_STRING_VALUE&type=SOME_STRING_VALUE&actionName=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/analytics/%7BNamespace%7D/expressions');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'page' => 'SOME_INTEGER_VALUE',
              'limit' => 'SOME_INTEGER_VALUE',
              'search' => 'SOME_STRING_VALUE',
              'sortBy' => 'name:asc',
              'directoryId' => 'SOME_STRING_VALUE',
              'ids' => 'SOME_STRING_VALUE',
              'type' => 'SOME_STRING_VALUE',
              'actionName' => '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/analytics/%7BNamespace%7D/expressions?page=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sortBy=name%3Aasc&directoryId=SOME_STRING_VALUE&ids=SOME_STRING_VALUE&type=SOME_STRING_VALUE&actionName=SOME_STRING_VALUE")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
    post:
      tags:
        - "Analytics: Expressions"
      summary: Create expression
      description: |
        Create an expression that is saved in the database and can be used in other analyses.

        ---

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

        **API key permissions required (at least one):** `ANALYTICS_BACKEND_EXPRESSIONS_CREATE`, `ANALYTICS_BACKEND_EXPRESSION_CREATE`

        **User role permission required:** `analytics: create`
      operationId: analytics2-expressions-create
      parameters:
        - $ref: "#/components/parameters/analytics-pathNamespace"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/analytics-expressionCreateRequestBody"
      responses:
        "201":
          description: Create expression
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/data-management#tag/Analytics:-Expressions/operation/analytics2-expressions-create
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/analytics/%7BNamespace%7D/expressions \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"isVisibleForClientProfile":true,"analysis":{"type":"EVENT","action":{"id":0,"name":"page.visit"},"name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}},"inlineAnalytics":[{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","analyticType":"EXPRESSION","analysis":{"type":"EVENT","action":{"id":0,"name":"page.visit"},"name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}}}]}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"isVisibleForClientProfile\":true,\"analysis\":{\"type\":\"EVENT\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}},\"inlineAnalytics\":[{\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\"analyticType\":\"EXPRESSION\",\"analysis\":{\"type\":\"EVENT\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}}}]}"

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

            conn.request("POST", "/analytics/%7BNamespace%7D/expressions", payload, headers)

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

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "isVisibleForClientProfile": true,
              "analysis": {
                "type": "EVENT",
                "action": {
                  "id": 0,
                  "name": "page.visit"
                },
                "name": "string",
                "description": "string",
                "expression": {
                  "type": "VALUE",
                  "title": "title",
                  "value": {
                    "type": "CONSTANT",
                    "constant": 10
                  }
                }
              },
              "inlineAnalytics": [
                {
                  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
                  "analyticType": "EXPRESSION",
                  "analysis": {
                    "type": "EVENT",
                    "action": {
                      "id": 0,
                      "name": "page.visit"
                    },
                    "name": "string",
                    "description": "string",
                    "expression": {
                      "type": "VALUE",
                      "title": "title",
                      "value": {
                        "type": "CONSTANT",
                        "constant": 10
                      }
                    }
                  }
                }
              ]
            });

            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/analytics/%7BNamespace%7D/expressions");
            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": "/analytics/%7BNamespace%7D/expressions",
              "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({
              isVisibleForClientProfile: true,
              analysis: {
                type: 'EVENT',
                action: {id: 0, name: 'page.visit'},
                name: 'string',
                description: 'string',
                expression: {type: 'VALUE', title: 'title', value: {type: 'CONSTANT', constant: 10}}
              },
              inlineAnalytics: [
                {
                  id: '497f6eca-6276-4993-bfeb-53cbbbba6f08',
                  analyticType: 'EXPRESSION',
                  analysis: {
                    type: 'EVENT',
                    action: {id: 0, name: 'page.visit'},
                    name: 'string',
                    description: 'string',
                    expression: {type: 'VALUE', title: 'title', value: {type: 'CONSTANT', constant: 10}}
                  }
                }
              ]
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/analytics/%7BNamespace%7D/expressions');
            $request->setMethod(HTTP_METH_POST);

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

            $request->setBody('{"isVisibleForClientProfile":true,"analysis":{"type":"EVENT","action":{"id":0,"name":"page.visit"},"name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}},"inlineAnalytics":[{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","analyticType":"EXPRESSION","analysis":{"type":"EVENT","action":{"id":0,"name":"page.visit"},"name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}}}]}');

            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/analytics/%7BNamespace%7D/expressions")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"isVisibleForClientProfile\":true,\"analysis\":{\"type\":\"EVENT\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}},\"inlineAnalytics\":[{\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\"analyticType\":\"EXPRESSION\",\"analysis\":{\"type\":\"EVENT\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}}}]}")
              .asString();
  /analytics/{Namespace}/expressions/{AnalysisId}:
    get:
      tags:
        - "Analytics: Expressions"
      summary: Get expression details
      description: |
        Retrieve information about an expression analysis

        ---

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

        **API key permissions required (at least one):** `ANALYTICS_BACKEND_EXPRESSIONS_READ`, `ANALYTICS_BACKEND_EXPRESSION_READ`

        **User role permission required:** `analytics: read`
      operationId: analytics2-expressions-get
      parameters:
        - $ref: "#/components/parameters/analytics-pathNamespace"
        - $ref: "#/components/parameters/analytics-AnalyticIdPathParam"
      responses:
        "200":
          description: Get expression details
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/analytics-ExpressionView"
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/data-management#tag/Analytics:-Expressions/operation/analytics2-expressions-get
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url https://api.synerise.com/analytics/%7BNamespace%7D/expressions/%7BAnalysisId%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", "/analytics/%7BNamespace%7D/expressions/%7BAnalysisId%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/analytics/%7BNamespace%7D/expressions/%7BAnalysisId%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": "/analytics/%7BNamespace%7D/expressions/%7BAnalysisId%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/analytics/%7BNamespace%7D/expressions/%7BAnalysisId%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/analytics/%7BNamespace%7D/expressions/%7BAnalysisId%7D")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
    put:
      tags:
        - "Analytics: Expressions"
      summary: Update expression
      description: |
        Update an existing expression

        ---

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

        **API key permissions required (at least one):** `ANALYTICS_BACKEND_EXPRESSIONS_UPDATE`, `ANALYTICS_BACKEND_EXPRESSION_UPDATE`

        **User role permission required:** `analytics: update`
      operationId: analytics2-expressions-update
      parameters:
        - $ref: "#/components/parameters/analytics-pathNamespace"
        - $ref: "#/components/parameters/analytics-AnalyticIdPathParam"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/analytics-expressionCreateRequestBody"
      responses:
        "200":
          description: Update expression
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/data-management#tag/Analytics:-Expressions/operation/analytics2-expressions-update
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request PUT \
              --url https://api.synerise.com/analytics/%7BNamespace%7D/expressions/%7BAnalysisId%7D \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"isVisibleForClientProfile":true,"analysis":{"type":"EVENT","action":{"id":0,"name":"page.visit"},"name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}},"inlineAnalytics":[{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","analyticType":"EXPRESSION","analysis":{"type":"EVENT","action":{"id":0,"name":"page.visit"},"name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}}}]}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"isVisibleForClientProfile\":true,\"analysis\":{\"type\":\"EVENT\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}},\"inlineAnalytics\":[{\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\"analyticType\":\"EXPRESSION\",\"analysis\":{\"type\":\"EVENT\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}}}]}"

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

            conn.request("PUT", "/analytics/%7BNamespace%7D/expressions/%7BAnalysisId%7D", payload, headers)

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

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "isVisibleForClientProfile": true,
              "analysis": {
                "type": "EVENT",
                "action": {
                  "id": 0,
                  "name": "page.visit"
                },
                "name": "string",
                "description": "string",
                "expression": {
                  "type": "VALUE",
                  "title": "title",
                  "value": {
                    "type": "CONSTANT",
                    "constant": 10
                  }
                }
              },
              "inlineAnalytics": [
                {
                  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
                  "analyticType": "EXPRESSION",
                  "analysis": {
                    "type": "EVENT",
                    "action": {
                      "id": 0,
                      "name": "page.visit"
                    },
                    "name": "string",
                    "description": "string",
                    "expression": {
                      "type": "VALUE",
                      "title": "title",
                      "value": {
                        "type": "CONSTANT",
                        "constant": 10
                      }
                    }
                  }
                }
              ]
            });

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

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

            xhr.open("PUT", "https://api.synerise.com/analytics/%7BNamespace%7D/expressions/%7BAnalysisId%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": "PUT",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/analytics/%7BNamespace%7D/expressions/%7BAnalysisId%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({
              isVisibleForClientProfile: true,
              analysis: {
                type: 'EVENT',
                action: {id: 0, name: 'page.visit'},
                name: 'string',
                description: 'string',
                expression: {type: 'VALUE', title: 'title', value: {type: 'CONSTANT', constant: 10}}
              },
              inlineAnalytics: [
                {
                  id: '497f6eca-6276-4993-bfeb-53cbbbba6f08',
                  analyticType: 'EXPRESSION',
                  analysis: {
                    type: 'EVENT',
                    action: {id: 0, name: 'page.visit'},
                    name: 'string',
                    description: 'string',
                    expression: {type: 'VALUE', title: 'title', value: {type: 'CONSTANT', constant: 10}}
                  }
                }
              ]
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/analytics/%7BNamespace%7D/expressions/%7BAnalysisId%7D');
            $request->setMethod(HTTP_METH_PUT);

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

            $request->setBody('{"isVisibleForClientProfile":true,"analysis":{"type":"EVENT","action":{"id":0,"name":"page.visit"},"name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}},"inlineAnalytics":[{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","analyticType":"EXPRESSION","analysis":{"type":"EVENT","action":{"id":0,"name":"page.visit"},"name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}}}]}');

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

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.put("https://api.synerise.com/analytics/%7BNamespace%7D/expressions/%7BAnalysisId%7D")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"isVisibleForClientProfile\":true,\"analysis\":{\"type\":\"EVENT\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}},\"inlineAnalytics\":[{\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\"analyticType\":\"EXPRESSION\",\"analysis\":{\"type\":\"EVENT\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}}}]}")
              .asString();
    delete:
      tags:
        - "Analytics: Expressions"
      summary: Delete expression
      operationId: analytics2-expressions-delete
      parameters:
        - $ref: "#/components/parameters/analytics-pathNamespace"
        - $ref: "#/components/parameters/analytics-AnalyticIdPathParam"
      responses:
        "204":
          description: Delete expression
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/data-management#tag/Analytics:-Expressions/operation/analytics2-expressions-delete
      description: |
        

        ---

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

        **API key permissions required (at least one):** `ANALYTICS_BACKEND_EXPRESSIONS_DELETE`, `ANALYTICS_BACKEND_EXPRESSION_DELETE`

        **User role permission required:** `analytics: delete`
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request DELETE \
              --url https://api.synerise.com/analytics/%7BNamespace%7D/expressions/%7BAnalysisId%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", "/analytics/%7BNamespace%7D/expressions/%7BAnalysisId%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/analytics/%7BNamespace%7D/expressions/%7BAnalysisId%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": "/analytics/%7BNamespace%7D/expressions/%7BAnalysisId%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/analytics/%7BNamespace%7D/expressions/%7BAnalysisId%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/analytics/%7BNamespace%7D/expressions/%7BAnalysisId%7D")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
  /analytics/{Namespace}/expressions/preview/by/{IdentifierType}:
    post:
      tags:
        - "Analytics: Expressions"
      summary: Get expression preview
      description: |
        Retrieve expression preview value. Previews are only available for CLIENT-type expressions. This request doesn't save the expression.

        ---

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

        **API key permission required:** `ANALYTICS_BACKEND_EXPRESSION_FOR_CLIENT_READ`

        **User role permission required (at least one):** `analytics: read`, `client_analytics_preview: read`
      operationId: analytics2-expression-preview-v2
      parameters:
        - $ref: "#/components/parameters/analytics-pathNamespace"
        - $ref: "#/components/parameters/analytics-pathIdentifierType"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/analytics-ExpressionPreviewRequestWithClient"
      responses:
        "200":
          description: Expression preview result
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/analytics-ExpressionTypedCalculationResponse"
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/data-management#tag/Analytics:-Expressions/operation/analytics2-expression-preview-v2
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/analytics/%7BNamespace%7D/expressions/preview/by/%7BIdentifierType%7D \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"identifierValue":"string","expression":{"id":"5370bf3c-2dfa-4e89-98ff-07100cffee6c","type":"CLIENT","name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}},"inlineAnalytics":[{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","analyticType":"EXPRESSION","analysis":{"type":"EVENT","action":{"id":0,"name":"page.visit"},"name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}}}]}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"identifierValue\":\"string\",\"expression\":{\"id\":\"5370bf3c-2dfa-4e89-98ff-07100cffee6c\",\"type\":\"CLIENT\",\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}},\"inlineAnalytics\":[{\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\"analyticType\":\"EXPRESSION\",\"analysis\":{\"type\":\"EVENT\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}}}]}"

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

            conn.request("POST", "/analytics/%7BNamespace%7D/expressions/preview/by/%7BIdentifierType%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",
              "expression": {
                "id": "5370bf3c-2dfa-4e89-98ff-07100cffee6c",
                "type": "CLIENT",
                "name": "string",
                "description": "string",
                "expression": {
                  "type": "VALUE",
                  "title": "title",
                  "value": {
                    "type": "CONSTANT",
                    "constant": 10
                  }
                }
              },
              "inlineAnalytics": [
                {
                  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
                  "analyticType": "EXPRESSION",
                  "analysis": {
                    "type": "EVENT",
                    "action": {
                      "id": 0,
                      "name": "page.visit"
                    },
                    "name": "string",
                    "description": "string",
                    "expression": {
                      "type": "VALUE",
                      "title": "title",
                      "value": {
                        "type": "CONSTANT",
                        "constant": 10
                      }
                    }
                  }
                }
              ]
            });

            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/analytics/%7BNamespace%7D/expressions/preview/by/%7BIdentifierType%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": "/analytics/%7BNamespace%7D/expressions/preview/by/%7BIdentifierType%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',
              expression: {
                id: '5370bf3c-2dfa-4e89-98ff-07100cffee6c',
                type: 'CLIENT',
                name: 'string',
                description: 'string',
                expression: {type: 'VALUE', title: 'title', value: {type: 'CONSTANT', constant: 10}}
              },
              inlineAnalytics: [
                {
                  id: '497f6eca-6276-4993-bfeb-53cbbbba6f08',
                  analyticType: 'EXPRESSION',
                  analysis: {
                    type: 'EVENT',
                    action: {id: 0, name: 'page.visit'},
                    name: 'string',
                    description: 'string',
                    expression: {type: 'VALUE', title: 'title', value: {type: 'CONSTANT', constant: 10}}
                  }
                }
              ]
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/analytics/%7BNamespace%7D/expressions/preview/by/%7BIdentifierType%7D');
            $request->setMethod(HTTP_METH_POST);

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

            $request->setBody('{"identifierValue":"string","expression":{"id":"5370bf3c-2dfa-4e89-98ff-07100cffee6c","type":"CLIENT","name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}},"inlineAnalytics":[{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","analyticType":"EXPRESSION","analysis":{"type":"EVENT","action":{"id":0,"name":"page.visit"},"name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}}}]}');

            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/analytics/%7BNamespace%7D/expressions/preview/by/%7BIdentifierType%7D")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"identifierValue\":\"string\",\"expression\":{\"id\":\"5370bf3c-2dfa-4e89-98ff-07100cffee6c\",\"type\":\"CLIENT\",\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}},\"inlineAnalytics\":[{\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\"analyticType\":\"EXPRESSION\",\"analysis\":{\"type\":\"EVENT\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}}}]}")
              .asString();
  /analytics/{Namespace}/histograms:
    get:
      tags:
        - "Analytics: Histograms"
      summary: List histograms
      description: |
        Returns a paginated list of histograms.

        ---

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

        **API key permission required:** `ANALYTICS_BACKEND_HISTOGRAMS_LIST_READ`

        **User role permission required:** `analytics: read`
      operationId: analytics2-histograms-list
      parameters:
        - $ref: "#/components/parameters/analytics-page"
        - $ref: "#/components/parameters/analytics-limit"
        - $ref: "#/components/parameters/analytics-search"
        - $ref: "#/components/parameters/analytics-sortBy"
        - $ref: "#/components/parameters/analytics-pathNamespace"
        - $ref: "#/components/parameters/analytics-directoryId"
        - $ref: "#/components/parameters/analytics-ids"
      responses:
        "200":
          description: List of histograms
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    description: Array of histograms
                    items:
                      $ref: "#/components/schemas/analytics-ListAnalyticsItemCommon"
                  meta:
                    $ref: "#/components/schemas/analytics-Meta"
                required:
                  - data
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Histograms/operation/analytics2-histograms-list
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.synerise.com/analytics/%7BNamespace%7D/histograms?page=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sortBy=name%3Aasc&directoryId=SOME_STRING_VALUE&ids=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", "/analytics/%7BNamespace%7D/histograms?page=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sortBy=name%3Aasc&directoryId=SOME_STRING_VALUE&ids=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/analytics/%7BNamespace%7D/histograms?page=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sortBy=name%3Aasc&directoryId=SOME_STRING_VALUE&ids=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": "/analytics/%7BNamespace%7D/histograms?page=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sortBy=name%3Aasc&directoryId=SOME_STRING_VALUE&ids=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/analytics/%7BNamespace%7D/histograms');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'page' => 'SOME_INTEGER_VALUE',
              'limit' => 'SOME_INTEGER_VALUE',
              'search' => 'SOME_STRING_VALUE',
              'sortBy' => 'name:asc',
              'directoryId' => 'SOME_STRING_VALUE',
              'ids' => '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/analytics/%7BNamespace%7D/histograms?page=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sortBy=name%3Aasc&directoryId=SOME_STRING_VALUE&ids=SOME_STRING_VALUE")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
    post:
      tags:
        - "Analytics: Histograms"
      summary: Create histogram
      operationId: analytics2-histograms-create
      parameters:
        - $ref: "#/components/parameters/analytics-pathNamespace"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/analytics-HistogramRequest"
      responses:
        "200":
          description: Histogram created
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/analytics-Id"
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Histograms/operation/analytics2-histograms-create
      description: |
        

        ---

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

        **API key permissions required (at least one):** `ANALYTICS_BACKEND_HISTOGRAMS_CREATE`, `ANALYTICS_BACKEND_HISTOGRAM_CREATE`

        **User role permission required:** `analytics: create`
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/analytics/%7BNamespace%7D/histograms \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"analysis":{"title":"string","description":"string","histogram":{"dateFilter":{"type":"ABSOLUTE","from":"2019-08-24T14:15:22Z","to":"2019-08-24T14:15:22Z","filter":{"type":"DAILY","nestingType":"IN_PLACE","from":"string","to":"string","inverted":false}},"period":{"type":"YEARS","value":0},"eventMetrics":[{"metricId":"5370bf3c-2dfa-4e89-98ff-07100cffee6c","chartType":"COLUMN","title":"string"}]}},"inlineAnalytics":[{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","analyticType":"EXPRESSION","analysis":{"type":"EVENT","action":{"id":0,"name":"page.visit"},"name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}}}]}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"analysis\":{\"title\":\"string\",\"description\":\"string\",\"histogram\":{\"dateFilter\":{\"type\":\"ABSOLUTE\",\"from\":\"2019-08-24T14:15:22Z\",\"to\":\"2019-08-24T14:15:22Z\",\"filter\":{\"type\":\"DAILY\",\"nestingType\":\"IN_PLACE\",\"from\":\"string\",\"to\":\"string\",\"inverted\":false}},\"period\":{\"type\":\"YEARS\",\"value\":0},\"eventMetrics\":[{\"metricId\":\"5370bf3c-2dfa-4e89-98ff-07100cffee6c\",\"chartType\":\"COLUMN\",\"title\":\"string\"}]}},\"inlineAnalytics\":[{\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\"analyticType\":\"EXPRESSION\",\"analysis\":{\"type\":\"EVENT\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}}}]}"

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

            conn.request("POST", "/analytics/%7BNamespace%7D/histograms", payload, headers)

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

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "analysis": {
                "title": "string",
                "description": "string",
                "histogram": {
                  "dateFilter": {
                    "type": "ABSOLUTE",
                    "from": "2019-08-24T14:15:22Z",
                    "to": "2019-08-24T14:15:22Z",
                    "filter": {
                      "type": "DAILY",
                      "nestingType": "IN_PLACE",
                      "from": "string",
                      "to": "string",
                      "inverted": false
                    }
                  },
                  "period": {
                    "type": "YEARS",
                    "value": 0
                  },
                  "eventMetrics": [
                    {
                      "metricId": "5370bf3c-2dfa-4e89-98ff-07100cffee6c",
                      "chartType": "COLUMN",
                      "title": "string"
                    }
                  ]
                }
              },
              "inlineAnalytics": [
                {
                  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
                  "analyticType": "EXPRESSION",
                  "analysis": {
                    "type": "EVENT",
                    "action": {
                      "id": 0,
                      "name": "page.visit"
                    },
                    "name": "string",
                    "description": "string",
                    "expression": {
                      "type": "VALUE",
                      "title": "title",
                      "value": {
                        "type": "CONSTANT",
                        "constant": 10
                      }
                    }
                  }
                }
              ]
            });

            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/analytics/%7BNamespace%7D/histograms");
            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": "/analytics/%7BNamespace%7D/histograms",
              "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({
              analysis: {
                title: 'string',
                description: 'string',
                histogram: {
                  dateFilter: {
                    type: 'ABSOLUTE',
                    from: '2019-08-24T14:15:22Z',
                    to: '2019-08-24T14:15:22Z',
                    filter: {
                      type: 'DAILY',
                      nestingType: 'IN_PLACE',
                      from: 'string',
                      to: 'string',
                      inverted: false
                    }
                  },
                  period: {type: 'YEARS', value: 0},
                  eventMetrics: [
                    {
                      metricId: '5370bf3c-2dfa-4e89-98ff-07100cffee6c',
                      chartType: 'COLUMN',
                      title: 'string'
                    }
                  ]
                }
              },
              inlineAnalytics: [
                {
                  id: '497f6eca-6276-4993-bfeb-53cbbbba6f08',
                  analyticType: 'EXPRESSION',
                  analysis: {
                    type: 'EVENT',
                    action: {id: 0, name: 'page.visit'},
                    name: 'string',
                    description: 'string',
                    expression: {type: 'VALUE', title: 'title', value: {type: 'CONSTANT', constant: 10}}
                  }
                }
              ]
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/analytics/%7BNamespace%7D/histograms');
            $request->setMethod(HTTP_METH_POST);

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

            $request->setBody('{"analysis":{"title":"string","description":"string","histogram":{"dateFilter":{"type":"ABSOLUTE","from":"2019-08-24T14:15:22Z","to":"2019-08-24T14:15:22Z","filter":{"type":"DAILY","nestingType":"IN_PLACE","from":"string","to":"string","inverted":false}},"period":{"type":"YEARS","value":0},"eventMetrics":[{"metricId":"5370bf3c-2dfa-4e89-98ff-07100cffee6c","chartType":"COLUMN","title":"string"}]}},"inlineAnalytics":[{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","analyticType":"EXPRESSION","analysis":{"type":"EVENT","action":{"id":0,"name":"page.visit"},"name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}}}]}');

            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/analytics/%7BNamespace%7D/histograms")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"analysis\":{\"title\":\"string\",\"description\":\"string\",\"histogram\":{\"dateFilter\":{\"type\":\"ABSOLUTE\",\"from\":\"2019-08-24T14:15:22Z\",\"to\":\"2019-08-24T14:15:22Z\",\"filter\":{\"type\":\"DAILY\",\"nestingType\":\"IN_PLACE\",\"from\":\"string\",\"to\":\"string\",\"inverted\":false}},\"period\":{\"type\":\"YEARS\",\"value\":0},\"eventMetrics\":[{\"metricId\":\"5370bf3c-2dfa-4e89-98ff-07100cffee6c\",\"chartType\":\"COLUMN\",\"title\":\"string\"}]}},\"inlineAnalytics\":[{\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\"analyticType\":\"EXPRESSION\",\"analysis\":{\"type\":\"EVENT\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}}}]}")
              .asString();
  /analytics/{Namespace}/histograms/{AnalysisId}:
    get:
      tags:
        - "Analytics: Histograms"
      summary: Get histogram details
      description: |
        Retrieve the details of an existing histogram definition

        ---

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

        **API key permissions required (at least one):** `ANALYTICS_BACKEND_HISTOGRAMS_READ`, `ANALYTICS_BACKEND_HISTOGRAM_READ`

        **User role permission required:** `analytics: read`
      operationId: analytics2-histograms-get
      parameters:
        - $ref: "#/components/parameters/analytics-pathNamespace"
        - $ref: "#/components/parameters/analytics-AnalyticIdPathParam"
      responses:
        "200":
          description: Histogram analysis details
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/analytics-HistogramView"
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Histograms/operation/analytics2-histograms-get
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url https://api.synerise.com/analytics/%7BNamespace%7D/histograms/%7BAnalysisId%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", "/analytics/%7BNamespace%7D/histograms/%7BAnalysisId%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/analytics/%7BNamespace%7D/histograms/%7BAnalysisId%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": "/analytics/%7BNamespace%7D/histograms/%7BAnalysisId%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/analytics/%7BNamespace%7D/histograms/%7BAnalysisId%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/analytics/%7BNamespace%7D/histograms/%7BAnalysisId%7D")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
    put:
      tags:
        - "Analytics: Histograms"
      summary: Update histogram analysis
      description: |
        Update an existing histogram analysis

        ---

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

        **API key permissions required (at least one):** `ANALYTICS_BACKEND_HISTOGRAMS_UPDATE`, `ANALYTICS_BACKEND_HISTOGRAM_UPDATE`

        **User role permission required:** `analytics: update`
      operationId: analytics2-histograms-update
      parameters:
        - $ref: "#/components/parameters/analytics-pathNamespace"
        - $ref: "#/components/parameters/analytics-AnalyticIdPathParam"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/analytics-HistogramRequest"
      responses:
        "200":
          description: Histogram updated
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Histograms/operation/analytics2-histograms-update
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request PUT \
              --url https://api.synerise.com/analytics/%7BNamespace%7D/histograms/%7BAnalysisId%7D \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"analysis":{"title":"string","description":"string","histogram":{"dateFilter":{"type":"ABSOLUTE","from":"2019-08-24T14:15:22Z","to":"2019-08-24T14:15:22Z","filter":{"type":"DAILY","nestingType":"IN_PLACE","from":"string","to":"string","inverted":false}},"period":{"type":"YEARS","value":0},"eventMetrics":[{"metricId":"5370bf3c-2dfa-4e89-98ff-07100cffee6c","chartType":"COLUMN","title":"string"}]}},"inlineAnalytics":[{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","analyticType":"EXPRESSION","analysis":{"type":"EVENT","action":{"id":0,"name":"page.visit"},"name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}}}]}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"analysis\":{\"title\":\"string\",\"description\":\"string\",\"histogram\":{\"dateFilter\":{\"type\":\"ABSOLUTE\",\"from\":\"2019-08-24T14:15:22Z\",\"to\":\"2019-08-24T14:15:22Z\",\"filter\":{\"type\":\"DAILY\",\"nestingType\":\"IN_PLACE\",\"from\":\"string\",\"to\":\"string\",\"inverted\":false}},\"period\":{\"type\":\"YEARS\",\"value\":0},\"eventMetrics\":[{\"metricId\":\"5370bf3c-2dfa-4e89-98ff-07100cffee6c\",\"chartType\":\"COLUMN\",\"title\":\"string\"}]}},\"inlineAnalytics\":[{\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\"analyticType\":\"EXPRESSION\",\"analysis\":{\"type\":\"EVENT\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}}}]}"

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

            conn.request("PUT", "/analytics/%7BNamespace%7D/histograms/%7BAnalysisId%7D", payload, headers)

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

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "analysis": {
                "title": "string",
                "description": "string",
                "histogram": {
                  "dateFilter": {
                    "type": "ABSOLUTE",
                    "from": "2019-08-24T14:15:22Z",
                    "to": "2019-08-24T14:15:22Z",
                    "filter": {
                      "type": "DAILY",
                      "nestingType": "IN_PLACE",
                      "from": "string",
                      "to": "string",
                      "inverted": false
                    }
                  },
                  "period": {
                    "type": "YEARS",
                    "value": 0
                  },
                  "eventMetrics": [
                    {
                      "metricId": "5370bf3c-2dfa-4e89-98ff-07100cffee6c",
                      "chartType": "COLUMN",
                      "title": "string"
                    }
                  ]
                }
              },
              "inlineAnalytics": [
                {
                  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
                  "analyticType": "EXPRESSION",
                  "analysis": {
                    "type": "EVENT",
                    "action": {
                      "id": 0,
                      "name": "page.visit"
                    },
                    "name": "string",
                    "description": "string",
                    "expression": {
                      "type": "VALUE",
                      "title": "title",
                      "value": {
                        "type": "CONSTANT",
                        "constant": 10
                      }
                    }
                  }
                }
              ]
            });

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

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

            xhr.open("PUT", "https://api.synerise.com/analytics/%7BNamespace%7D/histograms/%7BAnalysisId%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": "PUT",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/analytics/%7BNamespace%7D/histograms/%7BAnalysisId%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({
              analysis: {
                title: 'string',
                description: 'string',
                histogram: {
                  dateFilter: {
                    type: 'ABSOLUTE',
                    from: '2019-08-24T14:15:22Z',
                    to: '2019-08-24T14:15:22Z',
                    filter: {
                      type: 'DAILY',
                      nestingType: 'IN_PLACE',
                      from: 'string',
                      to: 'string',
                      inverted: false
                    }
                  },
                  period: {type: 'YEARS', value: 0},
                  eventMetrics: [
                    {
                      metricId: '5370bf3c-2dfa-4e89-98ff-07100cffee6c',
                      chartType: 'COLUMN',
                      title: 'string'
                    }
                  ]
                }
              },
              inlineAnalytics: [
                {
                  id: '497f6eca-6276-4993-bfeb-53cbbbba6f08',
                  analyticType: 'EXPRESSION',
                  analysis: {
                    type: 'EVENT',
                    action: {id: 0, name: 'page.visit'},
                    name: 'string',
                    description: 'string',
                    expression: {type: 'VALUE', title: 'title', value: {type: 'CONSTANT', constant: 10}}
                  }
                }
              ]
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/analytics/%7BNamespace%7D/histograms/%7BAnalysisId%7D');
            $request->setMethod(HTTP_METH_PUT);

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

            $request->setBody('{"analysis":{"title":"string","description":"string","histogram":{"dateFilter":{"type":"ABSOLUTE","from":"2019-08-24T14:15:22Z","to":"2019-08-24T14:15:22Z","filter":{"type":"DAILY","nestingType":"IN_PLACE","from":"string","to":"string","inverted":false}},"period":{"type":"YEARS","value":0},"eventMetrics":[{"metricId":"5370bf3c-2dfa-4e89-98ff-07100cffee6c","chartType":"COLUMN","title":"string"}]}},"inlineAnalytics":[{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","analyticType":"EXPRESSION","analysis":{"type":"EVENT","action":{"id":0,"name":"page.visit"},"name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}}}]}');

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

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.put("https://api.synerise.com/analytics/%7BNamespace%7D/histograms/%7BAnalysisId%7D")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"analysis\":{\"title\":\"string\",\"description\":\"string\",\"histogram\":{\"dateFilter\":{\"type\":\"ABSOLUTE\",\"from\":\"2019-08-24T14:15:22Z\",\"to\":\"2019-08-24T14:15:22Z\",\"filter\":{\"type\":\"DAILY\",\"nestingType\":\"IN_PLACE\",\"from\":\"string\",\"to\":\"string\",\"inverted\":false}},\"period\":{\"type\":\"YEARS\",\"value\":0},\"eventMetrics\":[{\"metricId\":\"5370bf3c-2dfa-4e89-98ff-07100cffee6c\",\"chartType\":\"COLUMN\",\"title\":\"string\"}]}},\"inlineAnalytics\":[{\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\"analyticType\":\"EXPRESSION\",\"analysis\":{\"type\":\"EVENT\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}}}]}")
              .asString();
    delete:
      tags:
        - "Analytics: Histograms"
      summary: Delete histogram
      operationId: analytics2-histograms-delete
      parameters:
        - $ref: "#/components/parameters/analytics-pathNamespace"
        - $ref: "#/components/parameters/analytics-AnalyticIdPathParam"
      responses:
        "204":
          description: Histogram deleted
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Histograms/operation/analytics2-histograms-delete
      description: |
        

        ---

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

        **API key permissions required (at least one):** `ANALYTICS_BACKEND_HISTOGRAMS_DELETE`, `ANALYTICS_BACKEND_HISTOGRAM_DELETE`

        **User role permission required:** `analytics: delete`
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request DELETE \
              --url https://api.synerise.com/analytics/%7BNamespace%7D/histograms/%7BAnalysisId%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", "/analytics/%7BNamespace%7D/histograms/%7BAnalysisId%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/analytics/%7BNamespace%7D/histograms/%7BAnalysisId%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": "/analytics/%7BNamespace%7D/histograms/%7BAnalysisId%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/analytics/%7BNamespace%7D/histograms/%7BAnalysisId%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/analytics/%7BNamespace%7D/histograms/%7BAnalysisId%7D")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
  /analytics/analytics/v3/metrics/histogram-metrics:
    get:
      tags:
        - "Analytics: Metrics"
      summary: Get metrics usable in histograms
      description: |
        Retrieve a list of metrics that can be used in histograms.

        ---

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

        **API key permission required:** `ANALYTICS_BACKEND_METRIC_HISTOGRAM_READ`

        **User role permission required:** `analytics: read`
      operationId: analytics2-get-histogram-metrics
      responses:
        "200":
          description: List of metrics
          content:
            application/json;charset=UTF-8:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/analytics-MetricProjectionResponse"
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Metrics/operation/analytics2-get-histogram-metrics
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url https://api.synerise.com/analytics/analytics/v3/metrics/histogram-metrics \
              --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", "/analytics/analytics/v3/metrics/histogram-metrics", 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/analytics/analytics/v3/metrics/histogram-metrics");
            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": "/analytics/analytics/v3/metrics/histogram-metrics",
              "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/analytics/analytics/v3/metrics/histogram-metrics');
            $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/analytics/analytics/v3/metrics/histogram-metrics")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
  /analytics/analytics/v2/segmentations/{AnalysisId}/dynamic/value:
    post:
      tags:
        - "Analytics: Segmentations"
      summary: Calculate dynamic segmentation
      description: |
        Calculate a segmentation that includes variables (dynamic keys).

        ---

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

        **API key permission required:** `ANALYTICS_BACKEND_SEGMENTATION_READ`

        **User role permission required:** `analytics: read`
      operationId: analytics2-calculate-segmentations-with-variables
      parameters:
        - $ref: "#/components/parameters/analytics-AnalyticIdPathParam"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/analytics-DynamicVariablesRequest"
      responses:
        "200":
          description: Segmentation calculation results
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/analytics-SegmentationCalculationResponse"
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Segmentations/operation/analytics2-calculate-segmentations-with-variables
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/analytics/analytics/v2/segmentations/%7BAnalysisId%7D/dynamic/value \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"variables":[{"name":"string","value":"example-string-value"}]}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"variables\":[{\"name\":\"string\",\"value\":\"example-string-value\"}]}"

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

            conn.request("POST", "/analytics/analytics/v2/segmentations/%7BAnalysisId%7D/dynamic/value", payload, headers)

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

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "variables": [
                {
                  "name": "string",
                  "value": "example-string-value"
                }
              ]
            });

            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/analytics/analytics/v2/segmentations/%7BAnalysisId%7D/dynamic/value");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
            xhr.setRequestHeader("content-type", "application/json");

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

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

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

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

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

            req.write(JSON.stringify({variables: [{name: 'string', value: 'example-string-value'}]}));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/analytics/analytics/v2/segmentations/%7BAnalysisId%7D/dynamic/value');
            $request->setMethod(HTTP_METH_POST);

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

            $request->setBody('{"variables":[{"name":"string","value":"example-string-value"}]}');

            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/analytics/analytics/v2/segmentations/%7BAnalysisId%7D/dynamic/value")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"variables\":[{\"name\":\"string\",\"value\":\"example-string-value\"}]}")
              .asString();
  /analytics/analytics/v2/segmentations/preview:
    post:
      tags:
        - "Analytics: Segmentations"
      summary: Preview segmentation
      description: |
        Preview the results of a segmentation, with information about the results of each segment. This request does not save the analysis.

        ---

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

        **API key permission required:** `ANALYTICS_BACKEND_SEGMENTATION_READ`

        **User role permission required:** `analytics: read`
      operationId: analytics2-segmentation-preview-legacy
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/analytics-SegmentationPreviewRequest"
      responses:
        "200":
          description: Calculation result
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/analytics-SegmentationCalculationResponse"
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Segmentations/operation/analytics2-segmentation-preview-legacy
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/analytics/analytics/v2/segmentations/preview \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"analysis":{"id":"5370bf3c-2dfa-4e89-98ff-07100cffee6c","title":"string","description":"string","segments":[{"title":"string","description":"string","filter":{"matching":true,"expressions":[{"type":"ATTRIBUTE","name":"string","matching":true,"attribute":{"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]}}],"expression":{"type":"EMPTY"},"groupBy":[{"type":"CONSTANT","constant":"string"}]}}],"unique":true},"allowNull":true,"inlineAnalytics":[{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","analyticType":"EXPRESSION","analysis":{"type":"EVENT","action":{"id":0,"name":"page.visit"},"name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}}}]}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"analysis\":{\"id\":\"5370bf3c-2dfa-4e89-98ff-07100cffee6c\",\"title\":\"string\",\"description\":\"string\",\"segments\":[{\"title\":\"string\",\"description\":\"string\",\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"ATTRIBUTE\",\"name\":\"string\",\"matching\":true,\"attribute\":{\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}}],\"expression\":{\"type\":\"EMPTY\"},\"groupBy\":[{\"type\":\"CONSTANT\",\"constant\":\"string\"}]}}],\"unique\":true},\"allowNull\":true,\"inlineAnalytics\":[{\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\"analyticType\":\"EXPRESSION\",\"analysis\":{\"type\":\"EVENT\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}}}]}"

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

            conn.request("POST", "/analytics/analytics/v2/segmentations/preview", payload, headers)

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

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "analysis": {
                "id": "5370bf3c-2dfa-4e89-98ff-07100cffee6c",
                "title": "string",
                "description": "string",
                "segments": [
                  {
                    "title": "string",
                    "description": "string",
                    "filter": {
                      "matching": true,
                      "expressions": [
                        {
                          "type": "ATTRIBUTE",
                          "name": "string",
                          "matching": true,
                          "attribute": {
                            "expressions": [
                              {
                                "constraint": {
                                  "type": "BOOL",
                                  "logic": "IS_TRUE"
                                },
                                "attribute": {
                                  "type": "PARAM",
                                  "param": "string"
                                }
                              }
                            ]
                          }
                        }
                      ],
                      "expression": {
                        "type": "EMPTY"
                      },
                      "groupBy": [
                        {
                          "type": "CONSTANT",
                          "constant": "string"
                        }
                      ]
                    }
                  }
                ],
                "unique": true
              },
              "allowNull": true,
              "inlineAnalytics": [
                {
                  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
                  "analyticType": "EXPRESSION",
                  "analysis": {
                    "type": "EVENT",
                    "action": {
                      "id": 0,
                      "name": "page.visit"
                    },
                    "name": "string",
                    "description": "string",
                    "expression": {
                      "type": "VALUE",
                      "title": "title",
                      "value": {
                        "type": "CONSTANT",
                        "constant": 10
                      }
                    }
                  }
                }
              ]
            });

            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/analytics/analytics/v2/segmentations/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": "/analytics/analytics/v2/segmentations/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({
              analysis: {
                id: '5370bf3c-2dfa-4e89-98ff-07100cffee6c',
                title: 'string',
                description: 'string',
                segments: [
                  {
                    title: 'string',
                    description: 'string',
                    filter: {
                      matching: true,
                      expressions: [
                        {
                          type: 'ATTRIBUTE',
                          name: 'string',
                          matching: true,
                          attribute: {
                            expressions: [
                              {
                                constraint: {type: 'BOOL', logic: 'IS_TRUE'},
                                attribute: {type: 'PARAM', param: 'string'}
                              }
                            ]
                          }
                        }
                      ],
                      expression: {type: 'EMPTY'},
                      groupBy: [{type: 'CONSTANT', constant: 'string'}]
                    }
                  }
                ],
                unique: true
              },
              allowNull: true,
              inlineAnalytics: [
                {
                  id: '497f6eca-6276-4993-bfeb-53cbbbba6f08',
                  analyticType: 'EXPRESSION',
                  analysis: {
                    type: 'EVENT',
                    action: {id: 0, name: 'page.visit'},
                    name: 'string',
                    description: 'string',
                    expression: {type: 'VALUE', title: 'title', value: {type: 'CONSTANT', constant: 10}}
                  }
                }
              ]
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

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

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

            $request->setBody('{"analysis":{"id":"5370bf3c-2dfa-4e89-98ff-07100cffee6c","title":"string","description":"string","segments":[{"title":"string","description":"string","filter":{"matching":true,"expressions":[{"type":"ATTRIBUTE","name":"string","matching":true,"attribute":{"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]}}],"expression":{"type":"EMPTY"},"groupBy":[{"type":"CONSTANT","constant":"string"}]}}],"unique":true},"allowNull":true,"inlineAnalytics":[{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","analyticType":"EXPRESSION","analysis":{"type":"EVENT","action":{"id":0,"name":"page.visit"},"name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}}}]}');

            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/analytics/analytics/v2/segmentations/preview")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"analysis\":{\"id\":\"5370bf3c-2dfa-4e89-98ff-07100cffee6c\",\"title\":\"string\",\"description\":\"string\",\"segments\":[{\"title\":\"string\",\"description\":\"string\",\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"ATTRIBUTE\",\"name\":\"string\",\"matching\":true,\"attribute\":{\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}}],\"expression\":{\"type\":\"EMPTY\"},\"groupBy\":[{\"type\":\"CONSTANT\",\"constant\":\"string\"}]}}],\"unique\":true},\"allowNull\":true,\"inlineAnalytics\":[{\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\"analyticType\":\"EXPRESSION\",\"analysis\":{\"type\":\"EVENT\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}}}]}")
              .asString();
  /analytics/analytics/v2/segmentations/preview/clients:
    post:
      tags:
        - "Analytics: Segmentations"
      summary: Preview profiles in segmentation
      description: |
        Calculate a segmentation and get a list of profiles in each segment. This request doesn't save the segmentation in the database.

        ---

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

        **API key permission required:** `ANALYTICS_BACKEND_SEGMENTATION_READ`

        **User role permission required:** `analytics: read`
      operationId: analytics2-segmentation-preview-clients-legacy
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/analytics-SegmentationPreviewRequest"
      responses:
        "200":
          description: Array of segments
          content:
            application/json:
              schema:
                type: array
                description: Each item in this array is a segment, according to their order in the request.
                items:
                  type: array
                  description: Each number in the segment is a profile ID.
                  items:
                    type: number
                    format: int64
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Segmentations/operation/analytics2-segmentation-preview-clients-legacy
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/analytics/analytics/v2/segmentations/preview/clients \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"analysis":{"id":"5370bf3c-2dfa-4e89-98ff-07100cffee6c","title":"string","description":"string","segments":[{"title":"string","description":"string","filter":{"matching":true,"expressions":[{"type":"ATTRIBUTE","name":"string","matching":true,"attribute":{"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]}}],"expression":{"type":"EMPTY"},"groupBy":[{"type":"CONSTANT","constant":"string"}]}}],"unique":true},"allowNull":true,"inlineAnalytics":[{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","analyticType":"EXPRESSION","analysis":{"type":"EVENT","action":{"id":0,"name":"page.visit"},"name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}}}]}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"analysis\":{\"id\":\"5370bf3c-2dfa-4e89-98ff-07100cffee6c\",\"title\":\"string\",\"description\":\"string\",\"segments\":[{\"title\":\"string\",\"description\":\"string\",\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"ATTRIBUTE\",\"name\":\"string\",\"matching\":true,\"attribute\":{\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}}],\"expression\":{\"type\":\"EMPTY\"},\"groupBy\":[{\"type\":\"CONSTANT\",\"constant\":\"string\"}]}}],\"unique\":true},\"allowNull\":true,\"inlineAnalytics\":[{\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\"analyticType\":\"EXPRESSION\",\"analysis\":{\"type\":\"EVENT\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}}}]}"

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

            conn.request("POST", "/analytics/analytics/v2/segmentations/preview/clients", payload, headers)

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

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "analysis": {
                "id": "5370bf3c-2dfa-4e89-98ff-07100cffee6c",
                "title": "string",
                "description": "string",
                "segments": [
                  {
                    "title": "string",
                    "description": "string",
                    "filter": {
                      "matching": true,
                      "expressions": [
                        {
                          "type": "ATTRIBUTE",
                          "name": "string",
                          "matching": true,
                          "attribute": {
                            "expressions": [
                              {
                                "constraint": {
                                  "type": "BOOL",
                                  "logic": "IS_TRUE"
                                },
                                "attribute": {
                                  "type": "PARAM",
                                  "param": "string"
                                }
                              }
                            ]
                          }
                        }
                      ],
                      "expression": {
                        "type": "EMPTY"
                      },
                      "groupBy": [
                        {
                          "type": "CONSTANT",
                          "constant": "string"
                        }
                      ]
                    }
                  }
                ],
                "unique": true
              },
              "allowNull": true,
              "inlineAnalytics": [
                {
                  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
                  "analyticType": "EXPRESSION",
                  "analysis": {
                    "type": "EVENT",
                    "action": {
                      "id": 0,
                      "name": "page.visit"
                    },
                    "name": "string",
                    "description": "string",
                    "expression": {
                      "type": "VALUE",
                      "title": "title",
                      "value": {
                        "type": "CONSTANT",
                        "constant": 10
                      }
                    }
                  }
                }
              ]
            });

            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/analytics/analytics/v2/segmentations/preview/clients");
            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": "/analytics/analytics/v2/segmentations/preview/clients",
              "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({
              analysis: {
                id: '5370bf3c-2dfa-4e89-98ff-07100cffee6c',
                title: 'string',
                description: 'string',
                segments: [
                  {
                    title: 'string',
                    description: 'string',
                    filter: {
                      matching: true,
                      expressions: [
                        {
                          type: 'ATTRIBUTE',
                          name: 'string',
                          matching: true,
                          attribute: {
                            expressions: [
                              {
                                constraint: {type: 'BOOL', logic: 'IS_TRUE'},
                                attribute: {type: 'PARAM', param: 'string'}
                              }
                            ]
                          }
                        }
                      ],
                      expression: {type: 'EMPTY'},
                      groupBy: [{type: 'CONSTANT', constant: 'string'}]
                    }
                  }
                ],
                unique: true
              },
              allowNull: true,
              inlineAnalytics: [
                {
                  id: '497f6eca-6276-4993-bfeb-53cbbbba6f08',
                  analyticType: 'EXPRESSION',
                  analysis: {
                    type: 'EVENT',
                    action: {id: 0, name: 'page.visit'},
                    name: 'string',
                    description: 'string',
                    expression: {type: 'VALUE', title: 'title', value: {type: 'CONSTANT', constant: 10}}
                  }
                }
              ]
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/analytics/analytics/v2/segmentations/preview/clients');
            $request->setMethod(HTTP_METH_POST);

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

            $request->setBody('{"analysis":{"id":"5370bf3c-2dfa-4e89-98ff-07100cffee6c","title":"string","description":"string","segments":[{"title":"string","description":"string","filter":{"matching":true,"expressions":[{"type":"ATTRIBUTE","name":"string","matching":true,"attribute":{"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]}}],"expression":{"type":"EMPTY"},"groupBy":[{"type":"CONSTANT","constant":"string"}]}}],"unique":true},"allowNull":true,"inlineAnalytics":[{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","analyticType":"EXPRESSION","analysis":{"type":"EVENT","action":{"id":0,"name":"page.visit"},"name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}}}]}');

            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/analytics/analytics/v2/segmentations/preview/clients")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"analysis\":{\"id\":\"5370bf3c-2dfa-4e89-98ff-07100cffee6c\",\"title\":\"string\",\"description\":\"string\",\"segments\":[{\"title\":\"string\",\"description\":\"string\",\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"ATTRIBUTE\",\"name\":\"string\",\"matching\":true,\"attribute\":{\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}}],\"expression\":{\"type\":\"EMPTY\"},\"groupBy\":[{\"type\":\"CONSTANT\",\"constant\":\"string\"}]}}],\"unique\":true},\"allowNull\":true,\"inlineAnalytics\":[{\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\"analyticType\":\"EXPRESSION\",\"analysis\":{\"type\":\"EVENT\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}}}]}")
              .asString();
  /analytics/analytics/v2/metrics/histograms/{AnalysisId}/recalculate/override:
    post:
      tags:
        - "Analytics: Histograms"
      summary: Calculate histogram with parameter override
      description: |
        Calculate a histogram with new parameters and/or variable (dynamic key) values.

        ---

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

        **API key permission required:** `ANALYTICS_BACKEND_HISTOGRAM_READ`

        **User role permission required:** `analytics: read`
      operationId: analytics2-calculate-histogram-with-override
      parameters:
        - $ref: "#/components/parameters/analytics-AnalyticIdPathParam"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/analytics-OverrideQueryRequest"
      responses:
        "200":
          description: Histogram override calculation result
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/analytics-HistogramCalculationResponse"
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Histograms/operation/analytics2-calculate-histogram-with-override
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/analytics/analytics/v2/metrics/histograms/%7BAnalysisId%7D/recalculate/override \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"title":"string","dateFilter":{"type":"ABSOLUTE","from":"2019-08-24T14:15:22Z","to":"2019-08-24T14:15:22Z","filter":{"type":"DAILY","nestingType":"IN_PLACE","from":"string","to":"string","inverted":false}},"aggregateDataBy":{"type":"YEARS","value":0},"filter":{"matching":true,"expressions":[{"type":"ATTRIBUTE","name":"string","matching":true,"attribute":{"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]}}],"expression":{"type":"EMPTY"},"groupBy":[{"type":"CONSTANT","constant":"string"}]},"variables":[{"name":"string","value":"example-string-value"}],"overrideNested":false}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"title\":\"string\",\"dateFilter\":{\"type\":\"ABSOLUTE\",\"from\":\"2019-08-24T14:15:22Z\",\"to\":\"2019-08-24T14:15:22Z\",\"filter\":{\"type\":\"DAILY\",\"nestingType\":\"IN_PLACE\",\"from\":\"string\",\"to\":\"string\",\"inverted\":false}},\"aggregateDataBy\":{\"type\":\"YEARS\",\"value\":0},\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"ATTRIBUTE\",\"name\":\"string\",\"matching\":true,\"attribute\":{\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}}],\"expression\":{\"type\":\"EMPTY\"},\"groupBy\":[{\"type\":\"CONSTANT\",\"constant\":\"string\"}]},\"variables\":[{\"name\":\"string\",\"value\":\"example-string-value\"}],\"overrideNested\":false}"

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

            conn.request("POST", "/analytics/analytics/v2/metrics/histograms/%7BAnalysisId%7D/recalculate/override", payload, headers)

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

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "title": "string",
              "dateFilter": {
                "type": "ABSOLUTE",
                "from": "2019-08-24T14:15:22Z",
                "to": "2019-08-24T14:15:22Z",
                "filter": {
                  "type": "DAILY",
                  "nestingType": "IN_PLACE",
                  "from": "string",
                  "to": "string",
                  "inverted": false
                }
              },
              "aggregateDataBy": {
                "type": "YEARS",
                "value": 0
              },
              "filter": {
                "matching": true,
                "expressions": [
                  {
                    "type": "ATTRIBUTE",
                    "name": "string",
                    "matching": true,
                    "attribute": {
                      "expressions": [
                        {
                          "constraint": {
                            "type": "BOOL",
                            "logic": "IS_TRUE"
                          },
                          "attribute": {
                            "type": "PARAM",
                            "param": "string"
                          }
                        }
                      ]
                    }
                  }
                ],
                "expression": {
                  "type": "EMPTY"
                },
                "groupBy": [
                  {
                    "type": "CONSTANT",
                    "constant": "string"
                  }
                ]
              },
              "variables": [
                {
                  "name": "string",
                  "value": "example-string-value"
                }
              ],
              "overrideNested": false
            });

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

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

            xhr.open("POST", "https://api.synerise.com/analytics/analytics/v2/metrics/histograms/%7BAnalysisId%7D/recalculate/override");
            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": "/analytics/analytics/v2/metrics/histograms/%7BAnalysisId%7D/recalculate/override",
              "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({
              title: 'string',
              dateFilter: {
                type: 'ABSOLUTE',
                from: '2019-08-24T14:15:22Z',
                to: '2019-08-24T14:15:22Z',
                filter: {
                  type: 'DAILY',
                  nestingType: 'IN_PLACE',
                  from: 'string',
                  to: 'string',
                  inverted: false
                }
              },
              aggregateDataBy: {type: 'YEARS', value: 0},
              filter: {
                matching: true,
                expressions: [
                  {
                    type: 'ATTRIBUTE',
                    name: 'string',
                    matching: true,
                    attribute: {
                      expressions: [
                        {
                          constraint: {type: 'BOOL', logic: 'IS_TRUE'},
                          attribute: {type: 'PARAM', param: 'string'}
                        }
                      ]
                    }
                  }
                ],
                expression: {type: 'EMPTY'},
                groupBy: [{type: 'CONSTANT', constant: 'string'}]
              },
              variables: [{name: 'string', value: 'example-string-value'}],
              overrideNested: false
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/analytics/analytics/v2/metrics/histograms/%7BAnalysisId%7D/recalculate/override');
            $request->setMethod(HTTP_METH_POST);

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

            $request->setBody('{"title":"string","dateFilter":{"type":"ABSOLUTE","from":"2019-08-24T14:15:22Z","to":"2019-08-24T14:15:22Z","filter":{"type":"DAILY","nestingType":"IN_PLACE","from":"string","to":"string","inverted":false}},"aggregateDataBy":{"type":"YEARS","value":0},"filter":{"matching":true,"expressions":[{"type":"ATTRIBUTE","name":"string","matching":true,"attribute":{"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]}}],"expression":{"type":"EMPTY"},"groupBy":[{"type":"CONSTANT","constant":"string"}]},"variables":[{"name":"string","value":"example-string-value"}],"overrideNested":false}');

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

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.post("https://api.synerise.com/analytics/analytics/v2/metrics/histograms/%7BAnalysisId%7D/recalculate/override")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"title\":\"string\",\"dateFilter\":{\"type\":\"ABSOLUTE\",\"from\":\"2019-08-24T14:15:22Z\",\"to\":\"2019-08-24T14:15:22Z\",\"filter\":{\"type\":\"DAILY\",\"nestingType\":\"IN_PLACE\",\"from\":\"string\",\"to\":\"string\",\"inverted\":false}},\"aggregateDataBy\":{\"type\":\"YEARS\",\"value\":0},\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"ATTRIBUTE\",\"name\":\"string\",\"matching\":true,\"attribute\":{\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}}],\"expression\":{\"type\":\"EMPTY\"},\"groupBy\":[{\"type\":\"CONSTANT\",\"constant\":\"string\"}]},\"variables\":[{\"name\":\"string\",\"value\":\"example-string-value\"}],\"overrideNested\":false}")
              .asString();
  /analytics/analytics/v2/metrics/histograms/preview:
    post:
      tags:
        - "Analytics: Histograms"
      summary: Preview histogram
      description: |
        Preview the results of a histogram. This request doesn't save the histogram.

        ---

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

        **API key permission required:** `ANALYTICS_BACKEND_HISTOGRAM_READ`

        **User role permission required:** `analytics: read`
      operationId: analytics2-histogram-preview-legacy
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/analytics-HistogramLegacyPreviewRequest"
      responses:
        "200":
          description: Histogram preview calculation result
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/analytics-HistogramCalculationResponse"
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Histograms/operation/analytics2-histogram-preview-legacy
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/analytics/analytics/v2/metrics/histograms/preview \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"analysis":{"title":"string","description":"string","histogram":{"dateFilter":{"type":"ABSOLUTE","from":"2019-08-24T14:15:22Z","to":"2019-08-24T14:15:22Z","filter":{"type":"DAILY","nestingType":"IN_PLACE","from":"string","to":"string","inverted":false}},"period":{"type":"YEARS","value":0},"eventMetrics":[{"metricId":"5370bf3c-2dfa-4e89-98ff-07100cffee6c","chartType":"COLUMN","title":"string"}]}},"inlineAnalytics":[{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","analyticType":"EXPRESSION","analysis":{"type":"EVENT","action":{"id":0,"name":"page.visit"},"name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}}}]}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"analysis\":{\"title\":\"string\",\"description\":\"string\",\"histogram\":{\"dateFilter\":{\"type\":\"ABSOLUTE\",\"from\":\"2019-08-24T14:15:22Z\",\"to\":\"2019-08-24T14:15:22Z\",\"filter\":{\"type\":\"DAILY\",\"nestingType\":\"IN_PLACE\",\"from\":\"string\",\"to\":\"string\",\"inverted\":false}},\"period\":{\"type\":\"YEARS\",\"value\":0},\"eventMetrics\":[{\"metricId\":\"5370bf3c-2dfa-4e89-98ff-07100cffee6c\",\"chartType\":\"COLUMN\",\"title\":\"string\"}]}},\"inlineAnalytics\":[{\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\"analyticType\":\"EXPRESSION\",\"analysis\":{\"type\":\"EVENT\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}}}]}"

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

            conn.request("POST", "/analytics/analytics/v2/metrics/histograms/preview", payload, headers)

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

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "analysis": {
                "title": "string",
                "description": "string",
                "histogram": {
                  "dateFilter": {
                    "type": "ABSOLUTE",
                    "from": "2019-08-24T14:15:22Z",
                    "to": "2019-08-24T14:15:22Z",
                    "filter": {
                      "type": "DAILY",
                      "nestingType": "IN_PLACE",
                      "from": "string",
                      "to": "string",
                      "inverted": false
                    }
                  },
                  "period": {
                    "type": "YEARS",
                    "value": 0
                  },
                  "eventMetrics": [
                    {
                      "metricId": "5370bf3c-2dfa-4e89-98ff-07100cffee6c",
                      "chartType": "COLUMN",
                      "title": "string"
                    }
                  ]
                }
              },
              "inlineAnalytics": [
                {
                  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
                  "analyticType": "EXPRESSION",
                  "analysis": {
                    "type": "EVENT",
                    "action": {
                      "id": 0,
                      "name": "page.visit"
                    },
                    "name": "string",
                    "description": "string",
                    "expression": {
                      "type": "VALUE",
                      "title": "title",
                      "value": {
                        "type": "CONSTANT",
                        "constant": 10
                      }
                    }
                  }
                }
              ]
            });

            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/analytics/analytics/v2/metrics/histograms/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": "/analytics/analytics/v2/metrics/histograms/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({
              analysis: {
                title: 'string',
                description: 'string',
                histogram: {
                  dateFilter: {
                    type: 'ABSOLUTE',
                    from: '2019-08-24T14:15:22Z',
                    to: '2019-08-24T14:15:22Z',
                    filter: {
                      type: 'DAILY',
                      nestingType: 'IN_PLACE',
                      from: 'string',
                      to: 'string',
                      inverted: false
                    }
                  },
                  period: {type: 'YEARS', value: 0},
                  eventMetrics: [
                    {
                      metricId: '5370bf3c-2dfa-4e89-98ff-07100cffee6c',
                      chartType: 'COLUMN',
                      title: 'string'
                    }
                  ]
                }
              },
              inlineAnalytics: [
                {
                  id: '497f6eca-6276-4993-bfeb-53cbbbba6f08',
                  analyticType: 'EXPRESSION',
                  analysis: {
                    type: 'EVENT',
                    action: {id: 0, name: 'page.visit'},
                    name: 'string',
                    description: 'string',
                    expression: {type: 'VALUE', title: 'title', value: {type: 'CONSTANT', constant: 10}}
                  }
                }
              ]
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/analytics/analytics/v2/metrics/histograms/preview');
            $request->setMethod(HTTP_METH_POST);

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

            $request->setBody('{"analysis":{"title":"string","description":"string","histogram":{"dateFilter":{"type":"ABSOLUTE","from":"2019-08-24T14:15:22Z","to":"2019-08-24T14:15:22Z","filter":{"type":"DAILY","nestingType":"IN_PLACE","from":"string","to":"string","inverted":false}},"period":{"type":"YEARS","value":0},"eventMetrics":[{"metricId":"5370bf3c-2dfa-4e89-98ff-07100cffee6c","chartType":"COLUMN","title":"string"}]}},"inlineAnalytics":[{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","analyticType":"EXPRESSION","analysis":{"type":"EVENT","action":{"id":0,"name":"page.visit"},"name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}}}]}');

            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/analytics/analytics/v2/metrics/histograms/preview")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"analysis\":{\"title\":\"string\",\"description\":\"string\",\"histogram\":{\"dateFilter\":{\"type\":\"ABSOLUTE\",\"from\":\"2019-08-24T14:15:22Z\",\"to\":\"2019-08-24T14:15:22Z\",\"filter\":{\"type\":\"DAILY\",\"nestingType\":\"IN_PLACE\",\"from\":\"string\",\"to\":\"string\",\"inverted\":false}},\"period\":{\"type\":\"YEARS\",\"value\":0},\"eventMetrics\":[{\"metricId\":\"5370bf3c-2dfa-4e89-98ff-07100cffee6c\",\"chartType\":\"COLUMN\",\"title\":\"string\"}]}},\"inlineAnalytics\":[{\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\"analyticType\":\"EXPRESSION\",\"analysis\":{\"type\":\"EVENT\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}}}]}")
              .asString();
  /analytics/profiles/segmentations/firstMatch/by/{IdentifierType}:
    post:
      tags:
        - "Analytics: Segmentations"
      summary: Get first matching segmentation for profile from provided list
      description: |
        Check a number of segmentations and return the first one that matches the selected profile. Note that `segmentations` is a list of objects to check, and each object can also refer to multiple segmentations.

        ---

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

        **API key permissions required (at least one):** `ANALYTICS_BACKEND_SEGMENTATIONS_READ`, `ANALYTICS_BACKEND_SEGMENTATION_READ`

        **User role permission required:** `analytics: read`
      operationId: analytics2-segmentation-first-match-by
      parameters:
        - $ref: "#/components/parameters/analytics-pathIdentifierType"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/analytics-AnalyticsFirstMatchRequest"
        required: true
      responses:
        "200":
          description: Identifier (`id` from the request body) of the matched entry
          content:
            application/json:
              schema:
                type: string
                format: uuid
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Segmentations/operation/analytics2-segmentation-first-match-by
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/analytics/profiles/segmentations/firstMatch/by/%7BIdentifierType%7D \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"identifierValue":"string","segmentations":[{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","segmentationIds":["497f6eca-6276-4993-bfeb-53cbbbba6f08"],"query":{"analysis":{"id":"5370bf3c-2dfa-4e89-98ff-07100cffee6c","title":"string","description":"string","segments":[{"title":"string","description":"string","filter":{"matching":true,"expressions":[{"type":"ATTRIBUTE","name":"string","matching":true,"attribute":{"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]}}],"expression":{"type":"EMPTY"},"groupBy":[{"type":"CONSTANT","constant":"string"}]}}],"unique":true}}}]}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"identifierValue\":\"string\",\"segmentations\":[{\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\"segmentationIds\":[\"497f6eca-6276-4993-bfeb-53cbbbba6f08\"],\"query\":{\"analysis\":{\"id\":\"5370bf3c-2dfa-4e89-98ff-07100cffee6c\",\"title\":\"string\",\"description\":\"string\",\"segments\":[{\"title\":\"string\",\"description\":\"string\",\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"ATTRIBUTE\",\"name\":\"string\",\"matching\":true,\"attribute\":{\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}}],\"expression\":{\"type\":\"EMPTY\"},\"groupBy\":[{\"type\":\"CONSTANT\",\"constant\":\"string\"}]}}],\"unique\":true}}}]}"

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

            conn.request("POST", "/analytics/profiles/segmentations/firstMatch/by/%7BIdentifierType%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",
              "segmentations": [
                {
                  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
                  "segmentationIds": [
                    "497f6eca-6276-4993-bfeb-53cbbbba6f08"
                  ],
                  "query": {
                    "analysis": {
                      "id": "5370bf3c-2dfa-4e89-98ff-07100cffee6c",
                      "title": "string",
                      "description": "string",
                      "segments": [
                        {
                          "title": "string",
                          "description": "string",
                          "filter": {
                            "matching": true,
                            "expressions": [
                              {
                                "type": "ATTRIBUTE",
                                "name": "string",
                                "matching": true,
                                "attribute": {
                                  "expressions": [
                                    {
                                      "constraint": {
                                        "type": "BOOL",
                                        "logic": "IS_TRUE"
                                      },
                                      "attribute": {
                                        "type": "PARAM",
                                        "param": "string"
                                      }
                                    }
                                  ]
                                }
                              }
                            ],
                            "expression": {
                              "type": "EMPTY"
                            },
                            "groupBy": [
                              {
                                "type": "CONSTANT",
                                "constant": "string"
                              }
                            ]
                          }
                        }
                      ],
                      "unique": 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/analytics/profiles/segmentations/firstMatch/by/%7BIdentifierType%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": "/analytics/profiles/segmentations/firstMatch/by/%7BIdentifierType%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',
              segmentations: [
                {
                  id: '497f6eca-6276-4993-bfeb-53cbbbba6f08',
                  segmentationIds: ['497f6eca-6276-4993-bfeb-53cbbbba6f08'],
                  query: {
                    analysis: {
                      id: '5370bf3c-2dfa-4e89-98ff-07100cffee6c',
                      title: 'string',
                      description: 'string',
                      segments: [
                        {
                          title: 'string',
                          description: 'string',
                          filter: {
                            matching: true,
                            expressions: [
                              {
                                type: 'ATTRIBUTE',
                                name: 'string',
                                matching: true,
                                attribute: {
                                  expressions: [
                                    {
                                      constraint: {type: 'BOOL', logic: 'IS_TRUE'},
                                      attribute: {type: 'PARAM', param: 'string'}
                                    }
                                  ]
                                }
                              }
                            ],
                            expression: {type: 'EMPTY'},
                            groupBy: [{type: 'CONSTANT', constant: 'string'}]
                          }
                        }
                      ],
                      unique: true
                    }
                  }
                }
              ]
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/analytics/profiles/segmentations/firstMatch/by/%7BIdentifierType%7D');
            $request->setMethod(HTTP_METH_POST);

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

            $request->setBody('{"identifierValue":"string","segmentations":[{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","segmentationIds":["497f6eca-6276-4993-bfeb-53cbbbba6f08"],"query":{"analysis":{"id":"5370bf3c-2dfa-4e89-98ff-07100cffee6c","title":"string","description":"string","segments":[{"title":"string","description":"string","filter":{"matching":true,"expressions":[{"type":"ATTRIBUTE","name":"string","matching":true,"attribute":{"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]}}],"expression":{"type":"EMPTY"},"groupBy":[{"type":"CONSTANT","constant":"string"}]}}],"unique":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/analytics/profiles/segmentations/firstMatch/by/%7BIdentifierType%7D")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"identifierValue\":\"string\",\"segmentations\":[{\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\"segmentationIds\":[\"497f6eca-6276-4993-bfeb-53cbbbba6f08\"],\"query\":{\"analysis\":{\"id\":\"5370bf3c-2dfa-4e89-98ff-07100cffee6c\",\"title\":\"string\",\"description\":\"string\",\"segments\":[{\"title\":\"string\",\"description\":\"string\",\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"ATTRIBUTE\",\"name\":\"string\",\"matching\":true,\"attribute\":{\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}}],\"expression\":{\"type\":\"EMPTY\"},\"groupBy\":[{\"type\":\"CONSTANT\",\"constant\":\"string\"}]}}],\"unique\":true}}}]}")
              .asString();
  /analytics/{Namespace}/segmentations:
    get:
      tags:
        - "Analytics: Segmentations"
      summary: List segmentations
      description: |
        Returns a paginated list of segmentations.

        ---

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

        **API key permission required:** `ANALYTICS_BACKEND_SEGMENTATIONS_LIST_READ`

        **User role permission required:** `analytics: read`
      operationId: analytics2-segmentations-list
      parameters:
        - $ref: "#/components/parameters/analytics-page"
        - $ref: "#/components/parameters/analytics-limit"
        - $ref: "#/components/parameters/analytics-search"
        - $ref: "#/components/parameters/analytics-sortBy"
        - $ref: "#/components/parameters/analytics-pathNamespace"
        - $ref: "#/components/parameters/analytics-directoryId"
        - $ref: "#/components/parameters/analytics-ids"
        - $ref: "#/components/parameters/analytics-shareType"
      responses:
        "200":
          description: List of segmentations
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    description: Array of segmentations
                    items:
                      $ref: "#/components/schemas/analytics-SegmentationBasic"
                  meta:
                    $ref: "#/components/schemas/analytics-Meta"
                required:
                  - data
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Segmentations/operation/analytics2-segmentations-list
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.synerise.com/analytics/%7BNamespace%7D/segmentations?page=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sortBy=name%3Aasc&directoryId=SOME_STRING_VALUE&ids=SOME_STRING_VALUE&shareType=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", "/analytics/%7BNamespace%7D/segmentations?page=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sortBy=name%3Aasc&directoryId=SOME_STRING_VALUE&ids=SOME_STRING_VALUE&shareType=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/analytics/%7BNamespace%7D/segmentations?page=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sortBy=name%3Aasc&directoryId=SOME_STRING_VALUE&ids=SOME_STRING_VALUE&shareType=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": "/analytics/%7BNamespace%7D/segmentations?page=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sortBy=name%3Aasc&directoryId=SOME_STRING_VALUE&ids=SOME_STRING_VALUE&shareType=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/analytics/%7BNamespace%7D/segmentations');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'page' => 'SOME_INTEGER_VALUE',
              'limit' => 'SOME_INTEGER_VALUE',
              'search' => 'SOME_STRING_VALUE',
              'sortBy' => 'name:asc',
              'directoryId' => 'SOME_STRING_VALUE',
              'ids' => 'SOME_STRING_VALUE',
              'shareType' => '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/analytics/%7BNamespace%7D/segmentations?page=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sortBy=name%3Aasc&directoryId=SOME_STRING_VALUE&ids=SOME_STRING_VALUE&shareType=SOME_STRING_VALUE")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
    post:
      tags:
        - "Analytics: Segmentations"
      summary: Create segmentation
      description: |
        Create a new segmentation

        ---

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

        **API key permissions required (at least one):** `ANALYTICS_BACKEND_SEGMENTATIONS_CREATE`, `ANALYTICS_BACKEND_SEGMENTATION_CREATE`

        **User role permission required:** `analytics: create`
      operationId: analytics2-segmentations-create
      parameters:
        - $ref: "#/components/parameters/analytics-pathNamespace"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/analytics-SegmentationRequest"
      responses:
        "200":
          description: ID of the created segmentation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/analytics-Id"
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Segmentations/operation/analytics2-segmentations-create
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/analytics/%7BNamespace%7D/segmentations \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"analysis":{"id":"5370bf3c-2dfa-4e89-98ff-07100cffee6c","title":"string","description":"string","segments":[{"title":"string","description":"string","filter":{"matching":true,"expressions":[{"type":"ATTRIBUTE","name":"string","matching":true,"attribute":{"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]}}],"expression":{"type":"EMPTY"},"groupBy":[{"type":"CONSTANT","constant":"string"}]}}],"unique":true},"isVisibleForClientProfile":true,"inlineAnalytics":[{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","analyticType":"EXPRESSION","analysis":{"type":"EVENT","action":{"id":0,"name":"page.visit"},"name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}}}]}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"analysis\":{\"id\":\"5370bf3c-2dfa-4e89-98ff-07100cffee6c\",\"title\":\"string\",\"description\":\"string\",\"segments\":[{\"title\":\"string\",\"description\":\"string\",\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"ATTRIBUTE\",\"name\":\"string\",\"matching\":true,\"attribute\":{\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}}],\"expression\":{\"type\":\"EMPTY\"},\"groupBy\":[{\"type\":\"CONSTANT\",\"constant\":\"string\"}]}}],\"unique\":true},\"isVisibleForClientProfile\":true,\"inlineAnalytics\":[{\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\"analyticType\":\"EXPRESSION\",\"analysis\":{\"type\":\"EVENT\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}}}]}"

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

            conn.request("POST", "/analytics/%7BNamespace%7D/segmentations", payload, headers)

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

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "analysis": {
                "id": "5370bf3c-2dfa-4e89-98ff-07100cffee6c",
                "title": "string",
                "description": "string",
                "segments": [
                  {
                    "title": "string",
                    "description": "string",
                    "filter": {
                      "matching": true,
                      "expressions": [
                        {
                          "type": "ATTRIBUTE",
                          "name": "string",
                          "matching": true,
                          "attribute": {
                            "expressions": [
                              {
                                "constraint": {
                                  "type": "BOOL",
                                  "logic": "IS_TRUE"
                                },
                                "attribute": {
                                  "type": "PARAM",
                                  "param": "string"
                                }
                              }
                            ]
                          }
                        }
                      ],
                      "expression": {
                        "type": "EMPTY"
                      },
                      "groupBy": [
                        {
                          "type": "CONSTANT",
                          "constant": "string"
                        }
                      ]
                    }
                  }
                ],
                "unique": true
              },
              "isVisibleForClientProfile": true,
              "inlineAnalytics": [
                {
                  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
                  "analyticType": "EXPRESSION",
                  "analysis": {
                    "type": "EVENT",
                    "action": {
                      "id": 0,
                      "name": "page.visit"
                    },
                    "name": "string",
                    "description": "string",
                    "expression": {
                      "type": "VALUE",
                      "title": "title",
                      "value": {
                        "type": "CONSTANT",
                        "constant": 10
                      }
                    }
                  }
                }
              ]
            });

            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/analytics/%7BNamespace%7D/segmentations");
            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": "/analytics/%7BNamespace%7D/segmentations",
              "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({
              analysis: {
                id: '5370bf3c-2dfa-4e89-98ff-07100cffee6c',
                title: 'string',
                description: 'string',
                segments: [
                  {
                    title: 'string',
                    description: 'string',
                    filter: {
                      matching: true,
                      expressions: [
                        {
                          type: 'ATTRIBUTE',
                          name: 'string',
                          matching: true,
                          attribute: {
                            expressions: [
                              {
                                constraint: {type: 'BOOL', logic: 'IS_TRUE'},
                                attribute: {type: 'PARAM', param: 'string'}
                              }
                            ]
                          }
                        }
                      ],
                      expression: {type: 'EMPTY'},
                      groupBy: [{type: 'CONSTANT', constant: 'string'}]
                    }
                  }
                ],
                unique: true
              },
              isVisibleForClientProfile: true,
              inlineAnalytics: [
                {
                  id: '497f6eca-6276-4993-bfeb-53cbbbba6f08',
                  analyticType: 'EXPRESSION',
                  analysis: {
                    type: 'EVENT',
                    action: {id: 0, name: 'page.visit'},
                    name: 'string',
                    description: 'string',
                    expression: {type: 'VALUE', title: 'title', value: {type: 'CONSTANT', constant: 10}}
                  }
                }
              ]
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/analytics/%7BNamespace%7D/segmentations');
            $request->setMethod(HTTP_METH_POST);

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

            $request->setBody('{"analysis":{"id":"5370bf3c-2dfa-4e89-98ff-07100cffee6c","title":"string","description":"string","segments":[{"title":"string","description":"string","filter":{"matching":true,"expressions":[{"type":"ATTRIBUTE","name":"string","matching":true,"attribute":{"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]}}],"expression":{"type":"EMPTY"},"groupBy":[{"type":"CONSTANT","constant":"string"}]}}],"unique":true},"isVisibleForClientProfile":true,"inlineAnalytics":[{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","analyticType":"EXPRESSION","analysis":{"type":"EVENT","action":{"id":0,"name":"page.visit"},"name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}}}]}');

            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/analytics/%7BNamespace%7D/segmentations")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"analysis\":{\"id\":\"5370bf3c-2dfa-4e89-98ff-07100cffee6c\",\"title\":\"string\",\"description\":\"string\",\"segments\":[{\"title\":\"string\",\"description\":\"string\",\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"ATTRIBUTE\",\"name\":\"string\",\"matching\":true,\"attribute\":{\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}}],\"expression\":{\"type\":\"EMPTY\"},\"groupBy\":[{\"type\":\"CONSTANT\",\"constant\":\"string\"}]}}],\"unique\":true},\"isVisibleForClientProfile\":true,\"inlineAnalytics\":[{\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\"analyticType\":\"EXPRESSION\",\"analysis\":{\"type\":\"EVENT\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}}}]}")
              .asString();
  /analytics/{Namespace}/segmentations/{AnalysisId}:
    get:
      tags:
        - "Analytics: Segmentations"
      summary: Get segmentation details
      description: |
        Retrieve the details of a segmentation analysis

        ---

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

        **API key permissions required (at least one):** `ANALYTICS_BACKEND_SEGMENTATIONS_READ`, `ANALYTICS_BACKEND_SEGMENTATION_READ`

        **User role permission required:** `analytics: read`
      operationId: analytics2-segmentation-get
      parameters:
        - $ref: "#/components/parameters/analytics-AnalyticIdPathParam"
        - $ref: "#/components/parameters/analytics-pathNamespace"
      responses:
        "200":
          description: Segmentation details
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/analytics-SegmentationView"
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Segmentations/operation/analytics2-segmentation-get
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url https://api.synerise.com/analytics/%7BNamespace%7D/segmentations/%7BAnalysisId%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", "/analytics/%7BNamespace%7D/segmentations/%7BAnalysisId%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/analytics/%7BNamespace%7D/segmentations/%7BAnalysisId%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": "/analytics/%7BNamespace%7D/segmentations/%7BAnalysisId%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/analytics/%7BNamespace%7D/segmentations/%7BAnalysisId%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/analytics/%7BNamespace%7D/segmentations/%7BAnalysisId%7D")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
    put:
      tags:
        - "Analytics: Segmentations"
      summary: Update segmentation
      description: |
        Update an existing segmentation analysis.

        ---

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

        **API key permissions required (at least one):** `ANALYTICS_BACKEND_SEGMENTATIONS_UPDATE`, `ANALYTICS_BACKEND_SEGMENTATION_UPDATE`

        **User role permission required:** `analytics: update`
      operationId: analytics2-segmentation-update
      parameters:
        - $ref: "#/components/parameters/analytics-AnalyticIdPathParam"
        - $ref: "#/components/parameters/analytics-pathNamespace"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/analytics-SegmentationRequest"
      responses:
        "200":
          description: Segmentation updated
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Segmentations/operation/analytics2-segmentation-update
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request PUT \
              --url https://api.synerise.com/analytics/%7BNamespace%7D/segmentations/%7BAnalysisId%7D \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"analysis":{"id":"5370bf3c-2dfa-4e89-98ff-07100cffee6c","title":"string","description":"string","segments":[{"title":"string","description":"string","filter":{"matching":true,"expressions":[{"type":"ATTRIBUTE","name":"string","matching":true,"attribute":{"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]}}],"expression":{"type":"EMPTY"},"groupBy":[{"type":"CONSTANT","constant":"string"}]}}],"unique":true},"isVisibleForClientProfile":true,"inlineAnalytics":[{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","analyticType":"EXPRESSION","analysis":{"type":"EVENT","action":{"id":0,"name":"page.visit"},"name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}}}]}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"analysis\":{\"id\":\"5370bf3c-2dfa-4e89-98ff-07100cffee6c\",\"title\":\"string\",\"description\":\"string\",\"segments\":[{\"title\":\"string\",\"description\":\"string\",\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"ATTRIBUTE\",\"name\":\"string\",\"matching\":true,\"attribute\":{\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}}],\"expression\":{\"type\":\"EMPTY\"},\"groupBy\":[{\"type\":\"CONSTANT\",\"constant\":\"string\"}]}}],\"unique\":true},\"isVisibleForClientProfile\":true,\"inlineAnalytics\":[{\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\"analyticType\":\"EXPRESSION\",\"analysis\":{\"type\":\"EVENT\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}}}]}"

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

            conn.request("PUT", "/analytics/%7BNamespace%7D/segmentations/%7BAnalysisId%7D", payload, headers)

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

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "analysis": {
                "id": "5370bf3c-2dfa-4e89-98ff-07100cffee6c",
                "title": "string",
                "description": "string",
                "segments": [
                  {
                    "title": "string",
                    "description": "string",
                    "filter": {
                      "matching": true,
                      "expressions": [
                        {
                          "type": "ATTRIBUTE",
                          "name": "string",
                          "matching": true,
                          "attribute": {
                            "expressions": [
                              {
                                "constraint": {
                                  "type": "BOOL",
                                  "logic": "IS_TRUE"
                                },
                                "attribute": {
                                  "type": "PARAM",
                                  "param": "string"
                                }
                              }
                            ]
                          }
                        }
                      ],
                      "expression": {
                        "type": "EMPTY"
                      },
                      "groupBy": [
                        {
                          "type": "CONSTANT",
                          "constant": "string"
                        }
                      ]
                    }
                  }
                ],
                "unique": true
              },
              "isVisibleForClientProfile": true,
              "inlineAnalytics": [
                {
                  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
                  "analyticType": "EXPRESSION",
                  "analysis": {
                    "type": "EVENT",
                    "action": {
                      "id": 0,
                      "name": "page.visit"
                    },
                    "name": "string",
                    "description": "string",
                    "expression": {
                      "type": "VALUE",
                      "title": "title",
                      "value": {
                        "type": "CONSTANT",
                        "constant": 10
                      }
                    }
                  }
                }
              ]
            });

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

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

            xhr.open("PUT", "https://api.synerise.com/analytics/%7BNamespace%7D/segmentations/%7BAnalysisId%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": "PUT",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/analytics/%7BNamespace%7D/segmentations/%7BAnalysisId%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({
              analysis: {
                id: '5370bf3c-2dfa-4e89-98ff-07100cffee6c',
                title: 'string',
                description: 'string',
                segments: [
                  {
                    title: 'string',
                    description: 'string',
                    filter: {
                      matching: true,
                      expressions: [
                        {
                          type: 'ATTRIBUTE',
                          name: 'string',
                          matching: true,
                          attribute: {
                            expressions: [
                              {
                                constraint: {type: 'BOOL', logic: 'IS_TRUE'},
                                attribute: {type: 'PARAM', param: 'string'}
                              }
                            ]
                          }
                        }
                      ],
                      expression: {type: 'EMPTY'},
                      groupBy: [{type: 'CONSTANT', constant: 'string'}]
                    }
                  }
                ],
                unique: true
              },
              isVisibleForClientProfile: true,
              inlineAnalytics: [
                {
                  id: '497f6eca-6276-4993-bfeb-53cbbbba6f08',
                  analyticType: 'EXPRESSION',
                  analysis: {
                    type: 'EVENT',
                    action: {id: 0, name: 'page.visit'},
                    name: 'string',
                    description: 'string',
                    expression: {type: 'VALUE', title: 'title', value: {type: 'CONSTANT', constant: 10}}
                  }
                }
              ]
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/analytics/%7BNamespace%7D/segmentations/%7BAnalysisId%7D');
            $request->setMethod(HTTP_METH_PUT);

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

            $request->setBody('{"analysis":{"id":"5370bf3c-2dfa-4e89-98ff-07100cffee6c","title":"string","description":"string","segments":[{"title":"string","description":"string","filter":{"matching":true,"expressions":[{"type":"ATTRIBUTE","name":"string","matching":true,"attribute":{"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]}}],"expression":{"type":"EMPTY"},"groupBy":[{"type":"CONSTANT","constant":"string"}]}}],"unique":true},"isVisibleForClientProfile":true,"inlineAnalytics":[{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","analyticType":"EXPRESSION","analysis":{"type":"EVENT","action":{"id":0,"name":"page.visit"},"name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}}}]}');

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

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.put("https://api.synerise.com/analytics/%7BNamespace%7D/segmentations/%7BAnalysisId%7D")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"analysis\":{\"id\":\"5370bf3c-2dfa-4e89-98ff-07100cffee6c\",\"title\":\"string\",\"description\":\"string\",\"segments\":[{\"title\":\"string\",\"description\":\"string\",\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"ATTRIBUTE\",\"name\":\"string\",\"matching\":true,\"attribute\":{\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}}],\"expression\":{\"type\":\"EMPTY\"},\"groupBy\":[{\"type\":\"CONSTANT\",\"constant\":\"string\"}]}}],\"unique\":true},\"isVisibleForClientProfile\":true,\"inlineAnalytics\":[{\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\"analyticType\":\"EXPRESSION\",\"analysis\":{\"type\":\"EVENT\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}}}]}")
              .asString();
    delete:
      tags:
        - "Analytics: Segmentations"
      summary: Delete segmentation
      operationId: analytics2-segmentation-delete
      parameters:
        - $ref: "#/components/parameters/analytics-AnalyticIdPathParam"
        - $ref: "#/components/parameters/analytics-pathNamespace"
      responses:
        "204":
          description: Deleted segmentation analysis
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Segmentations/operation/analytics2-segmentation-delete
      description: |
        

        ---

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

        **API key permissions required (at least one):** `ANALYTICS_BACKEND_SEGMENTATIONS_DELETE`, `ANALYTICS_BACKEND_SEGMENTATION_DELETE`

        **User role permission required:** `analytics: delete`
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request DELETE \
              --url https://api.synerise.com/analytics/%7BNamespace%7D/segmentations/%7BAnalysisId%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", "/analytics/%7BNamespace%7D/segmentations/%7BAnalysisId%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/analytics/%7BNamespace%7D/segmentations/%7BAnalysisId%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": "/analytics/%7BNamespace%7D/segmentations/%7BAnalysisId%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/analytics/%7BNamespace%7D/segmentations/%7BAnalysisId%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/analytics/%7BNamespace%7D/segmentations/%7BAnalysisId%7D")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
  /analytics/{Namespace}/segmentations/visible-for-client/by/{IdentifierType}:
    post:
      tags:
        - "Analytics: Segmentations"
      summary: Get segmentations for profile card
      description: |
        Retrieve segmentations to display on a profile's card in the Profiles module (`"isVisibleForClientProfile": true`) in the [segmentation config](https://developers.synerise.com/AnalyticsSuite/AnalyticsSuite.html#operation/addSegmentationPOST_v2)).


        ---

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

        **API key permission required:** `ANALYTICS_BACKEND_SEGMENTATIONS_FOR_CLIENT_READ`

        **User role permission required (at least one):** `analytics: read`, `client_analytics_preview: read`
      operationId: analytics2-client-card-segmentations-get
      parameters:
        - $ref: "#/components/parameters/analytics-pathNamespace"
        - $ref: "#/components/parameters/analytics-pathIdentifierType"
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                identifierValue:
                  $ref: "#/components/schemas/analytics-IdentifierValue"
              required:
                - identifierValue
      responses:
        "200":
          description: List of checked segmentations configured as visible on the profile card
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/analytics-CalculatedAnalytic"
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Segmentations/operation/analytics2-client-card-segmentations-get
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/analytics/%7BNamespace%7D/segmentations/visible-for-client/by/%7BIdentifierType%7D \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"identifierValue":"string"}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"identifierValue\":\"string\"}"

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

            conn.request("POST", "/analytics/%7BNamespace%7D/segmentations/visible-for-client/by/%7BIdentifierType%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"
            });

            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/analytics/%7BNamespace%7D/segmentations/visible-for-client/by/%7BIdentifierType%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": "/analytics/%7BNamespace%7D/segmentations/visible-for-client/by/%7BIdentifierType%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'}));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/analytics/%7BNamespace%7D/segmentations/visible-for-client/by/%7BIdentifierType%7D');
            $request->setMethod(HTTP_METH_POST);

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

            $request->setBody('{"identifierValue":"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/analytics/%7BNamespace%7D/segmentations/visible-for-client/by/%7BIdentifierType%7D")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"identifierValue\":\"string\"}")
              .asString();
  /analytics/{Namespace}/segmentations/check/by/{IdentifierType}:
    post:
      tags:
        - "Analytics: Segmentations"
      summary: Check if profile in segmentations
      description: |
        Check if a profile is in a number of segmentations.

        **IMPORTANT**: This endpoint is limited to:
        - 10 segmentations per request
        - 500 requests per second
        - 10 requests per second per profile


        ---

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

        **API key permission required:** `ANALYTICS_BACKEND_SEGMENTATIONS_LIST_READ`

        **User role permission required:** `analytics: read`
      operationId: analytics2-segmentation-check
      parameters:
        - $ref: "#/components/parameters/analytics-pathIdentifierType"
        - $ref: "#/components/parameters/analytics-pathNamespace"
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                identifierValue:
                  $ref: "#/components/schemas/analytics-IdentifierValue"
                segmentationIds:
                  type: array
                  description: UUIDs of the segmentations to check
                  items:
                    $ref: "#/components/schemas/analytics-AnalyticId"
                  maxItems: 10
              required:
                - identifierValue
                - segmentationIds
      responses:
        "200":
          description: Check results
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/analytics-SegmentationWithRelated"
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Segmentations/operation/analytics2-segmentation-check
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/analytics/%7BNamespace%7D/segmentations/check/by/%7BIdentifierType%7D \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"identifierValue":"string","segmentationIds":["5370bf3c-2dfa-4e89-98ff-07100cffee6c"]}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"identifierValue\":\"string\",\"segmentationIds\":[\"5370bf3c-2dfa-4e89-98ff-07100cffee6c\"]}"

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

            conn.request("POST", "/analytics/%7BNamespace%7D/segmentations/check/by/%7BIdentifierType%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",
              "segmentationIds": [
                "5370bf3c-2dfa-4e89-98ff-07100cffee6c"
              ]
            });

            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/analytics/%7BNamespace%7D/segmentations/check/by/%7BIdentifierType%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": "/analytics/%7BNamespace%7D/segmentations/check/by/%7BIdentifierType%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',
              segmentationIds: ['5370bf3c-2dfa-4e89-98ff-07100cffee6c']
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/analytics/%7BNamespace%7D/segmentations/check/by/%7BIdentifierType%7D');
            $request->setMethod(HTTP_METH_POST);

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

            $request->setBody('{"identifierValue":"string","segmentationIds":["5370bf3c-2dfa-4e89-98ff-07100cffee6c"]}');

            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/analytics/%7BNamespace%7D/segmentations/check/by/%7BIdentifierType%7D")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"identifierValue\":\"string\",\"segmentationIds\":[\"5370bf3c-2dfa-4e89-98ff-07100cffee6c\"]}")
              .asString();
  /analytics/analytics/definitions-manager/aggregates/{AggregateIdentifier}/client/{ProfileId}/calculate/histogram:
    post:
      tags:
        - "Analytics: Aggregates"
      summary: Calculate aggregate for profile with period conditions
      description: |
        Calculate the results of an aggregate in context of a single profile. The results can be date-filtered and aggregated in time periods.

        ---

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

        **API key permission required:** `ANALYTICS_BACKEND_AGGREGATE_HISTOGRAM_FOR_CLIENT_READ`

        **User role permission required:** `analytics: read`
      operationId: analytics-calculate-aggregate-for-profile-with-period-uuid
      parameters:
        - $ref: "#/components/parameters/analytics-aggregateIdentifierAsPathParam"
        - $ref: "#/components/parameters/analytics-clientIdAsPathParameter"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/analytics-AggregateHistogramRequest"
      responses:
        "200":
          description: Aggregate calculation result
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/analytics-AggregateHistogramCalculationResponse"
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/data-management#tag/Analytics:-Aggregates/operation/analytics-calculate-aggregate-for-profile-with-period-uuid
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/analytics/analytics/definitions-manager/aggregates/%7BAggregateIdentifier%7D/client/%7BProfileId%7D/calculate/histogram \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"variables":[{"name":"string","value":"example-string-value"}],"dateFilter":{"type":"ABSOLUTE","from":"2019-08-24T14:15:22Z","to":"2019-08-24T14:15:22Z","filter":{"type":"DAILY","nestingType":"IN_PLACE","from":"string","to":"string","inverted":false}},"aggregateDataBy":{"type":"YEARS","value":0}}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"variables\":[{\"name\":\"string\",\"value\":\"example-string-value\"}],\"dateFilter\":{\"type\":\"ABSOLUTE\",\"from\":\"2019-08-24T14:15:22Z\",\"to\":\"2019-08-24T14:15:22Z\",\"filter\":{\"type\":\"DAILY\",\"nestingType\":\"IN_PLACE\",\"from\":\"string\",\"to\":\"string\",\"inverted\":false}},\"aggregateDataBy\":{\"type\":\"YEARS\",\"value\":0}}"

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

            conn.request("POST", "/analytics/analytics/definitions-manager/aggregates/%7BAggregateIdentifier%7D/client/%7BProfileId%7D/calculate/histogram", payload, headers)

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

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "variables": [
                {
                  "name": "string",
                  "value": "example-string-value"
                }
              ],
              "dateFilter": {
                "type": "ABSOLUTE",
                "from": "2019-08-24T14:15:22Z",
                "to": "2019-08-24T14:15:22Z",
                "filter": {
                  "type": "DAILY",
                  "nestingType": "IN_PLACE",
                  "from": "string",
                  "to": "string",
                  "inverted": false
                }
              },
              "aggregateDataBy": {
                "type": "YEARS",
                "value": 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/analytics/analytics/definitions-manager/aggregates/%7BAggregateIdentifier%7D/client/%7BProfileId%7D/calculate/histogram");
            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": "/analytics/analytics/definitions-manager/aggregates/%7BAggregateIdentifier%7D/client/%7BProfileId%7D/calculate/histogram",
              "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({
              variables: [{name: 'string', value: 'example-string-value'}],
              dateFilter: {
                type: 'ABSOLUTE',
                from: '2019-08-24T14:15:22Z',
                to: '2019-08-24T14:15:22Z',
                filter: {
                  type: 'DAILY',
                  nestingType: 'IN_PLACE',
                  from: 'string',
                  to: 'string',
                  inverted: false
                }
              },
              aggregateDataBy: {type: 'YEARS', value: 0}
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/analytics/analytics/definitions-manager/aggregates/%7BAggregateIdentifier%7D/client/%7BProfileId%7D/calculate/histogram');
            $request->setMethod(HTTP_METH_POST);

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

            $request->setBody('{"variables":[{"name":"string","value":"example-string-value"}],"dateFilter":{"type":"ABSOLUTE","from":"2019-08-24T14:15:22Z","to":"2019-08-24T14:15:22Z","filter":{"type":"DAILY","nestingType":"IN_PLACE","from":"string","to":"string","inverted":false}},"aggregateDataBy":{"type":"YEARS","value":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/analytics/analytics/definitions-manager/aggregates/%7BAggregateIdentifier%7D/client/%7BProfileId%7D/calculate/histogram")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"variables\":[{\"name\":\"string\",\"value\":\"example-string-value\"}],\"dateFilter\":{\"type\":\"ABSOLUTE\",\"from\":\"2019-08-24T14:15:22Z\",\"to\":\"2019-08-24T14:15:22Z\",\"filter\":{\"type\":\"DAILY\",\"nestingType\":\"IN_PLACE\",\"from\":\"string\",\"to\":\"string\",\"inverted\":false}},\"aggregateDataBy\":{\"type\":\"YEARS\",\"value\":0}}")
              .asString();
  /analytics/{Namespace}/aggregates/preview/by/{IdentifierType}:
    post:
      tags:
        - "Analytics: Aggregates"
      summary: Get aggregate preview
      description: |
        Retrieve aggregate preview value. Previews are only available for the AGGREGATE type (profile aggregate). This request doesn't save an aggregate to the database.

        ---

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

        **API key permissions required (at least one):** `ANALYTICS_BACKEND_AGGREGATES_READ`, `ANALYTICS_BACKEND_AGGREGATE_READ`

        **User role permission required:** `analytics_aggregates: read`
      operationId: analytics2-aggregate-preview-v2
      parameters:
        - $ref: "#/components/parameters/analytics-pathNamespace"
        - $ref: "#/components/parameters/analytics-pathIdentifierType"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/analytics-AggregatePreviewRequest"
      responses:
        "200":
          description: Aggregate preview
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/analytics-AggregateTypedCalculationResponse"
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/data-management#tag/Analytics:-Aggregates/operation/analytics2-aggregate-preview-v2
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/analytics/%7BNamespace%7D/aggregates/preview/by/%7BIdentifierType%7D \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"identifierValue":"string","aggregate":{"aggregateType":"AGGREGATE","id":0,"name":"string","description":"string","uuid":"5370bf3c-2dfa-4e89-98ff-07100cffee6c","type":"AVG","level":0.1,"size":0,"unique":true,"dateFilter":{"type":"ABSOLUTE","from":"2019-08-24T14:15:22Z","to":"2019-08-24T14:15:22Z","filter":{"type":"DAILY","nestingType":"IN_PLACE","from":"string","to":"string","inverted":false}},"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}],"attribute":{"type":"PARAM","param":"string"},"action":{"id":0,"name":"page.visit"}},"inlineAnalytics":[{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","analyticType":"EXPRESSION","analysis":{"type":"EVENT","action":{"id":0,"name":"page.visit"},"name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}}}]}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"identifierValue\":\"string\",\"aggregate\":{\"aggregateType\":\"AGGREGATE\",\"id\":0,\"name\":\"string\",\"description\":\"string\",\"uuid\":\"5370bf3c-2dfa-4e89-98ff-07100cffee6c\",\"type\":\"AVG\",\"level\":0.1,\"size\":0,\"unique\":true,\"dateFilter\":{\"type\":\"ABSOLUTE\",\"from\":\"2019-08-24T14:15:22Z\",\"to\":\"2019-08-24T14:15:22Z\",\"filter\":{\"type\":\"DAILY\",\"nestingType\":\"IN_PLACE\",\"from\":\"string\",\"to\":\"string\",\"inverted\":false}},\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}],\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"},\"action\":{\"id\":0,\"name\":\"page.visit\"}},\"inlineAnalytics\":[{\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\"analyticType\":\"EXPRESSION\",\"analysis\":{\"type\":\"EVENT\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}}}]}"

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

            conn.request("POST", "/analytics/%7BNamespace%7D/aggregates/preview/by/%7BIdentifierType%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",
              "aggregate": {
                "aggregateType": "AGGREGATE",
                "id": 0,
                "name": "string",
                "description": "string",
                "uuid": "5370bf3c-2dfa-4e89-98ff-07100cffee6c",
                "type": "AVG",
                "level": 0.1,
                "size": 0,
                "unique": true,
                "dateFilter": {
                  "type": "ABSOLUTE",
                  "from": "2019-08-24T14:15:22Z",
                  "to": "2019-08-24T14:15:22Z",
                  "filter": {
                    "type": "DAILY",
                    "nestingType": "IN_PLACE",
                    "from": "string",
                    "to": "string",
                    "inverted": false
                  }
                },
                "expressions": [
                  {
                    "constraint": {
                      "type": "BOOL",
                      "logic": "IS_TRUE"
                    },
                    "attribute": {
                      "type": "PARAM",
                      "param": "string"
                    }
                  }
                ],
                "attribute": {
                  "type": "PARAM",
                  "param": "string"
                },
                "action": {
                  "id": 0,
                  "name": "page.visit"
                }
              },
              "inlineAnalytics": [
                {
                  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
                  "analyticType": "EXPRESSION",
                  "analysis": {
                    "type": "EVENT",
                    "action": {
                      "id": 0,
                      "name": "page.visit"
                    },
                    "name": "string",
                    "description": "string",
                    "expression": {
                      "type": "VALUE",
                      "title": "title",
                      "value": {
                        "type": "CONSTANT",
                        "constant": 10
                      }
                    }
                  }
                }
              ]
            });

            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/analytics/%7BNamespace%7D/aggregates/preview/by/%7BIdentifierType%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": "/analytics/%7BNamespace%7D/aggregates/preview/by/%7BIdentifierType%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',
              aggregate: {
                aggregateType: 'AGGREGATE',
                id: 0,
                name: 'string',
                description: 'string',
                uuid: '5370bf3c-2dfa-4e89-98ff-07100cffee6c',
                type: 'AVG',
                level: 0.1,
                size: 0,
                unique: true,
                dateFilter: {
                  type: 'ABSOLUTE',
                  from: '2019-08-24T14:15:22Z',
                  to: '2019-08-24T14:15:22Z',
                  filter: {
                    type: 'DAILY',
                    nestingType: 'IN_PLACE',
                    from: 'string',
                    to: 'string',
                    inverted: false
                  }
                },
                expressions: [
                  {
                    constraint: {type: 'BOOL', logic: 'IS_TRUE'},
                    attribute: {type: 'PARAM', param: 'string'}
                  }
                ],
                attribute: {type: 'PARAM', param: 'string'},
                action: {id: 0, name: 'page.visit'}
              },
              inlineAnalytics: [
                {
                  id: '497f6eca-6276-4993-bfeb-53cbbbba6f08',
                  analyticType: 'EXPRESSION',
                  analysis: {
                    type: 'EVENT',
                    action: {id: 0, name: 'page.visit'},
                    name: 'string',
                    description: 'string',
                    expression: {type: 'VALUE', title: 'title', value: {type: 'CONSTANT', constant: 10}}
                  }
                }
              ]
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/analytics/%7BNamespace%7D/aggregates/preview/by/%7BIdentifierType%7D');
            $request->setMethod(HTTP_METH_POST);

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

            $request->setBody('{"identifierValue":"string","aggregate":{"aggregateType":"AGGREGATE","id":0,"name":"string","description":"string","uuid":"5370bf3c-2dfa-4e89-98ff-07100cffee6c","type":"AVG","level":0.1,"size":0,"unique":true,"dateFilter":{"type":"ABSOLUTE","from":"2019-08-24T14:15:22Z","to":"2019-08-24T14:15:22Z","filter":{"type":"DAILY","nestingType":"IN_PLACE","from":"string","to":"string","inverted":false}},"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}],"attribute":{"type":"PARAM","param":"string"},"action":{"id":0,"name":"page.visit"}},"inlineAnalytics":[{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","analyticType":"EXPRESSION","analysis":{"type":"EVENT","action":{"id":0,"name":"page.visit"},"name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}}}]}');

            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/analytics/%7BNamespace%7D/aggregates/preview/by/%7BIdentifierType%7D")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"identifierValue\":\"string\",\"aggregate\":{\"aggregateType\":\"AGGREGATE\",\"id\":0,\"name\":\"string\",\"description\":\"string\",\"uuid\":\"5370bf3c-2dfa-4e89-98ff-07100cffee6c\",\"type\":\"AVG\",\"level\":0.1,\"size\":0,\"unique\":true,\"dateFilter\":{\"type\":\"ABSOLUTE\",\"from\":\"2019-08-24T14:15:22Z\",\"to\":\"2019-08-24T14:15:22Z\",\"filter\":{\"type\":\"DAILY\",\"nestingType\":\"IN_PLACE\",\"from\":\"string\",\"to\":\"string\",\"inverted\":false}},\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}],\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"},\"action\":{\"id\":0,\"name\":\"page.visit\"}},\"inlineAnalytics\":[{\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\"analyticType\":\"EXPRESSION\",\"analysis\":{\"type\":\"EVENT\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}}}]}")
              .asString();
  /analytics/{Namespace}/aggregates/visible-for-client/by/{IdentifierType}:
    post:
      tags:
        - "Analytics: Aggregates"
      summary: Get aggregates for profile card
      description: |
        Retrieve aggregates to display on a profile's card in the Profiles module (`"isVisibleForClientProfile": true`) in the [expression config](https://developers.synerise.com/AnalyticsSuite/AnalyticsSuite.html#operation/addAggregatePOST)).


        ---

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

        **API key permission required:** `ANALYTICS_BACKEND_AGGREGATE_FOR_CLIENT_READ`

        **User role permission required (at least one):** `analytics: read`, `client_analytics_preview: read`
      operationId: analytics2-client-card-aggregates-get
      parameters:
        - $ref: "#/components/parameters/analytics-pathIdentifierType"
        - $ref: "#/components/parameters/analytics-pathNamespace"
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                identifierValue:
                  $ref: "#/components/schemas/analytics-IdentifierValue"
              required:
                - identifierValue
      responses:
        "200":
          description: List of calculated aggregates configured as visible on the profile card
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/analytics-CalculatedAnalytic"
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/data-management#tag/Analytics:-Aggregates/operation/analytics2-client-card-aggregates-get
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/analytics/%7BNamespace%7D/aggregates/visible-for-client/by/%7BIdentifierType%7D \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"identifierValue":"string"}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"identifierValue\":\"string\"}"

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

            conn.request("POST", "/analytics/%7BNamespace%7D/aggregates/visible-for-client/by/%7BIdentifierType%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"
            });

            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/analytics/%7BNamespace%7D/aggregates/visible-for-client/by/%7BIdentifierType%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": "/analytics/%7BNamespace%7D/aggregates/visible-for-client/by/%7BIdentifierType%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'}));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/analytics/%7BNamespace%7D/aggregates/visible-for-client/by/%7BIdentifierType%7D');
            $request->setMethod(HTTP_METH_POST);

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

            $request->setBody('{"identifierValue":"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/analytics/%7BNamespace%7D/aggregates/visible-for-client/by/%7BIdentifierType%7D")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"identifierValue\":\"string\"}")
              .asString();
  /analytics/{Namespace}/aggregates/{AggregateIdentifier}/calculate/by/{IdentifierType}:
    post:
      tags:
        - "Analytics: Aggregates"
      summary: Calculate aggregate for profile
      description: |
        Calculate the result of an existing aggregate in context of a single profile.

        ---

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

        **API key permission required:** `ANALYTICS_BACKEND_AGGREGATE_FOR_CLIENT_READ`

        **User role permission required:** `analytics: read`
      operationId: analytics2-aggregate-calculate
      parameters:
        - $ref: "#/components/parameters/analytics-pathNamespace"
        - $ref: "#/components/parameters/analytics-aggregateIdentifierAsPathParam"
        - $ref: "#/components/parameters/analytics-pathIdentifierType"
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                identifierValue:
                  $ref: "#/components/schemas/analytics-IdentifierValue"
              required:
                - identifierValue
      responses:
        "200":
          description: Aggregate result
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/analytics-AggregateResult"
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/data-management#tag/Analytics:-Aggregates/operation/analytics2-aggregate-calculate
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/analytics/%7BNamespace%7D/aggregates/%7BAggregateIdentifier%7D/calculate/by/%7BIdentifierType%7D \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"identifierValue":"string"}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"identifierValue\":\"string\"}"

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

            conn.request("POST", "/analytics/%7BNamespace%7D/aggregates/%7BAggregateIdentifier%7D/calculate/by/%7BIdentifierType%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"
            });

            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/analytics/%7BNamespace%7D/aggregates/%7BAggregateIdentifier%7D/calculate/by/%7BIdentifierType%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": "/analytics/%7BNamespace%7D/aggregates/%7BAggregateIdentifier%7D/calculate/by/%7BIdentifierType%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'}));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/analytics/%7BNamespace%7D/aggregates/%7BAggregateIdentifier%7D/calculate/by/%7BIdentifierType%7D');
            $request->setMethod(HTTP_METH_POST);

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

            $request->setBody('{"identifierValue":"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/analytics/%7BNamespace%7D/aggregates/%7BAggregateIdentifier%7D/calculate/by/%7BIdentifierType%7D")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"identifierValue\":\"string\"}")
              .asString();
  /analytics/{Namespace}/aggregates:
    get:
      tags:
        - "Analytics: Aggregates"
      summary: List aggregates
      description: |
        Returns a paginated list of aggregates.

        ---

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

        **API key permission required:** `ANALYTICS_BACKEND_AGGREGATES_LIST_READ`

        **User role permission required:** `analytics: read`
      operationId: analytics2-aggregates-list
      parameters:
        - $ref: "#/components/parameters/analytics-page"
        - $ref: "#/components/parameters/analytics-limit"
        - $ref: "#/components/parameters/analytics-search"
        - $ref: "#/components/parameters/analytics-sortBy"
        - $ref: "#/components/parameters/analytics-pathNamespace"
        - $ref: "#/components/parameters/analytics-directoryId"
        - $ref: "#/components/parameters/analytics-ids"
        - $ref: "#/components/parameters/analytics-AggregateType"
      responses:
        "200":
          description: List of aggregates
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/analytics-AggregatePaginationContainer"
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/data-management#tag/Analytics:-Aggregates/operation/analytics2-aggregates-list
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.synerise.com/analytics/%7BNamespace%7D/aggregates?page=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sortBy=name%3Aasc&directoryId=SOME_STRING_VALUE&ids=SOME_STRING_VALUE&aggregateType=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", "/analytics/%7BNamespace%7D/aggregates?page=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sortBy=name%3Aasc&directoryId=SOME_STRING_VALUE&ids=SOME_STRING_VALUE&aggregateType=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/analytics/%7BNamespace%7D/aggregates?page=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sortBy=name%3Aasc&directoryId=SOME_STRING_VALUE&ids=SOME_STRING_VALUE&aggregateType=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": "/analytics/%7BNamespace%7D/aggregates?page=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sortBy=name%3Aasc&directoryId=SOME_STRING_VALUE&ids=SOME_STRING_VALUE&aggregateType=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/analytics/%7BNamespace%7D/aggregates');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'page' => 'SOME_INTEGER_VALUE',
              'limit' => 'SOME_INTEGER_VALUE',
              'search' => 'SOME_STRING_VALUE',
              'sortBy' => 'name:asc',
              'directoryId' => 'SOME_STRING_VALUE',
              'ids' => 'SOME_STRING_VALUE',
              'aggregateType' => '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/analytics/%7BNamespace%7D/aggregates?page=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sortBy=name%3Aasc&directoryId=SOME_STRING_VALUE&ids=SOME_STRING_VALUE&aggregateType=SOME_STRING_VALUE")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
    post:
      tags:
        - "Analytics: Aggregates"
      summary: Create aggregate
      description: |
        Create an aggregate analysis and save it to the database.

        ---

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

        **API key permissions required (at least one):** `ANALYTICS_BACKEND_AGGREGATES_CREATE`, `ANALYTICS_BACKEND_AGGREGATE_CREATE`

        **User role permission required:** `analytics_aggregates: create`
      operationId: analytics2-aggregate-create
      parameters:
        - $ref: "#/components/parameters/analytics-pathNamespace"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/analytics-AggregateRequest"
      responses:
        "201":
          description: Aggregate has been created
          content:
            application/json:
              schema:
                type: string
                description: UUID of the created aggregate
                format: uuid
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/data-management#tag/Analytics:-Aggregates/operation/analytics2-aggregate-create
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/analytics/%7BNamespace%7D/aggregates \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"analysis":{"aggregateType":"AGGREGATE","id":0,"name":"string","description":"string","uuid":"5370bf3c-2dfa-4e89-98ff-07100cffee6c","type":"AVG","level":0.1,"size":0,"unique":true,"dateFilter":{"type":"ABSOLUTE","from":"2019-08-24T14:15:22Z","to":"2019-08-24T14:15:22Z","filter":{"type":"DAILY","nestingType":"IN_PLACE","from":"string","to":"string","inverted":false}},"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}],"attribute":{"type":"PARAM","param":"string"},"action":{"id":0,"name":"page.visit"}},"isVisibleForClientProfile":true,"aggregateType":"AGGREGATE","previewDefaultObjectId":0,"inlineAnalytics":[{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","analyticType":"EXPRESSION","analysis":{"type":"EVENT","action":{"id":0,"name":"page.visit"},"name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}}}]}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"analysis\":{\"aggregateType\":\"AGGREGATE\",\"id\":0,\"name\":\"string\",\"description\":\"string\",\"uuid\":\"5370bf3c-2dfa-4e89-98ff-07100cffee6c\",\"type\":\"AVG\",\"level\":0.1,\"size\":0,\"unique\":true,\"dateFilter\":{\"type\":\"ABSOLUTE\",\"from\":\"2019-08-24T14:15:22Z\",\"to\":\"2019-08-24T14:15:22Z\",\"filter\":{\"type\":\"DAILY\",\"nestingType\":\"IN_PLACE\",\"from\":\"string\",\"to\":\"string\",\"inverted\":false}},\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}],\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"},\"action\":{\"id\":0,\"name\":\"page.visit\"}},\"isVisibleForClientProfile\":true,\"aggregateType\":\"AGGREGATE\",\"previewDefaultObjectId\":0,\"inlineAnalytics\":[{\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\"analyticType\":\"EXPRESSION\",\"analysis\":{\"type\":\"EVENT\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}}}]}"

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

            conn.request("POST", "/analytics/%7BNamespace%7D/aggregates", payload, headers)

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

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "analysis": {
                "aggregateType": "AGGREGATE",
                "id": 0,
                "name": "string",
                "description": "string",
                "uuid": "5370bf3c-2dfa-4e89-98ff-07100cffee6c",
                "type": "AVG",
                "level": 0.1,
                "size": 0,
                "unique": true,
                "dateFilter": {
                  "type": "ABSOLUTE",
                  "from": "2019-08-24T14:15:22Z",
                  "to": "2019-08-24T14:15:22Z",
                  "filter": {
                    "type": "DAILY",
                    "nestingType": "IN_PLACE",
                    "from": "string",
                    "to": "string",
                    "inverted": false
                  }
                },
                "expressions": [
                  {
                    "constraint": {
                      "type": "BOOL",
                      "logic": "IS_TRUE"
                    },
                    "attribute": {
                      "type": "PARAM",
                      "param": "string"
                    }
                  }
                ],
                "attribute": {
                  "type": "PARAM",
                  "param": "string"
                },
                "action": {
                  "id": 0,
                  "name": "page.visit"
                }
              },
              "isVisibleForClientProfile": true,
              "aggregateType": "AGGREGATE",
              "previewDefaultObjectId": 0,
              "inlineAnalytics": [
                {
                  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
                  "analyticType": "EXPRESSION",
                  "analysis": {
                    "type": "EVENT",
                    "action": {
                      "id": 0,
                      "name": "page.visit"
                    },
                    "name": "string",
                    "description": "string",
                    "expression": {
                      "type": "VALUE",
                      "title": "title",
                      "value": {
                        "type": "CONSTANT",
                        "constant": 10
                      }
                    }
                  }
                }
              ]
            });

            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/analytics/%7BNamespace%7D/aggregates");
            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": "/analytics/%7BNamespace%7D/aggregates",
              "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({
              analysis: {
                aggregateType: 'AGGREGATE',
                id: 0,
                name: 'string',
                description: 'string',
                uuid: '5370bf3c-2dfa-4e89-98ff-07100cffee6c',
                type: 'AVG',
                level: 0.1,
                size: 0,
                unique: true,
                dateFilter: {
                  type: 'ABSOLUTE',
                  from: '2019-08-24T14:15:22Z',
                  to: '2019-08-24T14:15:22Z',
                  filter: {
                    type: 'DAILY',
                    nestingType: 'IN_PLACE',
                    from: 'string',
                    to: 'string',
                    inverted: false
                  }
                },
                expressions: [
                  {
                    constraint: {type: 'BOOL', logic: 'IS_TRUE'},
                    attribute: {type: 'PARAM', param: 'string'}
                  }
                ],
                attribute: {type: 'PARAM', param: 'string'},
                action: {id: 0, name: 'page.visit'}
              },
              isVisibleForClientProfile: true,
              aggregateType: 'AGGREGATE',
              previewDefaultObjectId: 0,
              inlineAnalytics: [
                {
                  id: '497f6eca-6276-4993-bfeb-53cbbbba6f08',
                  analyticType: 'EXPRESSION',
                  analysis: {
                    type: 'EVENT',
                    action: {id: 0, name: 'page.visit'},
                    name: 'string',
                    description: 'string',
                    expression: {type: 'VALUE', title: 'title', value: {type: 'CONSTANT', constant: 10}}
                  }
                }
              ]
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/analytics/%7BNamespace%7D/aggregates');
            $request->setMethod(HTTP_METH_POST);

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

            $request->setBody('{"analysis":{"aggregateType":"AGGREGATE","id":0,"name":"string","description":"string","uuid":"5370bf3c-2dfa-4e89-98ff-07100cffee6c","type":"AVG","level":0.1,"size":0,"unique":true,"dateFilter":{"type":"ABSOLUTE","from":"2019-08-24T14:15:22Z","to":"2019-08-24T14:15:22Z","filter":{"type":"DAILY","nestingType":"IN_PLACE","from":"string","to":"string","inverted":false}},"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}],"attribute":{"type":"PARAM","param":"string"},"action":{"id":0,"name":"page.visit"}},"isVisibleForClientProfile":true,"aggregateType":"AGGREGATE","previewDefaultObjectId":0,"inlineAnalytics":[{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","analyticType":"EXPRESSION","analysis":{"type":"EVENT","action":{"id":0,"name":"page.visit"},"name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}}}]}');

            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/analytics/%7BNamespace%7D/aggregates")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"analysis\":{\"aggregateType\":\"AGGREGATE\",\"id\":0,\"name\":\"string\",\"description\":\"string\",\"uuid\":\"5370bf3c-2dfa-4e89-98ff-07100cffee6c\",\"type\":\"AVG\",\"level\":0.1,\"size\":0,\"unique\":true,\"dateFilter\":{\"type\":\"ABSOLUTE\",\"from\":\"2019-08-24T14:15:22Z\",\"to\":\"2019-08-24T14:15:22Z\",\"filter\":{\"type\":\"DAILY\",\"nestingType\":\"IN_PLACE\",\"from\":\"string\",\"to\":\"string\",\"inverted\":false}},\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}],\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"},\"action\":{\"id\":0,\"name\":\"page.visit\"}},\"isVisibleForClientProfile\":true,\"aggregateType\":\"AGGREGATE\",\"previewDefaultObjectId\":0,\"inlineAnalytics\":[{\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\"analyticType\":\"EXPRESSION\",\"analysis\":{\"type\":\"EVENT\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}}}]}")
              .asString();
  /analytics/{Namespace}/aggregates/{AggregateIdentifier}:
    get:
      tags:
        - "Analytics: Aggregates"
      summary: Get aggregate details
      description: |
        Retrieve all data about an aggregate definition.

        ---

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

        **API key permissions required (at least one):** `ANALYTICS_BACKEND_AGGREGATES_READ`, `ANALYTICS_BACKEND_AGGREGATE_READ`

        **User role permission required:** `analytics_aggregates: read`
      operationId: analytics2-aggregate-get
      parameters:
        - $ref: "#/components/parameters/analytics-pathNamespace"
        - $ref: "#/components/parameters/analytics-aggregateIdentifierAsPathParam"
      responses:
        "200":
          description: Details of the aggregate
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/analytics-AggregateView"
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/data-management#tag/Analytics:-Aggregates/operation/analytics2-aggregate-get
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url https://api.synerise.com/analytics/%7BNamespace%7D/aggregates/%7BAggregateIdentifier%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", "/analytics/%7BNamespace%7D/aggregates/%7BAggregateIdentifier%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/analytics/%7BNamespace%7D/aggregates/%7BAggregateIdentifier%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": "/analytics/%7BNamespace%7D/aggregates/%7BAggregateIdentifier%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/analytics/%7BNamespace%7D/aggregates/%7BAggregateIdentifier%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/analytics/%7BNamespace%7D/aggregates/%7BAggregateIdentifier%7D")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
    put:
      tags:
        - "Analytics: Aggregates"
      summary: Update aggregate
      description: |
        Update an aggregate.

        ---

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

        **API key permissions required (at least one):** `ANALYTICS_BACKEND_AGGREGATES_UPDATE`, `ANALYTICS_BACKEND_AGGREGATE_UPDATE`

        **User role permission required:** `analytics_aggregates: update`
      operationId: analytics2-aggregate-update
      parameters:
        - $ref: "#/components/parameters/analytics-pathNamespace"
        - $ref: "#/components/parameters/analytics-aggregateIdentifierAsPathParam"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/analytics-AggregateUpdateRequest"
      responses:
        "200":
          description: Aggregate updated
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/data-management#tag/Analytics:-Aggregates/operation/analytics2-aggregate-update
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request PUT \
              --url https://api.synerise.com/analytics/%7BNamespace%7D/aggregates/%7BAggregateIdentifier%7D \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"analysis":{"aggregateType":"AGGREGATE","id":0,"name":"string","description":"string","uuid":"5370bf3c-2dfa-4e89-98ff-07100cffee6c","type":"AVG","level":0.1,"size":0,"unique":true,"dateFilter":{"type":"ABSOLUTE","from":"2019-08-24T14:15:22Z","to":"2019-08-24T14:15:22Z","filter":{"type":"DAILY","nestingType":"IN_PLACE","from":"string","to":"string","inverted":false}},"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}],"attribute":{"type":"PARAM","param":"string"},"action":{"id":0,"name":"page.visit"}},"isVisibleForClientProfile":true,"aggregateType":"AGGREGATE","previewDefaultObjectId":0,"inlineAnalytics":[{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","analyticType":"EXPRESSION","analysis":{"type":"EVENT","action":{"id":0,"name":"page.visit"},"name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}}}]}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"analysis\":{\"aggregateType\":\"AGGREGATE\",\"id\":0,\"name\":\"string\",\"description\":\"string\",\"uuid\":\"5370bf3c-2dfa-4e89-98ff-07100cffee6c\",\"type\":\"AVG\",\"level\":0.1,\"size\":0,\"unique\":true,\"dateFilter\":{\"type\":\"ABSOLUTE\",\"from\":\"2019-08-24T14:15:22Z\",\"to\":\"2019-08-24T14:15:22Z\",\"filter\":{\"type\":\"DAILY\",\"nestingType\":\"IN_PLACE\",\"from\":\"string\",\"to\":\"string\",\"inverted\":false}},\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}],\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"},\"action\":{\"id\":0,\"name\":\"page.visit\"}},\"isVisibleForClientProfile\":true,\"aggregateType\":\"AGGREGATE\",\"previewDefaultObjectId\":0,\"inlineAnalytics\":[{\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\"analyticType\":\"EXPRESSION\",\"analysis\":{\"type\":\"EVENT\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}}}]}"

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

            conn.request("PUT", "/analytics/%7BNamespace%7D/aggregates/%7BAggregateIdentifier%7D", payload, headers)

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

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "analysis": {
                "aggregateType": "AGGREGATE",
                "id": 0,
                "name": "string",
                "description": "string",
                "uuid": "5370bf3c-2dfa-4e89-98ff-07100cffee6c",
                "type": "AVG",
                "level": 0.1,
                "size": 0,
                "unique": true,
                "dateFilter": {
                  "type": "ABSOLUTE",
                  "from": "2019-08-24T14:15:22Z",
                  "to": "2019-08-24T14:15:22Z",
                  "filter": {
                    "type": "DAILY",
                    "nestingType": "IN_PLACE",
                    "from": "string",
                    "to": "string",
                    "inverted": false
                  }
                },
                "expressions": [
                  {
                    "constraint": {
                      "type": "BOOL",
                      "logic": "IS_TRUE"
                    },
                    "attribute": {
                      "type": "PARAM",
                      "param": "string"
                    }
                  }
                ],
                "attribute": {
                  "type": "PARAM",
                  "param": "string"
                },
                "action": {
                  "id": 0,
                  "name": "page.visit"
                }
              },
              "isVisibleForClientProfile": true,
              "aggregateType": "AGGREGATE",
              "previewDefaultObjectId": 0,
              "inlineAnalytics": [
                {
                  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
                  "analyticType": "EXPRESSION",
                  "analysis": {
                    "type": "EVENT",
                    "action": {
                      "id": 0,
                      "name": "page.visit"
                    },
                    "name": "string",
                    "description": "string",
                    "expression": {
                      "type": "VALUE",
                      "title": "title",
                      "value": {
                        "type": "CONSTANT",
                        "constant": 10
                      }
                    }
                  }
                }
              ]
            });

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

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

            xhr.open("PUT", "https://api.synerise.com/analytics/%7BNamespace%7D/aggregates/%7BAggregateIdentifier%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": "PUT",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/analytics/%7BNamespace%7D/aggregates/%7BAggregateIdentifier%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({
              analysis: {
                aggregateType: 'AGGREGATE',
                id: 0,
                name: 'string',
                description: 'string',
                uuid: '5370bf3c-2dfa-4e89-98ff-07100cffee6c',
                type: 'AVG',
                level: 0.1,
                size: 0,
                unique: true,
                dateFilter: {
                  type: 'ABSOLUTE',
                  from: '2019-08-24T14:15:22Z',
                  to: '2019-08-24T14:15:22Z',
                  filter: {
                    type: 'DAILY',
                    nestingType: 'IN_PLACE',
                    from: 'string',
                    to: 'string',
                    inverted: false
                  }
                },
                expressions: [
                  {
                    constraint: {type: 'BOOL', logic: 'IS_TRUE'},
                    attribute: {type: 'PARAM', param: 'string'}
                  }
                ],
                attribute: {type: 'PARAM', param: 'string'},
                action: {id: 0, name: 'page.visit'}
              },
              isVisibleForClientProfile: true,
              aggregateType: 'AGGREGATE',
              previewDefaultObjectId: 0,
              inlineAnalytics: [
                {
                  id: '497f6eca-6276-4993-bfeb-53cbbbba6f08',
                  analyticType: 'EXPRESSION',
                  analysis: {
                    type: 'EVENT',
                    action: {id: 0, name: 'page.visit'},
                    name: 'string',
                    description: 'string',
                    expression: {type: 'VALUE', title: 'title', value: {type: 'CONSTANT', constant: 10}}
                  }
                }
              ]
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/analytics/%7BNamespace%7D/aggregates/%7BAggregateIdentifier%7D');
            $request->setMethod(HTTP_METH_PUT);

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

            $request->setBody('{"analysis":{"aggregateType":"AGGREGATE","id":0,"name":"string","description":"string","uuid":"5370bf3c-2dfa-4e89-98ff-07100cffee6c","type":"AVG","level":0.1,"size":0,"unique":true,"dateFilter":{"type":"ABSOLUTE","from":"2019-08-24T14:15:22Z","to":"2019-08-24T14:15:22Z","filter":{"type":"DAILY","nestingType":"IN_PLACE","from":"string","to":"string","inverted":false}},"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}],"attribute":{"type":"PARAM","param":"string"},"action":{"id":0,"name":"page.visit"}},"isVisibleForClientProfile":true,"aggregateType":"AGGREGATE","previewDefaultObjectId":0,"inlineAnalytics":[{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","analyticType":"EXPRESSION","analysis":{"type":"EVENT","action":{"id":0,"name":"page.visit"},"name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}}}]}');

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

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.put("https://api.synerise.com/analytics/%7BNamespace%7D/aggregates/%7BAggregateIdentifier%7D")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"analysis\":{\"aggregateType\":\"AGGREGATE\",\"id\":0,\"name\":\"string\",\"description\":\"string\",\"uuid\":\"5370bf3c-2dfa-4e89-98ff-07100cffee6c\",\"type\":\"AVG\",\"level\":0.1,\"size\":0,\"unique\":true,\"dateFilter\":{\"type\":\"ABSOLUTE\",\"from\":\"2019-08-24T14:15:22Z\",\"to\":\"2019-08-24T14:15:22Z\",\"filter\":{\"type\":\"DAILY\",\"nestingType\":\"IN_PLACE\",\"from\":\"string\",\"to\":\"string\",\"inverted\":false}},\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}],\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"},\"action\":{\"id\":0,\"name\":\"page.visit\"}},\"isVisibleForClientProfile\":true,\"aggregateType\":\"AGGREGATE\",\"previewDefaultObjectId\":0,\"inlineAnalytics\":[{\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\"analyticType\":\"EXPRESSION\",\"analysis\":{\"type\":\"EVENT\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}}}]}")
              .asString();
    delete:
      tags:
        - "Analytics: Aggregates"
      summary: Delete aggregate
      operationId: analytics2-aggregate-delete
      parameters:
        - $ref: "#/components/parameters/analytics-pathNamespace"
        - $ref: "#/components/parameters/analytics-aggregateIdentifierAsPathParam"
      responses:
        "204":
          description: Aggregate deleted
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/data-management#tag/Analytics:-Aggregates/operation/analytics2-aggregate-delete
      description: |
        

        ---

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

        **API key permissions required (at least one):** `ANALYTICS_BACKEND_AGGREGATES_DELETE`, `ANALYTICS_BACKEND_AGGREGATE_DELETE`

        **User role permission required:** `analytics_aggregates: delete`
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request DELETE \
              --url https://api.synerise.com/analytics/%7BNamespace%7D/aggregates/%7BAggregateIdentifier%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", "/analytics/%7BNamespace%7D/aggregates/%7BAggregateIdentifier%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/analytics/%7BNamespace%7D/aggregates/%7BAggregateIdentifier%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": "/analytics/%7BNamespace%7D/aggregates/%7BAggregateIdentifier%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/analytics/%7BNamespace%7D/aggregates/%7BAggregateIdentifier%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/analytics/%7BNamespace%7D/aggregates/%7BAggregateIdentifier%7D")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
  /analytics/analytics/v2/sankeys/preview:
    post:
      tags:
        - "Analytics: Sankeys"
      summary: Preview Sankey analysis
      description: |
        Preview the results of a Sankey analysis. This request doesn't save the analysis.

        ---

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

        **API key permission required:** `ANALYTICS_BACKEND_SANKEY_READ`

        **User role permission required:** `analytics: read`
      operationId: analytics2-sankey-preview-override
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/analytics-CreateRequestSankeyAnalysis"
        required: true
      responses:
        "200":
          description: Calculation results
          content:
            application/json;charset=UTF-8:
              schema:
                $ref: "#/components/schemas/analytics-SankeyCalculationResponse"
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Sankeys/operation/analytics2-sankey-preview-override
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/analytics/analytics/v2/sankeys/preview \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"analysis":{"id":"5370bf3c-2dfa-4e89-98ff-07100cffee6c","title":"string","description":"string","sourceEvent":{"action":{"id":0,"name":"page.visit"},"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]},"reverseOrder":true,"numberOfSteps":0,"numberOfPaths":0,"drillDown":[{"layer":0,"action":{"id":0,"name":"page.visit"},"attribute":{"type":"PARAM","param":"string"}}],"drillDownCount":0,"dateFilter":{"type":"ABSOLUTE","from":"2019-08-24T14:15:22Z","to":"2019-08-24T14:15:22Z","filter":{"type":"DAILY","nestingType":"IN_PLACE","from":"string","to":"string","inverted":false}},"filter":{"matching":true,"expressions":[{"type":"ATTRIBUTE","name":"string","matching":true,"attribute":{"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]}}],"expression":{"type":"EMPTY"},"groupBy":[{"type":"CONSTANT","constant":"string"}]},"eventFilters":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]}],"excludeEvents":true,"firstOccurrenceOnly":true},"inlineAnalytics":[{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","analyticType":"EXPRESSION","analysis":{"type":"EVENT","action":{"id":0,"name":"page.visit"},"name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}}}]}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"analysis\":{\"id\":\"5370bf3c-2dfa-4e89-98ff-07100cffee6c\",\"title\":\"string\",\"description\":\"string\",\"sourceEvent\":{\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]},\"reverseOrder\":true,\"numberOfSteps\":0,\"numberOfPaths\":0,\"drillDown\":[{\"layer\":0,\"action\":{\"id\":0,\"name\":\"page.visit\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}],\"drillDownCount\":0,\"dateFilter\":{\"type\":\"ABSOLUTE\",\"from\":\"2019-08-24T14:15:22Z\",\"to\":\"2019-08-24T14:15:22Z\",\"filter\":{\"type\":\"DAILY\",\"nestingType\":\"IN_PLACE\",\"from\":\"string\",\"to\":\"string\",\"inverted\":false}},\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"ATTRIBUTE\",\"name\":\"string\",\"matching\":true,\"attribute\":{\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}}],\"expression\":{\"type\":\"EMPTY\"},\"groupBy\":[{\"type\":\"CONSTANT\",\"constant\":\"string\"}]},\"eventFilters\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}],\"excludeEvents\":true,\"firstOccurrenceOnly\":true},\"inlineAnalytics\":[{\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\"analyticType\":\"EXPRESSION\",\"analysis\":{\"type\":\"EVENT\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}}}]}"

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

            conn.request("POST", "/analytics/analytics/v2/sankeys/preview", payload, headers)

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

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "analysis": {
                "id": "5370bf3c-2dfa-4e89-98ff-07100cffee6c",
                "title": "string",
                "description": "string",
                "sourceEvent": {
                  "action": {
                    "id": 0,
                    "name": "page.visit"
                  },
                  "expressions": [
                    {
                      "constraint": {
                        "type": "BOOL",
                        "logic": "IS_TRUE"
                      },
                      "attribute": {
                        "type": "PARAM",
                        "param": "string"
                      }
                    }
                  ]
                },
                "reverseOrder": true,
                "numberOfSteps": 0,
                "numberOfPaths": 0,
                "drillDown": [
                  {
                    "layer": 0,
                    "action": {
                      "id": 0,
                      "name": "page.visit"
                    },
                    "attribute": {
                      "type": "PARAM",
                      "param": "string"
                    }
                  }
                ],
                "drillDownCount": 0,
                "dateFilter": {
                  "type": "ABSOLUTE",
                  "from": "2019-08-24T14:15:22Z",
                  "to": "2019-08-24T14:15:22Z",
                  "filter": {
                    "type": "DAILY",
                    "nestingType": "IN_PLACE",
                    "from": "string",
                    "to": "string",
                    "inverted": false
                  }
                },
                "filter": {
                  "matching": true,
                  "expressions": [
                    {
                      "type": "ATTRIBUTE",
                      "name": "string",
                      "matching": true,
                      "attribute": {
                        "expressions": [
                          {
                            "constraint": {
                              "type": "BOOL",
                              "logic": "IS_TRUE"
                            },
                            "attribute": {
                              "type": "PARAM",
                              "param": "string"
                            }
                          }
                        ]
                      }
                    }
                  ],
                  "expression": {
                    "type": "EMPTY"
                  },
                  "groupBy": [
                    {
                      "type": "CONSTANT",
                      "constant": "string"
                    }
                  ]
                },
                "eventFilters": [
                  {
                    "title": "string",
                    "action": {
                      "id": 0,
                      "name": "page.visit"
                    },
                    "expressions": [
                      {
                        "constraint": {
                          "type": "BOOL",
                          "logic": "IS_TRUE"
                        },
                        "attribute": {
                          "type": "PARAM",
                          "param": "string"
                        }
                      }
                    ]
                  }
                ],
                "excludeEvents": true,
                "firstOccurrenceOnly": true
              },
              "inlineAnalytics": [
                {
                  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
                  "analyticType": "EXPRESSION",
                  "analysis": {
                    "type": "EVENT",
                    "action": {
                      "id": 0,
                      "name": "page.visit"
                    },
                    "name": "string",
                    "description": "string",
                    "expression": {
                      "type": "VALUE",
                      "title": "title",
                      "value": {
                        "type": "CONSTANT",
                        "constant": 10
                      }
                    }
                  }
                }
              ]
            });

            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/analytics/analytics/v2/sankeys/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": "/analytics/analytics/v2/sankeys/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({
              analysis: {
                id: '5370bf3c-2dfa-4e89-98ff-07100cffee6c',
                title: 'string',
                description: 'string',
                sourceEvent: {
                  action: {id: 0, name: 'page.visit'},
                  expressions: [
                    {
                      constraint: {type: 'BOOL', logic: 'IS_TRUE'},
                      attribute: {type: 'PARAM', param: 'string'}
                    }
                  ]
                },
                reverseOrder: true,
                numberOfSteps: 0,
                numberOfPaths: 0,
                drillDown: [
                  {
                    layer: 0,
                    action: {id: 0, name: 'page.visit'},
                    attribute: {type: 'PARAM', param: 'string'}
                  }
                ],
                drillDownCount: 0,
                dateFilter: {
                  type: 'ABSOLUTE',
                  from: '2019-08-24T14:15:22Z',
                  to: '2019-08-24T14:15:22Z',
                  filter: {
                    type: 'DAILY',
                    nestingType: 'IN_PLACE',
                    from: 'string',
                    to: 'string',
                    inverted: false
                  }
                },
                filter: {
                  matching: true,
                  expressions: [
                    {
                      type: 'ATTRIBUTE',
                      name: 'string',
                      matching: true,
                      attribute: {
                        expressions: [
                          {
                            constraint: {type: 'BOOL', logic: 'IS_TRUE'},
                            attribute: {type: 'PARAM', param: 'string'}
                          }
                        ]
                      }
                    }
                  ],
                  expression: {type: 'EMPTY'},
                  groupBy: [{type: 'CONSTANT', constant: 'string'}]
                },
                eventFilters: [
                  {
                    title: 'string',
                    action: {id: 0, name: 'page.visit'},
                    expressions: [
                      {
                        constraint: {type: 'BOOL', logic: 'IS_TRUE'},
                        attribute: {type: 'PARAM', param: 'string'}
                      }
                    ]
                  }
                ],
                excludeEvents: true,
                firstOccurrenceOnly: true
              },
              inlineAnalytics: [
                {
                  id: '497f6eca-6276-4993-bfeb-53cbbbba6f08',
                  analyticType: 'EXPRESSION',
                  analysis: {
                    type: 'EVENT',
                    action: {id: 0, name: 'page.visit'},
                    name: 'string',
                    description: 'string',
                    expression: {type: 'VALUE', title: 'title', value: {type: 'CONSTANT', constant: 10}}
                  }
                }
              ]
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

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

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

            $request->setBody('{"analysis":{"id":"5370bf3c-2dfa-4e89-98ff-07100cffee6c","title":"string","description":"string","sourceEvent":{"action":{"id":0,"name":"page.visit"},"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]},"reverseOrder":true,"numberOfSteps":0,"numberOfPaths":0,"drillDown":[{"layer":0,"action":{"id":0,"name":"page.visit"},"attribute":{"type":"PARAM","param":"string"}}],"drillDownCount":0,"dateFilter":{"type":"ABSOLUTE","from":"2019-08-24T14:15:22Z","to":"2019-08-24T14:15:22Z","filter":{"type":"DAILY","nestingType":"IN_PLACE","from":"string","to":"string","inverted":false}},"filter":{"matching":true,"expressions":[{"type":"ATTRIBUTE","name":"string","matching":true,"attribute":{"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]}}],"expression":{"type":"EMPTY"},"groupBy":[{"type":"CONSTANT","constant":"string"}]},"eventFilters":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]}],"excludeEvents":true,"firstOccurrenceOnly":true},"inlineAnalytics":[{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","analyticType":"EXPRESSION","analysis":{"type":"EVENT","action":{"id":0,"name":"page.visit"},"name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}}}]}');

            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/analytics/analytics/v2/sankeys/preview")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"analysis\":{\"id\":\"5370bf3c-2dfa-4e89-98ff-07100cffee6c\",\"title\":\"string\",\"description\":\"string\",\"sourceEvent\":{\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]},\"reverseOrder\":true,\"numberOfSteps\":0,\"numberOfPaths\":0,\"drillDown\":[{\"layer\":0,\"action\":{\"id\":0,\"name\":\"page.visit\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}],\"drillDownCount\":0,\"dateFilter\":{\"type\":\"ABSOLUTE\",\"from\":\"2019-08-24T14:15:22Z\",\"to\":\"2019-08-24T14:15:22Z\",\"filter\":{\"type\":\"DAILY\",\"nestingType\":\"IN_PLACE\",\"from\":\"string\",\"to\":\"string\",\"inverted\":false}},\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"ATTRIBUTE\",\"name\":\"string\",\"matching\":true,\"attribute\":{\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}}],\"expression\":{\"type\":\"EMPTY\"},\"groupBy\":[{\"type\":\"CONSTANT\",\"constant\":\"string\"}]},\"eventFilters\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}],\"excludeEvents\":true,\"firstOccurrenceOnly\":true},\"inlineAnalytics\":[{\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\"analyticType\":\"EXPRESSION\",\"analysis\":{\"type\":\"EVENT\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}}}]}")
              .asString();
  /analytics/analytics/v2/funnels/preview:
    post:
      tags:
        - "Analytics: Funnels"
      summary: Preview funnel calculation
      description: |
        Preview the results of a funnel. This request doesn't save the funnel.

        ---

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

        **API key permission required:** `ANALYTICS_BACKEND_FUNNEL_READ`

        **User role permission required:** `analytics: read`
      operationId: analytics2-funnel-preview
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/analytics-FunnelRequest"
        required: true
      responses:
        "200":
          description: Preview of the results
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/analytics-FunnelCalculationResponse"
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Funnels/operation/analytics2-funnel-preview
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/analytics/analytics/v2/funnels/preview \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"analysis":{"title":"string","description":"string","funnel":{"title":"string","completedWithin":{"period":"YEARS","value":0},"dateFilter":{"type":"ABSOLUTE","from":"2019-08-24T14:15:22Z","to":"2019-08-24T14:15:22Z","filter":{"type":"DAILY","nestingType":"IN_PLACE","from":"string","to":"string","inverted":false}},"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]}],"exact":false},"filter":{"matching":true,"expressions":[{"type":"ATTRIBUTE","name":"string","matching":true,"attribute":{"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]}}],"expression":{"type":"EMPTY"},"groupBy":[{"type":"CONSTANT","constant":"string"}]}},"inlineAnalytics":[{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","analyticType":"EXPRESSION","analysis":{"type":"EVENT","action":{"id":0,"name":"page.visit"},"name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}}}]}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"analysis\":{\"title\":\"string\",\"description\":\"string\",\"funnel\":{\"title\":\"string\",\"completedWithin\":{\"period\":\"YEARS\",\"value\":0},\"dateFilter\":{\"type\":\"ABSOLUTE\",\"from\":\"2019-08-24T14:15:22Z\",\"to\":\"2019-08-24T14:15:22Z\",\"filter\":{\"type\":\"DAILY\",\"nestingType\":\"IN_PLACE\",\"from\":\"string\",\"to\":\"string\",\"inverted\":false}},\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}],\"exact\":false},\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"ATTRIBUTE\",\"name\":\"string\",\"matching\":true,\"attribute\":{\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}}],\"expression\":{\"type\":\"EMPTY\"},\"groupBy\":[{\"type\":\"CONSTANT\",\"constant\":\"string\"}]}},\"inlineAnalytics\":[{\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\"analyticType\":\"EXPRESSION\",\"analysis\":{\"type\":\"EVENT\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}}}]}"

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

            conn.request("POST", "/analytics/analytics/v2/funnels/preview", payload, headers)

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

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "analysis": {
                "title": "string",
                "description": "string",
                "funnel": {
                  "title": "string",
                  "completedWithin": {
                    "period": "YEARS",
                    "value": 0
                  },
                  "dateFilter": {
                    "type": "ABSOLUTE",
                    "from": "2019-08-24T14:15:22Z",
                    "to": "2019-08-24T14:15:22Z",
                    "filter": {
                      "type": "DAILY",
                      "nestingType": "IN_PLACE",
                      "from": "string",
                      "to": "string",
                      "inverted": false
                    }
                  },
                  "steps": [
                    {
                      "title": "string",
                      "action": {
                        "id": 0,
                        "name": "page.visit"
                      },
                      "expressions": [
                        {
                          "constraint": {
                            "type": "BOOL",
                            "logic": "IS_TRUE"
                          },
                          "attribute": {
                            "type": "PARAM",
                            "param": "string"
                          }
                        }
                      ]
                    }
                  ],
                  "exact": false
                },
                "filter": {
                  "matching": true,
                  "expressions": [
                    {
                      "type": "ATTRIBUTE",
                      "name": "string",
                      "matching": true,
                      "attribute": {
                        "expressions": [
                          {
                            "constraint": {
                              "type": "BOOL",
                              "logic": "IS_TRUE"
                            },
                            "attribute": {
                              "type": "PARAM",
                              "param": "string"
                            }
                          }
                        ]
                      }
                    }
                  ],
                  "expression": {
                    "type": "EMPTY"
                  },
                  "groupBy": [
                    {
                      "type": "CONSTANT",
                      "constant": "string"
                    }
                  ]
                }
              },
              "inlineAnalytics": [
                {
                  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
                  "analyticType": "EXPRESSION",
                  "analysis": {
                    "type": "EVENT",
                    "action": {
                      "id": 0,
                      "name": "page.visit"
                    },
                    "name": "string",
                    "description": "string",
                    "expression": {
                      "type": "VALUE",
                      "title": "title",
                      "value": {
                        "type": "CONSTANT",
                        "constant": 10
                      }
                    }
                  }
                }
              ]
            });

            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/analytics/analytics/v2/funnels/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": "/analytics/analytics/v2/funnels/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({
              analysis: {
                title: 'string',
                description: 'string',
                funnel: {
                  title: 'string',
                  completedWithin: {period: 'YEARS', value: 0},
                  dateFilter: {
                    type: 'ABSOLUTE',
                    from: '2019-08-24T14:15:22Z',
                    to: '2019-08-24T14:15:22Z',
                    filter: {
                      type: 'DAILY',
                      nestingType: 'IN_PLACE',
                      from: 'string',
                      to: 'string',
                      inverted: false
                    }
                  },
                  steps: [
                    {
                      title: 'string',
                      action: {id: 0, name: 'page.visit'},
                      expressions: [
                        {
                          constraint: {type: 'BOOL', logic: 'IS_TRUE'},
                          attribute: {type: 'PARAM', param: 'string'}
                        }
                      ]
                    }
                  ],
                  exact: false
                },
                filter: {
                  matching: true,
                  expressions: [
                    {
                      type: 'ATTRIBUTE',
                      name: 'string',
                      matching: true,
                      attribute: {
                        expressions: [
                          {
                            constraint: {type: 'BOOL', logic: 'IS_TRUE'},
                            attribute: {type: 'PARAM', param: 'string'}
                          }
                        ]
                      }
                    }
                  ],
                  expression: {type: 'EMPTY'},
                  groupBy: [{type: 'CONSTANT', constant: 'string'}]
                }
              },
              inlineAnalytics: [
                {
                  id: '497f6eca-6276-4993-bfeb-53cbbbba6f08',
                  analyticType: 'EXPRESSION',
                  analysis: {
                    type: 'EVENT',
                    action: {id: 0, name: 'page.visit'},
                    name: 'string',
                    description: 'string',
                    expression: {type: 'VALUE', title: 'title', value: {type: 'CONSTANT', constant: 10}}
                  }
                }
              ]
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

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

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

            $request->setBody('{"analysis":{"title":"string","description":"string","funnel":{"title":"string","completedWithin":{"period":"YEARS","value":0},"dateFilter":{"type":"ABSOLUTE","from":"2019-08-24T14:15:22Z","to":"2019-08-24T14:15:22Z","filter":{"type":"DAILY","nestingType":"IN_PLACE","from":"string","to":"string","inverted":false}},"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]}],"exact":false},"filter":{"matching":true,"expressions":[{"type":"ATTRIBUTE","name":"string","matching":true,"attribute":{"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]}}],"expression":{"type":"EMPTY"},"groupBy":[{"type":"CONSTANT","constant":"string"}]}},"inlineAnalytics":[{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","analyticType":"EXPRESSION","analysis":{"type":"EVENT","action":{"id":0,"name":"page.visit"},"name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}}}]}');

            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/analytics/analytics/v2/funnels/preview")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"analysis\":{\"title\":\"string\",\"description\":\"string\",\"funnel\":{\"title\":\"string\",\"completedWithin\":{\"period\":\"YEARS\",\"value\":0},\"dateFilter\":{\"type\":\"ABSOLUTE\",\"from\":\"2019-08-24T14:15:22Z\",\"to\":\"2019-08-24T14:15:22Z\",\"filter\":{\"type\":\"DAILY\",\"nestingType\":\"IN_PLACE\",\"from\":\"string\",\"to\":\"string\",\"inverted\":false}},\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}],\"exact\":false},\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"ATTRIBUTE\",\"name\":\"string\",\"matching\":true,\"attribute\":{\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}}],\"expression\":{\"type\":\"EMPTY\"},\"groupBy\":[{\"type\":\"CONSTANT\",\"constant\":\"string\"}]}},\"inlineAnalytics\":[{\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\"analyticType\":\"EXPRESSION\",\"analysis\":{\"type\":\"EVENT\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}}}]}")
              .asString();
  /analytics/analytics/v2/funnels/{AnalysisId}/recalculate/override:
    post:
      tags:
        - "Analytics: Funnels"
      summary: Recalculate funnel with parameter override
      description: |
        Recalculate a funnel with new parameters and/or variable (dynamic key) values.

        ---

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

        **API key permission required:** `ANALYTICS_BACKEND_FUNNEL_READ`

        **User role permission required:** `analytics: read`
      operationId: analytics2-funnel-preview-override
      parameters:
        - $ref: "#/components/parameters/analytics-AnalyticIdPathParam"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/analytics-OverrideQueryRequest"
        required: true
      responses:
        "200":
          description: Funnel results
          content:
            application/json;charset=UTF-8:
              schema:
                $ref: "#/components/schemas/analytics-FunnelCalculationResponse"
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Funnels/operation/analytics2-funnel-preview-override
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/analytics/analytics/v2/funnels/%7BAnalysisId%7D/recalculate/override \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"title":"string","dateFilter":{"type":"ABSOLUTE","from":"2019-08-24T14:15:22Z","to":"2019-08-24T14:15:22Z","filter":{"type":"DAILY","nestingType":"IN_PLACE","from":"string","to":"string","inverted":false}},"aggregateDataBy":{"type":"YEARS","value":0},"filter":{"matching":true,"expressions":[{"type":"ATTRIBUTE","name":"string","matching":true,"attribute":{"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]}}],"expression":{"type":"EMPTY"},"groupBy":[{"type":"CONSTANT","constant":"string"}]},"variables":[{"name":"string","value":"example-string-value"}],"overrideNested":false}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"title\":\"string\",\"dateFilter\":{\"type\":\"ABSOLUTE\",\"from\":\"2019-08-24T14:15:22Z\",\"to\":\"2019-08-24T14:15:22Z\",\"filter\":{\"type\":\"DAILY\",\"nestingType\":\"IN_PLACE\",\"from\":\"string\",\"to\":\"string\",\"inverted\":false}},\"aggregateDataBy\":{\"type\":\"YEARS\",\"value\":0},\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"ATTRIBUTE\",\"name\":\"string\",\"matching\":true,\"attribute\":{\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}}],\"expression\":{\"type\":\"EMPTY\"},\"groupBy\":[{\"type\":\"CONSTANT\",\"constant\":\"string\"}]},\"variables\":[{\"name\":\"string\",\"value\":\"example-string-value\"}],\"overrideNested\":false}"

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

            conn.request("POST", "/analytics/analytics/v2/funnels/%7BAnalysisId%7D/recalculate/override", payload, headers)

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

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "title": "string",
              "dateFilter": {
                "type": "ABSOLUTE",
                "from": "2019-08-24T14:15:22Z",
                "to": "2019-08-24T14:15:22Z",
                "filter": {
                  "type": "DAILY",
                  "nestingType": "IN_PLACE",
                  "from": "string",
                  "to": "string",
                  "inverted": false
                }
              },
              "aggregateDataBy": {
                "type": "YEARS",
                "value": 0
              },
              "filter": {
                "matching": true,
                "expressions": [
                  {
                    "type": "ATTRIBUTE",
                    "name": "string",
                    "matching": true,
                    "attribute": {
                      "expressions": [
                        {
                          "constraint": {
                            "type": "BOOL",
                            "logic": "IS_TRUE"
                          },
                          "attribute": {
                            "type": "PARAM",
                            "param": "string"
                          }
                        }
                      ]
                    }
                  }
                ],
                "expression": {
                  "type": "EMPTY"
                },
                "groupBy": [
                  {
                    "type": "CONSTANT",
                    "constant": "string"
                  }
                ]
              },
              "variables": [
                {
                  "name": "string",
                  "value": "example-string-value"
                }
              ],
              "overrideNested": false
            });

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

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

            xhr.open("POST", "https://api.synerise.com/analytics/analytics/v2/funnels/%7BAnalysisId%7D/recalculate/override");
            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": "/analytics/analytics/v2/funnels/%7BAnalysisId%7D/recalculate/override",
              "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({
              title: 'string',
              dateFilter: {
                type: 'ABSOLUTE',
                from: '2019-08-24T14:15:22Z',
                to: '2019-08-24T14:15:22Z',
                filter: {
                  type: 'DAILY',
                  nestingType: 'IN_PLACE',
                  from: 'string',
                  to: 'string',
                  inverted: false
                }
              },
              aggregateDataBy: {type: 'YEARS', value: 0},
              filter: {
                matching: true,
                expressions: [
                  {
                    type: 'ATTRIBUTE',
                    name: 'string',
                    matching: true,
                    attribute: {
                      expressions: [
                        {
                          constraint: {type: 'BOOL', logic: 'IS_TRUE'},
                          attribute: {type: 'PARAM', param: 'string'}
                        }
                      ]
                    }
                  }
                ],
                expression: {type: 'EMPTY'},
                groupBy: [{type: 'CONSTANT', constant: 'string'}]
              },
              variables: [{name: 'string', value: 'example-string-value'}],
              overrideNested: false
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/analytics/analytics/v2/funnels/%7BAnalysisId%7D/recalculate/override');
            $request->setMethod(HTTP_METH_POST);

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

            $request->setBody('{"title":"string","dateFilter":{"type":"ABSOLUTE","from":"2019-08-24T14:15:22Z","to":"2019-08-24T14:15:22Z","filter":{"type":"DAILY","nestingType":"IN_PLACE","from":"string","to":"string","inverted":false}},"aggregateDataBy":{"type":"YEARS","value":0},"filter":{"matching":true,"expressions":[{"type":"ATTRIBUTE","name":"string","matching":true,"attribute":{"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]}}],"expression":{"type":"EMPTY"},"groupBy":[{"type":"CONSTANT","constant":"string"}]},"variables":[{"name":"string","value":"example-string-value"}],"overrideNested":false}');

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

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.post("https://api.synerise.com/analytics/analytics/v2/funnels/%7BAnalysisId%7D/recalculate/override")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"title\":\"string\",\"dateFilter\":{\"type\":\"ABSOLUTE\",\"from\":\"2019-08-24T14:15:22Z\",\"to\":\"2019-08-24T14:15:22Z\",\"filter\":{\"type\":\"DAILY\",\"nestingType\":\"IN_PLACE\",\"from\":\"string\",\"to\":\"string\",\"inverted\":false}},\"aggregateDataBy\":{\"type\":\"YEARS\",\"value\":0},\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"ATTRIBUTE\",\"name\":\"string\",\"matching\":true,\"attribute\":{\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}}],\"expression\":{\"type\":\"EMPTY\"},\"groupBy\":[{\"type\":\"CONSTANT\",\"constant\":\"string\"}]},\"variables\":[{\"name\":\"string\",\"value\":\"example-string-value\"}],\"overrideNested\":false}")
              .asString();
  /analytics/{Namespace}/funnels:
    get:
      tags:
        - "Analytics: Funnels"
      summary: List funnels
      description: |
        Returns a paginated list of funnels.

        ---

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

        **API key permission required:** `ANALYTICS_BACKEND_FUNNELS_LIST_READ`

        **User role permission required:** `analytics: read`
      operationId: analytics2-funnels-list
      parameters:
        - $ref: "#/components/parameters/analytics-page"
        - $ref: "#/components/parameters/analytics-limit"
        - $ref: "#/components/parameters/analytics-search"
        - $ref: "#/components/parameters/analytics-sortBy"
        - $ref: "#/components/parameters/analytics-pathNamespace"
        - $ref: "#/components/parameters/analytics-directoryId"
        - $ref: "#/components/parameters/analytics-ids"
      responses:
        "200":
          description: List of funnels
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    description: Array of funnels
                    items:
                      $ref: "#/components/schemas/analytics-ListAnalyticsItemCommon"
                  meta:
                    $ref: "#/components/schemas/analytics-Meta"
                required:
                  - data
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Funnels/operation/analytics2-funnels-list
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.synerise.com/analytics/%7BNamespace%7D/funnels?page=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sortBy=name%3Aasc&directoryId=SOME_STRING_VALUE&ids=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", "/analytics/%7BNamespace%7D/funnels?page=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sortBy=name%3Aasc&directoryId=SOME_STRING_VALUE&ids=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/analytics/%7BNamespace%7D/funnels?page=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sortBy=name%3Aasc&directoryId=SOME_STRING_VALUE&ids=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": "/analytics/%7BNamespace%7D/funnels?page=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sortBy=name%3Aasc&directoryId=SOME_STRING_VALUE&ids=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/analytics/%7BNamespace%7D/funnels');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'page' => 'SOME_INTEGER_VALUE',
              'limit' => 'SOME_INTEGER_VALUE',
              'search' => 'SOME_STRING_VALUE',
              'sortBy' => 'name:asc',
              'directoryId' => 'SOME_STRING_VALUE',
              'ids' => '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/analytics/%7BNamespace%7D/funnels?page=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sortBy=name%3Aasc&directoryId=SOME_STRING_VALUE&ids=SOME_STRING_VALUE")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
    post:
      tags:
        - "Analytics: Funnels"
      summary: Create a funnel
      description: |
        Create a funnel.

        ---

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

        **API key permissions required (at least one):** `ANALYTICS_BACKEND_FUNNELS_CREATE`, `ANALYTICS_BACKEND_FUNNEL_CREATE`

        **User role permission required:** `analytics: create`
      operationId: analytics2-funnels-create
      parameters:
        - $ref: "#/components/parameters/analytics-pathNamespace"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/analytics-FunnelRequest"
      responses:
        "201":
          description: Funnel created
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/analytics-Id"
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Funnels/operation/analytics2-funnels-create
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/analytics/%7BNamespace%7D/funnels \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"analysis":{"title":"string","description":"string","funnel":{"title":"string","completedWithin":{"period":"YEARS","value":0},"dateFilter":{"type":"ABSOLUTE","from":"2019-08-24T14:15:22Z","to":"2019-08-24T14:15:22Z","filter":{"type":"DAILY","nestingType":"IN_PLACE","from":"string","to":"string","inverted":false}},"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]}],"exact":false},"filter":{"matching":true,"expressions":[{"type":"ATTRIBUTE","name":"string","matching":true,"attribute":{"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]}}],"expression":{"type":"EMPTY"},"groupBy":[{"type":"CONSTANT","constant":"string"}]}},"inlineAnalytics":[{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","analyticType":"EXPRESSION","analysis":{"type":"EVENT","action":{"id":0,"name":"page.visit"},"name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}}}]}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"analysis\":{\"title\":\"string\",\"description\":\"string\",\"funnel\":{\"title\":\"string\",\"completedWithin\":{\"period\":\"YEARS\",\"value\":0},\"dateFilter\":{\"type\":\"ABSOLUTE\",\"from\":\"2019-08-24T14:15:22Z\",\"to\":\"2019-08-24T14:15:22Z\",\"filter\":{\"type\":\"DAILY\",\"nestingType\":\"IN_PLACE\",\"from\":\"string\",\"to\":\"string\",\"inverted\":false}},\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}],\"exact\":false},\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"ATTRIBUTE\",\"name\":\"string\",\"matching\":true,\"attribute\":{\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}}],\"expression\":{\"type\":\"EMPTY\"},\"groupBy\":[{\"type\":\"CONSTANT\",\"constant\":\"string\"}]}},\"inlineAnalytics\":[{\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\"analyticType\":\"EXPRESSION\",\"analysis\":{\"type\":\"EVENT\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}}}]}"

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

            conn.request("POST", "/analytics/%7BNamespace%7D/funnels", payload, headers)

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

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "analysis": {
                "title": "string",
                "description": "string",
                "funnel": {
                  "title": "string",
                  "completedWithin": {
                    "period": "YEARS",
                    "value": 0
                  },
                  "dateFilter": {
                    "type": "ABSOLUTE",
                    "from": "2019-08-24T14:15:22Z",
                    "to": "2019-08-24T14:15:22Z",
                    "filter": {
                      "type": "DAILY",
                      "nestingType": "IN_PLACE",
                      "from": "string",
                      "to": "string",
                      "inverted": false
                    }
                  },
                  "steps": [
                    {
                      "title": "string",
                      "action": {
                        "id": 0,
                        "name": "page.visit"
                      },
                      "expressions": [
                        {
                          "constraint": {
                            "type": "BOOL",
                            "logic": "IS_TRUE"
                          },
                          "attribute": {
                            "type": "PARAM",
                            "param": "string"
                          }
                        }
                      ]
                    }
                  ],
                  "exact": false
                },
                "filter": {
                  "matching": true,
                  "expressions": [
                    {
                      "type": "ATTRIBUTE",
                      "name": "string",
                      "matching": true,
                      "attribute": {
                        "expressions": [
                          {
                            "constraint": {
                              "type": "BOOL",
                              "logic": "IS_TRUE"
                            },
                            "attribute": {
                              "type": "PARAM",
                              "param": "string"
                            }
                          }
                        ]
                      }
                    }
                  ],
                  "expression": {
                    "type": "EMPTY"
                  },
                  "groupBy": [
                    {
                      "type": "CONSTANT",
                      "constant": "string"
                    }
                  ]
                }
              },
              "inlineAnalytics": [
                {
                  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
                  "analyticType": "EXPRESSION",
                  "analysis": {
                    "type": "EVENT",
                    "action": {
                      "id": 0,
                      "name": "page.visit"
                    },
                    "name": "string",
                    "description": "string",
                    "expression": {
                      "type": "VALUE",
                      "title": "title",
                      "value": {
                        "type": "CONSTANT",
                        "constant": 10
                      }
                    }
                  }
                }
              ]
            });

            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/analytics/%7BNamespace%7D/funnels");
            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": "/analytics/%7BNamespace%7D/funnels",
              "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({
              analysis: {
                title: 'string',
                description: 'string',
                funnel: {
                  title: 'string',
                  completedWithin: {period: 'YEARS', value: 0},
                  dateFilter: {
                    type: 'ABSOLUTE',
                    from: '2019-08-24T14:15:22Z',
                    to: '2019-08-24T14:15:22Z',
                    filter: {
                      type: 'DAILY',
                      nestingType: 'IN_PLACE',
                      from: 'string',
                      to: 'string',
                      inverted: false
                    }
                  },
                  steps: [
                    {
                      title: 'string',
                      action: {id: 0, name: 'page.visit'},
                      expressions: [
                        {
                          constraint: {type: 'BOOL', logic: 'IS_TRUE'},
                          attribute: {type: 'PARAM', param: 'string'}
                        }
                      ]
                    }
                  ],
                  exact: false
                },
                filter: {
                  matching: true,
                  expressions: [
                    {
                      type: 'ATTRIBUTE',
                      name: 'string',
                      matching: true,
                      attribute: {
                        expressions: [
                          {
                            constraint: {type: 'BOOL', logic: 'IS_TRUE'},
                            attribute: {type: 'PARAM', param: 'string'}
                          }
                        ]
                      }
                    }
                  ],
                  expression: {type: 'EMPTY'},
                  groupBy: [{type: 'CONSTANT', constant: 'string'}]
                }
              },
              inlineAnalytics: [
                {
                  id: '497f6eca-6276-4993-bfeb-53cbbbba6f08',
                  analyticType: 'EXPRESSION',
                  analysis: {
                    type: 'EVENT',
                    action: {id: 0, name: 'page.visit'},
                    name: 'string',
                    description: 'string',
                    expression: {type: 'VALUE', title: 'title', value: {type: 'CONSTANT', constant: 10}}
                  }
                }
              ]
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/analytics/%7BNamespace%7D/funnels');
            $request->setMethod(HTTP_METH_POST);

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

            $request->setBody('{"analysis":{"title":"string","description":"string","funnel":{"title":"string","completedWithin":{"period":"YEARS","value":0},"dateFilter":{"type":"ABSOLUTE","from":"2019-08-24T14:15:22Z","to":"2019-08-24T14:15:22Z","filter":{"type":"DAILY","nestingType":"IN_PLACE","from":"string","to":"string","inverted":false}},"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]}],"exact":false},"filter":{"matching":true,"expressions":[{"type":"ATTRIBUTE","name":"string","matching":true,"attribute":{"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]}}],"expression":{"type":"EMPTY"},"groupBy":[{"type":"CONSTANT","constant":"string"}]}},"inlineAnalytics":[{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","analyticType":"EXPRESSION","analysis":{"type":"EVENT","action":{"id":0,"name":"page.visit"},"name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}}}]}');

            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/analytics/%7BNamespace%7D/funnels")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"analysis\":{\"title\":\"string\",\"description\":\"string\",\"funnel\":{\"title\":\"string\",\"completedWithin\":{\"period\":\"YEARS\",\"value\":0},\"dateFilter\":{\"type\":\"ABSOLUTE\",\"from\":\"2019-08-24T14:15:22Z\",\"to\":\"2019-08-24T14:15:22Z\",\"filter\":{\"type\":\"DAILY\",\"nestingType\":\"IN_PLACE\",\"from\":\"string\",\"to\":\"string\",\"inverted\":false}},\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}],\"exact\":false},\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"ATTRIBUTE\",\"name\":\"string\",\"matching\":true,\"attribute\":{\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}}],\"expression\":{\"type\":\"EMPTY\"},\"groupBy\":[{\"type\":\"CONSTANT\",\"constant\":\"string\"}]}},\"inlineAnalytics\":[{\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\"analyticType\":\"EXPRESSION\",\"analysis\":{\"type\":\"EVENT\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}}}]}")
              .asString();
  /analytics/{Namespace}/funnels/{AnalysisId}:
    get:
      tags:
        - "Analytics: Funnels"
      summary: Get funnel details
      description: |
        Retrieve the definition of a single funnel

        ---

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

        **API key permissions required (at least one):** `ANALYTICS_BACKEND_FUNNELS_READ`, `ANALYTICS_BACKEND_FUNNEL_READ`

        **User role permission required:** `analytics: read`
      operationId: analytics2-funnels-get
      parameters:
        - $ref: "#/components/parameters/analytics-pathNamespace"
        - $ref: "#/components/parameters/analytics-AnalyticIdPathParam"
      responses:
        "200":
          description: Details of the funnel
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/analytics-FunnelView"
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Funnels/operation/analytics2-funnels-get
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url https://api.synerise.com/analytics/%7BNamespace%7D/funnels/%7BAnalysisId%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", "/analytics/%7BNamespace%7D/funnels/%7BAnalysisId%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/analytics/%7BNamespace%7D/funnels/%7BAnalysisId%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": "/analytics/%7BNamespace%7D/funnels/%7BAnalysisId%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/analytics/%7BNamespace%7D/funnels/%7BAnalysisId%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/analytics/%7BNamespace%7D/funnels/%7BAnalysisId%7D")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
    put:
      tags:
        - "Analytics: Funnels"
      summary: Update funnel
      description: |
        Update a funnel definition

        ---

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

        **API key permissions required (at least one):** `ANALYTICS_BACKEND_FUNNELS_UPDATE`, `ANALYTICS_BACKEND_FUNNEL_UPDATE`

        **User role permission required:** `analytics: update`
      operationId: analytics2-funnels-update
      parameters:
        - $ref: "#/components/parameters/analytics-pathNamespace"
        - $ref: "#/components/parameters/analytics-AnalyticIdPathParam"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/analytics-FunnelRequest"
      responses:
        "200":
          description: Funnel updated
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Funnels/operation/analytics2-funnels-update
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request PUT \
              --url https://api.synerise.com/analytics/%7BNamespace%7D/funnels/%7BAnalysisId%7D \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"analysis":{"title":"string","description":"string","funnel":{"title":"string","completedWithin":{"period":"YEARS","value":0},"dateFilter":{"type":"ABSOLUTE","from":"2019-08-24T14:15:22Z","to":"2019-08-24T14:15:22Z","filter":{"type":"DAILY","nestingType":"IN_PLACE","from":"string","to":"string","inverted":false}},"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]}],"exact":false},"filter":{"matching":true,"expressions":[{"type":"ATTRIBUTE","name":"string","matching":true,"attribute":{"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]}}],"expression":{"type":"EMPTY"},"groupBy":[{"type":"CONSTANT","constant":"string"}]}},"inlineAnalytics":[{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","analyticType":"EXPRESSION","analysis":{"type":"EVENT","action":{"id":0,"name":"page.visit"},"name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}}}]}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"analysis\":{\"title\":\"string\",\"description\":\"string\",\"funnel\":{\"title\":\"string\",\"completedWithin\":{\"period\":\"YEARS\",\"value\":0},\"dateFilter\":{\"type\":\"ABSOLUTE\",\"from\":\"2019-08-24T14:15:22Z\",\"to\":\"2019-08-24T14:15:22Z\",\"filter\":{\"type\":\"DAILY\",\"nestingType\":\"IN_PLACE\",\"from\":\"string\",\"to\":\"string\",\"inverted\":false}},\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}],\"exact\":false},\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"ATTRIBUTE\",\"name\":\"string\",\"matching\":true,\"attribute\":{\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}}],\"expression\":{\"type\":\"EMPTY\"},\"groupBy\":[{\"type\":\"CONSTANT\",\"constant\":\"string\"}]}},\"inlineAnalytics\":[{\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\"analyticType\":\"EXPRESSION\",\"analysis\":{\"type\":\"EVENT\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}}}]}"

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

            conn.request("PUT", "/analytics/%7BNamespace%7D/funnels/%7BAnalysisId%7D", payload, headers)

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

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "analysis": {
                "title": "string",
                "description": "string",
                "funnel": {
                  "title": "string",
                  "completedWithin": {
                    "period": "YEARS",
                    "value": 0
                  },
                  "dateFilter": {
                    "type": "ABSOLUTE",
                    "from": "2019-08-24T14:15:22Z",
                    "to": "2019-08-24T14:15:22Z",
                    "filter": {
                      "type": "DAILY",
                      "nestingType": "IN_PLACE",
                      "from": "string",
                      "to": "string",
                      "inverted": false
                    }
                  },
                  "steps": [
                    {
                      "title": "string",
                      "action": {
                        "id": 0,
                        "name": "page.visit"
                      },
                      "expressions": [
                        {
                          "constraint": {
                            "type": "BOOL",
                            "logic": "IS_TRUE"
                          },
                          "attribute": {
                            "type": "PARAM",
                            "param": "string"
                          }
                        }
                      ]
                    }
                  ],
                  "exact": false
                },
                "filter": {
                  "matching": true,
                  "expressions": [
                    {
                      "type": "ATTRIBUTE",
                      "name": "string",
                      "matching": true,
                      "attribute": {
                        "expressions": [
                          {
                            "constraint": {
                              "type": "BOOL",
                              "logic": "IS_TRUE"
                            },
                            "attribute": {
                              "type": "PARAM",
                              "param": "string"
                            }
                          }
                        ]
                      }
                    }
                  ],
                  "expression": {
                    "type": "EMPTY"
                  },
                  "groupBy": [
                    {
                      "type": "CONSTANT",
                      "constant": "string"
                    }
                  ]
                }
              },
              "inlineAnalytics": [
                {
                  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
                  "analyticType": "EXPRESSION",
                  "analysis": {
                    "type": "EVENT",
                    "action": {
                      "id": 0,
                      "name": "page.visit"
                    },
                    "name": "string",
                    "description": "string",
                    "expression": {
                      "type": "VALUE",
                      "title": "title",
                      "value": {
                        "type": "CONSTANT",
                        "constant": 10
                      }
                    }
                  }
                }
              ]
            });

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

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

            xhr.open("PUT", "https://api.synerise.com/analytics/%7BNamespace%7D/funnels/%7BAnalysisId%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": "PUT",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/analytics/%7BNamespace%7D/funnels/%7BAnalysisId%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({
              analysis: {
                title: 'string',
                description: 'string',
                funnel: {
                  title: 'string',
                  completedWithin: {period: 'YEARS', value: 0},
                  dateFilter: {
                    type: 'ABSOLUTE',
                    from: '2019-08-24T14:15:22Z',
                    to: '2019-08-24T14:15:22Z',
                    filter: {
                      type: 'DAILY',
                      nestingType: 'IN_PLACE',
                      from: 'string',
                      to: 'string',
                      inverted: false
                    }
                  },
                  steps: [
                    {
                      title: 'string',
                      action: {id: 0, name: 'page.visit'},
                      expressions: [
                        {
                          constraint: {type: 'BOOL', logic: 'IS_TRUE'},
                          attribute: {type: 'PARAM', param: 'string'}
                        }
                      ]
                    }
                  ],
                  exact: false
                },
                filter: {
                  matching: true,
                  expressions: [
                    {
                      type: 'ATTRIBUTE',
                      name: 'string',
                      matching: true,
                      attribute: {
                        expressions: [
                          {
                            constraint: {type: 'BOOL', logic: 'IS_TRUE'},
                            attribute: {type: 'PARAM', param: 'string'}
                          }
                        ]
                      }
                    }
                  ],
                  expression: {type: 'EMPTY'},
                  groupBy: [{type: 'CONSTANT', constant: 'string'}]
                }
              },
              inlineAnalytics: [
                {
                  id: '497f6eca-6276-4993-bfeb-53cbbbba6f08',
                  analyticType: 'EXPRESSION',
                  analysis: {
                    type: 'EVENT',
                    action: {id: 0, name: 'page.visit'},
                    name: 'string',
                    description: 'string',
                    expression: {type: 'VALUE', title: 'title', value: {type: 'CONSTANT', constant: 10}}
                  }
                }
              ]
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/analytics/%7BNamespace%7D/funnels/%7BAnalysisId%7D');
            $request->setMethod(HTTP_METH_PUT);

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

            $request->setBody('{"analysis":{"title":"string","description":"string","funnel":{"title":"string","completedWithin":{"period":"YEARS","value":0},"dateFilter":{"type":"ABSOLUTE","from":"2019-08-24T14:15:22Z","to":"2019-08-24T14:15:22Z","filter":{"type":"DAILY","nestingType":"IN_PLACE","from":"string","to":"string","inverted":false}},"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]}],"exact":false},"filter":{"matching":true,"expressions":[{"type":"ATTRIBUTE","name":"string","matching":true,"attribute":{"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]}}],"expression":{"type":"EMPTY"},"groupBy":[{"type":"CONSTANT","constant":"string"}]}},"inlineAnalytics":[{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","analyticType":"EXPRESSION","analysis":{"type":"EVENT","action":{"id":0,"name":"page.visit"},"name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}}}]}');

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

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.put("https://api.synerise.com/analytics/%7BNamespace%7D/funnels/%7BAnalysisId%7D")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"analysis\":{\"title\":\"string\",\"description\":\"string\",\"funnel\":{\"title\":\"string\",\"completedWithin\":{\"period\":\"YEARS\",\"value\":0},\"dateFilter\":{\"type\":\"ABSOLUTE\",\"from\":\"2019-08-24T14:15:22Z\",\"to\":\"2019-08-24T14:15:22Z\",\"filter\":{\"type\":\"DAILY\",\"nestingType\":\"IN_PLACE\",\"from\":\"string\",\"to\":\"string\",\"inverted\":false}},\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}],\"exact\":false},\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"ATTRIBUTE\",\"name\":\"string\",\"matching\":true,\"attribute\":{\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}}],\"expression\":{\"type\":\"EMPTY\"},\"groupBy\":[{\"type\":\"CONSTANT\",\"constant\":\"string\"}]}},\"inlineAnalytics\":[{\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\"analyticType\":\"EXPRESSION\",\"analysis\":{\"type\":\"EVENT\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}}}]}")
              .asString();
    delete:
      tags:
        - "Analytics: Funnels"
      summary: Delete funnel
      description: |
        Delete a funnel.

        ---

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

        **API key permissions required (at least one):** `ANALYTICS_BACKEND_FUNNELS_DELETE`, `ANALYTICS_BACKEND_FUNNEL_DELETE`

        **User role permission required:** `analytics: delete`
      operationId: analytics2-funnels-delete
      parameters:
        - $ref: "#/components/parameters/analytics-pathNamespace"
        - $ref: "#/components/parameters/analytics-AnalyticIdPathParam"
      responses:
        "204":
          description: Funnel deleted
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Funnels/operation/analytics2-funnels-delete
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request DELETE \
              --url https://api.synerise.com/analytics/%7BNamespace%7D/funnels/%7BAnalysisId%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", "/analytics/%7BNamespace%7D/funnels/%7BAnalysisId%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/analytics/%7BNamespace%7D/funnels/%7BAnalysisId%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": "/analytics/%7BNamespace%7D/funnels/%7BAnalysisId%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/analytics/%7BNamespace%7D/funnels/%7BAnalysisId%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/analytics/%7BNamespace%7D/funnels/%7BAnalysisId%7D")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
  /analytics/{Namespace}/reports:
    get:
      tags:
        - "Analytics: Reports"
      summary: List reports
      description: |
        Returns a paginated list of reports.

        ---

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

        **API key permission required:** `ANALYTICS_BACKEND_REPORTS_LIST_READ`

        **User role permission required:** `analytics: read`
      operationId: analytics2-reports-list
      parameters:
        - $ref: "#/components/parameters/analytics-page"
        - $ref: "#/components/parameters/analytics-limit"
        - $ref: "#/components/parameters/analytics-search"
        - $ref: "#/components/parameters/analytics-sortBy"
        - $ref: "#/components/parameters/analytics-pathNamespace"
        - $ref: "#/components/parameters/analytics-directoryId"
        - $ref: "#/components/parameters/analytics-ids"
        - $ref: "#/components/parameters/analytics-isMultiMetric"
      responses:
        "200":
          description: List of reports
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    description: Array of reports
                    items:
                      $ref: "#/components/schemas/analytics-ReportListItem"
                  meta:
                    $ref: "#/components/schemas/analytics-Meta"
                required:
                  - data
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Reports/operation/analytics2-reports-list
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.synerise.com/analytics/%7BNamespace%7D/reports?page=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sortBy=name%3Aasc&directoryId=SOME_STRING_VALUE&ids=SOME_STRING_VALUE&isMultiMetric=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", "/analytics/%7BNamespace%7D/reports?page=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sortBy=name%3Aasc&directoryId=SOME_STRING_VALUE&ids=SOME_STRING_VALUE&isMultiMetric=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/analytics/%7BNamespace%7D/reports?page=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sortBy=name%3Aasc&directoryId=SOME_STRING_VALUE&ids=SOME_STRING_VALUE&isMultiMetric=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": "/analytics/%7BNamespace%7D/reports?page=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sortBy=name%3Aasc&directoryId=SOME_STRING_VALUE&ids=SOME_STRING_VALUE&isMultiMetric=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/analytics/%7BNamespace%7D/reports');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'page' => 'SOME_INTEGER_VALUE',
              'limit' => 'SOME_INTEGER_VALUE',
              'search' => 'SOME_STRING_VALUE',
              'sortBy' => 'name:asc',
              'directoryId' => 'SOME_STRING_VALUE',
              'ids' => 'SOME_STRING_VALUE',
              'isMultiMetric' => '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/analytics/%7BNamespace%7D/reports?page=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sortBy=name%3Aasc&directoryId=SOME_STRING_VALUE&ids=SOME_STRING_VALUE&isMultiMetric=SOME_BOOLEAN_VALUE")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
    post:
      tags:
        - "Analytics: Reports"
      summary: Create report analysis
      operationId: analytics2-reports-create
      parameters:
        - $ref: "#/components/parameters/analytics-pathNamespace"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/analytics-ReportRequest"
      responses:
        "200":
          description: ID of the created report
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/analytics-Id"
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Reports/operation/analytics2-reports-create
      description: |
        

        ---

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

        **API key permissions required (at least one):** `ANALYTICS_BACKEND_REPORTS_CREATE`, `ANALYTICS_BACKEND_REPORT_CREATE`

        **User role permission required:** `analytics: create`
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/analytics/%7BNamespace%7D/reports \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"analysis":{"id":"5370bf3c-2dfa-4e89-98ff-07100cffee6c","title":"string","description":"string","reportMetrics":[{"metricId":"c2cc9ad9-a69d-40a3-8e01-a95e09e71978","dateFilter":{"type":"ABSOLUTE","from":"2019-08-24T14:15:22Z","to":"2019-08-24T14:15:22Z","filter":{"type":"DAILY","nestingType":"IN_PLACE","from":"string","to":"string","inverted":false}},"action":{"id":0,"name":"page.visit"},"actions":[{"id":0,"name":"page.visit"}],"format":{"compactNumbers":false,"currency":"EUR","dataFormat":"cash","fixedLength":0,"useSeparator":false},"columnName":"string","grouping":{"type":"TOP","top":0},"groups":[{"title":"string","format":{"compactNumbers":false,"currency":"EUR","dataFormat":"cash","fixedLength":0,"useSeparator":false},"type":"CLIENT","attribute":{"type":"PARAM","param":"string"}}]}],"filter":{"matching":true,"expressions":[{"type":"ATTRIBUTE","name":"string","matching":true,"attribute":{"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]}}],"expression":{"type":"EMPTY"},"groupBy":[{"type":"CONSTANT","constant":"string"}]}},"allowNull":true,"inlineAnalytics":[{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","analyticType":"EXPRESSION","analysis":{"type":"EVENT","action":{"id":0,"name":"page.visit"},"name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}}}]}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"analysis\":{\"id\":\"5370bf3c-2dfa-4e89-98ff-07100cffee6c\",\"title\":\"string\",\"description\":\"string\",\"reportMetrics\":[{\"metricId\":\"c2cc9ad9-a69d-40a3-8e01-a95e09e71978\",\"dateFilter\":{\"type\":\"ABSOLUTE\",\"from\":\"2019-08-24T14:15:22Z\",\"to\":\"2019-08-24T14:15:22Z\",\"filter\":{\"type\":\"DAILY\",\"nestingType\":\"IN_PLACE\",\"from\":\"string\",\"to\":\"string\",\"inverted\":false}},\"action\":{\"id\":0,\"name\":\"page.visit\"},\"actions\":[{\"id\":0,\"name\":\"page.visit\"}],\"format\":{\"compactNumbers\":false,\"currency\":\"EUR\",\"dataFormat\":\"cash\",\"fixedLength\":0,\"useSeparator\":false},\"columnName\":\"string\",\"grouping\":{\"type\":\"TOP\",\"top\":0},\"groups\":[{\"title\":\"string\",\"format\":{\"compactNumbers\":false,\"currency\":\"EUR\",\"dataFormat\":\"cash\",\"fixedLength\":0,\"useSeparator\":false},\"type\":\"CLIENT\",\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}],\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"ATTRIBUTE\",\"name\":\"string\",\"matching\":true,\"attribute\":{\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}}],\"expression\":{\"type\":\"EMPTY\"},\"groupBy\":[{\"type\":\"CONSTANT\",\"constant\":\"string\"}]}},\"allowNull\":true,\"inlineAnalytics\":[{\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\"analyticType\":\"EXPRESSION\",\"analysis\":{\"type\":\"EVENT\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}}}]}"

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

            conn.request("POST", "/analytics/%7BNamespace%7D/reports", payload, headers)

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

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "analysis": {
                "id": "5370bf3c-2dfa-4e89-98ff-07100cffee6c",
                "title": "string",
                "description": "string",
                "reportMetrics": [
                  {
                    "metricId": "c2cc9ad9-a69d-40a3-8e01-a95e09e71978",
                    "dateFilter": {
                      "type": "ABSOLUTE",
                      "from": "2019-08-24T14:15:22Z",
                      "to": "2019-08-24T14:15:22Z",
                      "filter": {
                        "type": "DAILY",
                        "nestingType": "IN_PLACE",
                        "from": "string",
                        "to": "string",
                        "inverted": false
                      }
                    },
                    "action": {
                      "id": 0,
                      "name": "page.visit"
                    },
                    "actions": [
                      {
                        "id": 0,
                        "name": "page.visit"
                      }
                    ],
                    "format": {
                      "compactNumbers": false,
                      "currency": "EUR",
                      "dataFormat": "cash",
                      "fixedLength": 0,
                      "useSeparator": false
                    },
                    "columnName": "string",
                    "grouping": {
                      "type": "TOP",
                      "top": 0
                    },
                    "groups": [
                      {
                        "title": "string",
                        "format": {
                          "compactNumbers": false,
                          "currency": "EUR",
                          "dataFormat": "cash",
                          "fixedLength": 0,
                          "useSeparator": false
                        },
                        "type": "CLIENT",
                        "attribute": {
                          "type": "PARAM",
                          "param": "string"
                        }
                      }
                    ]
                  }
                ],
                "filter": {
                  "matching": true,
                  "expressions": [
                    {
                      "type": "ATTRIBUTE",
                      "name": "string",
                      "matching": true,
                      "attribute": {
                        "expressions": [
                          {
                            "constraint": {
                              "type": "BOOL",
                              "logic": "IS_TRUE"
                            },
                            "attribute": {
                              "type": "PARAM",
                              "param": "string"
                            }
                          }
                        ]
                      }
                    }
                  ],
                  "expression": {
                    "type": "EMPTY"
                  },
                  "groupBy": [
                    {
                      "type": "CONSTANT",
                      "constant": "string"
                    }
                  ]
                }
              },
              "allowNull": true,
              "inlineAnalytics": [
                {
                  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
                  "analyticType": "EXPRESSION",
                  "analysis": {
                    "type": "EVENT",
                    "action": {
                      "id": 0,
                      "name": "page.visit"
                    },
                    "name": "string",
                    "description": "string",
                    "expression": {
                      "type": "VALUE",
                      "title": "title",
                      "value": {
                        "type": "CONSTANT",
                        "constant": 10
                      }
                    }
                  }
                }
              ]
            });

            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/analytics/%7BNamespace%7D/reports");
            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": "/analytics/%7BNamespace%7D/reports",
              "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({
              analysis: {
                id: '5370bf3c-2dfa-4e89-98ff-07100cffee6c',
                title: 'string',
                description: 'string',
                reportMetrics: [
                  {
                    metricId: 'c2cc9ad9-a69d-40a3-8e01-a95e09e71978',
                    dateFilter: {
                      type: 'ABSOLUTE',
                      from: '2019-08-24T14:15:22Z',
                      to: '2019-08-24T14:15:22Z',
                      filter: {
                        type: 'DAILY',
                        nestingType: 'IN_PLACE',
                        from: 'string',
                        to: 'string',
                        inverted: false
                      }
                    },
                    action: {id: 0, name: 'page.visit'},
                    actions: [{id: 0, name: 'page.visit'}],
                    format: {
                      compactNumbers: false,
                      currency: 'EUR',
                      dataFormat: 'cash',
                      fixedLength: 0,
                      useSeparator: false
                    },
                    columnName: 'string',
                    grouping: {type: 'TOP', top: 0},
                    groups: [
                      {
                        title: 'string',
                        format: {
                          compactNumbers: false,
                          currency: 'EUR',
                          dataFormat: 'cash',
                          fixedLength: 0,
                          useSeparator: false
                        },
                        type: 'CLIENT',
                        attribute: {type: 'PARAM', param: 'string'}
                      }
                    ]
                  }
                ],
                filter: {
                  matching: true,
                  expressions: [
                    {
                      type: 'ATTRIBUTE',
                      name: 'string',
                      matching: true,
                      attribute: {
                        expressions: [
                          {
                            constraint: {type: 'BOOL', logic: 'IS_TRUE'},
                            attribute: {type: 'PARAM', param: 'string'}
                          }
                        ]
                      }
                    }
                  ],
                  expression: {type: 'EMPTY'},
                  groupBy: [{type: 'CONSTANT', constant: 'string'}]
                }
              },
              allowNull: true,
              inlineAnalytics: [
                {
                  id: '497f6eca-6276-4993-bfeb-53cbbbba6f08',
                  analyticType: 'EXPRESSION',
                  analysis: {
                    type: 'EVENT',
                    action: {id: 0, name: 'page.visit'},
                    name: 'string',
                    description: 'string',
                    expression: {type: 'VALUE', title: 'title', value: {type: 'CONSTANT', constant: 10}}
                  }
                }
              ]
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/analytics/%7BNamespace%7D/reports');
            $request->setMethod(HTTP_METH_POST);

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

            $request->setBody('{"analysis":{"id":"5370bf3c-2dfa-4e89-98ff-07100cffee6c","title":"string","description":"string","reportMetrics":[{"metricId":"c2cc9ad9-a69d-40a3-8e01-a95e09e71978","dateFilter":{"type":"ABSOLUTE","from":"2019-08-24T14:15:22Z","to":"2019-08-24T14:15:22Z","filter":{"type":"DAILY","nestingType":"IN_PLACE","from":"string","to":"string","inverted":false}},"action":{"id":0,"name":"page.visit"},"actions":[{"id":0,"name":"page.visit"}],"format":{"compactNumbers":false,"currency":"EUR","dataFormat":"cash","fixedLength":0,"useSeparator":false},"columnName":"string","grouping":{"type":"TOP","top":0},"groups":[{"title":"string","format":{"compactNumbers":false,"currency":"EUR","dataFormat":"cash","fixedLength":0,"useSeparator":false},"type":"CLIENT","attribute":{"type":"PARAM","param":"string"}}]}],"filter":{"matching":true,"expressions":[{"type":"ATTRIBUTE","name":"string","matching":true,"attribute":{"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]}}],"expression":{"type":"EMPTY"},"groupBy":[{"type":"CONSTANT","constant":"string"}]}},"allowNull":true,"inlineAnalytics":[{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","analyticType":"EXPRESSION","analysis":{"type":"EVENT","action":{"id":0,"name":"page.visit"},"name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}}}]}');

            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/analytics/%7BNamespace%7D/reports")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"analysis\":{\"id\":\"5370bf3c-2dfa-4e89-98ff-07100cffee6c\",\"title\":\"string\",\"description\":\"string\",\"reportMetrics\":[{\"metricId\":\"c2cc9ad9-a69d-40a3-8e01-a95e09e71978\",\"dateFilter\":{\"type\":\"ABSOLUTE\",\"from\":\"2019-08-24T14:15:22Z\",\"to\":\"2019-08-24T14:15:22Z\",\"filter\":{\"type\":\"DAILY\",\"nestingType\":\"IN_PLACE\",\"from\":\"string\",\"to\":\"string\",\"inverted\":false}},\"action\":{\"id\":0,\"name\":\"page.visit\"},\"actions\":[{\"id\":0,\"name\":\"page.visit\"}],\"format\":{\"compactNumbers\":false,\"currency\":\"EUR\",\"dataFormat\":\"cash\",\"fixedLength\":0,\"useSeparator\":false},\"columnName\":\"string\",\"grouping\":{\"type\":\"TOP\",\"top\":0},\"groups\":[{\"title\":\"string\",\"format\":{\"compactNumbers\":false,\"currency\":\"EUR\",\"dataFormat\":\"cash\",\"fixedLength\":0,\"useSeparator\":false},\"type\":\"CLIENT\",\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}],\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"ATTRIBUTE\",\"name\":\"string\",\"matching\":true,\"attribute\":{\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}}],\"expression\":{\"type\":\"EMPTY\"},\"groupBy\":[{\"type\":\"CONSTANT\",\"constant\":\"string\"}]}},\"allowNull\":true,\"inlineAnalytics\":[{\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\"analyticType\":\"EXPRESSION\",\"analysis\":{\"type\":\"EVENT\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}}}]}")
              .asString();
  /analytics/{Namespace}/reports/{AnalysisId}:
    get:
      tags:
        - "Analytics: Reports"
      summary: Get report analysis details
      operationId: analytics2-reports-get
      parameters:
        - $ref: "#/components/parameters/analytics-pathNamespace"
        - $ref: "#/components/parameters/analytics-AnalyticIdPathParam"
      responses:
        "200":
          description: Get report analysis details
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/analytics-ReportView"
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Reports/operation/analytics2-reports-get
      description: |
        

        ---

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

        **API key permissions required (at least one):** `ANALYTICS_BACKEND_REPORTS_READ`, `ANALYTICS_BACKEND_REPORT_READ`

        **User role permission required:** `analytics: read`
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url https://api.synerise.com/analytics/%7BNamespace%7D/reports/%7BAnalysisId%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", "/analytics/%7BNamespace%7D/reports/%7BAnalysisId%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/analytics/%7BNamespace%7D/reports/%7BAnalysisId%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": "/analytics/%7BNamespace%7D/reports/%7BAnalysisId%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/analytics/%7BNamespace%7D/reports/%7BAnalysisId%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/analytics/%7BNamespace%7D/reports/%7BAnalysisId%7D")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
    put:
      tags:
        - "Analytics: Reports"
      summary: Update report analysis
      operationId: analytics2-reports-update
      parameters:
        - $ref: "#/components/parameters/analytics-AnalyticIdPathParam"
        - $ref: "#/components/parameters/analytics-pathNamespace"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/analytics-ReportRequest"
      responses:
        "200":
          description: Report analysis updated
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Reports/operation/analytics2-reports-update
      description: |
        

        ---

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

        **API key permissions required (at least one):** `ANALYTICS_BACKEND_REPORTS_UPDATE`, `ANALYTICS_BACKEND_REPORT_UPDATE`

        **User role permission required:** `analytics: update`
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request PUT \
              --url https://api.synerise.com/analytics/%7BNamespace%7D/reports/%7BAnalysisId%7D \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"analysis":{"id":"5370bf3c-2dfa-4e89-98ff-07100cffee6c","title":"string","description":"string","reportMetrics":[{"metricId":"c2cc9ad9-a69d-40a3-8e01-a95e09e71978","dateFilter":{"type":"ABSOLUTE","from":"2019-08-24T14:15:22Z","to":"2019-08-24T14:15:22Z","filter":{"type":"DAILY","nestingType":"IN_PLACE","from":"string","to":"string","inverted":false}},"action":{"id":0,"name":"page.visit"},"actions":[{"id":0,"name":"page.visit"}],"format":{"compactNumbers":false,"currency":"EUR","dataFormat":"cash","fixedLength":0,"useSeparator":false},"columnName":"string","grouping":{"type":"TOP","top":0},"groups":[{"title":"string","format":{"compactNumbers":false,"currency":"EUR","dataFormat":"cash","fixedLength":0,"useSeparator":false},"type":"CLIENT","attribute":{"type":"PARAM","param":"string"}}]}],"filter":{"matching":true,"expressions":[{"type":"ATTRIBUTE","name":"string","matching":true,"attribute":{"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]}}],"expression":{"type":"EMPTY"},"groupBy":[{"type":"CONSTANT","constant":"string"}]}},"allowNull":true,"inlineAnalytics":[{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","analyticType":"EXPRESSION","analysis":{"type":"EVENT","action":{"id":0,"name":"page.visit"},"name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}}}]}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"analysis\":{\"id\":\"5370bf3c-2dfa-4e89-98ff-07100cffee6c\",\"title\":\"string\",\"description\":\"string\",\"reportMetrics\":[{\"metricId\":\"c2cc9ad9-a69d-40a3-8e01-a95e09e71978\",\"dateFilter\":{\"type\":\"ABSOLUTE\",\"from\":\"2019-08-24T14:15:22Z\",\"to\":\"2019-08-24T14:15:22Z\",\"filter\":{\"type\":\"DAILY\",\"nestingType\":\"IN_PLACE\",\"from\":\"string\",\"to\":\"string\",\"inverted\":false}},\"action\":{\"id\":0,\"name\":\"page.visit\"},\"actions\":[{\"id\":0,\"name\":\"page.visit\"}],\"format\":{\"compactNumbers\":false,\"currency\":\"EUR\",\"dataFormat\":\"cash\",\"fixedLength\":0,\"useSeparator\":false},\"columnName\":\"string\",\"grouping\":{\"type\":\"TOP\",\"top\":0},\"groups\":[{\"title\":\"string\",\"format\":{\"compactNumbers\":false,\"currency\":\"EUR\",\"dataFormat\":\"cash\",\"fixedLength\":0,\"useSeparator\":false},\"type\":\"CLIENT\",\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}],\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"ATTRIBUTE\",\"name\":\"string\",\"matching\":true,\"attribute\":{\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}}],\"expression\":{\"type\":\"EMPTY\"},\"groupBy\":[{\"type\":\"CONSTANT\",\"constant\":\"string\"}]}},\"allowNull\":true,\"inlineAnalytics\":[{\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\"analyticType\":\"EXPRESSION\",\"analysis\":{\"type\":\"EVENT\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}}}]}"

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

            conn.request("PUT", "/analytics/%7BNamespace%7D/reports/%7BAnalysisId%7D", payload, headers)

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

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "analysis": {
                "id": "5370bf3c-2dfa-4e89-98ff-07100cffee6c",
                "title": "string",
                "description": "string",
                "reportMetrics": [
                  {
                    "metricId": "c2cc9ad9-a69d-40a3-8e01-a95e09e71978",
                    "dateFilter": {
                      "type": "ABSOLUTE",
                      "from": "2019-08-24T14:15:22Z",
                      "to": "2019-08-24T14:15:22Z",
                      "filter": {
                        "type": "DAILY",
                        "nestingType": "IN_PLACE",
                        "from": "string",
                        "to": "string",
                        "inverted": false
                      }
                    },
                    "action": {
                      "id": 0,
                      "name": "page.visit"
                    },
                    "actions": [
                      {
                        "id": 0,
                        "name": "page.visit"
                      }
                    ],
                    "format": {
                      "compactNumbers": false,
                      "currency": "EUR",
                      "dataFormat": "cash",
                      "fixedLength": 0,
                      "useSeparator": false
                    },
                    "columnName": "string",
                    "grouping": {
                      "type": "TOP",
                      "top": 0
                    },
                    "groups": [
                      {
                        "title": "string",
                        "format": {
                          "compactNumbers": false,
                          "currency": "EUR",
                          "dataFormat": "cash",
                          "fixedLength": 0,
                          "useSeparator": false
                        },
                        "type": "CLIENT",
                        "attribute": {
                          "type": "PARAM",
                          "param": "string"
                        }
                      }
                    ]
                  }
                ],
                "filter": {
                  "matching": true,
                  "expressions": [
                    {
                      "type": "ATTRIBUTE",
                      "name": "string",
                      "matching": true,
                      "attribute": {
                        "expressions": [
                          {
                            "constraint": {
                              "type": "BOOL",
                              "logic": "IS_TRUE"
                            },
                            "attribute": {
                              "type": "PARAM",
                              "param": "string"
                            }
                          }
                        ]
                      }
                    }
                  ],
                  "expression": {
                    "type": "EMPTY"
                  },
                  "groupBy": [
                    {
                      "type": "CONSTANT",
                      "constant": "string"
                    }
                  ]
                }
              },
              "allowNull": true,
              "inlineAnalytics": [
                {
                  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
                  "analyticType": "EXPRESSION",
                  "analysis": {
                    "type": "EVENT",
                    "action": {
                      "id": 0,
                      "name": "page.visit"
                    },
                    "name": "string",
                    "description": "string",
                    "expression": {
                      "type": "VALUE",
                      "title": "title",
                      "value": {
                        "type": "CONSTANT",
                        "constant": 10
                      }
                    }
                  }
                }
              ]
            });

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

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

            xhr.open("PUT", "https://api.synerise.com/analytics/%7BNamespace%7D/reports/%7BAnalysisId%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": "PUT",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/analytics/%7BNamespace%7D/reports/%7BAnalysisId%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({
              analysis: {
                id: '5370bf3c-2dfa-4e89-98ff-07100cffee6c',
                title: 'string',
                description: 'string',
                reportMetrics: [
                  {
                    metricId: 'c2cc9ad9-a69d-40a3-8e01-a95e09e71978',
                    dateFilter: {
                      type: 'ABSOLUTE',
                      from: '2019-08-24T14:15:22Z',
                      to: '2019-08-24T14:15:22Z',
                      filter: {
                        type: 'DAILY',
                        nestingType: 'IN_PLACE',
                        from: 'string',
                        to: 'string',
                        inverted: false
                      }
                    },
                    action: {id: 0, name: 'page.visit'},
                    actions: [{id: 0, name: 'page.visit'}],
                    format: {
                      compactNumbers: false,
                      currency: 'EUR',
                      dataFormat: 'cash',
                      fixedLength: 0,
                      useSeparator: false
                    },
                    columnName: 'string',
                    grouping: {type: 'TOP', top: 0},
                    groups: [
                      {
                        title: 'string',
                        format: {
                          compactNumbers: false,
                          currency: 'EUR',
                          dataFormat: 'cash',
                          fixedLength: 0,
                          useSeparator: false
                        },
                        type: 'CLIENT',
                        attribute: {type: 'PARAM', param: 'string'}
                      }
                    ]
                  }
                ],
                filter: {
                  matching: true,
                  expressions: [
                    {
                      type: 'ATTRIBUTE',
                      name: 'string',
                      matching: true,
                      attribute: {
                        expressions: [
                          {
                            constraint: {type: 'BOOL', logic: 'IS_TRUE'},
                            attribute: {type: 'PARAM', param: 'string'}
                          }
                        ]
                      }
                    }
                  ],
                  expression: {type: 'EMPTY'},
                  groupBy: [{type: 'CONSTANT', constant: 'string'}]
                }
              },
              allowNull: true,
              inlineAnalytics: [
                {
                  id: '497f6eca-6276-4993-bfeb-53cbbbba6f08',
                  analyticType: 'EXPRESSION',
                  analysis: {
                    type: 'EVENT',
                    action: {id: 0, name: 'page.visit'},
                    name: 'string',
                    description: 'string',
                    expression: {type: 'VALUE', title: 'title', value: {type: 'CONSTANT', constant: 10}}
                  }
                }
              ]
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/analytics/%7BNamespace%7D/reports/%7BAnalysisId%7D');
            $request->setMethod(HTTP_METH_PUT);

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

            $request->setBody('{"analysis":{"id":"5370bf3c-2dfa-4e89-98ff-07100cffee6c","title":"string","description":"string","reportMetrics":[{"metricId":"c2cc9ad9-a69d-40a3-8e01-a95e09e71978","dateFilter":{"type":"ABSOLUTE","from":"2019-08-24T14:15:22Z","to":"2019-08-24T14:15:22Z","filter":{"type":"DAILY","nestingType":"IN_PLACE","from":"string","to":"string","inverted":false}},"action":{"id":0,"name":"page.visit"},"actions":[{"id":0,"name":"page.visit"}],"format":{"compactNumbers":false,"currency":"EUR","dataFormat":"cash","fixedLength":0,"useSeparator":false},"columnName":"string","grouping":{"type":"TOP","top":0},"groups":[{"title":"string","format":{"compactNumbers":false,"currency":"EUR","dataFormat":"cash","fixedLength":0,"useSeparator":false},"type":"CLIENT","attribute":{"type":"PARAM","param":"string"}}]}],"filter":{"matching":true,"expressions":[{"type":"ATTRIBUTE","name":"string","matching":true,"attribute":{"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]}}],"expression":{"type":"EMPTY"},"groupBy":[{"type":"CONSTANT","constant":"string"}]}},"allowNull":true,"inlineAnalytics":[{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","analyticType":"EXPRESSION","analysis":{"type":"EVENT","action":{"id":0,"name":"page.visit"},"name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}}}]}');

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

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.put("https://api.synerise.com/analytics/%7BNamespace%7D/reports/%7BAnalysisId%7D")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"analysis\":{\"id\":\"5370bf3c-2dfa-4e89-98ff-07100cffee6c\",\"title\":\"string\",\"description\":\"string\",\"reportMetrics\":[{\"metricId\":\"c2cc9ad9-a69d-40a3-8e01-a95e09e71978\",\"dateFilter\":{\"type\":\"ABSOLUTE\",\"from\":\"2019-08-24T14:15:22Z\",\"to\":\"2019-08-24T14:15:22Z\",\"filter\":{\"type\":\"DAILY\",\"nestingType\":\"IN_PLACE\",\"from\":\"string\",\"to\":\"string\",\"inverted\":false}},\"action\":{\"id\":0,\"name\":\"page.visit\"},\"actions\":[{\"id\":0,\"name\":\"page.visit\"}],\"format\":{\"compactNumbers\":false,\"currency\":\"EUR\",\"dataFormat\":\"cash\",\"fixedLength\":0,\"useSeparator\":false},\"columnName\":\"string\",\"grouping\":{\"type\":\"TOP\",\"top\":0},\"groups\":[{\"title\":\"string\",\"format\":{\"compactNumbers\":false,\"currency\":\"EUR\",\"dataFormat\":\"cash\",\"fixedLength\":0,\"useSeparator\":false},\"type\":\"CLIENT\",\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}],\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"ATTRIBUTE\",\"name\":\"string\",\"matching\":true,\"attribute\":{\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}}],\"expression\":{\"type\":\"EMPTY\"},\"groupBy\":[{\"type\":\"CONSTANT\",\"constant\":\"string\"}]}},\"allowNull\":true,\"inlineAnalytics\":[{\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\"analyticType\":\"EXPRESSION\",\"analysis\":{\"type\":\"EVENT\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}}}]}")
              .asString();
    delete:
      tags:
        - "Analytics: Reports"
      summary: Delete report analysis
      operationId: analytics2-reports-delete
      parameters:
        - $ref: "#/components/parameters/analytics-AnalyticIdPathParam"
        - $ref: "#/components/parameters/analytics-pathNamespace"
      responses:
        "204":
          description: Report analysis deleted
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Reports/operation/analytics2-reports-delete
      description: |
        

        ---

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

        **API key permissions required (at least one):** `ANALYTICS_BACKEND_REPORTS_DELETE`, `ANALYTICS_BACKEND_REPORT_DELETE`

        **User role permission required:** `analytics: delete`
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request DELETE \
              --url https://api.synerise.com/analytics/%7BNamespace%7D/reports/%7BAnalysisId%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", "/analytics/%7BNamespace%7D/reports/%7BAnalysisId%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/analytics/%7BNamespace%7D/reports/%7BAnalysisId%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": "/analytics/%7BNamespace%7D/reports/%7BAnalysisId%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/analytics/%7BNamespace%7D/reports/%7BAnalysisId%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/analytics/%7BNamespace%7D/reports/%7BAnalysisId%7D")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
  /analytics/{Namespace}/trends:
    get:
      tags:
        - "Analytics: Trends"
      summary: List trends
      description: |
        Returns a paginated list of trends.

        ---

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

        **API key permission required:** `ANALYTICS_BACKEND_TRENDS_LIST_READ`

        **User role permission required:** `analytics: read`
      operationId: analytics2-trends-list
      parameters:
        - $ref: "#/components/parameters/analytics-page"
        - $ref: "#/components/parameters/analytics-limit"
        - $ref: "#/components/parameters/analytics-search"
        - $ref: "#/components/parameters/analytics-sortBy"
        - $ref: "#/components/parameters/analytics-pathNamespace"
        - $ref: "#/components/parameters/analytics-directoryId"
        - $ref: "#/components/parameters/analytics-ids"
      responses:
        "200":
          description: List of trends
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    description: Array of trends
                    items:
                      $ref: "#/components/schemas/analytics-ListAnalyticsItemCommon"
                  meta:
                    $ref: "#/components/schemas/analytics-Meta"
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Trends/operation/analytics2-trends-list
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.synerise.com/analytics/%7BNamespace%7D/trends?page=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sortBy=name%3Aasc&directoryId=SOME_STRING_VALUE&ids=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", "/analytics/%7BNamespace%7D/trends?page=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sortBy=name%3Aasc&directoryId=SOME_STRING_VALUE&ids=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/analytics/%7BNamespace%7D/trends?page=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sortBy=name%3Aasc&directoryId=SOME_STRING_VALUE&ids=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": "/analytics/%7BNamespace%7D/trends?page=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sortBy=name%3Aasc&directoryId=SOME_STRING_VALUE&ids=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/analytics/%7BNamespace%7D/trends');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'page' => 'SOME_INTEGER_VALUE',
              'limit' => 'SOME_INTEGER_VALUE',
              'search' => 'SOME_STRING_VALUE',
              'sortBy' => 'name:asc',
              'directoryId' => 'SOME_STRING_VALUE',
              'ids' => '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/analytics/%7BNamespace%7D/trends?page=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sortBy=name%3Aasc&directoryId=SOME_STRING_VALUE&ids=SOME_STRING_VALUE")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
    post:
      tags:
        - "Analytics: Trends"
      summary: Create a trend
      description: |
        Create a trend.

        ---

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

        **API key permission required:** `ANALYTICS_BACKEND_TRENDS_CREATE`

        **User role permission required:** `analytics_trends: create`
      operationId: analytics2-trend-create
      parameters:
        - $ref: "#/components/parameters/analytics-pathNamespace"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/analytics-TrendRequest"
      responses:
        "200":
          description: Trend created
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/analytics-Id"
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Trends/operation/analytics2-trend-create
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/analytics/%7BNamespace%7D/trends \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"analysis":{"id":"5370bf3c-2dfa-4e89-98ff-07100cffee6c","title":"string","description":"string","filter":{"matching":true,"expressions":[{"type":"ATTRIBUTE","name":"string","matching":true,"attribute":{"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]}}],"expression":{"type":"EMPTY"},"groupBy":[{"type":"CONSTANT","constant":"string"}]},"trend":{"aggregateDataBy":{"type":"YEARS","value":0},"dateFilter":{"type":"ABSOLUTE","from":"2019-08-24T14:15:22Z","to":"2019-08-24T14:15:22Z","filter":{"type":"DAILY","nestingType":"IN_PLACE","from":"string","to":"string","inverted":false}},"trendDefinitions":[{"id":"5370bf3c-2dfa-4e89-98ff-07100cffee6c","title":"string","description":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}],"tabIndex":0,"aggregationType":"EVENT","chartType":"COLUMN"}]}},"inlineAnalytics":[{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","analyticType":"EXPRESSION","analysis":{"type":"EVENT","action":{"id":0,"name":"page.visit"},"name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}}}]}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"analysis\":{\"id\":\"5370bf3c-2dfa-4e89-98ff-07100cffee6c\",\"title\":\"string\",\"description\":\"string\",\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"ATTRIBUTE\",\"name\":\"string\",\"matching\":true,\"attribute\":{\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}}],\"expression\":{\"type\":\"EMPTY\"},\"groupBy\":[{\"type\":\"CONSTANT\",\"constant\":\"string\"}]},\"trend\":{\"aggregateDataBy\":{\"type\":\"YEARS\",\"value\":0},\"dateFilter\":{\"type\":\"ABSOLUTE\",\"from\":\"2019-08-24T14:15:22Z\",\"to\":\"2019-08-24T14:15:22Z\",\"filter\":{\"type\":\"DAILY\",\"nestingType\":\"IN_PLACE\",\"from\":\"string\",\"to\":\"string\",\"inverted\":false}},\"trendDefinitions\":[{\"id\":\"5370bf3c-2dfa-4e89-98ff-07100cffee6c\",\"title\":\"string\",\"description\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}],\"tabIndex\":0,\"aggregationType\":\"EVENT\",\"chartType\":\"COLUMN\"}]}},\"inlineAnalytics\":[{\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\"analyticType\":\"EXPRESSION\",\"analysis\":{\"type\":\"EVENT\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}}}]}"

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

            conn.request("POST", "/analytics/%7BNamespace%7D/trends", payload, headers)

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

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "analysis": {
                "id": "5370bf3c-2dfa-4e89-98ff-07100cffee6c",
                "title": "string",
                "description": "string",
                "filter": {
                  "matching": true,
                  "expressions": [
                    {
                      "type": "ATTRIBUTE",
                      "name": "string",
                      "matching": true,
                      "attribute": {
                        "expressions": [
                          {
                            "constraint": {
                              "type": "BOOL",
                              "logic": "IS_TRUE"
                            },
                            "attribute": {
                              "type": "PARAM",
                              "param": "string"
                            }
                          }
                        ]
                      }
                    }
                  ],
                  "expression": {
                    "type": "EMPTY"
                  },
                  "groupBy": [
                    {
                      "type": "CONSTANT",
                      "constant": "string"
                    }
                  ]
                },
                "trend": {
                  "aggregateDataBy": {
                    "type": "YEARS",
                    "value": 0
                  },
                  "dateFilter": {
                    "type": "ABSOLUTE",
                    "from": "2019-08-24T14:15:22Z",
                    "to": "2019-08-24T14:15:22Z",
                    "filter": {
                      "type": "DAILY",
                      "nestingType": "IN_PLACE",
                      "from": "string",
                      "to": "string",
                      "inverted": false
                    }
                  },
                  "trendDefinitions": [
                    {
                      "id": "5370bf3c-2dfa-4e89-98ff-07100cffee6c",
                      "title": "string",
                      "description": "string",
                      "action": {
                        "id": 0,
                        "name": "page.visit"
                      },
                      "expressions": [
                        {
                          "constraint": {
                            "type": "BOOL",
                            "logic": "IS_TRUE"
                          },
                          "attribute": {
                            "type": "PARAM",
                            "param": "string"
                          }
                        }
                      ],
                      "tabIndex": 0,
                      "aggregationType": "EVENT",
                      "chartType": "COLUMN"
                    }
                  ]
                }
              },
              "inlineAnalytics": [
                {
                  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
                  "analyticType": "EXPRESSION",
                  "analysis": {
                    "type": "EVENT",
                    "action": {
                      "id": 0,
                      "name": "page.visit"
                    },
                    "name": "string",
                    "description": "string",
                    "expression": {
                      "type": "VALUE",
                      "title": "title",
                      "value": {
                        "type": "CONSTANT",
                        "constant": 10
                      }
                    }
                  }
                }
              ]
            });

            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/analytics/%7BNamespace%7D/trends");
            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": "/analytics/%7BNamespace%7D/trends",
              "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({
              analysis: {
                id: '5370bf3c-2dfa-4e89-98ff-07100cffee6c',
                title: 'string',
                description: 'string',
                filter: {
                  matching: true,
                  expressions: [
                    {
                      type: 'ATTRIBUTE',
                      name: 'string',
                      matching: true,
                      attribute: {
                        expressions: [
                          {
                            constraint: {type: 'BOOL', logic: 'IS_TRUE'},
                            attribute: {type: 'PARAM', param: 'string'}
                          }
                        ]
                      }
                    }
                  ],
                  expression: {type: 'EMPTY'},
                  groupBy: [{type: 'CONSTANT', constant: 'string'}]
                },
                trend: {
                  aggregateDataBy: {type: 'YEARS', value: 0},
                  dateFilter: {
                    type: 'ABSOLUTE',
                    from: '2019-08-24T14:15:22Z',
                    to: '2019-08-24T14:15:22Z',
                    filter: {
                      type: 'DAILY',
                      nestingType: 'IN_PLACE',
                      from: 'string',
                      to: 'string',
                      inverted: false
                    }
                  },
                  trendDefinitions: [
                    {
                      id: '5370bf3c-2dfa-4e89-98ff-07100cffee6c',
                      title: 'string',
                      description: 'string',
                      action: {id: 0, name: 'page.visit'},
                      expressions: [
                        {
                          constraint: {type: 'BOOL', logic: 'IS_TRUE'},
                          attribute: {type: 'PARAM', param: 'string'}
                        }
                      ],
                      tabIndex: 0,
                      aggregationType: 'EVENT',
                      chartType: 'COLUMN'
                    }
                  ]
                }
              },
              inlineAnalytics: [
                {
                  id: '497f6eca-6276-4993-bfeb-53cbbbba6f08',
                  analyticType: 'EXPRESSION',
                  analysis: {
                    type: 'EVENT',
                    action: {id: 0, name: 'page.visit'},
                    name: 'string',
                    description: 'string',
                    expression: {type: 'VALUE', title: 'title', value: {type: 'CONSTANT', constant: 10}}
                  }
                }
              ]
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/analytics/%7BNamespace%7D/trends');
            $request->setMethod(HTTP_METH_POST);

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

            $request->setBody('{"analysis":{"id":"5370bf3c-2dfa-4e89-98ff-07100cffee6c","title":"string","description":"string","filter":{"matching":true,"expressions":[{"type":"ATTRIBUTE","name":"string","matching":true,"attribute":{"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]}}],"expression":{"type":"EMPTY"},"groupBy":[{"type":"CONSTANT","constant":"string"}]},"trend":{"aggregateDataBy":{"type":"YEARS","value":0},"dateFilter":{"type":"ABSOLUTE","from":"2019-08-24T14:15:22Z","to":"2019-08-24T14:15:22Z","filter":{"type":"DAILY","nestingType":"IN_PLACE","from":"string","to":"string","inverted":false}},"trendDefinitions":[{"id":"5370bf3c-2dfa-4e89-98ff-07100cffee6c","title":"string","description":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}],"tabIndex":0,"aggregationType":"EVENT","chartType":"COLUMN"}]}},"inlineAnalytics":[{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","analyticType":"EXPRESSION","analysis":{"type":"EVENT","action":{"id":0,"name":"page.visit"},"name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}}}]}');

            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/analytics/%7BNamespace%7D/trends")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"analysis\":{\"id\":\"5370bf3c-2dfa-4e89-98ff-07100cffee6c\",\"title\":\"string\",\"description\":\"string\",\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"ATTRIBUTE\",\"name\":\"string\",\"matching\":true,\"attribute\":{\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}}],\"expression\":{\"type\":\"EMPTY\"},\"groupBy\":[{\"type\":\"CONSTANT\",\"constant\":\"string\"}]},\"trend\":{\"aggregateDataBy\":{\"type\":\"YEARS\",\"value\":0},\"dateFilter\":{\"type\":\"ABSOLUTE\",\"from\":\"2019-08-24T14:15:22Z\",\"to\":\"2019-08-24T14:15:22Z\",\"filter\":{\"type\":\"DAILY\",\"nestingType\":\"IN_PLACE\",\"from\":\"string\",\"to\":\"string\",\"inverted\":false}},\"trendDefinitions\":[{\"id\":\"5370bf3c-2dfa-4e89-98ff-07100cffee6c\",\"title\":\"string\",\"description\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}],\"tabIndex\":0,\"aggregationType\":\"EVENT\",\"chartType\":\"COLUMN\"}]}},\"inlineAnalytics\":[{\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\"analyticType\":\"EXPRESSION\",\"analysis\":{\"type\":\"EVENT\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}}}]}")
              .asString();
  /analytics/{Namespace}/trends/{AnalysisId}:
    get:
      tags:
        - "Analytics: Trends"
      summary: Get trend details
      description: |
        Retrieve the definition of a single trend

        ---

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

        **API key permissions required (at least one):** `ANALYTICS_BACKEND_TRENDS_READ`, `ANALYTICS_BACKEND_TREND_READ`

        **User role permission required:** `analytics_trends: read`
      operationId: analytics2-trend-get
      parameters:
        - $ref: "#/components/parameters/analytics-pathNamespace"
        - $ref: "#/components/parameters/analytics-AnalyticIdPathParam"
      responses:
        "200":
          description: Details of a trend
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/analytics-TrendView"
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Trends/operation/analytics2-trend-get
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url https://api.synerise.com/analytics/%7BNamespace%7D/trends/%7BAnalysisId%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", "/analytics/%7BNamespace%7D/trends/%7BAnalysisId%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/analytics/%7BNamespace%7D/trends/%7BAnalysisId%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": "/analytics/%7BNamespace%7D/trends/%7BAnalysisId%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/analytics/%7BNamespace%7D/trends/%7BAnalysisId%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/analytics/%7BNamespace%7D/trends/%7BAnalysisId%7D")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
    put:
      tags:
        - "Analytics: Trends"
      summary: Update trend
      description: |
        Update an existing trend

        ---

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

        **API key permissions required (at least one):** `ANALYTICS_BACKEND_TRENDS_UPDATE`, `ANALYTICS_BACKEND_TREND_UPDATE`

        **User role permission required:** `analytics_trends: update`
      operationId: analytics2-trend-update
      parameters:
        - $ref: "#/components/parameters/analytics-pathNamespace"
        - $ref: "#/components/parameters/analytics-AnalyticIdPathParam"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/analytics-TrendRequest"
      responses:
        "200":
          description: Trend updated
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Trends/operation/analytics2-trend-update
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request PUT \
              --url https://api.synerise.com/analytics/%7BNamespace%7D/trends/%7BAnalysisId%7D \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"analysis":{"id":"5370bf3c-2dfa-4e89-98ff-07100cffee6c","title":"string","description":"string","filter":{"matching":true,"expressions":[{"type":"ATTRIBUTE","name":"string","matching":true,"attribute":{"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]}}],"expression":{"type":"EMPTY"},"groupBy":[{"type":"CONSTANT","constant":"string"}]},"trend":{"aggregateDataBy":{"type":"YEARS","value":0},"dateFilter":{"type":"ABSOLUTE","from":"2019-08-24T14:15:22Z","to":"2019-08-24T14:15:22Z","filter":{"type":"DAILY","nestingType":"IN_PLACE","from":"string","to":"string","inverted":false}},"trendDefinitions":[{"id":"5370bf3c-2dfa-4e89-98ff-07100cffee6c","title":"string","description":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}],"tabIndex":0,"aggregationType":"EVENT","chartType":"COLUMN"}]}},"inlineAnalytics":[{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","analyticType":"EXPRESSION","analysis":{"type":"EVENT","action":{"id":0,"name":"page.visit"},"name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}}}]}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"analysis\":{\"id\":\"5370bf3c-2dfa-4e89-98ff-07100cffee6c\",\"title\":\"string\",\"description\":\"string\",\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"ATTRIBUTE\",\"name\":\"string\",\"matching\":true,\"attribute\":{\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}}],\"expression\":{\"type\":\"EMPTY\"},\"groupBy\":[{\"type\":\"CONSTANT\",\"constant\":\"string\"}]},\"trend\":{\"aggregateDataBy\":{\"type\":\"YEARS\",\"value\":0},\"dateFilter\":{\"type\":\"ABSOLUTE\",\"from\":\"2019-08-24T14:15:22Z\",\"to\":\"2019-08-24T14:15:22Z\",\"filter\":{\"type\":\"DAILY\",\"nestingType\":\"IN_PLACE\",\"from\":\"string\",\"to\":\"string\",\"inverted\":false}},\"trendDefinitions\":[{\"id\":\"5370bf3c-2dfa-4e89-98ff-07100cffee6c\",\"title\":\"string\",\"description\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}],\"tabIndex\":0,\"aggregationType\":\"EVENT\",\"chartType\":\"COLUMN\"}]}},\"inlineAnalytics\":[{\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\"analyticType\":\"EXPRESSION\",\"analysis\":{\"type\":\"EVENT\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}}}]}"

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

            conn.request("PUT", "/analytics/%7BNamespace%7D/trends/%7BAnalysisId%7D", payload, headers)

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

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "analysis": {
                "id": "5370bf3c-2dfa-4e89-98ff-07100cffee6c",
                "title": "string",
                "description": "string",
                "filter": {
                  "matching": true,
                  "expressions": [
                    {
                      "type": "ATTRIBUTE",
                      "name": "string",
                      "matching": true,
                      "attribute": {
                        "expressions": [
                          {
                            "constraint": {
                              "type": "BOOL",
                              "logic": "IS_TRUE"
                            },
                            "attribute": {
                              "type": "PARAM",
                              "param": "string"
                            }
                          }
                        ]
                      }
                    }
                  ],
                  "expression": {
                    "type": "EMPTY"
                  },
                  "groupBy": [
                    {
                      "type": "CONSTANT",
                      "constant": "string"
                    }
                  ]
                },
                "trend": {
                  "aggregateDataBy": {
                    "type": "YEARS",
                    "value": 0
                  },
                  "dateFilter": {
                    "type": "ABSOLUTE",
                    "from": "2019-08-24T14:15:22Z",
                    "to": "2019-08-24T14:15:22Z",
                    "filter": {
                      "type": "DAILY",
                      "nestingType": "IN_PLACE",
                      "from": "string",
                      "to": "string",
                      "inverted": false
                    }
                  },
                  "trendDefinitions": [
                    {
                      "id": "5370bf3c-2dfa-4e89-98ff-07100cffee6c",
                      "title": "string",
                      "description": "string",
                      "action": {
                        "id": 0,
                        "name": "page.visit"
                      },
                      "expressions": [
                        {
                          "constraint": {
                            "type": "BOOL",
                            "logic": "IS_TRUE"
                          },
                          "attribute": {
                            "type": "PARAM",
                            "param": "string"
                          }
                        }
                      ],
                      "tabIndex": 0,
                      "aggregationType": "EVENT",
                      "chartType": "COLUMN"
                    }
                  ]
                }
              },
              "inlineAnalytics": [
                {
                  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
                  "analyticType": "EXPRESSION",
                  "analysis": {
                    "type": "EVENT",
                    "action": {
                      "id": 0,
                      "name": "page.visit"
                    },
                    "name": "string",
                    "description": "string",
                    "expression": {
                      "type": "VALUE",
                      "title": "title",
                      "value": {
                        "type": "CONSTANT",
                        "constant": 10
                      }
                    }
                  }
                }
              ]
            });

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

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

            xhr.open("PUT", "https://api.synerise.com/analytics/%7BNamespace%7D/trends/%7BAnalysisId%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": "PUT",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/analytics/%7BNamespace%7D/trends/%7BAnalysisId%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({
              analysis: {
                id: '5370bf3c-2dfa-4e89-98ff-07100cffee6c',
                title: 'string',
                description: 'string',
                filter: {
                  matching: true,
                  expressions: [
                    {
                      type: 'ATTRIBUTE',
                      name: 'string',
                      matching: true,
                      attribute: {
                        expressions: [
                          {
                            constraint: {type: 'BOOL', logic: 'IS_TRUE'},
                            attribute: {type: 'PARAM', param: 'string'}
                          }
                        ]
                      }
                    }
                  ],
                  expression: {type: 'EMPTY'},
                  groupBy: [{type: 'CONSTANT', constant: 'string'}]
                },
                trend: {
                  aggregateDataBy: {type: 'YEARS', value: 0},
                  dateFilter: {
                    type: 'ABSOLUTE',
                    from: '2019-08-24T14:15:22Z',
                    to: '2019-08-24T14:15:22Z',
                    filter: {
                      type: 'DAILY',
                      nestingType: 'IN_PLACE',
                      from: 'string',
                      to: 'string',
                      inverted: false
                    }
                  },
                  trendDefinitions: [
                    {
                      id: '5370bf3c-2dfa-4e89-98ff-07100cffee6c',
                      title: 'string',
                      description: 'string',
                      action: {id: 0, name: 'page.visit'},
                      expressions: [
                        {
                          constraint: {type: 'BOOL', logic: 'IS_TRUE'},
                          attribute: {type: 'PARAM', param: 'string'}
                        }
                      ],
                      tabIndex: 0,
                      aggregationType: 'EVENT',
                      chartType: 'COLUMN'
                    }
                  ]
                }
              },
              inlineAnalytics: [
                {
                  id: '497f6eca-6276-4993-bfeb-53cbbbba6f08',
                  analyticType: 'EXPRESSION',
                  analysis: {
                    type: 'EVENT',
                    action: {id: 0, name: 'page.visit'},
                    name: 'string',
                    description: 'string',
                    expression: {type: 'VALUE', title: 'title', value: {type: 'CONSTANT', constant: 10}}
                  }
                }
              ]
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/analytics/%7BNamespace%7D/trends/%7BAnalysisId%7D');
            $request->setMethod(HTTP_METH_PUT);

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

            $request->setBody('{"analysis":{"id":"5370bf3c-2dfa-4e89-98ff-07100cffee6c","title":"string","description":"string","filter":{"matching":true,"expressions":[{"type":"ATTRIBUTE","name":"string","matching":true,"attribute":{"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]}}],"expression":{"type":"EMPTY"},"groupBy":[{"type":"CONSTANT","constant":"string"}]},"trend":{"aggregateDataBy":{"type":"YEARS","value":0},"dateFilter":{"type":"ABSOLUTE","from":"2019-08-24T14:15:22Z","to":"2019-08-24T14:15:22Z","filter":{"type":"DAILY","nestingType":"IN_PLACE","from":"string","to":"string","inverted":false}},"trendDefinitions":[{"id":"5370bf3c-2dfa-4e89-98ff-07100cffee6c","title":"string","description":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}],"tabIndex":0,"aggregationType":"EVENT","chartType":"COLUMN"}]}},"inlineAnalytics":[{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","analyticType":"EXPRESSION","analysis":{"type":"EVENT","action":{"id":0,"name":"page.visit"},"name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}}}]}');

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

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.put("https://api.synerise.com/analytics/%7BNamespace%7D/trends/%7BAnalysisId%7D")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"analysis\":{\"id\":\"5370bf3c-2dfa-4e89-98ff-07100cffee6c\",\"title\":\"string\",\"description\":\"string\",\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"ATTRIBUTE\",\"name\":\"string\",\"matching\":true,\"attribute\":{\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}}],\"expression\":{\"type\":\"EMPTY\"},\"groupBy\":[{\"type\":\"CONSTANT\",\"constant\":\"string\"}]},\"trend\":{\"aggregateDataBy\":{\"type\":\"YEARS\",\"value\":0},\"dateFilter\":{\"type\":\"ABSOLUTE\",\"from\":\"2019-08-24T14:15:22Z\",\"to\":\"2019-08-24T14:15:22Z\",\"filter\":{\"type\":\"DAILY\",\"nestingType\":\"IN_PLACE\",\"from\":\"string\",\"to\":\"string\",\"inverted\":false}},\"trendDefinitions\":[{\"id\":\"5370bf3c-2dfa-4e89-98ff-07100cffee6c\",\"title\":\"string\",\"description\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}],\"tabIndex\":0,\"aggregationType\":\"EVENT\",\"chartType\":\"COLUMN\"}]}},\"inlineAnalytics\":[{\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\"analyticType\":\"EXPRESSION\",\"analysis\":{\"type\":\"EVENT\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}}}]}")
              .asString();
    delete:
      tags:
        - "Analytics: Trends"
      summary: Delete trend
      description: |
        Delete a trend.

        ---

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

        **API key permissions required (at least one):** `ANALYTICS_BACKEND_TRENDS_DELETE`, `ANALYTICS_BACKEND_TREND_DELETE`

        **User role permission required:** `analytics_trends: delete`
      operationId: analytics2-trend-delete
      parameters:
        - $ref: "#/components/parameters/analytics-pathNamespace"
        - $ref: "#/components/parameters/analytics-AnalyticIdPathParam"
      responses:
        "204":
          description: Trend deleted
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Trends/operation/analytics2-trend-delete
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request DELETE \
              --url https://api.synerise.com/analytics/%7BNamespace%7D/trends/%7BAnalysisId%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", "/analytics/%7BNamespace%7D/trends/%7BAnalysisId%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/analytics/%7BNamespace%7D/trends/%7BAnalysisId%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": "/analytics/%7BNamespace%7D/trends/%7BAnalysisId%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/analytics/%7BNamespace%7D/trends/%7BAnalysisId%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/analytics/%7BNamespace%7D/trends/%7BAnalysisId%7D")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
  /analytics/analytics/v2/trends/{AnalysisId}/recalculate/override:
    post:
      tags:
        - "Analytics: Trends"
      summary: Calculate trend with parameter override
      description: |
        Recalculate a trend with new parameters and/or variable (dynamic key) values.

        ---

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

        **API key permission required:** `ANALYTICS_BACKEND_TREND_READ`

        **User role permission required:** `analytics: read`
      operationId: analytics2-calculate-trend-with-override
      parameters:
        - $ref: "#/components/parameters/analytics-AnalyticIdPathParam"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/analytics-OverrideQueryRequest"
      responses:
        "200":
          description: Trend calculation result
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/analytics-TrendSignedCalculationResponse"
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Trends/operation/analytics2-calculate-trend-with-override
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/analytics/analytics/v2/trends/%7BAnalysisId%7D/recalculate/override \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"title":"string","dateFilter":{"type":"ABSOLUTE","from":"2019-08-24T14:15:22Z","to":"2019-08-24T14:15:22Z","filter":{"type":"DAILY","nestingType":"IN_PLACE","from":"string","to":"string","inverted":false}},"aggregateDataBy":{"type":"YEARS","value":0},"filter":{"matching":true,"expressions":[{"type":"ATTRIBUTE","name":"string","matching":true,"attribute":{"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]}}],"expression":{"type":"EMPTY"},"groupBy":[{"type":"CONSTANT","constant":"string"}]},"variables":[{"name":"string","value":"example-string-value"}],"overrideNested":false}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"title\":\"string\",\"dateFilter\":{\"type\":\"ABSOLUTE\",\"from\":\"2019-08-24T14:15:22Z\",\"to\":\"2019-08-24T14:15:22Z\",\"filter\":{\"type\":\"DAILY\",\"nestingType\":\"IN_PLACE\",\"from\":\"string\",\"to\":\"string\",\"inverted\":false}},\"aggregateDataBy\":{\"type\":\"YEARS\",\"value\":0},\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"ATTRIBUTE\",\"name\":\"string\",\"matching\":true,\"attribute\":{\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}}],\"expression\":{\"type\":\"EMPTY\"},\"groupBy\":[{\"type\":\"CONSTANT\",\"constant\":\"string\"}]},\"variables\":[{\"name\":\"string\",\"value\":\"example-string-value\"}],\"overrideNested\":false}"

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

            conn.request("POST", "/analytics/analytics/v2/trends/%7BAnalysisId%7D/recalculate/override", payload, headers)

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

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "title": "string",
              "dateFilter": {
                "type": "ABSOLUTE",
                "from": "2019-08-24T14:15:22Z",
                "to": "2019-08-24T14:15:22Z",
                "filter": {
                  "type": "DAILY",
                  "nestingType": "IN_PLACE",
                  "from": "string",
                  "to": "string",
                  "inverted": false
                }
              },
              "aggregateDataBy": {
                "type": "YEARS",
                "value": 0
              },
              "filter": {
                "matching": true,
                "expressions": [
                  {
                    "type": "ATTRIBUTE",
                    "name": "string",
                    "matching": true,
                    "attribute": {
                      "expressions": [
                        {
                          "constraint": {
                            "type": "BOOL",
                            "logic": "IS_TRUE"
                          },
                          "attribute": {
                            "type": "PARAM",
                            "param": "string"
                          }
                        }
                      ]
                    }
                  }
                ],
                "expression": {
                  "type": "EMPTY"
                },
                "groupBy": [
                  {
                    "type": "CONSTANT",
                    "constant": "string"
                  }
                ]
              },
              "variables": [
                {
                  "name": "string",
                  "value": "example-string-value"
                }
              ],
              "overrideNested": false
            });

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

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

            xhr.open("POST", "https://api.synerise.com/analytics/analytics/v2/trends/%7BAnalysisId%7D/recalculate/override");
            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": "/analytics/analytics/v2/trends/%7BAnalysisId%7D/recalculate/override",
              "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({
              title: 'string',
              dateFilter: {
                type: 'ABSOLUTE',
                from: '2019-08-24T14:15:22Z',
                to: '2019-08-24T14:15:22Z',
                filter: {
                  type: 'DAILY',
                  nestingType: 'IN_PLACE',
                  from: 'string',
                  to: 'string',
                  inverted: false
                }
              },
              aggregateDataBy: {type: 'YEARS', value: 0},
              filter: {
                matching: true,
                expressions: [
                  {
                    type: 'ATTRIBUTE',
                    name: 'string',
                    matching: true,
                    attribute: {
                      expressions: [
                        {
                          constraint: {type: 'BOOL', logic: 'IS_TRUE'},
                          attribute: {type: 'PARAM', param: 'string'}
                        }
                      ]
                    }
                  }
                ],
                expression: {type: 'EMPTY'},
                groupBy: [{type: 'CONSTANT', constant: 'string'}]
              },
              variables: [{name: 'string', value: 'example-string-value'}],
              overrideNested: false
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/analytics/analytics/v2/trends/%7BAnalysisId%7D/recalculate/override');
            $request->setMethod(HTTP_METH_POST);

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

            $request->setBody('{"title":"string","dateFilter":{"type":"ABSOLUTE","from":"2019-08-24T14:15:22Z","to":"2019-08-24T14:15:22Z","filter":{"type":"DAILY","nestingType":"IN_PLACE","from":"string","to":"string","inverted":false}},"aggregateDataBy":{"type":"YEARS","value":0},"filter":{"matching":true,"expressions":[{"type":"ATTRIBUTE","name":"string","matching":true,"attribute":{"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]}}],"expression":{"type":"EMPTY"},"groupBy":[{"type":"CONSTANT","constant":"string"}]},"variables":[{"name":"string","value":"example-string-value"}],"overrideNested":false}');

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

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.post("https://api.synerise.com/analytics/analytics/v2/trends/%7BAnalysisId%7D/recalculate/override")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"title\":\"string\",\"dateFilter\":{\"type\":\"ABSOLUTE\",\"from\":\"2019-08-24T14:15:22Z\",\"to\":\"2019-08-24T14:15:22Z\",\"filter\":{\"type\":\"DAILY\",\"nestingType\":\"IN_PLACE\",\"from\":\"string\",\"to\":\"string\",\"inverted\":false}},\"aggregateDataBy\":{\"type\":\"YEARS\",\"value\":0},\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"ATTRIBUTE\",\"name\":\"string\",\"matching\":true,\"attribute\":{\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}}],\"expression\":{\"type\":\"EMPTY\"},\"groupBy\":[{\"type\":\"CONSTANT\",\"constant\":\"string\"}]},\"variables\":[{\"name\":\"string\",\"value\":\"example-string-value\"}],\"overrideNested\":false}")
              .asString();
  /analytics/analytics/v2/trends/preview:
    post:
      tags:
        - "Analytics: Trends"
      summary: Preview trend calculation
      operationId: analytics2-preview-trend
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                analysis:
                  $ref: "#/components/schemas/analytics-TrendAnalysisRequest"
                inlineAnalytics:
                  $ref: "#/components/schemas/analytics-InlineAnalytics"
              required:
                - analysis
      responses:
        "200":
          description: Calculation result
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/analytics-TrendSignedCalculationResponse"
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Trends/operation/analytics2-preview-trend
      description: |
        

        ---

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

        **API key permission required:** `ANALYTICS_BACKEND_TREND_READ`

        **User role permission required:** `analytics: read`
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/analytics/analytics/v2/trends/preview \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"analysis":{"analysis":{"id":"5370bf3c-2dfa-4e89-98ff-07100cffee6c","title":"string","description":"string","filter":{"matching":true,"expressions":[{"type":"ATTRIBUTE","name":"string","matching":true,"attribute":{"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]}}],"expression":{"type":"EMPTY"},"groupBy":[{"type":"CONSTANT","constant":"string"}]},"trend":{"aggregateDataBy":{"type":"YEARS","value":0},"dateFilter":{"type":"ABSOLUTE","from":"2019-08-24T14:15:22Z","to":"2019-08-24T14:15:22Z","filter":{"type":"DAILY","nestingType":"IN_PLACE","from":"string","to":"string","inverted":false}},"trendDefinitions":[{"id":"5370bf3c-2dfa-4e89-98ff-07100cffee6c","title":"string","description":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}],"tabIndex":0,"aggregationType":"EVENT","chartType":"COLUMN"}]}},"tags":["string"]},"inlineAnalytics":[{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","analyticType":"EXPRESSION","analysis":{"type":"EVENT","action":{"id":0,"name":"page.visit"},"name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}}}]}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"analysis\":{\"analysis\":{\"id\":\"5370bf3c-2dfa-4e89-98ff-07100cffee6c\",\"title\":\"string\",\"description\":\"string\",\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"ATTRIBUTE\",\"name\":\"string\",\"matching\":true,\"attribute\":{\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}}],\"expression\":{\"type\":\"EMPTY\"},\"groupBy\":[{\"type\":\"CONSTANT\",\"constant\":\"string\"}]},\"trend\":{\"aggregateDataBy\":{\"type\":\"YEARS\",\"value\":0},\"dateFilter\":{\"type\":\"ABSOLUTE\",\"from\":\"2019-08-24T14:15:22Z\",\"to\":\"2019-08-24T14:15:22Z\",\"filter\":{\"type\":\"DAILY\",\"nestingType\":\"IN_PLACE\",\"from\":\"string\",\"to\":\"string\",\"inverted\":false}},\"trendDefinitions\":[{\"id\":\"5370bf3c-2dfa-4e89-98ff-07100cffee6c\",\"title\":\"string\",\"description\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}],\"tabIndex\":0,\"aggregationType\":\"EVENT\",\"chartType\":\"COLUMN\"}]}},\"tags\":[\"string\"]},\"inlineAnalytics\":[{\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\"analyticType\":\"EXPRESSION\",\"analysis\":{\"type\":\"EVENT\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}}}]}"

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

            conn.request("POST", "/analytics/analytics/v2/trends/preview", payload, headers)

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

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "analysis": {
                "analysis": {
                  "id": "5370bf3c-2dfa-4e89-98ff-07100cffee6c",
                  "title": "string",
                  "description": "string",
                  "filter": {
                    "matching": true,
                    "expressions": [
                      {
                        "type": "ATTRIBUTE",
                        "name": "string",
                        "matching": true,
                        "attribute": {
                          "expressions": [
                            {
                              "constraint": {
                                "type": "BOOL",
                                "logic": "IS_TRUE"
                              },
                              "attribute": {
                                "type": "PARAM",
                                "param": "string"
                              }
                            }
                          ]
                        }
                      }
                    ],
                    "expression": {
                      "type": "EMPTY"
                    },
                    "groupBy": [
                      {
                        "type": "CONSTANT",
                        "constant": "string"
                      }
                    ]
                  },
                  "trend": {
                    "aggregateDataBy": {
                      "type": "YEARS",
                      "value": 0
                    },
                    "dateFilter": {
                      "type": "ABSOLUTE",
                      "from": "2019-08-24T14:15:22Z",
                      "to": "2019-08-24T14:15:22Z",
                      "filter": {
                        "type": "DAILY",
                        "nestingType": "IN_PLACE",
                        "from": "string",
                        "to": "string",
                        "inverted": false
                      }
                    },
                    "trendDefinitions": [
                      {
                        "id": "5370bf3c-2dfa-4e89-98ff-07100cffee6c",
                        "title": "string",
                        "description": "string",
                        "action": {
                          "id": 0,
                          "name": "page.visit"
                        },
                        "expressions": [
                          {
                            "constraint": {
                              "type": "BOOL",
                              "logic": "IS_TRUE"
                            },
                            "attribute": {
                              "type": "PARAM",
                              "param": "string"
                            }
                          }
                        ],
                        "tabIndex": 0,
                        "aggregationType": "EVENT",
                        "chartType": "COLUMN"
                      }
                    ]
                  }
                },
                "tags": [
                  "string"
                ]
              },
              "inlineAnalytics": [
                {
                  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
                  "analyticType": "EXPRESSION",
                  "analysis": {
                    "type": "EVENT",
                    "action": {
                      "id": 0,
                      "name": "page.visit"
                    },
                    "name": "string",
                    "description": "string",
                    "expression": {
                      "type": "VALUE",
                      "title": "title",
                      "value": {
                        "type": "CONSTANT",
                        "constant": 10
                      }
                    }
                  }
                }
              ]
            });

            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/analytics/analytics/v2/trends/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": "/analytics/analytics/v2/trends/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({
              analysis: {
                analysis: {
                  id: '5370bf3c-2dfa-4e89-98ff-07100cffee6c',
                  title: 'string',
                  description: 'string',
                  filter: {
                    matching: true,
                    expressions: [
                      {
                        type: 'ATTRIBUTE',
                        name: 'string',
                        matching: true,
                        attribute: {
                          expressions: [
                            {
                              constraint: {type: 'BOOL', logic: 'IS_TRUE'},
                              attribute: {type: 'PARAM', param: 'string'}
                            }
                          ]
                        }
                      }
                    ],
                    expression: {type: 'EMPTY'},
                    groupBy: [{type: 'CONSTANT', constant: 'string'}]
                  },
                  trend: {
                    aggregateDataBy: {type: 'YEARS', value: 0},
                    dateFilter: {
                      type: 'ABSOLUTE',
                      from: '2019-08-24T14:15:22Z',
                      to: '2019-08-24T14:15:22Z',
                      filter: {
                        type: 'DAILY',
                        nestingType: 'IN_PLACE',
                        from: 'string',
                        to: 'string',
                        inverted: false
                      }
                    },
                    trendDefinitions: [
                      {
                        id: '5370bf3c-2dfa-4e89-98ff-07100cffee6c',
                        title: 'string',
                        description: 'string',
                        action: {id: 0, name: 'page.visit'},
                        expressions: [
                          {
                            constraint: {type: 'BOOL', logic: 'IS_TRUE'},
                            attribute: {type: 'PARAM', param: 'string'}
                          }
                        ],
                        tabIndex: 0,
                        aggregationType: 'EVENT',
                        chartType: 'COLUMN'
                      }
                    ]
                  }
                },
                tags: ['string']
              },
              inlineAnalytics: [
                {
                  id: '497f6eca-6276-4993-bfeb-53cbbbba6f08',
                  analyticType: 'EXPRESSION',
                  analysis: {
                    type: 'EVENT',
                    action: {id: 0, name: 'page.visit'},
                    name: 'string',
                    description: 'string',
                    expression: {type: 'VALUE', title: 'title', value: {type: 'CONSTANT', constant: 10}}
                  }
                }
              ]
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

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

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

            $request->setBody('{"analysis":{"analysis":{"id":"5370bf3c-2dfa-4e89-98ff-07100cffee6c","title":"string","description":"string","filter":{"matching":true,"expressions":[{"type":"ATTRIBUTE","name":"string","matching":true,"attribute":{"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]}}],"expression":{"type":"EMPTY"},"groupBy":[{"type":"CONSTANT","constant":"string"}]},"trend":{"aggregateDataBy":{"type":"YEARS","value":0},"dateFilter":{"type":"ABSOLUTE","from":"2019-08-24T14:15:22Z","to":"2019-08-24T14:15:22Z","filter":{"type":"DAILY","nestingType":"IN_PLACE","from":"string","to":"string","inverted":false}},"trendDefinitions":[{"id":"5370bf3c-2dfa-4e89-98ff-07100cffee6c","title":"string","description":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}],"tabIndex":0,"aggregationType":"EVENT","chartType":"COLUMN"}]}},"tags":["string"]},"inlineAnalytics":[{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","analyticType":"EXPRESSION","analysis":{"type":"EVENT","action":{"id":0,"name":"page.visit"},"name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}}}]}');

            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/analytics/analytics/v2/trends/preview")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"analysis\":{\"analysis\":{\"id\":\"5370bf3c-2dfa-4e89-98ff-07100cffee6c\",\"title\":\"string\",\"description\":\"string\",\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"ATTRIBUTE\",\"name\":\"string\",\"matching\":true,\"attribute\":{\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}}],\"expression\":{\"type\":\"EMPTY\"},\"groupBy\":[{\"type\":\"CONSTANT\",\"constant\":\"string\"}]},\"trend\":{\"aggregateDataBy\":{\"type\":\"YEARS\",\"value\":0},\"dateFilter\":{\"type\":\"ABSOLUTE\",\"from\":\"2019-08-24T14:15:22Z\",\"to\":\"2019-08-24T14:15:22Z\",\"filter\":{\"type\":\"DAILY\",\"nestingType\":\"IN_PLACE\",\"from\":\"string\",\"to\":\"string\",\"inverted\":false}},\"trendDefinitions\":[{\"id\":\"5370bf3c-2dfa-4e89-98ff-07100cffee6c\",\"title\":\"string\",\"description\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}],\"tabIndex\":0,\"aggregationType\":\"EVENT\",\"chartType\":\"COLUMN\"}]}},\"tags\":[\"string\"]},\"inlineAnalytics\":[{\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\"analyticType\":\"EXPRESSION\",\"analysis\":{\"type\":\"EVENT\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}}}]}")
              .asString();
  /analytics/{Namespace}/sankeys:
    get:
      tags:
        - "Analytics: Sankeys"
      summary: List Sankeys
      description: |
        Returns a paginated list of Sankey analyses.

        ---

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

        **API key permission required:** `ANALYTICS_BACKEND_SANKEYS_LIST_READ`

        **User role permission required:** `analytics: read`
      operationId: analytics2-sankeys-list
      parameters:
        - $ref: "#/components/parameters/analytics-page"
        - $ref: "#/components/parameters/analytics-limit"
        - $ref: "#/components/parameters/analytics-search"
        - $ref: "#/components/parameters/analytics-sortBy"
        - $ref: "#/components/parameters/analytics-pathNamespace"
        - $ref: "#/components/parameters/analytics-directoryId"
        - $ref: "#/components/parameters/analytics-ids"
      responses:
        "200":
          description: List of sankeys
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    description: List of sankeys
                    items:
                      $ref: "#/components/schemas/analytics-ListAnalyticsItemCommon"
                  meta:
                    $ref: "#/components/schemas/analytics-Meta"
                required:
                  - data
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Sankeys/operation/analytics2-sankeys-list
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.synerise.com/analytics/%7BNamespace%7D/sankeys?page=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sortBy=name%3Aasc&directoryId=SOME_STRING_VALUE&ids=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", "/analytics/%7BNamespace%7D/sankeys?page=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sortBy=name%3Aasc&directoryId=SOME_STRING_VALUE&ids=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/analytics/%7BNamespace%7D/sankeys?page=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sortBy=name%3Aasc&directoryId=SOME_STRING_VALUE&ids=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": "/analytics/%7BNamespace%7D/sankeys?page=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sortBy=name%3Aasc&directoryId=SOME_STRING_VALUE&ids=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/analytics/%7BNamespace%7D/sankeys');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'page' => 'SOME_INTEGER_VALUE',
              'limit' => 'SOME_INTEGER_VALUE',
              'search' => 'SOME_STRING_VALUE',
              'sortBy' => 'name:asc',
              'directoryId' => 'SOME_STRING_VALUE',
              'ids' => '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/analytics/%7BNamespace%7D/sankeys?page=SOME_INTEGER_VALUE&limit=SOME_INTEGER_VALUE&search=SOME_STRING_VALUE&sortBy=name%3Aasc&directoryId=SOME_STRING_VALUE&ids=SOME_STRING_VALUE")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
    post:
      tags:
        - "Analytics: Sankeys"
      summary: Create Sankey analysis
      description: |
        Create sankey analysis

        ---

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

        **API key permissions required (at least one):** `ANALYTICS_BACKEND_SANKEYS_CREATE`, `ANALYTICS_BACKEND_SANKEY_CREATE`

        **User role permission required:** `analytics: create`
      operationId: analytics2-sankeys-create
      parameters:
        - $ref: "#/components/parameters/analytics-pathNamespace"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/analytics-CreateRequestSankeyAnalysis"
      responses:
        "200":
          description: ID of the created analysis
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/analytics-Id"
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Sankeys/operation/analytics2-sankeys-create
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/analytics/%7BNamespace%7D/sankeys \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"analysis":{"id":"5370bf3c-2dfa-4e89-98ff-07100cffee6c","title":"string","description":"string","sourceEvent":{"action":{"id":0,"name":"page.visit"},"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]},"reverseOrder":true,"numberOfSteps":0,"numberOfPaths":0,"drillDown":[{"layer":0,"action":{"id":0,"name":"page.visit"},"attribute":{"type":"PARAM","param":"string"}}],"drillDownCount":0,"dateFilter":{"type":"ABSOLUTE","from":"2019-08-24T14:15:22Z","to":"2019-08-24T14:15:22Z","filter":{"type":"DAILY","nestingType":"IN_PLACE","from":"string","to":"string","inverted":false}},"filter":{"matching":true,"expressions":[{"type":"ATTRIBUTE","name":"string","matching":true,"attribute":{"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]}}],"expression":{"type":"EMPTY"},"groupBy":[{"type":"CONSTANT","constant":"string"}]},"eventFilters":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]}],"excludeEvents":true,"firstOccurrenceOnly":true},"inlineAnalytics":[{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","analyticType":"EXPRESSION","analysis":{"type":"EVENT","action":{"id":0,"name":"page.visit"},"name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}}}]}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"analysis\":{\"id\":\"5370bf3c-2dfa-4e89-98ff-07100cffee6c\",\"title\":\"string\",\"description\":\"string\",\"sourceEvent\":{\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]},\"reverseOrder\":true,\"numberOfSteps\":0,\"numberOfPaths\":0,\"drillDown\":[{\"layer\":0,\"action\":{\"id\":0,\"name\":\"page.visit\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}],\"drillDownCount\":0,\"dateFilter\":{\"type\":\"ABSOLUTE\",\"from\":\"2019-08-24T14:15:22Z\",\"to\":\"2019-08-24T14:15:22Z\",\"filter\":{\"type\":\"DAILY\",\"nestingType\":\"IN_PLACE\",\"from\":\"string\",\"to\":\"string\",\"inverted\":false}},\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"ATTRIBUTE\",\"name\":\"string\",\"matching\":true,\"attribute\":{\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}}],\"expression\":{\"type\":\"EMPTY\"},\"groupBy\":[{\"type\":\"CONSTANT\",\"constant\":\"string\"}]},\"eventFilters\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}],\"excludeEvents\":true,\"firstOccurrenceOnly\":true},\"inlineAnalytics\":[{\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\"analyticType\":\"EXPRESSION\",\"analysis\":{\"type\":\"EVENT\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}}}]}"

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

            conn.request("POST", "/analytics/%7BNamespace%7D/sankeys", payload, headers)

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

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "analysis": {
                "id": "5370bf3c-2dfa-4e89-98ff-07100cffee6c",
                "title": "string",
                "description": "string",
                "sourceEvent": {
                  "action": {
                    "id": 0,
                    "name": "page.visit"
                  },
                  "expressions": [
                    {
                      "constraint": {
                        "type": "BOOL",
                        "logic": "IS_TRUE"
                      },
                      "attribute": {
                        "type": "PARAM",
                        "param": "string"
                      }
                    }
                  ]
                },
                "reverseOrder": true,
                "numberOfSteps": 0,
                "numberOfPaths": 0,
                "drillDown": [
                  {
                    "layer": 0,
                    "action": {
                      "id": 0,
                      "name": "page.visit"
                    },
                    "attribute": {
                      "type": "PARAM",
                      "param": "string"
                    }
                  }
                ],
                "drillDownCount": 0,
                "dateFilter": {
                  "type": "ABSOLUTE",
                  "from": "2019-08-24T14:15:22Z",
                  "to": "2019-08-24T14:15:22Z",
                  "filter": {
                    "type": "DAILY",
                    "nestingType": "IN_PLACE",
                    "from": "string",
                    "to": "string",
                    "inverted": false
                  }
                },
                "filter": {
                  "matching": true,
                  "expressions": [
                    {
                      "type": "ATTRIBUTE",
                      "name": "string",
                      "matching": true,
                      "attribute": {
                        "expressions": [
                          {
                            "constraint": {
                              "type": "BOOL",
                              "logic": "IS_TRUE"
                            },
                            "attribute": {
                              "type": "PARAM",
                              "param": "string"
                            }
                          }
                        ]
                      }
                    }
                  ],
                  "expression": {
                    "type": "EMPTY"
                  },
                  "groupBy": [
                    {
                      "type": "CONSTANT",
                      "constant": "string"
                    }
                  ]
                },
                "eventFilters": [
                  {
                    "title": "string",
                    "action": {
                      "id": 0,
                      "name": "page.visit"
                    },
                    "expressions": [
                      {
                        "constraint": {
                          "type": "BOOL",
                          "logic": "IS_TRUE"
                        },
                        "attribute": {
                          "type": "PARAM",
                          "param": "string"
                        }
                      }
                    ]
                  }
                ],
                "excludeEvents": true,
                "firstOccurrenceOnly": true
              },
              "inlineAnalytics": [
                {
                  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
                  "analyticType": "EXPRESSION",
                  "analysis": {
                    "type": "EVENT",
                    "action": {
                      "id": 0,
                      "name": "page.visit"
                    },
                    "name": "string",
                    "description": "string",
                    "expression": {
                      "type": "VALUE",
                      "title": "title",
                      "value": {
                        "type": "CONSTANT",
                        "constant": 10
                      }
                    }
                  }
                }
              ]
            });

            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/analytics/%7BNamespace%7D/sankeys");
            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": "/analytics/%7BNamespace%7D/sankeys",
              "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({
              analysis: {
                id: '5370bf3c-2dfa-4e89-98ff-07100cffee6c',
                title: 'string',
                description: 'string',
                sourceEvent: {
                  action: {id: 0, name: 'page.visit'},
                  expressions: [
                    {
                      constraint: {type: 'BOOL', logic: 'IS_TRUE'},
                      attribute: {type: 'PARAM', param: 'string'}
                    }
                  ]
                },
                reverseOrder: true,
                numberOfSteps: 0,
                numberOfPaths: 0,
                drillDown: [
                  {
                    layer: 0,
                    action: {id: 0, name: 'page.visit'},
                    attribute: {type: 'PARAM', param: 'string'}
                  }
                ],
                drillDownCount: 0,
                dateFilter: {
                  type: 'ABSOLUTE',
                  from: '2019-08-24T14:15:22Z',
                  to: '2019-08-24T14:15:22Z',
                  filter: {
                    type: 'DAILY',
                    nestingType: 'IN_PLACE',
                    from: 'string',
                    to: 'string',
                    inverted: false
                  }
                },
                filter: {
                  matching: true,
                  expressions: [
                    {
                      type: 'ATTRIBUTE',
                      name: 'string',
                      matching: true,
                      attribute: {
                        expressions: [
                          {
                            constraint: {type: 'BOOL', logic: 'IS_TRUE'},
                            attribute: {type: 'PARAM', param: 'string'}
                          }
                        ]
                      }
                    }
                  ],
                  expression: {type: 'EMPTY'},
                  groupBy: [{type: 'CONSTANT', constant: 'string'}]
                },
                eventFilters: [
                  {
                    title: 'string',
                    action: {id: 0, name: 'page.visit'},
                    expressions: [
                      {
                        constraint: {type: 'BOOL', logic: 'IS_TRUE'},
                        attribute: {type: 'PARAM', param: 'string'}
                      }
                    ]
                  }
                ],
                excludeEvents: true,
                firstOccurrenceOnly: true
              },
              inlineAnalytics: [
                {
                  id: '497f6eca-6276-4993-bfeb-53cbbbba6f08',
                  analyticType: 'EXPRESSION',
                  analysis: {
                    type: 'EVENT',
                    action: {id: 0, name: 'page.visit'},
                    name: 'string',
                    description: 'string',
                    expression: {type: 'VALUE', title: 'title', value: {type: 'CONSTANT', constant: 10}}
                  }
                }
              ]
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/analytics/%7BNamespace%7D/sankeys');
            $request->setMethod(HTTP_METH_POST);

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

            $request->setBody('{"analysis":{"id":"5370bf3c-2dfa-4e89-98ff-07100cffee6c","title":"string","description":"string","sourceEvent":{"action":{"id":0,"name":"page.visit"},"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]},"reverseOrder":true,"numberOfSteps":0,"numberOfPaths":0,"drillDown":[{"layer":0,"action":{"id":0,"name":"page.visit"},"attribute":{"type":"PARAM","param":"string"}}],"drillDownCount":0,"dateFilter":{"type":"ABSOLUTE","from":"2019-08-24T14:15:22Z","to":"2019-08-24T14:15:22Z","filter":{"type":"DAILY","nestingType":"IN_PLACE","from":"string","to":"string","inverted":false}},"filter":{"matching":true,"expressions":[{"type":"ATTRIBUTE","name":"string","matching":true,"attribute":{"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]}}],"expression":{"type":"EMPTY"},"groupBy":[{"type":"CONSTANT","constant":"string"}]},"eventFilters":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]}],"excludeEvents":true,"firstOccurrenceOnly":true},"inlineAnalytics":[{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","analyticType":"EXPRESSION","analysis":{"type":"EVENT","action":{"id":0,"name":"page.visit"},"name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}}}]}');

            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/analytics/%7BNamespace%7D/sankeys")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"analysis\":{\"id\":\"5370bf3c-2dfa-4e89-98ff-07100cffee6c\",\"title\":\"string\",\"description\":\"string\",\"sourceEvent\":{\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]},\"reverseOrder\":true,\"numberOfSteps\":0,\"numberOfPaths\":0,\"drillDown\":[{\"layer\":0,\"action\":{\"id\":0,\"name\":\"page.visit\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}],\"drillDownCount\":0,\"dateFilter\":{\"type\":\"ABSOLUTE\",\"from\":\"2019-08-24T14:15:22Z\",\"to\":\"2019-08-24T14:15:22Z\",\"filter\":{\"type\":\"DAILY\",\"nestingType\":\"IN_PLACE\",\"from\":\"string\",\"to\":\"string\",\"inverted\":false}},\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"ATTRIBUTE\",\"name\":\"string\",\"matching\":true,\"attribute\":{\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}}],\"expression\":{\"type\":\"EMPTY\"},\"groupBy\":[{\"type\":\"CONSTANT\",\"constant\":\"string\"}]},\"eventFilters\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}],\"excludeEvents\":true,\"firstOccurrenceOnly\":true},\"inlineAnalytics\":[{\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\"analyticType\":\"EXPRESSION\",\"analysis\":{\"type\":\"EVENT\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}}}]}")
              .asString();
  /analytics/{Namespace}/sankeys/{AnalysisId}:
    get:
      tags:
        - "Analytics: Sankeys"
      summary: Get Sankey details
      description: |
        Retrieve the details of a Sankey analysis

        ---

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

        **API key permission required:** `ANALYTICS_BACKEND_SANKEYS_LIST_READ`

        **User role permission required:** `analytics: read`
      operationId: analytics2-sankeys-get
      parameters:
        - $ref: "#/components/parameters/analytics-pathNamespace"
        - $ref: "#/components/parameters/analytics-AnalyticIdPathParam"
      responses:
        "200":
          description: Sankey analysis details
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/analytics-SankeyView"
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Sankeys/operation/analytics2-sankeys-get
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url https://api.synerise.com/analytics/%7BNamespace%7D/sankeys/%7BAnalysisId%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", "/analytics/%7BNamespace%7D/sankeys/%7BAnalysisId%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/analytics/%7BNamespace%7D/sankeys/%7BAnalysisId%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": "/analytics/%7BNamespace%7D/sankeys/%7BAnalysisId%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/analytics/%7BNamespace%7D/sankeys/%7BAnalysisId%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/analytics/%7BNamespace%7D/sankeys/%7BAnalysisId%7D")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
    put:
      tags:
        - "Analytics: Sankeys"
      summary: Update Sankey
      description: |
        Update an existing Sankey analysis

        ---

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

        **API key permissions required (at least one):** `ANALYTICS_BACKEND_SANKEYS_UPDATE`, `ANALYTICS_BACKEND_SANKEY_UPDATE`

        **User role permission required:** `analytics: update`
      operationId: analytics2-sankeys-update
      parameters:
        - $ref: "#/components/parameters/analytics-pathNamespace"
        - $ref: "#/components/parameters/analytics-AnalyticIdPathParam"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/analytics-CreateRequestSankeyAnalysis"
      responses:
        "200":
          description: Analysis updated
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Sankeys/operation/analytics2-sankeys-update
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request PUT \
              --url https://api.synerise.com/analytics/%7BNamespace%7D/sankeys/%7BAnalysisId%7D \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"analysis":{"id":"5370bf3c-2dfa-4e89-98ff-07100cffee6c","title":"string","description":"string","sourceEvent":{"action":{"id":0,"name":"page.visit"},"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]},"reverseOrder":true,"numberOfSteps":0,"numberOfPaths":0,"drillDown":[{"layer":0,"action":{"id":0,"name":"page.visit"},"attribute":{"type":"PARAM","param":"string"}}],"drillDownCount":0,"dateFilter":{"type":"ABSOLUTE","from":"2019-08-24T14:15:22Z","to":"2019-08-24T14:15:22Z","filter":{"type":"DAILY","nestingType":"IN_PLACE","from":"string","to":"string","inverted":false}},"filter":{"matching":true,"expressions":[{"type":"ATTRIBUTE","name":"string","matching":true,"attribute":{"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]}}],"expression":{"type":"EMPTY"},"groupBy":[{"type":"CONSTANT","constant":"string"}]},"eventFilters":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]}],"excludeEvents":true,"firstOccurrenceOnly":true},"inlineAnalytics":[{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","analyticType":"EXPRESSION","analysis":{"type":"EVENT","action":{"id":0,"name":"page.visit"},"name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}}}]}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"analysis\":{\"id\":\"5370bf3c-2dfa-4e89-98ff-07100cffee6c\",\"title\":\"string\",\"description\":\"string\",\"sourceEvent\":{\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]},\"reverseOrder\":true,\"numberOfSteps\":0,\"numberOfPaths\":0,\"drillDown\":[{\"layer\":0,\"action\":{\"id\":0,\"name\":\"page.visit\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}],\"drillDownCount\":0,\"dateFilter\":{\"type\":\"ABSOLUTE\",\"from\":\"2019-08-24T14:15:22Z\",\"to\":\"2019-08-24T14:15:22Z\",\"filter\":{\"type\":\"DAILY\",\"nestingType\":\"IN_PLACE\",\"from\":\"string\",\"to\":\"string\",\"inverted\":false}},\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"ATTRIBUTE\",\"name\":\"string\",\"matching\":true,\"attribute\":{\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}}],\"expression\":{\"type\":\"EMPTY\"},\"groupBy\":[{\"type\":\"CONSTANT\",\"constant\":\"string\"}]},\"eventFilters\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}],\"excludeEvents\":true,\"firstOccurrenceOnly\":true},\"inlineAnalytics\":[{\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\"analyticType\":\"EXPRESSION\",\"analysis\":{\"type\":\"EVENT\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}}}]}"

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

            conn.request("PUT", "/analytics/%7BNamespace%7D/sankeys/%7BAnalysisId%7D", payload, headers)

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

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "analysis": {
                "id": "5370bf3c-2dfa-4e89-98ff-07100cffee6c",
                "title": "string",
                "description": "string",
                "sourceEvent": {
                  "action": {
                    "id": 0,
                    "name": "page.visit"
                  },
                  "expressions": [
                    {
                      "constraint": {
                        "type": "BOOL",
                        "logic": "IS_TRUE"
                      },
                      "attribute": {
                        "type": "PARAM",
                        "param": "string"
                      }
                    }
                  ]
                },
                "reverseOrder": true,
                "numberOfSteps": 0,
                "numberOfPaths": 0,
                "drillDown": [
                  {
                    "layer": 0,
                    "action": {
                      "id": 0,
                      "name": "page.visit"
                    },
                    "attribute": {
                      "type": "PARAM",
                      "param": "string"
                    }
                  }
                ],
                "drillDownCount": 0,
                "dateFilter": {
                  "type": "ABSOLUTE",
                  "from": "2019-08-24T14:15:22Z",
                  "to": "2019-08-24T14:15:22Z",
                  "filter": {
                    "type": "DAILY",
                    "nestingType": "IN_PLACE",
                    "from": "string",
                    "to": "string",
                    "inverted": false
                  }
                },
                "filter": {
                  "matching": true,
                  "expressions": [
                    {
                      "type": "ATTRIBUTE",
                      "name": "string",
                      "matching": true,
                      "attribute": {
                        "expressions": [
                          {
                            "constraint": {
                              "type": "BOOL",
                              "logic": "IS_TRUE"
                            },
                            "attribute": {
                              "type": "PARAM",
                              "param": "string"
                            }
                          }
                        ]
                      }
                    }
                  ],
                  "expression": {
                    "type": "EMPTY"
                  },
                  "groupBy": [
                    {
                      "type": "CONSTANT",
                      "constant": "string"
                    }
                  ]
                },
                "eventFilters": [
                  {
                    "title": "string",
                    "action": {
                      "id": 0,
                      "name": "page.visit"
                    },
                    "expressions": [
                      {
                        "constraint": {
                          "type": "BOOL",
                          "logic": "IS_TRUE"
                        },
                        "attribute": {
                          "type": "PARAM",
                          "param": "string"
                        }
                      }
                    ]
                  }
                ],
                "excludeEvents": true,
                "firstOccurrenceOnly": true
              },
              "inlineAnalytics": [
                {
                  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
                  "analyticType": "EXPRESSION",
                  "analysis": {
                    "type": "EVENT",
                    "action": {
                      "id": 0,
                      "name": "page.visit"
                    },
                    "name": "string",
                    "description": "string",
                    "expression": {
                      "type": "VALUE",
                      "title": "title",
                      "value": {
                        "type": "CONSTANT",
                        "constant": 10
                      }
                    }
                  }
                }
              ]
            });

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

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

            xhr.open("PUT", "https://api.synerise.com/analytics/%7BNamespace%7D/sankeys/%7BAnalysisId%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": "PUT",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/analytics/%7BNamespace%7D/sankeys/%7BAnalysisId%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({
              analysis: {
                id: '5370bf3c-2dfa-4e89-98ff-07100cffee6c',
                title: 'string',
                description: 'string',
                sourceEvent: {
                  action: {id: 0, name: 'page.visit'},
                  expressions: [
                    {
                      constraint: {type: 'BOOL', logic: 'IS_TRUE'},
                      attribute: {type: 'PARAM', param: 'string'}
                    }
                  ]
                },
                reverseOrder: true,
                numberOfSteps: 0,
                numberOfPaths: 0,
                drillDown: [
                  {
                    layer: 0,
                    action: {id: 0, name: 'page.visit'},
                    attribute: {type: 'PARAM', param: 'string'}
                  }
                ],
                drillDownCount: 0,
                dateFilter: {
                  type: 'ABSOLUTE',
                  from: '2019-08-24T14:15:22Z',
                  to: '2019-08-24T14:15:22Z',
                  filter: {
                    type: 'DAILY',
                    nestingType: 'IN_PLACE',
                    from: 'string',
                    to: 'string',
                    inverted: false
                  }
                },
                filter: {
                  matching: true,
                  expressions: [
                    {
                      type: 'ATTRIBUTE',
                      name: 'string',
                      matching: true,
                      attribute: {
                        expressions: [
                          {
                            constraint: {type: 'BOOL', logic: 'IS_TRUE'},
                            attribute: {type: 'PARAM', param: 'string'}
                          }
                        ]
                      }
                    }
                  ],
                  expression: {type: 'EMPTY'},
                  groupBy: [{type: 'CONSTANT', constant: 'string'}]
                },
                eventFilters: [
                  {
                    title: 'string',
                    action: {id: 0, name: 'page.visit'},
                    expressions: [
                      {
                        constraint: {type: 'BOOL', logic: 'IS_TRUE'},
                        attribute: {type: 'PARAM', param: 'string'}
                      }
                    ]
                  }
                ],
                excludeEvents: true,
                firstOccurrenceOnly: true
              },
              inlineAnalytics: [
                {
                  id: '497f6eca-6276-4993-bfeb-53cbbbba6f08',
                  analyticType: 'EXPRESSION',
                  analysis: {
                    type: 'EVENT',
                    action: {id: 0, name: 'page.visit'},
                    name: 'string',
                    description: 'string',
                    expression: {type: 'VALUE', title: 'title', value: {type: 'CONSTANT', constant: 10}}
                  }
                }
              ]
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/analytics/%7BNamespace%7D/sankeys/%7BAnalysisId%7D');
            $request->setMethod(HTTP_METH_PUT);

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

            $request->setBody('{"analysis":{"id":"5370bf3c-2dfa-4e89-98ff-07100cffee6c","title":"string","description":"string","sourceEvent":{"action":{"id":0,"name":"page.visit"},"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]},"reverseOrder":true,"numberOfSteps":0,"numberOfPaths":0,"drillDown":[{"layer":0,"action":{"id":0,"name":"page.visit"},"attribute":{"type":"PARAM","param":"string"}}],"drillDownCount":0,"dateFilter":{"type":"ABSOLUTE","from":"2019-08-24T14:15:22Z","to":"2019-08-24T14:15:22Z","filter":{"type":"DAILY","nestingType":"IN_PLACE","from":"string","to":"string","inverted":false}},"filter":{"matching":true,"expressions":[{"type":"ATTRIBUTE","name":"string","matching":true,"attribute":{"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]}}],"expression":{"type":"EMPTY"},"groupBy":[{"type":"CONSTANT","constant":"string"}]},"eventFilters":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"constraint":{"type":"BOOL","logic":"IS_TRUE"},"attribute":{"type":"PARAM","param":"string"}}]}],"excludeEvents":true,"firstOccurrenceOnly":true},"inlineAnalytics":[{"id":"497f6eca-6276-4993-bfeb-53cbbbba6f08","analyticType":"EXPRESSION","analysis":{"type":"EVENT","action":{"id":0,"name":"page.visit"},"name":"string","description":"string","expression":{"type":"VALUE","title":"title","value":{"type":"CONSTANT","constant":10}}}}]}');

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

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.put("https://api.synerise.com/analytics/%7BNamespace%7D/sankeys/%7BAnalysisId%7D")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"analysis\":{\"id\":\"5370bf3c-2dfa-4e89-98ff-07100cffee6c\",\"title\":\"string\",\"description\":\"string\",\"sourceEvent\":{\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]},\"reverseOrder\":true,\"numberOfSteps\":0,\"numberOfPaths\":0,\"drillDown\":[{\"layer\":0,\"action\":{\"id\":0,\"name\":\"page.visit\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}],\"drillDownCount\":0,\"dateFilter\":{\"type\":\"ABSOLUTE\",\"from\":\"2019-08-24T14:15:22Z\",\"to\":\"2019-08-24T14:15:22Z\",\"filter\":{\"type\":\"DAILY\",\"nestingType\":\"IN_PLACE\",\"from\":\"string\",\"to\":\"string\",\"inverted\":false}},\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"ATTRIBUTE\",\"name\":\"string\",\"matching\":true,\"attribute\":{\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}}],\"expression\":{\"type\":\"EMPTY\"},\"groupBy\":[{\"type\":\"CONSTANT\",\"constant\":\"string\"}]},\"eventFilters\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\"}}]}],\"excludeEvents\":true,\"firstOccurrenceOnly\":true},\"inlineAnalytics\":[{\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\",\"analyticType\":\"EXPRESSION\",\"analysis\":{\"type\":\"EVENT\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"title\",\"value\":{\"type\":\"CONSTANT\",\"constant\":10}}}}]}")
              .asString();
    delete:
      tags:
        - "Analytics: Sankeys"
      summary: Delete Sankey
      description: |
        Delete a Sankey analysis

        ---

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

        **API key permissions required (at least one):** `ANALYTICS_BACKEND_SANKEYS_DELETE`, `ANALYTICS_BACKEND_SANKEY_DELETE`

        **User role permission required:** `analytics: delete`
      operationId: analytics2-sankeys-delete
      parameters:
        - $ref: "#/components/parameters/analytics-pathNamespace"
        - $ref: "#/components/parameters/analytics-AnalyticIdPathParam"
      responses:
        "204":
          description: Deleted sankeys analysis
        4XX:
          $ref: "#/components/responses/analytics-genericError"
        5XX:
          $ref: "#/components/responses/analytics-genericError"
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Sankeys/operation/analytics2-sankeys-delete
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request DELETE \
              --url https://api.synerise.com/analytics/%7BNamespace%7D/sankeys/%7BAnalysisId%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", "/analytics/%7BNamespace%7D/sankeys/%7BAnalysisId%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/analytics/%7BNamespace%7D/sankeys/%7BAnalysisId%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": "/analytics/%7BNamespace%7D/sankeys/%7BAnalysisId%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/analytics/%7BNamespace%7D/sankeys/%7BAnalysisId%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/analytics/%7BNamespace%7D/sankeys/%7BAnalysisId%7D")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
  /metrics/v2/available:
    get:
      summary: Check available metrics (recommendations)
      description: |
        Returns metrics available for the Workspace. The metrics can be used when defining boostMetric and sortMetric query parameters in recommendations and in metric-based recommendations.

        ---

        **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:** `METRICS_RECOMMENDATIONS_READ`

        **User role permission required:** `campaigns_recommendations: read`
      operationId: ApiGetAvailableMetricsV2
      tags:
        - "AI: Metrics"
      security:
        - JWT: []
      responses:
        "200":
          description: Available metrics
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/metrics-AvailableMetrics"
        "500":
          description: An error occurred
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/metrics-Error"
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/AI:-Metrics/operation/ApiGetAvailableMetricsV2
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url https://api.synerise.com/metrics/v2/available \
              --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", "/metrics/v2/available", 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/metrics/v2/available");
            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": "/metrics/v2/available",
              "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/metrics/v2/available');
            $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/metrics/v2/available")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
  /metrics/v2/available-ids:
    get:
      summary: Retrieve IDs of available metrics (recommendations)
      description: |
        Returns IDs of metrics that are available for the Workspace. The metrics can be used when defining boostMetric and sortMetric query parameters in recommendations and in metric-based recommendations.

        ---

        **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:** `METRICS_RECOMMENDATIONS_READ`

        **User role permission required:** `campaigns_recommendations: read`
      operationId: ApiGetAvailableMetricsIdsV2
      tags:
        - "AI: Metrics"
      security:
        - JWT: []
      responses:
        "200":
          description: IDs of available metrics
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/metrics-AvailableMetricsIds"
        "500":
          description: An error occurred
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/metrics-Error"
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/AI:-Metrics/operation/ApiGetAvailableMetricsIdsV2
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url https://api.synerise.com/metrics/v2/available-ids \
              --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", "/metrics/v2/available-ids", 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/metrics/v2/available-ids");
            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": "/metrics/v2/available-ids",
              "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/metrics/v2/available-ids');
            $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/metrics/v2/available-ids")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .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:
    analytics-Error:
      allOf:
        - type: object
          properties:
            source:
              type: object
              nullable: true
              description: Information about a parameter that caused the error, if applicable.
              properties:
                pointer:
                  type: string
                  description: Information about a parameter
                value:
                  type: string
                  nullable: true
                  description: Currently unused
            errors:
              type: array
              description: An array of errors, if applicable
              items:
                $ref: "#/components/schemas/analytics-ErrorContent"
        - $ref: "#/components/schemas/analytics-ErrorContent"
    analytics-ErrorContent:
      type: object
      properties:
        timestamp:
          type: string
          format: date-time
          description: Time when the error occurred
        errorCode:
          type: string
          description: Code of the error, needed for troubleshooting. See [https://developers.synerise.com/errors.html](https://developers.synerise.com/errors.html).
        httpStatus:
          type: integer
          description: HTTP status code
        message:
          type: string
          description: Description of the problem
        traceId:
          type: string
          description: Currently unused
          nullable: true
        help:
          type: string
          nullable: true
          description: Currently unused
    analytics-AnalyticsBatchDeleteRequest:
      type: object
      properties:
        funnelIds:
          type: array
          minItems: 0
          description: A list of funnels to delete
          items:
            type: string
            format: uuid
        segmentationIds:
          type: array
          minItems: 0
          description: A list of segmentations to delete
          items:
            type: string
            format: uuid
        trendIds:
          type: array
          minItems: 0
          description: A list of trends to delete
          items:
            type: string
            format: uuid
        metricIds:
          type: array
          minItems: 0
          description: A list of metrics to delete
          items:
            type: string
            format: uuid
        histogramIds:
          type: array
          minItems: 0
          description: A list of histograms to delete
          items:
            type: string
            format: uuid
        reportIds:
          type: array
          minItems: 0
          description: A list of reports to delete
          items:
            type: string
            format: uuid
        aggregateIds:
          type: array
          minItems: 0
          description: A list of aggregates to delete
          items:
            type: string
            format: uuid
        expressionIds:
          type: array
          minItems: 0
          description: A list of expressions to delete
          items:
            type: string
            format: uuid
        sankeyIds:
          type: array
          minItems: 0
          description: A list of sankey analyses to delete
          items:
            type: string
            format: uuid
      required:
        - aggregateIds
        - expressionIds
        - funnelIds
        - histogramIds
        - metricIds
        - reportIds
        - sankeyIds
        - segmentationIds
        - trendIds
    analytics-Meta:
      type: object
      description: Pagination metadata
      properties:
        links:
          type: array
          description: Links to the neighboring pages and the first page
          items:
            $ref: "#/components/schemas/analytics-Link"
        limit:
          type: integer
          format: int32
          description: Limit of items per page
        count:
          type: integer
          description: Currently unused
          nullable: true
      required:
        - links
        - limit
    analytics-Link:
      type: object
      properties:
        url:
          type: string
          description: URL of the page, used for navigation
        rel:
          type: string
          x-class-name: LinkRel
          description: The type of relation to the current page. `first` is always the first page.
          enum:
            - first
            - prev
            - next
      required:
        - rel
        - url
    analytics-MetricListItem:
      allOf:
        - type: object
          properties:
            action:
              $ref: "#/components/schemas/analytics-Action"
            actions:
              description: Event definitions
              type: array
              items:
                $ref: "#/components/schemas/analytics-Action"
            eventName:
              $ref: "#/components/schemas/analytics-ActionName"
            eventNames:
              description: Event definition names
              type: array
              items:
                $ref: "#/components/schemas/analytics-ActionName"
            actionId:
              $ref: "#/components/schemas/analytics-ActionId"
            actionIds:
              description: Event definition IDs
              type: array
              items:
                $ref: "#/components/schemas/analytics-ActionId"
            isNumber:
              $ref: "#/components/schemas/analytics-IsNumber"
            isMetricHistogram:
              $ref: "#/components/schemas/analytics-IsMetricHistogram"
            isReportMetric:
              $ref: "#/components/schemas/analytics-IsReportMetric"
        - $ref: "#/components/schemas/analytics-ListAnalyticsItemCommon"
    analytics-ListAnalyticsItemCommon:
      type: object
      description: Common elements retrieved in lists of analyses
      properties:
        id:
          $ref: "#/components/schemas/analytics-Id"
        name:
          $ref: "#/components/schemas/analytics-Name"
        author:
          $ref: "#/components/schemas/analytics-Author"
        updatedAt:
          $ref: "#/components/schemas/analytics-UpdatedAt"
        usedAt:
          $ref: "#/components/schemas/analytics-UsedAt"
        createdAt:
          $ref: "#/components/schemas/analytics-CreatedAt"
        directoryId:
          $ref: "#/components/schemas/analytics-DirectoryId"
        isDynamicAnalytic:
          $ref: "#/components/schemas/analytics-IsDynamicAnalytic"
        variables:
          $ref: "#/components/schemas/analytics-Variables"
      required:
        - author
        - createdAt
        - directoryId
        - id
        - isDynamicAnalytic
        - name
        - updatedAt
        - usedAt
        - variables
    analytics-Variables:
      type: array
      description: Dynamic keys used in this analysis
      items:
        $ref: "#/components/schemas/analytics-Variable"
    analytics-Variable:
      type: object
      properties:
        name:
          type: string
          description: The name of the variable (dynamic key) which will receive this value for the current calculation.
        value:
          description: |
            The value of the variable. Can be one of: string, integer, boolean, string[], integer[], or a DateFilter object (with type ABSOLUTE/RELATIVE).
          example: example-string-value
      required:
        - name
        - value
    analytics-IsDynamicAnalytic:
      type: boolean
      description: "`true` if the analysis contains any [dynamic values](https://hub.synerise.com/docs/analytics/i_events-parameter-value/#dynamic-key)."
    analytics-DirectoryId:
      type: string
      format: uuid
      description: Unique ID of the directory which contains this analysis. A 'default' directory is automatically created in every workspace.
    analytics-CreatedAt:
      type: string
      format: date-time
      description: Creation time
    analytics-UsedAt:
      type: string
      format: date-time
      description: The date and time when the item was last used
      nullable: true
    analytics-UpdatedAt:
      type: string
      format: date-time
      description: Last update time
    analytics-Author:
      type: object
      description: Data of the author of the analysis
      properties:
        id:
          $ref: "#/components/schemas/analytics-AuthorId"
        name:
          type: string
          description: Name of the author
        icon:
          type: string
          description: URL of the author's avatar icon
      required:
        - id
        - name
    analytics-AuthorId:
      type: integer
      format: int64
      description: Unique ID of the original creator. `1` means the resource was created by a request with workspace authorization.
    analytics-Name:
      type: string
      description: Name of the resource
    analytics-Id:
      type: string
      format: uuid
      description: Unique ID of the resource
    analytics-IsReportMetric:
      type: boolean
      description: "`true` when the metric can be used as a report metric (the expression references either client params or event params, but not both)"
    analytics-IsMetricHistogram:
      type: boolean
      description: "`true` when the metric can be used in a histogram"
    analytics-IsNumber:
      type: boolean
      description: "`true` when the metric is purely numerical (does not calculate any events, parameters, etc.)"
    analytics-ActionId:
      type: integer
      format: int64
      deprecated: true
      nullable: true
      description: Deprecated parameter. DO NOT use. Has no effect in create/update requests.
    analytics-ActionName:
      type: string
      description: Action name of the event.
      example: page.visit
    analytics-Action:
      type: object
      description: The analyzed event
      nullable: true
      required:
        - name
      properties:
        id:
          $ref: "#/components/schemas/analytics-ActionId"
        name:
          $ref: "#/components/schemas/analytics-ActionName"
    analytics-MetricRequest:
      type: object
      properties:
        analysis:
          $ref: "#/components/schemas/analytics-MetricAnalysis"
        inlineAnalytics:
          $ref: "#/components/schemas/analytics-InlineAnalytics"
    analytics-InlineAnalytics:
      type: array
      description: Analyses added to the request. They can be referenced by their ID in filters and expressions same as other analyses, but are not saved in persistent storage.
      items:
        $ref: "#/components/schemas/analytics-InlineAnalytic"
    analytics-InlineAnalytic:
      description: An inline analytic definition carried alongside a request so it can be referenced by id without being persisted.
      oneOf:
        - $ref: "#/components/schemas/analytics-InlineExpression"
        - $ref: "#/components/schemas/analytics-InlineSegmentation"
        - $ref: "#/components/schemas/analytics-InlineAggregate"
        - $ref: "#/components/schemas/analytics-InlineRunningAggregate"
        - $ref: "#/components/schemas/analytics-InlineMetric"
      discriminator:
        propertyName: analyticType
        mapping:
          EXPRESSION: "#/components/schemas/analytics-InlineExpression"
          SEGMENTATION: "#/components/schemas/analytics-InlineSegmentation"
          AGGREGATE: "#/components/schemas/analytics-InlineAggregate"
          RUNNING_AGGREGATE: "#/components/schemas/analytics-InlineRunningAggregate"
          METRIC: "#/components/schemas/analytics-InlineMetric"
    analytics-InlineMetric:
      type: object
      x-class-name: InlineMetric
      x-interface-name-ts: InlineMetric
      properties:
        id:
          $ref: "#/components/schemas/analytics-Id"
        analyticType:
          type: string
          enum:
            - METRIC
        analysis:
          $ref: "#/components/schemas/analytics-MetricAnalysis"
      required:
        - id
        - analyticType
        - analysis
    analytics-MetricAnalysis:
      type: object
      description: Structure of the analytical query
      properties:
        id:
          $ref: "#/components/schemas/analytics-AnalyticId"
        title:
          $ref: "#/components/schemas/analytics-Name"
        description:
          $ref: "#/components/schemas/analytics-Description"
        format:
          $ref: "#/components/schemas/analytics-MetricFormat"
        comparison:
          $ref: "#/components/schemas/analytics-MetricComparison"
        metricType:
          $ref: "#/components/schemas/analytics-MetricType"
        expression:
          $ref: "#/components/schemas/analytics-MetricExpressionContent"
        isVisibleForClientProfile:
          $ref: "#/components/schemas/analytics-IsVisibleForClientProfile"
        allowNull:
          $ref: "#/components/schemas/analytics-AllowNull"
        grouping:
          description: Defines how the results are returned
          type: array
          items:
            $ref: "#/components/schemas/analytics-ReportMetricGrouping"
      required:
        - id
        - title
        - description
        - format
        - comparison
        - metricType
        - expression
        - isVisibleForClientProfile
    analytics-ReportMetricGrouping:
      description: |
        The type and number of results to show. "TOP" shows the highest results. "LAST" shows the most recent results.
      discriminator:
        propertyName: type
        mapping:
          TOP: "#/components/schemas/analytics-TopReportMetricGrouping"
          LAST: "#/components/schemas/analytics-LastReportMetricGrouping"
      oneOf:
        - $ref: "#/components/schemas/analytics-TopReportMetricGrouping"
        - $ref: "#/components/schemas/analytics-LastReportMetricGrouping"
    analytics-LastReportMetricGrouping:
      type: object
      title: Last
      description: This type shows the most recent occurrences
      required:
        - type
        - last
      properties:
        type:
          title: LastReportMetricGroupingType
          x-class-name: LastReportMetricGroupingType
          type: string
          description: This type shows the most recent occurrences
          enum:
            - LAST
        last:
          type: integer
          description: The number of results to show in the report
    analytics-TopReportMetricGrouping:
      type: object
      title: Top
      required:
        - type
        - top
      properties:
        type:
          title: TopReportMetricGroupingType
          x-class-name: TopReportMetricGroupingType
          description: Returns the top results
          type: string
          enum:
            - TOP
        top:
          type: integer
          description: The number of results to show in the report
    analytics-AllowNull:
      type: boolean
      default: true
      description: When `true`, null values can be included in the results.
    analytics-IsVisibleForClientProfile:
      type: boolean
      description: When set to `true`, information about this analysis is shown on a profile's card.
    analytics-MetricExpressionContent:
      example:
        type: VALUE
        value:
          type: NUMBER
          value: 100
      discriminator:
        propertyName: type
        mapping:
          FUNCTION: "#/components/schemas/analytics-MetricExpressionContentFunction"
          VALUE: "#/components/schemas/analytics-MetricExpressionContentValue"
      oneOf:
        - $ref: "#/components/schemas/analytics-MetricExpressionContentFunction"
        - $ref: "#/components/schemas/analytics-MetricExpressionContentValue"
    analytics-MetricExpressionContentValue:
      type: object
      description: An expression to calculate
      properties:
        type:
          $ref: "#/components/schemas/analytics-MetricExpressionContentValueType"
        title:
          $ref: "#/components/schemas/analytics-Name"
        value:
          $ref: "#/components/schemas/analytics-MetricExpression"
    analytics-MetricExpression:
      discriminator:
        propertyName: type
        mapping:
          OPERATOR: "#/components/schemas/analytics-OperatorMetricExpression"
          NUMBER: "#/components/schemas/analytics-NumberMetricExpression"
          EVENT: "#/components/schemas/analytics-EventMetricExpression"
          CLIENT: "#/components/schemas/analytics-ClientMetricExpression"
          METRIC: "#/components/schemas/analytics-NestedMetricExpression"
      oneOf:
        - $ref: "#/components/schemas/analytics-ClientMetricExpression"
        - $ref: "#/components/schemas/analytics-EventMetricExpression"
        - $ref: "#/components/schemas/analytics-NestedMetricExpression"
        - $ref: "#/components/schemas/analytics-NumberMetricExpression"
        - $ref: "#/components/schemas/analytics-OperatorMetricExpression"
    analytics-OperatorMetricExpression:
      type: object
      x-class-name: OperatorMetricExpression
      x-interface-name-ts: OperatorMetricExpression
      properties:
        type:
          $ref: "#/components/schemas/analytics-MetricExpressionOperatorType"
        operator:
          $ref: "#/components/schemas/analytics-MetricOperator"
      required:
        - type
        - operator
    analytics-MetricOperator:
      type: string
      description: A mathematical/logical operator
      enum:
        - ADDITION_SIGN
        - SUBSTRACTION_SIGN
        - DIVISION_SIGN
        - MULTIPLICATION_SIGN
        - REMINDER
        - LEFT_BRACKET
        - RIGHT_BRACKET
    analytics-MetricExpressionOperatorType:
      type: string
      enum:
        - OPERATOR
    analytics-NumberMetricExpression:
      type: object
      x-class-name: NumberMetricExpression
      x-interface-name-ts: NumberMetricExpression
      properties:
        type:
          $ref: "#/components/schemas/analytics-MetricExpressionNumberType"
        value:
          description: The numeric value
          type: number
      required:
        - type
        - value
    analytics-MetricExpressionNumberType:
      type: string
      enum:
        - NUMBER
    analytics-NestedMetricExpression:
      type: object
      description: Reference to a metric
      x-class-name: NestedMetricExpression
      x-interface-name-ts: NestedMetricExpression
      properties:
        type:
          $ref: "#/components/schemas/analytics-MetricExpressionMetricType"
        id:
          $ref: "#/components/schemas/analytics-AnalyticId"
        title:
          type: string
          description: Can't be empty, can't contain whitespace only
      required:
        - type
        - id
        - title
    analytics-AnalyticId:
      type: string
      format: uuid
      description: |
        UUID of the analysis
      example: 5370bf3c-2dfa-4e89-98ff-07100cffee6c
    analytics-MetricExpressionMetricType:
      type: string
      enum:
        - METRIC
    analytics-EventMetricExpression:
      type: object
      x-class-name: EventMetricExpression
      description: An event metric
      x-interface-name-ts: EventMetricExpression
      properties:
        type:
          $ref: "#/components/schemas/analytics-MetricExpressionEventType"
        occurrenceType:
          $ref: "#/components/schemas/analytics-OccurrenceType"
        title:
          $ref: "#/components/schemas/analytics-Name"
        aggregation:
          $ref: "#/components/schemas/analytics-EventMetricAggregation"
        dateFilter:
          $ref: "#/components/schemas/analytics-DateFilter"
        action:
          $ref: "#/components/schemas/analytics-Action"
        filter:
          $ref: "#/components/schemas/analytics-ExpressionFilter"
        expressions:
          $ref: "#/components/schemas/analytics-EventExpressions"
        eventName:
          type: string
          description: Name (action) of the analyzed event
          nullable: true
      required:
        - type
        - occurrenceType
        - title
        - aggregation
        - dateFilter
        - action
        - filter
        - expressions
    analytics-EventExpressions:
      type: array
      description: An array of conditions that the event must meet
      items:
        $ref: "#/components/schemas/analytics-EventExpression"
    analytics-EventExpression:
      type: object
      description: The `attribute` object is an event attribute that must exist in the analyzed event. The `constraint` object is a condition that the attribute must meet.
      properties:
        constraint:
          $ref: "#/components/schemas/analytics-EventConstraint"
        attribute:
          $ref: "#/components/schemas/analytics-EventAttribute"
      required:
        - constrain
        - attribute
    analytics-EventAttribute:
      description: An event attribute to analyze
      discriminator:
        propertyName: type
        mapping:
          PARAM: "#/components/schemas/analytics-ParameterEventAttribute"
          RUNNING_AGGREGATE: "#/components/schemas/analytics-RunningAggregateEventAttribute"
          EXPRESSION: "#/components/schemas/analytics-ExpressionEventAttribute"
          SPECIAL: "#/components/schemas/analytics-SpecialEventAttribute"
          EMPTY: "#/components/schemas/analytics-EmptyEventAttribute"
      oneOf:
        - $ref: "#/components/schemas/analytics-ParameterEventAttribute"
        - $ref: "#/components/schemas/analytics-RunningAggregateEventAttribute"
        - $ref: "#/components/schemas/analytics-ExpressionEventAttribute"
        - $ref: "#/components/schemas/analytics-SpecialEventAttribute"
        - $ref: "#/components/schemas/analytics-EmptyEventAttribute"
    analytics-EmptyEventAttribute:
      type: object
      title: No attribute
      properties:
        type:
          x-class-name: EmptyEventAttributeType
          type: string
          enum:
            - EMPTY
          description: Can be used for analyses whose result isn't based on an attribute, such as `EXISTS`. **Can't be used with `constraint`**.
      required:
        - type
    analytics-SpecialEventAttribute:
      type: object
      title: Special property
      properties:
        type:
          x-class-name: SpecialEventAttributeType
          type: string
          enum:
            - SPECIAL
          description: This type lets you access special properties of an event.
        special:
          $ref: "#/components/schemas/analytics-SpecialTypeAttribute"
      required:
        - type
        - special
    analytics-SpecialTypeAttribute:
      type: string
      description: The type of special attribute you want to use
      enum:
        - TIMESTAMP
    analytics-ExpressionEventAttribute:
      type: object
      title: Expression
      properties:
        type:
          x-class-name: ExpressionEventAttributeType
          type: string
          enum:
            - EXPRESSION
          description: This type refers to expressions. You must provide the ID of the expression.
        id:
          type: string
          format: uuid
          description: ID of the expression
      required:
        - type
        - id
    analytics-RunningAggregateEventAttribute:
      type: object
      title: Event aggregate
      properties:
        type:
          x-class-name: RunningAggregateEventAttributeType
          type: string
          enum:
            - RUNNING_AGGREGATE
          description: This type refers to event aggregates. You must provide the ID of the aggregate.
        id:
          type: string
          format: uuid
          description: ID of the event aggregate
      required:
        - type
        - id
    analytics-ParameterEventAttribute:
      type: object
      title: Event parameter
      properties:
        type:
          x-class-name: ParamEventAttributeType
          enum:
            - PARAM
          description: This `type` refers to parameters in an event.
        param:
          type: string
          description: Name of the parameter
      required:
        - type
    analytics-EventConstraint:
      description: |
        This object defines the logic to apply to the `attribute`, and the values to compare it against (if required).

        **The analytics engine doesn't check if the data types match - you need to ensure that your data types are consistent in the data you send to the database**.
      discriminator:
        propertyName: type
        mapping:
          BOOL: "#/components/schemas/analytics-BoolConstraintEventConstraint"
          STRING_ZERO: "#/components/schemas/analytics-StringZeroConstraintEventConstraint"
          STRING_ONE: "#/components/schemas/analytics-StringOneConstraintEventConstraint"
          NUMBER_ONE: "#/components/schemas/analytics-NumberOneConstraintEventConstraint"
          NUMBER_TWO: "#/components/schemas/analytics-NumberTwoConstraintEventConstraint"
          STRING_ARRAY: "#/components/schemas/analytics-StringArrayConstraintEventConstraint"
          ARRAY_STRING_ONE_DEPRECATED: "#/components/schemas/analytics-StringArrayOneConstraintEventConstraint"
          "NULL": "#/components/schemas/analytics-NullConstraintEventConstraint"
          DATE_ZERO: "#/components/schemas/analytics-DateZeroConstraintEventConstraint"
          DATE_ONE: "#/components/schemas/analytics-DateOneConstraintEventConstraint"
          DATE_TWO: "#/components/schemas/analytics-DateTwoConstraintEventConstraint"
          DATE_FILTER: "#/components/schemas/analytics-DateFilterConstraintEventConstraint"
      oneOf:
        - $ref: "#/components/schemas/analytics-BoolConstraintEventConstraint"
        - $ref: "#/components/schemas/analytics-StringZeroConstraintEventConstraint"
        - $ref: "#/components/schemas/analytics-StringOneConstraintEventConstraint"
        - $ref: "#/components/schemas/analytics-NumberOneConstraintEventConstraint"
        - $ref: "#/components/schemas/analytics-NumberTwoConstraintEventConstraint"
        - $ref: "#/components/schemas/analytics-StringArrayConstraintEventConstraint"
        - $ref: "#/components/schemas/analytics-StringArrayOneConstraintEventConstraint"
        - $ref: "#/components/schemas/analytics-NullConstraintEventConstraint"
        - $ref: "#/components/schemas/analytics-DateZeroConstraintEventConstraint"
        - $ref: "#/components/schemas/analytics-DateOneConstraintEventConstraint"
        - $ref: "#/components/schemas/analytics-DateTwoConstraintEventConstraint"
        - $ref: "#/components/schemas/analytics-DateFilterConstraintEventConstraint"
    analytics-DateFilterConstraintEventConstraint:
      description: This type is used to check if a date matches a date filter.
      type: object
      title: Date filter
      properties:
        type:
          x-class-name: DateFilterConstraintType
          type: string
          description: This type is used to check if a date matches a date filter.
          enum:
            - DATE_FILTER
        logic:
          x-class-name: DateFilterConstraintLogic
          type: string
          enum:
            - DATE_FILTER
          description: Checks if the date from `attribute` matches a date filter.
        value:
          $ref: "#/components/schemas/analytics-DateFilter"
      required:
        - type
        - logic
        - value
    analytics-DateFilter:
      description: |
        Definition of a date filter. Only data that meets the result of the filter will be included in the analysis. For no filter, leave this object empty.

        An absolute date filter lets you define static dates and times that always apply to the analysis.

        A relative date filter lets you create a date filter that goes back a certain time from the moment of calculating the analysis.
      discriminator:
        propertyName: type
        mapping:
          ABSOLUTE: "#/components/schemas/analytics-AbsoluteDateFilter"
          RELATIVE: "#/components/schemas/analytics-RelativeDateFilter"
      oneOf:
        - $ref: "#/components/schemas/analytics-AbsoluteDateFilter"
        - $ref: "#/components/schemas/analytics-RelativeDateFilter"
    analytics-RelativeDateFilter:
      type: object
      title: RelativeDateFilter
      properties:
        type:
          title: RelativeDateFilterType
          x-class-name: RelativeDateFilterType
          x-interface-name-ts: RelativeDateFilterType
          type: string
          enum:
            - RELATIVE
          description: |
            Relative filters allow you to create a filter that depends on when the analysis is calculated. 

            - `duration` is the length of time that the filter covers.
            - `offset` is the time that the filter goes back to set the beginning of the duration.
        duration:
          $ref: "#/components/schemas/analytics-Period"
        offset:
          $ref: "#/components/schemas/analytics-Period"
        filter:
          $ref: "#/components/schemas/analytics-CustomDateFilter"
      required:
        - duration
        - offset
        - type
    analytics-CustomDateFilter:
      description: This object allows you to define a pattern for a more detailed time filter. These patterns are applied within the constraints of the `dateFilter` object that contains them, regardless of its type relative or absolute).
      oneOf:
        - $ref: "#/components/schemas/analytics-CustomDailyDateFilter"
        - $ref: "#/components/schemas/analytics-CustomWeeklyDateFilter"
        - $ref: "#/components/schemas/analytics-CustomMonthlyDateFilter"
      discriminator:
        propertyName: type
        mapping:
          DAILY: "#/components/schemas/analytics-CustomDailyDateFilter"
          WEEKLY: "#/components/schemas/analytics-CustomWeeklyDateFilter"
          MONTHLY: "#/components/schemas/analytics-CustomMonthlyDateFilter"
    analytics-CustomMonthlyDateFilter:
      type: object
      title: Monthly
      x-class-name: CustomMonthlyFilterType
      x-interface-name-ts: CustomMonthlyFilterType
      properties:
        type:
          type: string
          x-class-name: CustomMonthlyFilterType
          x-interface-name-ts: CustomMonthlyFilterType
          enum:
            - MONTHLY
          description: Monthly filters allow you to build rules for days of the month and/or weeks, including rules for different days of the week.
        nestingType:
          x-class-name: CustomMonthlyFilterNestingType
          type: string
          enum:
            - IN_PLACE
        rules:
          $ref: "#/components/schemas/analytics-DateRule"
      required:
        - nestingType
        - rules
        - type
    analytics-DateRule:
      description: A set of rules. Within a monthly filter, you can include a mixture of rules for days of the month and days of the week.
      oneOf:
        - $ref: "#/components/schemas/analytics-WeekDateRule"
        - $ref: "#/components/schemas/analytics-MonthDateRule"
      discriminator:
        propertyName: type
        mapping:
          WEEK: "#/components/schemas/analytics-WeekDateRule"
          MONTH: "#/components/schemas/analytics-MonthDateRule"
    analytics-MonthDateRule:
      type: object
      title: Days of the month
      x-class-name: MonthDateRule
      x-interface-name-ts: MonthDateRule
      properties:
        type:
          description: Rules for days of the month
          type: string
          x-class-name: MonthDateRuleType
          x-interface-name-ts: MonthDateRuleType
          enum:
            - MONTH
        days:
          type: array
          description: Days of the month included in the pattern.
          items:
            $ref: "#/components/schemas/analytics-DayOf"
        inverted:
          type: boolean
          default: false
          description: |
            When set to `true`, days are counted from the end of the month.

            For example, if `inverted` is true and `day` is set to 1, the rule applies to the last day of each month. This lets you take into account the varying length of months.  

            **NOTE:** Remember that this `inverted` field is not the same as the `inverted` field of each object in the `days` array.
      required:
        - days
        - type
    analytics-DayOf:
      type: object
      properties:
        day:
          type: integer
          description: The day that this rule applies to. In weekly patterns, `1` is Monday (Sunday if inverted).
        from:
          $ref: "#/components/schemas/analytics-DatePickerDayFrom"
        to:
          $ref: "#/components/schemas/analytics-DatePickerDayTo"
        mode:
          $ref: "#/components/schemas/analytics-DayOfMode"
        inverted:
          $ref: "#/components/schemas/analytics-DatePickerInverted"
      required:
        - day
        - from
        - inverted
        - to
    analytics-DatePickerInverted:
      type: boolean
      default: false
      description: "Inverts the pattern's timeframe. For example: if `from` is 12:00:00; `to` is 14:00:00; and `inverted` is true, the analysis does NOT include anything between 12:00:01 and 13:59:59."
    analytics-DayOfMode:
      type: string
      enum:
        - Range
        - Hour
    analytics-DatePickerDayTo:
      type: string
      description: Upper boundary of the pattern's timeframe, in HH:MM:SS format.
    analytics-DatePickerDayFrom:
      type: string
      description: Lower boundary of the pattern's timeframe, in HH:MM:SS format.
    analytics-WeekDateRule:
      type: object
      title: Days of the week
      x-class-name: WeekDateRule
      x-interface-name-ts: WeekDateRule
      properties:
        type:
          type: string
          x-class-name: WeekDateRuleType
          x-interface-name-ts: WeekDateRuleType
          enum:
            - WEEK
          description: Weekly filters limit the scope to days in a week
        weeks:
          type: array
          description: Weeks of the month included in the pattern
          items:
            $ref: "#/components/schemas/analytics-WeekOfMonth"
        inverted:
          type: boolean
          default: false
          description: |
            When set to `true`, weeks are counted from the end of the month.

            For example, if `inverted` is true and `week` is set to 1, the rule applies to the last week of each month. This lets you take into account the varying length of months.

            **NOTE:** Remember that this `inverted` field is not the same as the `inverted` field of each object in the `days` array of each week..
      required:
        - type
        - weeks
    analytics-WeekOfMonth:
      type: object
      properties:
        week:
          type: integer
          description: Number of the week. The direction of counting depends on the `inverted` boolean property of the ancestor object.
        days:
          type: array
          description: Days included in the pattern
          items:
            $ref: "#/components/schemas/analytics-DayOf"
      required:
        - days
        - type
    analytics-CustomWeeklyDateFilter:
      type: object
      title: Weekly
      x-class-name: CustomWeeklyFilter
      x-interface-name-ts: CustomWeeklyFilter
      properties:
        type:
          type: string
          x-class-name: CustomWeeklyFilterType
          x-interface-name-ts: CustomWeeklyFilterType
          enum:
            - WEEKLY
          description: Weekly filters let you define separate rules for each day of the week.
        nestingType:
          x-class-name: CustomWeeklyFilterNestingType
          type: string
          enum:
            - IN_PLACE
        days:
          $ref: "#/components/schemas/analytics-WeeklyDays"
      required:
        - days
        - nestingType
        - type
    analytics-WeeklyDays:
      type: array
      description: An array of rules for different days of the week.
      items:
        $ref: "#/components/schemas/analytics-DayOf"
    analytics-CustomDailyDateFilter:
      type: object
      title: Daily
      x-class-name: CustomDailyFilter
      x-interface-name-ts: CustomDailyFilter
      properties:
        type:
          type: string
          x-class-name: CustomDailyFilterType
          x-interface-name-ts: CustomDailyFilterType
          enum:
            - DAILY
          description: Daily filters limit the data scope to a range of hours every day.
        nestingType:
          x-class-name: CustomDailyFilterNestingType
          type: string
          enum:
            - IN_PLACE
        from:
          $ref: "#/components/schemas/analytics-DatePickerDayFrom"
        to:
          $ref: "#/components/schemas/analytics-DatePickerDayTo"
        inverted:
          $ref: "#/components/schemas/analytics-DatePickerInverted"
      required:
        - nestingType
        - type
        - from
        - to
    analytics-Period:
      type: object
      description: The definition of a length of time.
      properties:
        type:
          $ref: "#/components/schemas/analytics-TimePeriod"
        value:
          $ref: "#/components/schemas/analytics-TimeValue"
      required:
        - type
        - value
    analytics-TimeValue:
      type: integer
      description: The number of time units
      format: int64
    analytics-TimePeriod:
      type: string
      x-class-name: TimePeriod
      x-interface-name-ts: TimePeriod
      description: The unit of time
      enum:
        - YEARS
        - MONTHS
        - WEEKS
        - DAYS
        - HOURS
        - MINUTES
        - SECONDS
        - UNKNOWN
    analytics-AbsoluteDateFilter:
      type: object
      title: AbsoluteDateFilter
      properties:
        type:
          title: AbsoluteDateFilterType
          x-class-name: AbsoluteDateFilterType
          x-interface-name-ts: AbsoluteDateFilterType
          type: string
          enum:
            - ABSOLUTE
          description: Absolute filters have the same start and end regardless of when the analysis is calculated.
        from:
          type: string
          format: date-time
          description: The lower boundary of the date filter.
        to:
          type: string
          format: date-time
          description: The upper boundary of the date filter. Must be later than `from`.
        filter:
          $ref: "#/components/schemas/analytics-CustomDateFilter"
      required:
        - type
    analytics-DateTwoConstraintEventConstraint:
      description: This type is used to check if a date is between two other dates.
      type: object
      title: Date range
      properties:
        type:
          x-class-name: DateTwoConstraintType
          type: string
          description: This type is used to check if a date is between two other dates.
          enum:
            - DATE_TWO
        logic:
          x-class-name: DateTwoConstraintLogic
          type: string
          description: Checks if the date from `attribute` is between the dates from `value1` and `value2`.
          enum:
            - BETWEEN
        value1:
          $ref: "#/components/schemas/analytics-EventValue"
        value2:
          $ref: "#/components/schemas/analytics-EventValue"
      required:
        - type
        - logic
        - value1
        - value2
    analytics-EventValue:
      description: The value to test `attribute` against.
      discriminator:
        propertyName: type
        mapping:
          CONSTANT: "#/components/schemas/analytics-ConstantValue"
          EVENT: "#/components/schemas/analytics-EventParameter"
          CLIENT: "#/components/schemas/analytics-ClientParameter"
          VARIABLE: "#/components/schemas/analytics-VariableValue"
      oneOf:
        - $ref: "#/components/schemas/analytics-ConstantValue"
        - $ref: "#/components/schemas/analytics-EventParameter"
        - $ref: "#/components/schemas/analytics-ClientParameter"
        - $ref: "#/components/schemas/analytics-VariableValue"
    analytics-VariableValue:
      type: object
      title: Dynamic value
      properties:
        type:
          x-class-name: VariableValueType
          type: string
          enum:
            - VARIABLE
          description: |
            This type is called a Dynamic Key in the Synerise Portal. It can be used to let other analytic components, such as dashboards, insert a value.

            The variable value can't:
              - be longer than 21000 characters if it's a string
              - be larger than 65000 items if it's an array. Strings in the array can't be longer than 21000 characters.
        name:
          type: string
          description: The name of the dynamic key
        defaultValue:
          type: string
          maxLength: 21000
          description: The default value to use
      required:
        - type
        - name
        - defaultValue
    analytics-ClientParameter:
      type: object
      title: Profile attribute
      properties:
        type:
          description: References a profile attribute, including analyses.
          x-class-name: ClientEventValueType
          type: string
          enum:
            - CLIENT
        attribute:
          $ref: "#/components/schemas/analytics-ClientAttribute"
      required:
        - type
        - attribute
    analytics-ClientAttribute:
      description: A profile attribute to analyze
      discriminator:
        propertyName: type
        mapping:
          PARAM: "#/components/schemas/analytics-ClientParamAttribute"
          TAG: "#/components/schemas/analytics-ClientTagAttribute"
          AGGREGATE: "#/components/schemas/analytics-ClientAggregateAttribute"
          SEGMENTATION: "#/components/schemas/analytics-ClientSegmentationAttribute"
          EXPRESSION: "#/components/schemas/analytics-ClientExpressionAttribute"
          SPECIAL: "#/components/schemas/analytics-ClientSpecialAttribute"
          EMPTY: "#/components/schemas/analytics-ClientEmptyAttribute"
      oneOf:
        - $ref: "#/components/schemas/analytics-ClientParamAttribute"
        - $ref: "#/components/schemas/analytics-ClientTagAttribute"
        - $ref: "#/components/schemas/analytics-ClientAggregateAttribute"
        - $ref: "#/components/schemas/analytics-ClientSegmentationAttribute"
        - $ref: "#/components/schemas/analytics-ClientExpressionAttribute"
        - $ref: "#/components/schemas/analytics-ClientSpecialAttribute"
        - $ref: "#/components/schemas/analytics-ClientEmptyAttribute"
    analytics-ClientEmptyAttribute:
      type: object
      properties:
        type:
          $ref: "#/components/schemas/analytics-ClientAttributeEmptyType"
      required:
        - type
    analytics-ClientAttributeEmptyType:
      type: string
      enum:
        - EMPTY
    analytics-ClientSpecialAttribute:
      type: object
      description: Reference to a special parameter
      properties:
        type:
          $ref: "#/components/schemas/analytics-ClientAttributeSpecialType"
        special:
          type: string
          description: The name of the special parameter
      required:
        - type
        - special
    analytics-ClientAttributeSpecialType:
      type: string
      enum:
        - SPECIAL
    analytics-ClientExpressionAttribute:
      type: object
      description: Pointer to an expression
      properties:
        type:
          $ref: "#/components/schemas/analytics-ClientAttributeExpressionType"
        id:
          $ref: "#/components/schemas/analytics-AnalyticId"
      required:
        - type
        - id
    analytics-ClientAttributeExpressionType:
      type: string
      enum:
        - EXPRESSION
    analytics-ClientSegmentationAttribute:
      type: object
      description: Reference to a segmentation
      properties:
        type:
          $ref: "#/components/schemas/analytics-ClientAttributeSegmentationType"
        id:
          $ref: "#/components/schemas/analytics-AnalyticId"
      required:
        - type
        - id
    analytics-ClientAttributeSegmentationType:
      type: string
      enum:
        - SEGMENTATION
    analytics-ClientAggregateAttribute:
      type: object
      properties:
        type:
          $ref: "#/components/schemas/analytics-ClientAttributeAggregateType"
        uuid:
          $ref: "#/components/schemas/analytics-AnalyticId"
        id:
          $ref: "#/components/schemas/analytics-AnalyticId"
      required:
        - type
        - uuid
        - id
    analytics-ClientAttributeAggregateType:
      type: string
      enum:
        - AGGREGATE
    analytics-ClientTagAttribute:
      type: object
      description: Reference to a tag
      properties:
        type:
          $ref: "#/components/schemas/analytics-ClientAttributeTagType"
        tag:
          description: Name of the tag
          type: string
      required:
        - type
        - tag
    analytics-ClientAttributeTagType:
      type: string
      enum:
        - TAG
    analytics-ClientParamAttribute:
      type: object
      properties:
        type:
          $ref: "#/components/schemas/analytics-ClientAttributeParamType"
        param:
          description: Name of the parameter
          type: string
      required:
        - type
        - param
    analytics-ClientAttributeParamType:
      type: string
      enum:
        - PARAM
    analytics-EventParameter:
      type: object
      title: Event parameter
      description: Inserts an event parameter value
      properties:
        type:
          x-class-name: EventParameterType
          description: Inserts an event parameter value
          type: string
          enum:
            - EVENT
        attribute:
          $ref: "#/components/schemas/analytics-EventAttribute"
      required:
        - type
        - attribute
    analytics-ConstantValue:
      type: object
      title: Static value
      description: Inserts a static value.
      properties:
        type:
          x-class-name: ConstantValueType
          type: string
          description: Inserts a static value.
          enum:
            - CONSTANT
        constant:
          $ref: "#/components/schemas/analytics-ConstantValueConstant"
      required:
        - type
        - constant
    analytics-ConstantValueConstant:
      description: |
        The value can't:
          - be longer than 21000 characters if it's a string
          - be larger than 65000 items if it's an array. Strings in the array can't be longer than 21000 characters.
      oneOf:
        - type: string
          maxLength: 21000
        - type: number
        - type: boolean
        - type: array
          maxItems: 65000
          items:
            type: string
            maxLength: 21000
    analytics-DateOneConstraintEventConstraint:
      description: This type is used to check `attribute` against a date.
      type: object
      title: Date
      properties:
        type:
          x-class-name: DateOneConstraintType
          type: string
          description: This type is used to check `attribute` against a date.
          enum:
            - DATE_ONE
        logic:
          x-class-name: DateOneConstraintLogic
          type: string
          description: Checks how the date from `attribute` compares to the one in `value`. For example, MORE returns true if `attribute` is the later date.
          enum:
            - LESS
            - MORE
            - LESS_OR_EQUAL
            - MORE_OR_EQUAL
        value:
          $ref: "#/components/schemas/analytics-EventValue"
      required:
        - type
        - logic
        - value
    analytics-DateZeroConstraintEventConstraint:
      type: object
      title: Current date
      properties:
        type:
          x-class-name: DateZeroConstraintType
          type: string
          enum:
            - DATE_ZERO
          description: Compare a date from `attribute` to the current date
        logic:
          x-class-name: LogicZeroConstraintLogic
          type: string
          enum:
            - MATCHES_CURRENT_DAY
            - MATCHES_CURRENT_HOUR
            - MATCHES_CURRENT_MONTH
            - MATCHES_CURRENT_YEAR
          description: Logic to apply to the date from `attribute`
      required:
        - type
        - logic
    analytics-NullConstraintEventConstraint:
      type: object
      title: Check if null
      properties:
        type:
          x-class-name: NullConstraintType
          description: This type is used to check if a value is null
          type: string
          enum:
            - "NULL"
        logic:
          x-class-name: NullConstraintLogic
          type: string
          description: Checks if the attribute is or isn't null. Empty strings, `0`, and negative numbers are NOT null. String `"null"` is NOT null.
          enum:
            - IS_NULL
            - IS_NOT_NULL
      required:
        - type
        - logic
    analytics-StringArrayOneConstraintEventConstraint:
      type: object
      title: Other string array tests
      properties:
        type:
          x-class-name: ArrayStringOneConstraintType
          type: string
          enum:
            - ARRAY_STRING_ONE_DEPRECATED
          description: "`value` should be an array"
        logic:
          x-class-name: ArrayStringOneConstraintLogic
          type: string
          description: |
            - CONTAIN/NOT_CONTAIN test if any item in the array contains/doesn't contain the value from `attribute`
            - EQUAL/NOT_EQUAL test if any item in the array is/isn't identical to the value from `attribute`
            - STARTS_WITH/ENDS_WITH test if any item in the array starts/ends with the value from `attribute`
            - REGEXP tests if any item in the array matches the regular expression from `attribute`
          enum:
            - CONTAIN
            - NOT_CONTAIN
            - EQUAL
            - NOT_EQUAL
            - STARTS_WITH
            - REGEXP
            - ENDS_WITH
        value:
          $ref: "#/components/schemas/analytics-EventValue"
      required:
        - type
        - logic
        - value
    analytics-StringArrayConstraintEventConstraint:
      type: object
      title: Check if string in array
      properties:
        type:
          x-class-name: StringArrayConstraintType
          type: string
          enum:
            - STRING_ARRAY
          description: This type is used to check if a string exists in an array defined in `value`
        logic:
          type: string
          x-class-name: StringArrayConstraintLogic
          description: You can check if the value from `attribute` is in the array defined in `value`
          enum:
            - IN
            - NOT_IN
        value:
          $ref: "#/components/schemas/analytics-EventValue"
      required:
        - type
        - logic
        - value
    analytics-NumberTwoConstraintEventConstraint:
      type: object
      title: Two numbers
      properties:
        type:
          x-class-name: NumberTwoConstraintType
          type: string
          enum:
            - NUMBER_TWO
          description: Checks if the `attribute` is between two numbers, defined in `value1` and `value2`.
        logic:
          description: Checks if the attribute is between two numbers.
          x-class-name: NumberTwoConstraintLogic
          type: string
          enum:
            - BETWEEN
        value1:
          $ref: "#/components/schemas/analytics-EventValue"
        value2:
          $ref: "#/components/schemas/analytics-EventValue"
      required:
        - type
        - logic
        - value1
        - value2
    analytics-NumberOneConstraintEventConstraint:
      type: object
      title: Number
      properties:
        type:
          x-class-name: NumberOneConstraintType
          type: string
          enum:
            - NUMBER_ONE
          description: This type is used to test values that are a single number
        logic:
          x-class-name: NumberOneConstraintLogic
          type: string
          description: Logic of the test. For example, if the logic is `EQUAL` and the `value` returns 15, the expression checks if the `attribute` (sibling object to `constraint`) is 15.
          enum:
            - EQUAL
            - NOT_EQUAL
            - LESS
            - MORE
            - MORE_OR_EQUAL
            - LESS_OR_EQUAL
        value:
          $ref: "#/components/schemas/analytics-EventValue"
      required:
        - type
        - logic
        - value
    analytics-StringOneConstraintEventConstraint:
      type: object
      title: String
      properties:
        type:
          x-class-name: StringOneConstraintType
          type: string
          enum:
            - STRING_ONE
          description: This type is used to test values that are a single string.
        logic:
          x-class-name: StringOneConstraintLogic
          type: string
          description: Logic of the test. For example, if the logic is `CONTAIN` and the `value` returns "foo", the expression checks if the `attribute` (sibling object to `constraint`) contains the string "foo".
          enum:
            - CONTAIN
            - NOT_CONTAIN
            - EQUAL
            - NOT_EQUAL
            - STARTS_WITH
            - REGEXP
            - ENDS_WITH
        value:
          $ref: "#/components/schemas/analytics-EventValue"
      required:
        - type
        - logic
        - value
    analytics-StringZeroConstraintEventConstraint:
      type: object
      title: Check empty
      description: This type is used to check if a string is empty.
      properties:
        type:
          title: String zero
          x-class-name: StringZeroConstraintType
          type: string
          description: This type is used to check if a string is empty.
          enum:
            - STRING_ZERO
        logic:
          x-class-name: StringZeroConstraintLogic
          type: string
          description: Checks if a string is empty (zero-length). Null value is considered empty. A string of whitespace characters is NOT empty.
          enum:
            - IS_EMPTY
            - IS_NOT_EMPTY
      required:
        - type
        - logic
    analytics-BoolConstraintEventConstraint:
      type: object
      title: Boolean
      properties:
        type:
          x-class-name: BoolConstraintType
          type: string
          enum:
            - BOOL
          description: Tests a boolean value
        logic:
          x-class-name: BoolConstraintLogic
          type: string
          description: Boolean logic. Empty (zero-length) strings, `0`, and `"0"` are considered false. Null values are false.
          enum:
            - IS_TRUE
            - IS_FALSE
      required:
        - type
        - logic
    analytics-ExpressionFilter:
      type: object
      description: |
        This filter lets you limit the results to profiles that match it. For no filter, leave the object empty.  

        The `expression` object is only used by the Synerise Web Portal. If you're integrating an API, don't send this object or send it empty. If you send `expression` and `expressions`, `expressions` takes priority.
      properties:
        matching:
          $ref: "#/components/schemas/analytics-matching"
        expressions:
          type: array
          description: Profile filter details. The expressions are applied according to their position in the array. The logical AND/OR operator must be placed between expressions. An empty array means no filters are applied.
          items:
            $ref: "#/components/schemas/analytics-FilterBox"
        expression:
          $ref: "#/components/schemas/analytics-FilterExpressionContent"
        groupBy:
          type: array
          items:
            $ref: "#/components/schemas/analytics-ClientValue"
      required:
        - matching
        - expressions
        - expression
    analytics-ClientValue:
      discriminator:
        propertyName: type
        mapping:
          CONSTANT: "#/components/schemas/analytics-ConstantClientValue"
          CLIENT: "#/components/schemas/analytics-ClientAttributeValue"
          VARIABLE: "#/components/schemas/analytics-VariableClientValue"
      oneOf:
        - $ref: "#/components/schemas/analytics-ConstantClientValue"
        - $ref: "#/components/schemas/analytics-ClientAttributeValue"
        - $ref: "#/components/schemas/analytics-VariableClientValue"
    analytics-VariableClientValue:
      type: object
      title: Dynamic value
      properties:
        type:
          x-class-name: VariableClientValueType
          type: string
          description: This type is called a Dynamic Key in the Synerise Portal. It can be used to let other analytic components, such as dashboards, insert a value.
          enum:
            - VARIABLE
        name:
          type: string
          description: The name of the dynamic key
        defaultValue:
          description: The default value to use
          oneOf:
            - type: string
            - type: number
            - type: array
              items: {}
      required:
        - type
        - name
        - defaultValue
    analytics-ClientAttributeValue:
      type: object
      title: Profile attribute
      properties:
        type:
          x-class-name: ClientClientValueType
          type: string
          enum:
            - CLIENT
          description: Definition of a profile attribute
        attribute:
          $ref: "#/components/schemas/analytics-ClientAttribute"
      required:
        - type
        - attribute
    analytics-ConstantClientValue:
      type: object
      title: Static value
      description: Inserts a static value.
      properties:
        type:
          x-class-name: ConstantClientValueType
          type: string
          description: Inserts a static value.
          enum:
            - CONSTANT
        constant:
          description: |
            The value can't:
              - be longer than 21000 characters if it's a string
              - be larger than 65000 items if it's an array. Strings in the array can't be longer than 21000 characters.
          oneOf:
            - type: string
            - type: number
            - type: boolean
            - type: array
              items:
                type: string
      required:
        - type
        - constant
    analytics-FilterExpressionContent:
      deprecated: true
      example:
        type: EMPTY
      discriminator:
        propertyName: type
        mapping:
          FUNCTION: "#/components/schemas/analytics-FilterExpressionFunction"
          ATTRIBUTE: "#/components/schemas/analytics-AttributeFilterExpressionContent"
          FUNNEL: "#/components/schemas/analytics-FunnelFilterExpressionContent"
          EXPRESSION: "#/components/schemas/analytics-ExpressionFilterExpressionContent"
          EMPTY: "#/components/schemas/analytics-EmptyFilterExpressionContent"
      oneOf:
        - $ref: "#/components/schemas/analytics-FilterExpressionFunction"
        - $ref: "#/components/schemas/analytics-AttributeFilterExpressionContent"
        - $ref: "#/components/schemas/analytics-FunnelFilterExpressionContent"
        - $ref: "#/components/schemas/analytics-ExpressionFilterExpressionContent"
        - $ref: "#/components/schemas/analytics-EmptyFilterExpressionContent"
    analytics-EmptyFilterExpressionContent:
      description: An empty value
      type: object
      properties:
        type:
          description: An empty value
          x-class-name: EmptyFilterExpressionContentType
          type: string
          enum:
            - EMPTY
        name:
          type: string
      required:
        - type
    analytics-ExpressionFilterExpressionContent:
      description: Definition of a profile filter
      type: object
      properties:
        type:
          x-class-name: ExpressionFilterExpressionContentType
          type: string
          enum:
            - EXPRESSION
        name:
          type: string
        matching:
          $ref: "#/components/schemas/analytics-matching"
        expressions:
          description: Profile filter details. The expressions are applied according to their position in the array. The logical AND/OR operator must be placed between expressions. An empty array means no filters are applied.
          type: array
          items:
            $ref: "#/components/schemas/analytics-FilterBox"
        expression:
          $ref: "#/components/schemas/analytics-FilterExpressionContent"
      required:
        - type
        - expressions
    analytics-FilterBox:
      discriminator:
        propertyName: type
        mapping:
          ATTRIBUTE: "#/components/schemas/analytics-AttributeFilterBox"
          EXPRESSION: "#/components/schemas/analytics-ExpressionFilterBox"
          FUNNEL: "#/components/schemas/analytics-FunnelFilterBox"
          OPERATOR: "#/components/schemas/analytics-OperatorFilterBox"
      oneOf:
        - $ref: "#/components/schemas/analytics-AttributeFilterBox"
        - $ref: "#/components/schemas/analytics-ExpressionFilterBox"
        - $ref: "#/components/schemas/analytics-FunnelFilterBox"
        - $ref: "#/components/schemas/analytics-OperatorFilterBox"
    analytics-OperatorFilterBox:
      type: object
      properties:
        type:
          description: Logical operator between expressions
          x-class-name: OperatorFilterBoxType
          type: string
          enum:
            - OPERATOR
        name:
          $ref: "#/components/schemas/analytics-Name"
        logic:
          x-class-name: FilterBoxOperatorType
          type: string
          enum:
            - OR
            - AND
            - LEFT_BRACKET
            - RIGHT_BRACKET
      required:
        - type
        - name
        - logic
    analytics-FunnelFilterBox:
      type: object
      properties:
        type:
          description: Tests against a funnel
          x-class-name: ExpressionFilterBoxType
          type: string
          enum:
            - FUNNEL
        name:
          $ref: "#/components/schemas/analytics-Name"
        matching:
          $ref: "#/components/schemas/analytics-matching"
        funnel:
          $ref: "#/components/schemas/analytics-Funnel"
      required:
        - type
        - funnel
    analytics-Funnel:
      type: object
      description: Funnel conditions
      properties:
        title:
          type: string
          description: Title of the funnel.
        completedWithin:
          $ref: "#/components/schemas/analytics-CompletedWithin"
        dateFilter:
          $ref: "#/components/schemas/analytics-DateFilter"
        steps:
          type: array
          minItems: 0
          description: An array of steps in the funnel. The order of the steps in the array determines the order of their analysis (that is, the step at index 0 is the first step, the step at index 1 is the second step, and so on).
          items:
            $ref: "#/components/schemas/analytics-FunnelStep"
        exact:
          type: boolean
          default: false
          description: |
            When true, the profile's events must be exactly as in the funnel. For example, if the profile's history has events `A -> B -> C -> D`, and the funnel is `A -> C -> D`, the match is not exact, because there is an event between A and C.
      required:
        - title
        - steps
    analytics-FunnelStep:
      type: object
      properties:
        title:
          type: string
          description: The name of the step
        action:
          $ref: "#/components/schemas/analytics-Action"
        expressions:
          $ref: "#/components/schemas/analytics-EventExpressions"
      required:
        - action
        - title
        - expressions
    analytics-CompletedWithin:
      type: object
      description: |
        Time constraint for completing all the steps in the funnel. Timer starts
        when the first step is triggered.

        - `period` sets the time unit
        - `value` sets the number of time units
      properties:
        period:
          $ref: "#/components/schemas/analytics-TimePeriod"
        value:
          description: The number of time units
          type: number
          format: int64
    analytics-matching:
      type: boolean
      description: When `true`, the results include only data that matched the condition. When `false`, the results include only data that did not match the condition.
      default: true
    analytics-ExpressionFilterBox:
      description: A condition to test
      type: object
      properties:
        type:
          description: A condition to test
          x-class-name: ExpressionFilterBoxType
          type: string
          enum:
            - EXPRESSION
        name:
          type: string
        matching:
          type: boolean
        expressions:
          $ref: "#/components/schemas/analytics-FilterBox"
      required:
        - type
        - expressions
    analytics-AttributeFilterBox:
      type: object
      properties:
        type:
          x-class-name: AttributeFilterBoxType
          type: string
          enum:
            - ATTRIBUTE
          description: Tests a profile attribute against a condition
        name:
          $ref: "#/components/schemas/analytics-Name"
        matching:
          $ref: "#/components/schemas/analytics-matching"
        attribute:
          $ref: "#/components/schemas/analytics-Attribute"
    analytics-Attribute:
      type: object
      description: The condition to test a profile attribute
      properties:
        expressions:
          $ref: "#/components/schemas/analytics-ClientExpressions"
      required:
        - expressions
    analytics-ClientExpressions:
      type: array
      description: An array of conditions. All conditions must be met.
      items:
        $ref: "#/components/schemas/analytics-ClientExpression"
    analytics-ClientExpression:
      type: object
      properties:
        constraint:
          $ref: "#/components/schemas/analytics-ClientConstraint"
        attribute:
          $ref: "#/components/schemas/analytics-ClientAttribute"
    analytics-ClientConstraint:
      discriminator:
        propertyName: type
        mapping:
          BOOL: "#/components/schemas/analytics-BoolConstraintClientConstraint"
          STRING_ZERO: "#/components/schemas/analytics-StringZeroConstraintClientConstraint"
          STRING_ONE: "#/components/schemas/analytics-StringOneConstraintClientConstraint"
          NUMBER_ONE: "#/components/schemas/analytics-NumberOneConstraintClientConstraint"
          NUMBER_TWO: "#/components/schemas/analytics-NumberTwoConstraintClientConstraint"
          STRING_ARRAY: "#/components/schemas/analytics-StringArrayConstraintClientConstraint"
          ARRAY_STRING_ONE_DEPRECATED: "#/components/schemas/analytics-StringArrayOneConstraintClientConstraint"
          "NULL": "#/components/schemas/analytics-NullConstraintClientConstraint"
          DATE_ZERO: "#/components/schemas/analytics-DateZeroConstraintClientConstraint"
          DATE_ONE: "#/components/schemas/analytics-DateOneConstraintClientConstraint"
          DATE_TWO: "#/components/schemas/analytics-DateTwoConstraintClientConstraint"
          DATE_FILTER: "#/components/schemas/analytics-DateFilterConstraintClientConstraint"
      oneOf:
        - $ref: "#/components/schemas/analytics-BoolConstraintClientConstraint"
        - $ref: "#/components/schemas/analytics-StringZeroConstraintClientConstraint"
        - $ref: "#/components/schemas/analytics-StringOneConstraintClientConstraint"
        - $ref: "#/components/schemas/analytics-NumberOneConstraintClientConstraint"
        - $ref: "#/components/schemas/analytics-NumberTwoConstraintClientConstraint"
        - $ref: "#/components/schemas/analytics-StringArrayConstraintClientConstraint"
        - $ref: "#/components/schemas/analytics-StringArrayOneConstraintClientConstraint"
        - $ref: "#/components/schemas/analytics-NullConstraintClientConstraint"
        - $ref: "#/components/schemas/analytics-DateZeroConstraintClientConstraint"
        - $ref: "#/components/schemas/analytics-DateOneConstraintClientConstraint"
        - $ref: "#/components/schemas/analytics-DateTwoConstraintClientConstraint"
        - $ref: "#/components/schemas/analytics-DateFilterConstraintClientConstraint"
    analytics-DateFilterConstraintClientConstraint:
      type: object
      title: Date filter
      description: This type is used to check if a date matches a date filter.
      properties:
        type:
          x-class-name: DateFilterClientConstraintType
          type: string
          description: This type is used to check if a date matches a date filter.
          enum:
            - DATE_FILTER
        logic:
          description: Checks if the date from `attribute` matches a date filter.
          x-class-name: DateFilterClientConstraintLogic
          type: string
          enum:
            - DATE_FILTER
        value:
          $ref: "#/components/schemas/analytics-DateFilter"
      required:
        - type
        - logic
        - value
    analytics-DateTwoConstraintClientConstraint:
      description: This type is used to check if a date is between two other dates.
      type: object
      title: Date range
      properties:
        type:
          x-class-name: DateTwoClientConstraintType
          type: string
          description: This type is used to check if a date is between two other dates.
          enum:
            - DATE_TWO
        logic:
          description: Checks if the date from `attribute` is between the dates from `value1` and `value2`.
          x-class-name: DateTwoClientConstraintLogic
          type: string
          enum:
            - BETWEEN
        value1:
          $ref: "#/components/schemas/analytics-ClientValue"
        value2:
          $ref: "#/components/schemas/analytics-ClientValue"
      required:
        - type
        - logic
        - value1
        - value2
    analytics-DateOneConstraintClientConstraint:
      description: This type is used to check `attribute` against a date.
      type: object
      title: Date
      properties:
        type:
          x-class-name: DateOneClientConstraintType
          type: string
          description: This type is used to check `attribute` against a date.
          enum:
            - DATE_ONE
        logic:
          description: Checks how the date from `attribute` compares to the one in `value`. For example, MORE returns true if `attribute` is the later date.
          x-class-name: DateOneClientConstraintLogic
          type: string
          enum:
            - LESS
            - MORE
            - LESS_OR_EQUAL
            - MORE_OR_EQUAL
        value:
          $ref: "#/components/schemas/analytics-ClientValue"
      required:
        - type
        - logic
        - value
    analytics-DateZeroConstraintClientConstraint:
      type: object
      title: Current date
      properties:
        type:
          description: Compare a date from `attribute` to the current date
          x-class-name: DateZeroClientConstraintType
          type: string
          enum:
            - DATE_ZERO
        logic:
          description: Logic to apply to the date from `attribute`
          x-class-name: DateZeroClientConstraintLogic
          type: string
          enum:
            - MATCHES_CURRENT_DAY
            - MATCHES_CURRENT_HOUR
            - MATCHES_CURRENT_MONTH
            - MATCHES_CURRENT_YEAR
      required:
        - type
        - logic
    analytics-NullConstraintClientConstraint:
      type: object
      title: Check if null
      properties:
        type:
          x-class-name: NullClientConstraintType
          type: string
          enum:
            - "NULL"
          description: This type is used to check if a value is null
        logic:
          description: Checks if the attribute is or isn't null. Empty strings, `0`, and negative numbers are NOT null. String `"null"` is NOT null.
          x-class-name: NullClientConstraintLogic
          type: string
          enum:
            - IS_NULL
            - IS_NOT_NULL
      required:
        - type
        - logic
    analytics-StringArrayOneConstraintClientConstraint:
      type: object
      title: Other string array tests
      properties:
        type:
          description: "`value` should be an array"
          x-class-name: ArrayStringOneClientConstraintType
          type: string
          enum:
            - ARRAY_STRING_ONE_DEPRECATED
        logic:
          description: "- CONTAIN/NOT_CONTAIN test if any item in the array contains/doesn't contain the value from `attribute` - EQUAL/NOT_EQUAL test if any item in the array is/isn't identical to the value from `attribute` - STARTS_WITH/ENDS_WITH test if any item in the array starts/ends with the value from `attribute` - REGEXP tests if any item in the array matches the regular expression from `attribute` "
          x-class-name: ArrayStringOneClientConstraintLogic
          type: string
          enum:
            - CONTAIN
            - NOT_CONTAIN
            - EQUAL
            - NOT_EQUAL
            - STARTS_WITH
            - REGEXP
            - ENDS_WITH
        value:
          $ref: "#/components/schemas/analytics-ClientValue"
      required:
        - type
        - logic
        - value
    analytics-StringArrayConstraintClientConstraint:
      type: object
      title: Check if string in array
      properties:
        type:
          description: This type is used to check if a string exists in an array defined in `value`
          x-class-name: StringArrayClientConstraintType
          type: string
          enum:
            - STRING_ARRAY
        logic:
          description: You can check if the value from `attribute` is in the array defined in `value`
          x-class-name: StringArrayClientConstraintLogic
          type: string
          enum:
            - IN
            - NOT_IN
        value:
          $ref: "#/components/schemas/analytics-ClientValue"
      required:
        - type
        - logic
        - value
    analytics-NumberTwoConstraintClientConstraint:
      type: object
      title: Two numbers
      properties:
        type:
          description: Checks if the `attribute` is between two numbers, defined in `value1` and `value2`.
          x-class-name: NumberTwoClientConstraintType
          type: string
          enum:
            - NUMBER_TWO
        logic:
          description: Checks if the attribute is between two numbers.
          x-class-name: NumberTwoClientConstraintLogic
          type: string
          enum:
            - BETWEEN
        value1:
          $ref: "#/components/schemas/analytics-ClientValue"
        value2:
          $ref: "#/components/schemas/analytics-ClientValue"
      required:
        - type
        - logic
        - value1
        - value2
    analytics-NumberOneConstraintClientConstraint:
      type: object
      title: Number
      properties:
        type:
          description: This type is used to test values that are a single number
          x-class-name: NumberOneClientConstraintType
          type: string
          enum:
            - NUMBER_ONE
        logic:
          description: Logic of the test. For example, if the logic is `EQUAL` and the `value` returns 15, the expression checks if the `attribute` (sibling object to `constraint`) is 15.
          x-class-name: NumberOneClientConstraintLogic
          type: string
          enum:
            - EQUAL
            - NOT_EQUAL
            - LESS
            - MORE
            - MORE_OR_EQUAL
            - LESS_OR_EQUAL
        value:
          $ref: "#/components/schemas/analytics-ClientValue"
      required:
        - type
        - logic
        - value
    analytics-StringOneConstraintClientConstraint:
      type: object
      title: String
      properties:
        type:
          description: This type is used to test values that are a single string.
          x-class-name: StringOneClientConstraintType
          type: string
          enum:
            - STRING_ONE
        logic:
          description: Logic of the test. For example, if the logic is `CONTAIN` and the `value` returns "foo", the expression checks if the `attribute` (sibling object to `constraint`) contains the string "foo".
          x-class-name: StringOneClientConstraintLogic
          type: string
          enum:
            - CONTAIN
            - NOT_CONTAIN
            - EQUAL
            - NOT_EQUAL
            - STARTS_WITH
            - REGEXP
            - ENDS_WITH
        value:
          $ref: "#/components/schemas/analytics-ClientValue"
      required:
        - type
        - logic
        - value
    analytics-StringZeroConstraintClientConstraint:
      type: object
      title: Check empty
      description: This type is used to check if a string is empty.
      properties:
        type:
          x-class-name: StringZeroClientConstraintType
          type: string
          description: This type is used to check if a string is empty.
          enum:
            - STRING_ZERO
        logic:
          description: Checks if a string is empty (zero-length). Null value is considered empty. A string of whitespace characters is NOT empty.
          x-class-name: StringZeroClientConstraintLogic
          type: string
          enum:
            - IS_EMPTY
            - IS_NOT_EMPTY
      required:
        - type
        - logic
    analytics-BoolConstraintClientConstraint:
      type: object
      title: Boolean
      properties:
        type:
          x-class-name: BoolClientConstraintType
          type: string
          enum:
            - BOOL
          description: Tests a boolean value
        logic:
          description: Boolean logic. Empty (zero-length) strings, `0`, and `"0"` are considered false. Null values are false.
          x-class-name: BoolClientConstraintLogic
          type: string
          enum:
            - IS_TRUE
            - IS_FALSE
      required:
        - type
        - logic
    analytics-FunnelFilterExpressionContent:
      type: object
      title: Funnel
      properties:
        type:
          description: Tests against a funnel
          x-class-name: FunnelFilterExpressionContentType
          type: string
          enum:
            - FUNNEL
        matching:
          $ref: "#/components/schemas/analytics-matching"
        funnel:
          $ref: "#/components/schemas/analytics-Funnel"
    analytics-AttributeFilterExpressionContent:
      type: object
      title: Profile attribute
      properties:
        type:
          x-class-name: AttributeFilterExpressionContentType
          type: string
          enum:
            - ATTRIBUTE
          description: Tests a profile attribute against a condition
        matching:
          $ref: "#/components/schemas/analytics-matching"
        attribute:
          $ref: "#/components/schemas/analytics-Attribute"
    analytics-FilterExpressionFunction:
      type: object
      description: Logical operators
      properties:
        type:
          description: Logical operators
          x-class-name: FunctionFilterExpressionContentType
          type: string
          enum:
            - FUNCTION
        function:
          x-class-name: FilterFunctionType
          type: string
          enum:
            - AND
            - OR
            - BRACKET
        arg:
          type: object
          description: An argument of the function. This is a recursive schema; an argument can be a function which contains more functions in its arguments.
          x-codegen-schema: FilterExpressionContent
        arg1:
          type: object
          description: An argument of the function. This is a recursive schema; an argument can be a function which contains more functions in its arguments.
          x-codegen-schema: FilterExpressionContent
        arg2:
          type: object
          description: An argument of the function. This is a recursive schema; an argument can be a function which contains more functions in its arguments.
          x-codegen-schema: FilterExpressionContent
        name:
          type: string
      required:
        - type
        - function
    analytics-EventMetricAggregation:
      type: object
      x-class-name: EventMetricAggregation
      x-interface-name-ts: EventMetricAggregation
      properties:
        type:
          $ref: "#/components/schemas/analytics-AggregateExpressionType"
        attribute:
          $ref: "#/components/schemas/analytics-EventAttribute"
        level:
          type: number
          nullable: true
      required:
        - type
        - attribute
    analytics-AggregateExpressionType:
      type: string
      description: |
        The type of calculation.

        - COUNT allows you to count the total number of the entities that meet the filters.

        - COUNT_DISTINCT allows you to count the total number of distinct (unique) attribute values in entities which match the filters.

        - SUM, MIN, MAX, MEDIAN, QUANTILE (requires `level`) and AVG allow you to perform calculations on numerical-value parameters within the entities that meet the filters.

        - EXISTS checks the existence of at least a single entity that meets the filters and returns 1 when "true" or 0 when "false".

        - LAST and LAST_MULTI (requires `size`) retrieve the newest matching data.

        - FIRST and FIRST_MULTI (requires `size`) retrieve the oldest matching data.

        - LAST_TIME and FIRST_TIME (running aggregates only; require `timeWindow`) retrieve the single newest / oldest matching value from events within the time window preceding the currently evaluated event.

        - LAST_MULTI_TIME and FIRST_MULTI_TIME (running aggregates only; require `size` and `timeWindow`) retrieve the newest / oldest matching data from events within the time window preceding the currently evaluated event.
      enum:
        - AVG
        - SUM
        - MIN
        - MAX
        - COUNT
        - MEDIAN
        - QUANTILE
        - COUNT_DISTINCT
        - LAST
        - FIRST
        - EXISTS
        - FIRST_MULTI
        - LAST_MULTI
        - FIRST_TIME
        - LAST_TIME
        - FIRST_MULTI_TIME
        - LAST_MULTI_TIME
        - TOP
        - BOTTOM
        - TOP_MULTI
        - BOTTOM_MULTI
    analytics-OccurrenceType:
      type: string
      x-class-name: OccurrenceType
      x-interface-name-ts: OccurrenceType
      enum:
        - FIRST
        - LAST
        - ALL
    analytics-MetricExpressionEventType:
      type: string
      enum:
        - EVENT
    analytics-ClientMetricExpression:
      type: object
      description: Definition of a metric expression
      x-class-name: ClientMetricExpression
      x-interface-name-ts: ClientMetricExpression
      properties:
        type:
          $ref: "#/components/schemas/analytics-MetricExpressionClientType"
        title:
          $ref: "#/components/schemas/analytics-Name"
        aggregation:
          $ref: "#/components/schemas/analytics-ClientMetricAggregation"
        filter:
          $ref: "#/components/schemas/analytics-ExpressionFilter"
        groupBy:
          $ref: "#/components/schemas/analytics-ClientValue"
      required:
        - type
        - title
        - aggregation
        - filter
    analytics-ClientMetricAggregation:
      type: object
      properties:
        type:
          $ref: "#/components/schemas/analytics-AggregateExpressionType"
        attribute:
          $ref: "#/components/schemas/analytics-ClientAttribute"
        level:
          $ref: "#/components/schemas/analytics-QuantileLevel"
      required:
        - type
        - attribute
    analytics-QuantileLevel:
      type: number
      format: double
      nullable: true
      description: Only applies when `type` is `QUANTILE`. This is the percentile whose value will be the result of the analysis. For example, `0.35` is the 35th percentile.
    analytics-MetricExpressionClientType:
      type: string
      enum:
        - CLIENT
    analytics-MetricExpressionContentValueType:
      type: string
      enum:
        - VALUE
    analytics-MetricExpressionContentFunction:
      type: object
      description: A function to apply
      x-interface-name-ts: MetricExpressionContentFunction
      properties:
        type:
          $ref: "#/components/schemas/analytics-MetricExpressionContentFunctionType"
        function:
          x-class-name: MetricExpressionContentFunctionFunction
          description: |
            The function to apply. The number of required arguments depends on the function arity:
            - Nullary (0 args): NOW
            - Unary (1 arg via `arg`): LN, ABS, CEIL, EXP, FLOOR, ROUND, TO_NUMBER, TO_STRING, DAY_OF_MONTH, DAY_OF_WEEK, DAY_OF_YEAR, HOUR, MONTH, WEEK, YEAR, TO_MONEY, TO_TIMESTAMP, TO_DATE, BRACKET
            - Binary (2 args via `arg1`, `arg2`): DIVIDE, IF_NULL, MAX, MIN, MOD, MULTIPLY, SUB, SUM, GREATER, GREATER_OR_EQUALS, LESS, LESS_OR_EQUAL, NOT_EQUAL, EQUALS, ADD_YEARS, CONCAT, REGEXP
            - Ternary (3 args via `arg1`, `arg2`, `arg3`): IF (arg1 - condition; arg2 - return if true; arg3 - return if false)
          type: string
          enum:
            - NOW
            - LN
            - ABS
            - CEIL
            - EXP
            - FLOOR
            - ROUND
            - BRACKET
            - TO_NUMBER
            - TO_STRING
            - DAY_OF_MONTH
            - DAY_OF_WEEK
            - DAY_OF_YEAR
            - HOUR
            - MONTH
            - WEEK
            - YEAR
            - TO_MONEY
            - TO_TIMESTAMP
            - TO_DATE
            - DIVIDE
            - IFNULL
            - MAX
            - MIN
            - MOD
            - MULTIPLY
            - SUB
            - SUM
            - GREATER
            - GREATER_OR_EQUALS
            - LESS
            - LESS_OR_EQUALS
            - NOT_EQUALS
            - EQUALS
            - ADD_YEARS
            - CONCAT
            - REGEXP
            - IF
        arg:
          type: object
          description: An argument of the function. This is a recursive schema; an argument can be a function which contains more functions in its arguments.
          x-codegen-schema: MetricExpressionContent
        arg1:
          type: object
          description: An argument of the function. This is a recursive schema; an argument can be a function which contains more functions in its arguments.
          x-codegen-schema: MetricExpressionContent
        arg2:
          type: object
          description: An argument of the function. This is a recursive schema; an argument can be a function which contains more functions in its arguments.
          x-codegen-schema: MetricExpressionContent
        arg3:
          type: object
          description: An argument of the function. This is a recursive schema; an argument can be a function which contains more functions in its arguments.
          x-codegen-schema: MetricExpressionContent
      required:
        - type
        - function
    analytics-MetricExpressionContentFunctionType:
      type: string
      enum:
        - FUNCTION
    analytics-MetricType:
      type: string
      x-class-name: MetricType
      enum:
        - SIMPLE
        - FORMULA
      description: |
        Defines the type of the metric. This affects the contents of the
        `expression` object.

        When the type is `SIMPLE`, the `expression` can only include a single argument.
    analytics-MetricComparison:
      type: object
      description: Use this filter to compare the data from `expression` with another period. If this is used, then the result of the analysis is the difference between the two periods.
      properties:
        dateFilter:
          $ref: "#/components/schemas/analytics-DateFilter"
    analytics-MetricFormat:
      type: object
      description: |
        
        This object defines the display format of the data in the Synerise Web UI. The JSON format of the results is not affected.

        Values other than in the enums or min-max ranges are accepted by the backend, but may not be displayed properly by the Synerise Web UI.
      properties:
        compactNumbers:
          type: boolean
          default: false
          description: When `true`, numbers are shortened. For example, "20500" becomes "20.5k".
        currency:
          type: string
          x-class-name: Currency
          nullable: true
          title: CurrencyName
          enum:
            - EUR
            - USD
            - PLN
            - JPY
          description: The currency to use when `dataFormat` is `cash`
        dataFormat:
          type: string
          title: DateFormatName
          x-class-name: DateFormatName
          nullable: true
          enum:
            - cash
            - numeric
            - percent
          description: Format of the data
        fixedLength:
          description: The number of digits after the decimal point
          type: integer
          format: int32
          default: 0
          minimum: 0
          maximum: 4
        useSeparator:
          type: boolean
          default: false
          description: Enables the use of a comma as the thousands separator. When `false`, no separator is used.
    analytics-Description:
      type: string
      description: Description of the resource
    analytics-InlineRunningAggregate:
      type: object
      x-class-name: InlineRunningAggregate
      x-interface-name-ts: InlineRunningAggregate
      properties:
        id:
          $ref: "#/components/schemas/analytics-Id"
        analyticType:
          type: string
          enum:
            - RUNNING_AGGREGATE
        analysis:
          $ref: "#/components/schemas/analytics-AggregateAnalysis"
      required:
        - id
        - analyticType
        - analysis
    analytics-AggregateAnalysis:
      description: |
        Definition of the aggregate. In `attribute`, define the attribute that you want to analyze.
      discriminator:
        propertyName: aggregateType
        mapping:
          AGGREGATE: "#/components/schemas/analytics-ClientAggregate"
          RUNNING_AGGREGATE: "#/components/schemas/analytics-RunningAggregate"
      oneOf:
        - $ref: "#/components/schemas/analytics-ClientAggregate"
        - $ref: "#/components/schemas/analytics-RunningAggregate"
    analytics-RunningAggregate:
      type: object
      properties:
        aggregateType:
          description: An aggregate with an event context
          x-class-name: RunningAggregateAggregateType
          type: string
          enum:
            - RUNNING_AGGREGATE
        id:
          $ref: "#/components/schemas/analytics-AnalysisOldId"
        name:
          $ref: "#/components/schemas/analytics-Name"
        description:
          $ref: "#/components/schemas/analytics-Description"
        uuid:
          $ref: "#/components/schemas/analytics-AnalyticId"
        type:
          $ref: "#/components/schemas/analytics-AggregateExpressionType"
        level:
          $ref: "#/components/schemas/analytics-QuantileLevel"
        size:
          $ref: "#/components/schemas/analytics-AggregateSize"
        unique:
          $ref: "#/components/schemas/analytics-AggregateUnique"
        dateFilter:
          $ref: "#/components/schemas/analytics-DateFilter"
        expressions:
          $ref: "#/components/schemas/analytics-EventExpressions"
        attribute:
          $ref: "#/components/schemas/analytics-EventAttribute"
        action:
          $ref: "#/components/schemas/analytics-Action"
        excludeCurrent:
          $ref: "#/components/schemas/analytics-ExcludeCurrent"
        timeWindow:
          $ref: "#/components/schemas/analytics-Period"
      required:
        - aggregateType
        - id
        - name
        - description
        - uuid
        - type
        - level
        - size
        - unique
        - dateFilter
        - expressions
        - attribute
        - action
        - excludeCurrent
    analytics-ExcludeCurrent:
      type: boolean
      description: When `false`, data from the event that is the subject of the analysis is analyzed in addition to data of the events that occurred before it.
    analytics-AggregateUnique:
      type: boolean
      description: Only applies when `type`` is *_MULTI. When set to `true``, only unique occurrences of an event parameter are included in the results.
    analytics-AggregateSize:
      type: integer
      format: int32
      minimum: 0
      description: Only applies and is required when `type` is *_MULTI. Defines how many results to return.
    analytics-AnalysisOldId:
      type: integer
      format: int64
      minimum: 0
      description: Unique numeric ID of the analysis
    analytics-ClientAggregate:
      type: object
      description: The definition of an aggregate
      properties:
        aggregateType:
          x-class-name: ClientAggregateAggregateType
          type: string
          description: An aggregate with a profile context
          enum:
            - AGGREGATE
        id:
          $ref: "#/components/schemas/analytics-AnalysisOldId"
        name:
          $ref: "#/components/schemas/analytics-Name"
        description:
          $ref: "#/components/schemas/analytics-Description"
        uuid:
          $ref: "#/components/schemas/analytics-AnalyticId"
        type:
          $ref: "#/components/schemas/analytics-AggregateExpressionType"
        level:
          $ref: "#/components/schemas/analytics-QuantileLevel"
        size:
          $ref: "#/components/schemas/analytics-AggregateSize"
        unique:
          $ref: "#/components/schemas/analytics-AggregateUnique"
        dateFilter:
          $ref: "#/components/schemas/analytics-DateFilter"
        expressions:
          $ref: "#/components/schemas/analytics-EventExpressions"
        attribute:
          $ref: "#/components/schemas/analytics-EventAttribute"
        action:
          $ref: "#/components/schemas/analytics-Action"
      required:
        - aggregateType
        - id
        - name
        - description
        - uuid
        - type
        - level
        - size
        - unique
        - dateFilter
        - expressions
        - attribute
        - action
    analytics-InlineAggregate:
      type: object
      x-class-name: InlineAggregate
      x-interface-name-ts: InlineAggregate
      properties:
        id:
          $ref: "#/components/schemas/analytics-Id"
        analyticType:
          type: string
          enum:
            - AGGREGATE
        analysis:
          $ref: "#/components/schemas/analytics-AggregateAnalysis"
      required:
        - id
        - analyticType
        - analysis
    analytics-InlineSegmentation:
      type: object
      x-class-name: InlineSegmentation
      x-interface-name-ts: InlineSegmentation
      properties:
        id:
          $ref: "#/components/schemas/analytics-Id"
        analyticType:
          type: string
          enum:
            - SEGMENTATION
        analysis:
          $ref: "#/components/schemas/analytics-SegmentationAnalysis"
      required:
        - id
        - analyticType
        - analysis
    analytics-SegmentationAnalysis:
      type: object
      description: Definition of the segmentation.
      properties:
        id:
          $ref: "#/components/schemas/analytics-AnalyticId"
        title:
          $ref: "#/components/schemas/analytics-Name"
        description:
          $ref: "#/components/schemas/analytics-Description"
        segments:
          type: array
          description: An array of segments in the segmentation. By default, a profile is only included in the first matching segment, even if it meets the filters of the following segments. To change this, use the `unique` parameter.
          minItems: 1
          items:
            $ref: "#/components/schemas/analytics-OneSegment"
        unique:
          $ref: "#/components/schemas/analytics-SegmentationUnique"
      required:
        - title
        - segments
    analytics-SegmentationUnique:
      type: boolean
      description: When `true`, a profile is only included in the first segment that it matches; segments that follow do not include this profile in their results even if their conditions are met. The segments are checked according to their order in the request.
      default: true
    analytics-OneSegment:
      type: object
      x-class-name: Segment
      properties:
        title:
          type: string
          description: Name of the segment. If you want to use the segment name (for example, by creating an expression that returns it for use in a filter), the name shouldn't include any whitespace or special characters.
        description:
          type: string
          description: Description of the segment
        filter:
          $ref: "#/components/schemas/analytics-ExpressionFilter"
      required:
        - title
        - description
        - filter
    analytics-InlineExpression:
      type: object
      x-class-name: InlineExpression
      x-interface-name-ts: InlineExpression
      properties:
        id:
          $ref: "#/components/schemas/analytics-Id"
        analyticType:
          type: string
          enum:
            - EXPRESSION
        analysis:
          discriminator:
            propertyName: type
            mapping:
              EVENT: "#/components/schemas/analytics-EventExpressionEntity"
              CLIENT: "#/components/schemas/analytics-ClientExpressionEntity"
          oneOf:
            - $ref: "#/components/schemas/analytics-EventExpressionEntity"
            - $ref: "#/components/schemas/analytics-ClientExpressionEntity"
      required:
        - id
        - analyticType
        - analysis
    analytics-ClientExpressionEntity:
      type: object
      title: Profile expression
      description: Details of a profile expression. In the Synerise Portal, they are called _attribute_ expressions.
      properties:
        id:
          $ref: "#/components/schemas/analytics-AnalyticId"
        type:
          type: string
          enum:
            - CLIENT
          description: This type of expression can be used to analyze profile attributes.
        name:
          $ref: "#/components/schemas/analytics-Name"
        description:
          $ref: "#/components/schemas/analytics-Description"
        expression:
          $ref: "#/components/schemas/analytics-ClientExpressionContentEntity"
      required:
        - type
        - name
        - expression
    analytics-ClientExpressionContentEntity:
      description: Structure of the expression. This is a recursive schema - functions can contain more functions.
      example:
        type: VALUE
        title: title
        value:
          type: CONSTANT
          constant: 10
      discriminator:
        propertyName: type
        mapping:
          VALUE: "#/components/schemas/analytics-ClientExpressionContentEntityValue"
          FUNCTION: "#/components/schemas/analytics-ClientExpressionContentEntityFunction"
      oneOf:
        - $ref: "#/components/schemas/analytics-ClientExpressionContentEntityValue"
        - $ref: "#/components/schemas/analytics-ClientExpressionContentEntityFunction"
    analytics-ClientExpressionContentEntityFunction:
      type: object
      title: Function
      description: |
        A function in the expression. Arguments are optional depending on function arity:
        - `arg` - argument for single-argument (unary) functions
        - `arg1` - first argument for multi-argument functions (binary, ternary)
        - `arg2` - second argument for multi-argument functions (binary, ternary)
        - `arg3` - third argument for ternary functions (IF)
      example:
        type: FUNCTION
        function: LN
        arg:
          type: VALUE
          title: title
          value:
            type: CONSTANT
            constant: 10
      properties:
        type:
          x-class-name: ClientExpressionContentEntityFunctionType
          type: string
          enum:
            - FUNCTION
        function:
          x-class-name: ClientExpressionFunctionType
          type: string
          description: |
            The function to apply. The number of required arguments depends on the function arity:
            - Nullary (0 args): NOW
            - Unary (1 arg via `arg`): LN, ABS, CEIL, EXP, FLOOR, ROUND, TO_NUMBER, TO_STRING, DAY_OF_MONTH, DAY_OF_WEEK, DAY_OF_YEAR, HOUR, MONTH, WEEK, YEAR, TO_MONEY, TO_TIMESTAMP, TO_DATE, BRACKET
            - Binary (2 args via `arg1`, `arg2`): DIVIDE, IF_NULL, MAX, MIN, MOD, MULTIPLY, SUB, SUM, GREATER, GREATER_OR_EQUALS, LESS, LESS_OR_EQUAL, NOT_EQUAL, EQUALS, ADD_YEARS, CONCAT, REGEXP
            - Ternary (3 args via `arg1`, `arg2`, `arg3`): IF (arg1 - condition; arg2 - return if true; arg3 - return if false)
          enum:
            - NOW
            - LN
            - ABS
            - CEIL
            - EXP
            - FLOOR
            - ROUND
            - TO_NUMBER
            - TO_STRING
            - DAY_OF_MONTH
            - DAY_OF_WEEK
            - DAY_OF_YEAR
            - HOUR
            - MONTH
            - WEEK
            - YEAR
            - TO_MONEY
            - TO_TIMESTAMP
            - TO_DATE
            - BRACKET
            - DIVIDE
            - IF_NULL
            - MAX
            - MIN
            - MOD
            - MULTIPLY
            - SUB
            - SUM
            - GREATER
            - GREATER_OR_EQUALS
            - LESS
            - LESS_OR_EQUAL
            - NOT_EQUAL
            - EQUALS
            - ADD_YEARS
            - CONCAT
            - REGEXP
            - IF
        arg:
          type: object
          description: An argument of the function. This is a recursive schema; an argument can be a function which contains more functions in its arguments.
          x-codegen-schema: ClientExpressionContentEntity
        arg1:
          type: object
          description: An argument of the function. This is a recursive schema; an argument can be a function which contains more functions in its arguments.
          x-codegen-schema: ClientExpressionContentEntity
        arg2:
          type: object
          description: An argument of the function. This is a recursive schema; an argument can be a function which contains more functions in its arguments.
          x-codegen-schema: ClientExpressionContentEntity
        arg3:
          type: object
          description: An argument of the function. This is a recursive schema; an argument can be a function which contains more functions in its arguments.
          x-codegen-schema: ClientExpressionContentEntity
      required:
        - type
        - function
    analytics-ClientExpressionContentEntityValue:
      type: object
      title: Value
      description: A value reference in the expression - can reference a profile parameter, constant, or variable.
      properties:
        type:
          x-class-name: ClientExpressionContentEntityValueType
          type: string
          description: A value reference in the expression - can reference a profile parameter, constant, or variable.
          enum:
            - VALUE
        title:
          type: string
          description: Title of the value
        value:
          oneOf:
            - $ref: "#/components/schemas/analytics-ClientParameter"
            - $ref: "#/components/schemas/analytics-ConstantValue"
            - $ref: "#/components/schemas/analytics-VariableValue"
      required:
        - title
        - type
        - value
    analytics-EventExpressionEntity:
      type: object
      title: Event expression
      properties:
        type:
          type: string
          enum:
            - EVENT
          description: This type of expression can be used to analyze event attributes, including the attributes of the profile that owns the event.
        action:
          $ref: "#/components/schemas/analytics-Action"
        name:
          $ref: "#/components/schemas/analytics-Name"
        description:
          $ref: "#/components/schemas/analytics-Description"
        expression:
          $ref: "#/components/schemas/analytics-EventExpressionContentEntity"
      required:
        - expression
        - name
        - type
        - description
    analytics-EventExpressionContentEntity:
      description: Structure of the expression. This is a recursive schema - functions can contain more functions.
      example:
        type: VALUE
        title: title
        value:
          type: CONSTANT
          constant: 10
      discriminator:
        propertyName: type
        mapping:
          VALUE: "#/components/schemas/analytics-EventExpressionContentEntityValue"
          FUNCTION: "#/components/schemas/analytics-EventExpressionContentEntityFunction"
      oneOf:
        - $ref: "#/components/schemas/analytics-EventExpressionContentEntityValue"
        - $ref: "#/components/schemas/analytics-EventExpressionContentEntityFunction"
    analytics-EventExpressionContentEntityFunction:
      type: object
      title: Function
      description: |
        A function in the expression. Arguments are optional depending on function arity:
        - `arg` - argument for single-argument (unary) functions
        - `arg1` - first argument for multi-argument functions (binary, ternary)
        - `arg2` - second argument for multi-argument functions (binary, ternary)
        - `arg3` - third argument for ternary functions (IF)
      example:
        type: FUNCTION
        function: LN
        arg:
          type: VALUE
          title: title
          value:
            type: CONSTANT
            constant: 10
      properties:
        type:
          x-class-name: EventExpressionContentEntityFunctionType
          type: string
          enum:
            - FUNCTION
        function:
          x-class-name: EventExpressionFunctionType
          type: string
          description: |
            The function to apply. The number of required arguments depends on the function arity:
            - Nullary (0 args): NOW
            - Unary (1 arg via `arg`): LN, ABS, CEIL, EXP, FLOOR, ROUND, TO_NUMBER, TO_STRING, DAY_OF_MONTH, DAY_OF_WEEK, DAY_OF_YEAR, HOUR, MONTH, WEEK, YEAR, TO_MONEY, TO_TIMESTAMP, TO_DATE, BRACKET
            - Binary (2 args via `arg1`, `arg2`): DIVIDE, IF_NULL, MAX, MIN, MOD, MULTIPLY, SUB, SUM, GREATER, GREATER_OR_EQUALS, LESS, LESS_OR_EQUAL, NOT_EQUAL, EQUALS, ADD_YEARS, CONCAT, REGEXP
            - Ternary (3 args via `arg1`, `arg2`, `arg3`): IF (arg1 - condition; arg2 - return if true; arg3 - return if false)
          enum:
            - NOW
            - LN
            - ABS
            - CEIL
            - EXP
            - FLOOR
            - ROUND
            - TO_NUMBER
            - TO_STRING
            - DAY_OF_MONTH
            - DAY_OF_WEEK
            - DAY_OF_YEAR
            - HOUR
            - MONTH
            - WEEK
            - YEAR
            - TO_MONEY
            - TO_TIMESTAMP
            - TO_DATE
            - BRACKET
            - DIVIDE
            - IF_NULL
            - MAX
            - MIN
            - MOD
            - MULTIPLY
            - SUB
            - SUM
            - GREATER
            - GREATER_OR_EQUALS
            - LESS
            - LESS_OR_EQUAL
            - NOT_EQUAL
            - EQUALS
            - ADD_YEARS
            - CONCAT
            - REGEXP
            - IF
        arg:
          type: object
          description: An argument of the function. This is a recursive schema; an argument can be a function which contains more functions in its arguments.
          x-codegen-schema: EventExpressionContentEntity
        arg1:
          type: object
          description: An argument of the function. This is a recursive schema; an argument can be a function which contains more functions in its arguments.
          x-codegen-schema: EventExpressionContentEntity
        arg2:
          type: object
          description: An argument of the function. This is a recursive schema; an argument can be a function which contains more functions in its arguments.
          x-codegen-schema: EventExpressionContentEntity
        arg3:
          type: object
          description: An argument of the function. This is a recursive schema; an argument can be a function which contains more functions in its arguments.
          x-codegen-schema: EventExpressionContentEntity
      required:
        - type
        - function
    analytics-EventExpressionContentEntityValue:
      type: object
      title: Value
      description: A value reference in the expression - can reference an event parameter, profile parameter, constant, or variable.
      properties:
        type:
          description: A value reference in the expression - can reference an event parameter, profile parameter, constant, or variable.
          x-class-name: EventExpressionContentEntityValueType
          type: string
          enum:
            - VALUE
        title:
          type: string
          description: Title of the value
        value:
          $ref: "#/components/schemas/analytics-EventValue"
      required:
        - title
        - type
        - value
    analytics-MetricView:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/analytics-AnalyticId"
        name:
          $ref: "#/components/schemas/analytics-Name"
        author:
          $ref: "#/components/schemas/analytics-AuthorId"
        modifier:
          $ref: "#/components/schemas/analytics-modifierId"
        updatedAt:
          $ref: "#/components/schemas/analytics-UpdatedAt"
        createdAt:
          $ref: "#/components/schemas/analytics-CreatedAt"
        usedAt:
          $ref: "#/components/schemas/analytics-UsedAt"
        analysis:
          $ref: "#/components/schemas/analytics-MetricAnalysis"
        inlineAnalytics:
          $ref: "#/components/schemas/analytics-InlineAnalytics"
        isPredefinedAnalytic:
          $ref: "#/components/schemas/analytics-IsPredefinedAnalytic"
        isDynamicAnalytic:
          $ref: "#/components/schemas/analytics-IsDynamicAnalytic"
        isMetricHistogram:
          $ref: "#/components/schemas/analytics-IsMetricHistogram"
        isDeleted:
          $ref: "#/components/schemas/analytics-IsDeleted"
        namespace:
          $ref: "#/components/schemas/analytics-Namespace"
        directoryId:
          $ref: "#/components/schemas/analytics-DirectoryId"
      required:
        - id
        - name
        - author
        - modifier
        - updatedAt
        - createdAt
        - usedAt
        - analysis
        - isPredefinedAnalytic
        - isDynamicAnalytic
        - isMetricHistogram
        - isDeleted
        - namespace
        - directoryId
    analytics-Namespace:
      type: string
      description: Name of the namespace in the database where this resource is saved. This is **different than the namespace in the path parameters** of the request.
    analytics-IsDeleted:
      type: boolean
      description: "`true` if the resource was deleted"
    analytics-IsPredefinedAnalytic:
      type: boolean
      description: "`true` if the analysis was automatically created with the workspace"
    analytics-modifierId:
      type: integer
      format: int64
      description: Unique ID of the last editor. `1` means the resource was edited by a request with workspace authorization.
    analytics-ReportCalculationResponse:
      type: object
      properties:
        data:
          type: array
          description: Calculation results. Each object in this array corresponds to one metric included in the report. The Synerise Web UI currently only supports single-metric reports.
          items:
            $ref: "#/components/schemas/analytics-ReportCalculationData"
      required:
        - data
    analytics-ReportCalculationData:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/analytics-Id"
        columnName:
          type: string
          description: |
            Column header for this metric. Uses the per-metric `columnName` from the report
            definition when set; otherwise falls back to the underlying metric's title.
        values:
          type: array
          description: |
            
            An array of results for each grouping.

            Note that `values` is a single-item array of arrays.

            **Example**: if the dimensions of your report are _firstname_ and _title_ in a page visit event, this may be the result:

            ```json
            "values": [
              [
                {
                  "name": [
                    "John",
                    "Discounted Product Page"
                  ],
                  "value": 26.0
                },
                {
                  "name": [
                    "Steve",
                    "Discounted Product Page"
                  ],
                  "value": 12.0
                },
                {
                  "name": [
                    "Steve",
                    "New product pre-order"
                  ],
                  "value": 117.0
                }
              ]
            ]
            ```

            This means that 26 profiles named John visited a page titled "Discounted Product Page". The same page was visited by 12 profiles named Steve. Profiles named Steve visited "New product pre-order" page 117 times.
          items:
            type: array
            items:
              $ref: "#/components/schemas/analytics-GroupingReportMetric"
        groups:
          type: array
          description: A list of parameters that were used for creating dimensions (grouping)
          items:
            type: string
      required:
        - columnName
        - groups
        - id
        - values
    analytics-GroupingReportMetric:
      type: object
      properties:
        name:
          type: array
          description: Parameter values
          items:
            anyOf:
              - type: string
              - type: number
        value:
          type: number
          description: The number of occurrences of the combination defined in `name`
          format: double
      required:
        - name
        - value
    analytics-OverrideQueryRequest:
      type: object
      description: Override details
      properties:
        title:
          $ref: "#/components/schemas/analytics-Name"
        dateFilter:
          $ref: "#/components/schemas/analytics-DateFilter"
        aggregateDataBy:
          $ref: "#/components/schemas/analytics-Period"
        filter:
          $ref: "#/components/schemas/analytics-ExpressionFilter"
        variables:
          type: array
          description: A list of variable values to use in this calculation
          items:
            $ref: "#/components/schemas/analytics-Variable"
        overrideNested:
          description: When `true`, the date filter overrides date filters in analyses nested in the conditions.
          type: boolean
          default: false
    analytics-ReportPreviewRequest:
      type: object
      properties:
        allowNull:
          $ref: "#/components/schemas/analytics-AllowNull"
        analysis:
          $ref: "#/components/schemas/analytics-ReportAnalysis"
        inlineAnalytics:
          $ref: "#/components/schemas/analytics-InlineAnalytics"
      required:
        - analysis
    analytics-ReportAnalysis:
      type: object
      description: Structure of the report analysis
      properties:
        id:
          $ref: "#/components/schemas/analytics-AnalyticId"
        title:
          $ref: "#/components/schemas/analytics-Name"
        description:
          $ref: "#/components/schemas/analytics-Description"
        reportMetrics:
          type: array
          minLength: 0
          description: An array of metrics in the report. The Synerise Web Portal currently only supports reports with one metric.
          items:
            $ref: "#/components/schemas/analytics-ReportMetricDefinition"
        filter:
          $ref: "#/components/schemas/analytics-ExpressionFilter"
      required:
        - title
        - description
        - reportMetrics
        - filter
    analytics-ReportMetricDefinition:
      type: object
      properties:
        metricId:
          $ref: "#/components/schemas/analytics-Id"
        dateFilter:
          $ref: "#/components/schemas/analytics-DateFilter"
        action:
          $ref: "#/components/schemas/analytics-Action"
        actions:
          type: array
          description: |
            
            All events that the metric referenced by `metricId` is based on.
            When the report defines dimensions (`groups`) based on event parameters, the grouping applies to every event of the metric, so each event the metric uses must be listed here. When omitted, it defaults to a single-element array containing `action`.
          items:
            $ref: "#/components/schemas/analytics-Action"
        format:
          $ref: "#/components/schemas/analytics-MetricFormat"
        columnName:
          type: string
          description: Optional alias displayed as this metric's column header. Falls back to the underlying metric's title when null or omitted.
        grouping:
          $ref: "#/components/schemas/analytics-ReportMetricGrouping"
        groups:
          type: array
          description: |
            
            The data to be included in the report. This data is called the _dimensions_ of the report.
            Each object in the array adds one dimension.
            - When you choose a metric created on the basis of one event only, you can group the results in reports only by the parameters assigned to this event.
            - When you choose a metric that is based only on the profile attributes, then you can group the results according to attributes assigned to profiles.
            - When you choose a metric that is created on the basis of events and profile attributes which don't have a common parameter, then you can group the results in reports only by attributes assigned to profiles.
            Grouping: The parameters of an event defined in this object can be used in the dimensions (`group` object) of the report. The event must be included in the metric that is the base of the report.
            Date filter: This date filter overrides the date filter in the metric.
            **Example 1:**
            You have a metric that counts page visits. You want to see the results of the report grouped by the first name of the person who visited the page.
            To achieve this, you need to add one dimension: the profile's first name. The response will include an array of objects that list the names and the number of their occurrences.

            **Example 2:**
            While using the same metric as in example 1, you add two dimensions:
            - profile's name (`firstname` param)
            - title of the page (`title` param)

            The response will include the firstname/title combinations and the number of their occurrences. For a JSON example, see the description of the response schema for this method.
          items:
            $ref: "#/components/schemas/analytics-ReportMetricGroup"
      required:
        - action
        - dateFilter
        - format
        - grouping
        - groups
        - metricId
    analytics-ReportMetricGroup:
      description: |
        The type and source of data shown in the report.
        When type is CLIENT, attribute refers to a ProfileAttribute.
        When type is EVENT, attribute refers to an EventAttribute.
      discriminator:
        propertyName: type
        mapping:
          CLIENT: "#/components/schemas/analytics-ClientReportMetricGroup"
          EVENT: "#/components/schemas/analytics-EventReportMetricGroup"
      oneOf:
        - $ref: "#/components/schemas/analytics-ClientReportMetricGroup"
        - $ref: "#/components/schemas/analytics-EventReportMetricGroup"
    analytics-EventReportMetricGroup:
      type: object
      title: EventReportMetricGroup
      required:
        - type
        - attribute
      properties:
        title:
          type: string
          description: The name of the dimension
        format:
          $ref: "#/components/schemas/analytics-MetricFormat"
        type:
          title: EventReportMetricGroupType
          x-class-name: EventReportMetricGroupType
          type: string
          enum:
            - EVENT
          description: Defines the source type of the data shown in the report.
        attribute:
          $ref: "#/components/schemas/analytics-EventAttribute"
    analytics-ClientReportMetricGroup:
      type: object
      title: ClientReportMetricGroup
      required:
        - type
        - attribute
      properties:
        title:
          type: string
          description: The name of the dimension
        format:
          $ref: "#/components/schemas/analytics-MetricFormat"
        type:
          title: ClientReportMetricGroupType
          x-class-name: ClientReportMetricGroupType
          type: string
          enum:
            - CLIENT
          description: Defines the source type of the data shown in the report.
        attribute:
          $ref: "#/components/schemas/analytics-ClientAttribute"
    analytics-Directory:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/analytics-Id"
        businessProfileId:
          $ref: "#/components/schemas/analytics-BusinessProfileId"
        name:
          $ref: "#/components/schemas/analytics-Name"
        objectType:
          $ref: "#/components/schemas/analytics-ObjectType"
        createdAt:
          $ref: "#/components/schemas/analytics-CreatedAt"
        updatedAt:
          $ref: "#/components/schemas/analytics-UpdatedAt"
        isDefault:
          type: boolean
          description: "`true` if this is the default directory"
      required:
        - createdAt
        - id
        - isDefault
        - name
        - objectType
        - updatedAt
    analytics-ObjectType:
      type: string
      enum:
        - EXPRESSION
        - AGGREGATE
        - SEGMENTATION
        - METRIC
        - FUNNEL
        - SANKEY
        - TREND
        - HISTOGRAM
        - REPORT
        - ANALYTICS_QUERY
        - ANALYTICS_DASHBOARD
    analytics-BusinessProfileId:
      type: integer
      format: int32
      description: ID of the workspace (formerly business profile)
      example: 48
    analytics-DirectoryCreateRequest:
      type: object
      properties:
        name:
          $ref: "#/components/schemas/analytics-Name"
        analyticType:
          $ref: "#/components/schemas/analytics-ObjectType"
      required:
        - analyticType
        - name
    analytics-DirectoryRenameRequest:
      type: object
      properties:
        newName:
          type: string
          description: New name for the directory
      required:
        - newName
    analytics-DirectoryChangeRequest:
      type: object
      properties:
        newDir:
          description: ID of the new directory
          type: string
          format: uuid
        analyticType:
          $ref: "#/components/schemas/analytics-ObjectType"
      required:
        - analyticType
        - newDir
    analytics-MetricCalculationResponse:
      type: object
      properties:
        result:
          description: The numerical result. In metrics that return true/false values, `1` is "true" and `0` is "false".
          type: number
          format: double
        metricData:
          $ref: "#/components/schemas/analytics-MetricCalculationData"
      required:
        - metricData
        - result
    analytics-MetricCalculationData:
      type: object
      description: Basic information about the metric
      properties:
        name:
          $ref: "#/components/schemas/analytics-Name"
        description:
          $ref: "#/components/schemas/analytics-Description"
        format:
          $ref: "#/components/schemas/analytics-MetricFormat"
        initialDateFilter:
          $ref: "#/components/schemas/analytics-DateFilter"
      required:
        - description
        - format
        - initialDateFilter
        - name
    analytics-MetricLegacyPreview:
      type: object
      properties:
        analysis:
          $ref: "#/components/schemas/analytics-MetricAnalysis"
        inlineAnalytics:
          $ref: "#/components/schemas/analytics-InlineAnalytics"
      required:
        - analysis
    analytics-DynamicVariablesRequest:
      type: object
      properties:
        variables:
          $ref: "#/components/schemas/analytics-Variables"
      required:
        - variables
    analytics-BatchCalculationResult:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/analytics-AnalyticId"
        name:
          $ref: "#/components/schemas/analytics-AnalyticName"
        result:
          description: Result of the analysis
          oneOf:
            - $ref: "#/components/schemas/analytics-SuccessResult"
            - $ref: "#/components/schemas/analytics-FailureResult"
      required:
        - id
        - name
        - result
    analytics-FailureResult:
      type: object
      example:
        success: false
        errorMessage: Analytic or one of nested analytics does not exist
        httpStatus: 400
        errorCode: ANA-002
      properties:
        success:
          type: boolean
          description: Always `false`
        errorMessage:
          type: string
          description: Details of the error which caused the calculation failure
        httpStatus:
          type: integer
          description: HTTP status of the error which caused the calculation failure
        errorCode:
          type: string
          description: Code of the error which caused the calculation failure
      required:
        - errorMessage
        - success
      title: Failed calculation
    analytics-SuccessResult:
      type: object
      example:
        success: true
        value: "123"
      properties:
        success:
          type: boolean
          description: Always `true`
        value:
          type: string
          description: Calculation result
      required:
        - success
        - value
      title: Successful calculation
    analytics-AnalyticName:
      type: string
      description: Name of the analysis
      example: Nice people who read the documentation
    analytics-IdentifierValue:
      type: string
      description: Value of the selected identifier. Note that IDs must also be sent as strings.
    analytics-ExpressionResult:
      type: object
      properties:
        clientId:
          type: integer
          format: int32
          description: ID of the profile
        expressionId:
          type: string
          format: uuid
          description: UUID of the expression
        name:
          type: string
          description: Name of the expression
        result:
          type: string
          description: The result of the expression
      required:
        - clientId
        - expressionId
        - name
        - result
    analytics-ExpressionListItem:
      allOf:
        - type: object
          properties:
            action:
              $ref: "#/components/schemas/analytics-Action"
            type:
              $ref: "#/components/schemas/analytics-ExpressionType"
          required:
            - action
            - type
        - $ref: "#/components/schemas/analytics-ListAnalyticsItemCommon"
    analytics-ExpressionType:
      type: string
      x-class-name: ExpressionType
      enum:
        - EVENT
        - CLIENT
    analytics-expressionCreateRequestBody:
      type: object
      properties:
        isVisibleForClientProfile:
          $ref: "#/components/schemas/analytics-IsVisibleForClientProfile"
        analysis:
          $ref: "#/components/schemas/analytics-ExpressionEntity"
        inlineAnalytics:
          $ref: "#/components/schemas/analytics-InlineAnalytics"
      required:
        - isVisibleForClientProfile
        - analysis
    analytics-ExpressionEntity:
      description: Details of the analysis
      discriminator:
        propertyName: type
        mapping:
          EVENT: "#/components/schemas/analytics-EventExpressionEntity"
          CLIENT: "#/components/schemas/analytics-ClientExpressionEntity"
      oneOf:
        - $ref: "#/components/schemas/analytics-EventExpressionEntity"
        - $ref: "#/components/schemas/analytics-ClientExpressionEntity"
    analytics-ExpressionView:
      type: object
      x-interface-name-ts: ExpressionView
      properties:
        analysis:
          $ref: "#/components/schemas/analytics-ExpressionEntity"
        inlineAnalytics:
          $ref: "#/components/schemas/analytics-InlineAnalytics"
        analyticVersion:
          $ref: "#/components/schemas/analytics-AnalyticVersion"
        isVisibleForClientProfile:
          $ref: "#/components/schemas/analytics-IsVisibleForClientProfile"
        id:
          $ref: "#/components/schemas/analytics-Id"
        businessProfileId:
          $ref: "#/components/schemas/analytics-BusinessProfileId"
        name:
          $ref: "#/components/schemas/analytics-Name"
        description:
          $ref: "#/components/schemas/analytics-Description"
        author:
          $ref: "#/components/schemas/analytics-AuthorId"
        modifier:
          $ref: "#/components/schemas/analytics-modifierId"
        updatedAt:
          $ref: "#/components/schemas/analytics-UpdatedAt"
        createdAt:
          $ref: "#/components/schemas/analytics-CreatedAt"
        usedAt:
          $ref: "#/components/schemas/analytics-UsedAt"
        isPredefinedAnalytic:
          $ref: "#/components/schemas/analytics-IsPredefinedAnalytic"
        isDynamicAnalytic:
          $ref: "#/components/schemas/analytics-IsDynamicAnalytic"
        isDeleted:
          $ref: "#/components/schemas/analytics-IsDeleted"
        namespace:
          $ref: "#/components/schemas/analytics-Namespace"
        directoryId:
          $ref: "#/components/schemas/analytics-DirectoryId"
      required:
        - analysis
        - analyticVersion
        - author
        - businessProfileId
        - createdAt
        - description
        - directoryId
        - id
        - isDeleted
        - isDynamicAnalytic
        - isPredefinedAnalytic
        - isVisibleForClientProfile
        - modifier
        - name
        - namespace
        - updatedAt
        - usedAt
    analytics-AnalyticVersion:
      type: string
      format: uuid
      nullable: true
      description: Unique ID of this version of the resource
    analytics-ExpressionTypedCalculationResponse:
      type: object
      properties:
        expressionId:
          type: string
          format: uuid
          description: Random ID for this expression preview
        clientId:
          type: integer
          format: int64
          description: ID of the profile
        title:
          type: string
          description: Expression title
        result:
          description: Result of the expression
          anyOf:
            - type: string
            - type: boolean
            - type: number
            - type: object
            - type: array
              items: {}
        variables:
          $ref: "#/components/schemas/analytics-Variables"
      required:
        - clientId
        - expressionId
        - result
        - title
        - variables
    analytics-ExpressionPreviewRequestWithClient:
      type: object
      properties:
        identifierValue:
          $ref: "#/components/schemas/analytics-IdentifierValue"
        expression:
          $ref: "#/components/schemas/analytics-ClientExpressionEntity"
        inlineAnalytics:
          $ref: "#/components/schemas/analytics-InlineAnalytics"
      required:
        - expression
        - identifierValue
    analytics-HistogramRequest:
      type: object
      properties:
        analysis:
          $ref: "#/components/schemas/analytics-HistogramAnalysis"
        inlineAnalytics:
          $ref: "#/components/schemas/analytics-InlineAnalytics"
      required:
        - analysis
    analytics-HistogramAnalysis:
      type: object
      description: Details of a histogram
      properties:
        title:
          $ref: "#/components/schemas/analytics-Name"
        description:
          $ref: "#/components/schemas/analytics-Description"
        histogram:
          $ref: "#/components/schemas/analytics-HistogramDefinition"
      required:
        - description
        - histogram
        - title
    analytics-HistogramDefinition:
      type: object
      description: Structure of a histogram analysis. A histogram must have a date filter - an empty (infinite) filter causes a Bad Request error due to database limits per request.
      properties:
        dateFilter:
          $ref: "#/components/schemas/analytics-DateFilter"
        period:
          $ref: "#/components/schemas/analytics-Period"
        eventMetrics:
          type: array
          description: An array of metrics in the histogram
          items:
            $ref: "#/components/schemas/analytics-HistogramMetric"
      required:
        - dateFilter
        - eventMetrics
        - period
    analytics-HistogramMetric:
      type: object
      properties:
        metricId:
          $ref: "#/components/schemas/analytics-AnalyticId"
        chartType:
          $ref: "#/components/schemas/analytics-ChartType"
        title:
          type: string
          description: Name of the metric on the histogram (can be different than the name saved in the metric's details)
      required:
        - chartType
        - metricId
    analytics-ChartType:
      type: string
      description: Currently unused. For compatibility, set to COLUMN
      enum:
        - COLUMN
        - LINE
    analytics-HistogramView:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/analytics-AnalyticId"
        businessProfileId:
          $ref: "#/components/schemas/analytics-BusinessProfileId"
        name:
          $ref: "#/components/schemas/analytics-Name"
        author:
          $ref: "#/components/schemas/analytics-AuthorId"
        modifier:
          $ref: "#/components/schemas/analytics-modifierId"
        updatedAt:
          $ref: "#/components/schemas/analytics-UpdatedAt"
        createdAt:
          $ref: "#/components/schemas/analytics-CreatedAt"
        usedAt:
          $ref: "#/components/schemas/analytics-UsedAt"
        analysis:
          $ref: "#/components/schemas/analytics-HistogramAnalysis"
        inlineAnalytics:
          $ref: "#/components/schemas/analytics-InlineAnalytics"
        isPredefinedAnalytic:
          $ref: "#/components/schemas/analytics-IsPredefinedAnalytic"
        isDynamicAnalytic:
          $ref: "#/components/schemas/analytics-IsDynamicAnalytic"
        isDeleted:
          $ref: "#/components/schemas/analytics-IsDeleted"
        namespace:
          $ref: "#/components/schemas/analytics-Namespace"
        directoryId:
          $ref: "#/components/schemas/analytics-DirectoryId"
      required:
        - id
        - businessProfileId
        - name
        - author
        - modifier
        - updatedAt
        - createdAt
        - usedAt
        - analysis
        - isPredefinedAnalytic
        - isDynamicAnalytic
        - isDeleted
        - namespace
        - directoryId
    analytics-MetricProjectionResponse:
      type: object
      properties:
        hashId:
          $ref: "#/components/schemas/analytics-Id"
        name:
          $ref: "#/components/schemas/analytics-Name"
        description:
          $ref: "#/components/schemas/analytics-Description"
        action:
          $ref: "#/components/schemas/analytics-Action"
        eventName:
          $ref: "#/components/schemas/analytics-ActionName"
        actionId:
          $ref: "#/components/schemas/analytics-ActionId"
        isNumber:
          $ref: "#/components/schemas/analytics-IsNumber"
        isDynamicAnalytic:
          $ref: "#/components/schemas/analytics-IsDynamicAnalytic"
        variables:
          $ref: "#/components/schemas/analytics-Variables"
        createdAt:
          $ref: "#/components/schemas/analytics-CreatedAt"
        isMetricHistogram:
          $ref: "#/components/schemas/analytics-IsMetricHistogram"
      required:
        - createdAt
        - isNumber
        - name
    analytics-SegmentationCalculationResponse:
      type: object
      properties:
        calculationResults:
          type: array
          description: A list of segments
          items:
            $ref: "#/components/schemas/analytics-CalculationResult"
        totalContacts:
          type: integer
          description: The total number of profiles in the database
        excludedContacts:
          type: integer
          description: The number of profiles which did not match the conditions of any segment
        metadata:
          $ref: "#/components/schemas/analytics-Metadata"
      required:
        - calculationResults
    analytics-Metadata:
      type: object
      description: Raw data of the calculation
      properties:
        source:
          type: array
          description: An array of results. Each number is the number of profiles which matched a segment, according to the segments' order in the request. The last number is the the number of profiles which don't match any of the segment.
          items:
            type: integer
    analytics-CalculationResult:
      type: object
      properties:
        name:
          type: string
          description: Segment name
        result:
          type: integer
          format: int64
          description: |
            
            The number of profiles which matched the conditions of this segment.

            **IMPORTANT:** If a profile matches a segment's conditions, that profile is not included in any further calculations, even if it would normally match the conditions of the segments that follow.
      required:
        - name
        - result
    analytics-SegmentationPreviewRequest:
      type: object
      properties:
        analysis:
          $ref: "#/components/schemas/analytics-SegmentationAnalysis"
        allowNull:
          $ref: "#/components/schemas/analytics-AllowNull"
        inlineAnalytics:
          $ref: "#/components/schemas/analytics-InlineAnalytics"
      required:
        - analysis
    analytics-HistogramCalculationResponse:
      type: object
      properties:
        metadata:
          $ref: "#/components/schemas/analytics-HistogramMetadata"
        items:
          type: array
          description: The numerical results, divided into time units defined in the `period` object. Each object in the array holds the results of all metrics for a particular aggregation period.
          items:
            $ref: "#/components/schemas/analytics-HistogramItems"
        legends:
          type: array
          description: Information about included metrics and their display mode
          items:
            $ref: "#/components/schemas/analytics-HistogramLegends"
      required:
        - items
        - legends
        - metadata
    analytics-HistogramLegends:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: UUID of a metric
        title:
          type: string
          description: Title of a metric
        chartType:
          $ref: "#/components/schemas/analytics-ChartType"
      required:
        - chartType
        - id
        - title
    analytics-HistogramItems:
      type: object
      properties:
        aggregateTimeDescription:
          type: string
          description: Timestamp of the result
          format: date-time
        values:
          type: array
          description: An array of the results of the included metrics
          items:
            $ref: "#/components/schemas/analytics-HistogramItemsValues"
      required:
        - aggregateTimeDescription
        - values
    analytics-HistogramItemsValues:
      type: object
      properties:
        metricId:
          type: string
          description: UUID of a metric
          format: uuid
        value:
          type: number
          format: double
          description: Result of a metric
      required:
        - metricId
        - value
    analytics-HistogramMetadata:
      type: object
      description: Time constraints and aggregation details
      properties:
        period:
          $ref: "#/components/schemas/analytics-Period"
        dateFilter:
          $ref: "#/components/schemas/analytics-DateFilter"
      required:
        - aggregateDataBy
        - dateFilter
    analytics-HistogramLegacyPreviewRequest:
      type: object
      properties:
        analysis:
          $ref: "#/components/schemas/analytics-HistogramAnalysis"
        inlineAnalytics:
          $ref: "#/components/schemas/analytics-InlineAnalytics"
    analytics-AnalyticsFirstMatchRequest:
      type: object
      properties:
        identifierValue:
          $ref: "#/components/schemas/analytics-IdentifierValue"
        segmentations:
          type: array
          description: An array of objects. The objects are checked in the order from the array, and when a segmentation from an object matches the profile, the value of that object's `id` is returned in the response. Note that each object can check multiple segmentations - in such cases, only one of those segmentation needs to match for the object to be considered a match.
          items:
            $ref: "#/components/schemas/analytics-FirstMatchingSegmentation"
      required:
        - identifierValue
        - segmentations
    analytics-FirstMatchingSegmentation:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: This ID will be returned in the response to identify which object contains the first matching segmentation.
        segmentationIds:
          type: array
          description: An array of segmentations to check in this entry
          items:
            type: string
            format: uuid
          minItems: 0
        query:
          type: object
          description: A segmentation query to check
          properties:
            analysis:
              $ref: "#/components/schemas/analytics-SegmentationAnalysis"
      required:
        - id
        - segmentationIds
    analytics-SegmentationBasic:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/analytics-AnalyticId"
        name:
          $ref: "#/components/schemas/analytics-Name"
        author:
          $ref: "#/components/schemas/analytics-Author"
        updatedAt:
          $ref: "#/components/schemas/analytics-UpdatedAt"
        createdAt:
          $ref: "#/components/schemas/analytics-CreatedAt"
        usedAt:
          $ref: "#/components/schemas/analytics-UsedAt"
        segments:
          description: The number of segments in the segmentation
          type: integer
        starred:
          description: "`true` if the segmentation is added to starred items"
          type: boolean
        isPredefinedAnalytic:
          $ref: "#/components/schemas/analytics-IsPredefinedAnalytic"
        children:
          description: Analyses nested in the segmentation
          type: array
          nullable: true
          items:
            $ref: "#/components/schemas/analytics-SegmentationChild"
        directoryId:
          $ref: "#/components/schemas/analytics-DirectoryId"
        isDynamicAnalytic:
          $ref: "#/components/schemas/analytics-IsDynamicAnalytic"
        variables:
          $ref: "#/components/schemas/analytics-Variables"
        sharing:
          $ref: "#/components/schemas/analytics-SharingData"
      required:
        - author
        - children
        - createdAt
        - directoryId
        - id
        - isDynamicAnalytic
        - isPredefinedAnalytic
        - name
        - segments
        - sharing
        - starred
        - updatedAt
        - usedAt
        - variables
    analytics-SharingData:
      type: object
      properties:
        process:
          $ref: "#/components/schemas/analytics-SharingProcessSimple"
        attribute:
          $ref: "#/components/schemas/analytics-AttributeData"
      required:
        - process
        - attribute
    analytics-AttributeData:
      type: object
      properties:
        name:
          description: Name of the attribute
          type: string
        id:
          description: Unique ID of the attribute
          type: integer
          format: int64
      required:
        - name
        - id
    analytics-SharingProcessSimple:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/analytics-SharingProcessId"
        name:
          $ref: "#/components/schemas/analytics-SharingProcessName"
        shareType:
          $ref: "#/components/schemas/analytics-SharingProcessShareType"
        automationId:
          $ref: "#/components/schemas/analytics-SharingProcessAutomationId"
        status:
          $ref: "#/components/schemas/analytics-SharingProcessStatus"
      required:
        - id
        - name
        - shareType
        - status
    analytics-SharingProcessStatus:
      type: string
      description: Status of the sharing process
      enum:
        - ACTIVE
        - INACTIVE
        - DELETED
    analytics-SharingProcessAutomationId:
      type: string
      format: uuid
      description: ID of the automation which handles the sharing
    analytics-SharingProcessShareType:
      type: string
      description: Type of sharing process
      enum:
        - CROSSWORKSPACE
        - INTERNAL
    analytics-SharingProcessName:
      type: string
      description: Name of the sharing process
    analytics-SharingProcessId:
      type: string
      format: uuid
      description: Unique identifier of the sharing process
    analytics-SegmentationChild:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/analytics-Id"
        segmentationId:
          $ref: "#/components/schemas/analytics-Id"
        name:
          $ref: "#/components/schemas/analytics-Name"
      required:
        - name
        - segmentationId
    analytics-SegmentationRequest:
      type: object
      properties:
        analysis:
          $ref: "#/components/schemas/analytics-SegmentationAnalysis"
        isVisibleForClientProfile:
          $ref: "#/components/schemas/analytics-IsVisibleForClientProfile"
        inlineAnalytics:
          $ref: "#/components/schemas/analytics-InlineAnalytics"
      required:
        - analysis
        - isVisibleForClientProfile
    analytics-SegmentationView:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/analytics-AnalyticId"
        businessProfileId:
          $ref: "#/components/schemas/analytics-BusinessProfileId"
        name:
          $ref: "#/components/schemas/analytics-Name"
        description:
          $ref: "#/components/schemas/analytics-Description"
        author:
          $ref: "#/components/schemas/analytics-AuthorId"
        modifier:
          $ref: "#/components/schemas/analytics-modifierId"
        updatedAt:
          $ref: "#/components/schemas/analytics-UpdatedAt"
        createdAt:
          $ref: "#/components/schemas/analytics-CreatedAt"
        usedAt:
          $ref: "#/components/schemas/analytics-UsedAt"
        analysis:
          $ref: "#/components/schemas/analytics-SegmentationAnalysis"
        inlineAnalytics:
          $ref: "#/components/schemas/analytics-InlineAnalytics"
        isPredefinedAnalytic:
          $ref: "#/components/schemas/analytics-IsPredefinedAnalytic"
        isVisibleForClientProfile:
          $ref: "#/components/schemas/analytics-IsVisibleForClientProfile"
        isDynamicAnalytic:
          $ref: "#/components/schemas/analytics-IsDynamicAnalytic"
        isDeleted:
          $ref: "#/components/schemas/analytics-IsDeleted"
        namespace:
          $ref: "#/components/schemas/analytics-Namespace"
        directoryId:
          $ref: "#/components/schemas/analytics-DirectoryId"
        sharing:
          $ref: "#/components/schemas/analytics-SharingData"
      required:
        - id
        - businessProfileId
        - name
        - description
        - author
        - modifier
        - updatedAt
        - createdAt
        - usedAt
        - analysis
        - isPredefinedAnalytic
        - isVisibleForClientProfile
        - isDynamicAnalytic
        - isDeleted
        - namespace
        - directoryId
        - sharing
    analytics-CalculatedAnalytic:
      type: object
      properties:
        analyticId:
          $ref: "#/components/schemas/analytics-AnalyticId"
        name:
          $ref: "#/components/schemas/analytics-AnalyticName"
        result:
          $ref: "#/components/schemas/analytics-CalculationResult"
      required:
        - analyticId
        - name
        - result
    analytics-SegmentationWithRelated:
      type: object
      properties:
        segmentationId:
          $ref: "#/components/schemas/analytics-AnalyticId"
        related:
          type: boolean
          description: "`true` if profile belongs to this segmentation."
      required:
        - related
        - segmentationId
    analytics-AggregateHistogramCalculationResponse:
      type: object
      properties:
        items:
          type: array
          description: The numerical results, divided into time units according to `aggregateDataBy`. Each object in the array holds the results for a particular aggregation period.
          items:
            $ref: "#/components/schemas/analytics-HistogramTimeDistributionItem"
        metadata:
          $ref: "#/components/schemas/analytics-HistogramMetadata"
      required:
        - items
        - metadata
    analytics-HistogramTimeDistributionItem:
      type: object
      properties:
        aggregateTimeDescription:
          type: string
          description: Time when this interval ended
        values:
          type: array
          description: The result of the aggregate
          items:
            $ref: "#/components/schemas/analytics-HistogramAggregateTimeDistributedChartItem"
      required:
        - aggregateTimeDescription
        - values
    analytics-HistogramAggregateTimeDistributedChartItem:
      type: object
      properties:
        uuid:
          description: Identifier of the value
          type: string
          format: uuid
        value:
          description: The value
          type: number
          format: double
      required:
        - metricId
        - value
    analytics-AggregateHistogramRequest:
      type: object
      properties:
        variables:
          type: array
          description: A list of variable values to use in this calculation
          items:
            $ref: "#/components/schemas/analytics-Variable"
        dateFilter:
          $ref: "#/components/schemas/analytics-DateFilter"
        aggregateDataBy:
          $ref: "#/components/schemas/analytics-Period"
      required:
        - aggregateDataBy
        - dateFilter
        - variables
    analytics-AggregateTypedCalculationResponse:
      type: object
      properties:
        aggregateId:
          $ref: "#/components/schemas/analytics-AnalyticId"
        aggregateUuid:
          $ref: "#/components/schemas/analytics-AnalyticId"
        clientId:
          $ref: "#/components/schemas/analytics-ClientId"
        title:
          $ref: "#/components/schemas/analytics-AnalyticName"
        result:
          description: The result of the calculation
          anyOf:
            - type: string
            - type: number
            - type: object
            - type: boolean
            - type: array
              items: {}
        variables:
          $ref: "#/components/schemas/analytics-Variables"
        dateFilter:
          $ref: "#/components/schemas/analytics-DateFilter"
        analyticVersion:
          $ref: "#/components/schemas/analytics-AnalyticVersion"
      required:
        - aggregateId
        - aggregateUuid
        - clientId
        - title
        - result
        - variables
        - dateFilter
        - analyticVersion
    analytics-ClientId:
      type: number
      format: int64
      description: ID of the profile
    analytics-AggregatePreviewRequest:
      properties:
        identifierValue:
          $ref: "#/components/schemas/analytics-IdentifierValue"
        aggregate:
          $ref: "#/components/schemas/analytics-ClientAggregate"
        inlineAnalytics:
          $ref: "#/components/schemas/analytics-InlineAnalytics"
      required:
        - aggregate
        - identifierValue
    analytics-AggregateResult:
      type: object
      properties:
        clientId:
          type: integer
          format: int32
          description: ID of the profile
        aggregateId:
          type: string
          format: uuid
          description: UUID of the aggregate
        name:
          type: string
          description: Name of the aggregate
        result:
          description: The result of the calculation
          anyOf:
            - type: string
            - type: number
            - type: object
            - type: boolean
            - type: array
              items: {}
      required:
        - aggregateId
        - clientId
        - name
        - result
    analytics-AggregatePaginationContainer:
      type: object
      properties:
        data:
          type: array
          description: An array of funnels
          items:
            $ref: "#/components/schemas/analytics-AggregateSimplifiedView"
        meta:
          $ref: "#/components/schemas/analytics-Meta"
      required:
        - data
    analytics-AggregateSimplifiedView:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/analytics-AnalyticId"
        name:
          $ref: "#/components/schemas/analytics-Name"
        author:
          $ref: "#/components/schemas/analytics-AuthorId"
        updatedAt:
          $ref: "#/components/schemas/analytics-UpdatedAt"
        createdAt:
          $ref: "#/components/schemas/analytics-CreatedAt"
        usedAt:
          $ref: "#/components/schemas/analytics-UsedAt"
        directoryId:
          $ref: "#/components/schemas/analytics-DirectoryId"
        isDynamicAnalytic:
          $ref: "#/components/schemas/analytics-IsDynamicAnalytic"
        aggregateType:
          $ref: "#/components/schemas/analytics-AggregateType"
        variables:
          description: Dynamic keys used in this analysis
          type: array
          items:
            $ref: "#/components/schemas/analytics-TerrariumVariable"
      required:
        - id
        - name
        - author
        - updatedAt
        - createdAt
        - usedAt
        - directoryId
        - isDynamicAnalytic
        - aggregateType
        - variables
    analytics-TerrariumVariable:
      type: object
      properties:
        name:
          type: string
        value: {}
      required:
        - name
        - value
    analytics-AggregateType:
      type: string
      enum:
        - AGGREGATE
        - RUNNING_AGGREGATE
    analytics-AggregateRequest:
      type: object
      description: Definition of the aggregate
      properties:
        analysis:
          $ref: "#/components/schemas/analytics-AggregateAnalysis"
        isVisibleForClientProfile:
          $ref: "#/components/schemas/analytics-IsVisibleForClientProfile"
        aggregateType:
          $ref: "#/components/schemas/analytics-AggregateType"
        previewDefaultObjectId:
          $ref: "#/components/schemas/analytics-PreviewDefaultObjectId"
        inlineAnalytics:
          $ref: "#/components/schemas/analytics-InlineAnalytics"
      required:
        - analysis
        - isVisibleForClientProfile
    analytics-PreviewDefaultObjectId:
      type: number
      format: int64
      nullable: true
      description: The ID of the default profile for generating a preview of the results.
    analytics-AggregateView:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/analytics-AnalyticId"
        oldId:
          $ref: "#/components/schemas/analytics-OldId"
        businessProfileId:
          $ref: "#/components/schemas/analytics-BusinessProfileId"
        name:
          $ref: "#/components/schemas/analytics-Name"
        description:
          $ref: "#/components/schemas/analytics-Description"
        author:
          $ref: "#/components/schemas/analytics-AuthorId"
        modifier:
          $ref: "#/components/schemas/analytics-modifierId"
        updatedAt:
          $ref: "#/components/schemas/analytics-UpdatedAt"
        createdAt:
          $ref: "#/components/schemas/analytics-CreatedAt"
        usedAt:
          $ref: "#/components/schemas/analytics-UsedAt"
        analysis:
          $ref: "#/components/schemas/analytics-AggregateAnalysis"
        inlineAnalytics:
          $ref: "#/components/schemas/analytics-InlineAnalytics"
        isPredefinedAnalytic:
          $ref: "#/components/schemas/analytics-IsPredefinedAnalytic"
        isVisibleForClientProfile:
          $ref: "#/components/schemas/analytics-IsVisibleForClientProfile"
        isDynamicAnalytic:
          $ref: "#/components/schemas/analytics-IsDynamicAnalytic"
        isDeleted:
          $ref: "#/components/schemas/analytics-IsDeleted"
        analyticVersion:
          $ref: "#/components/schemas/analytics-AnalyticVersion"
        namespace:
          $ref: "#/components/schemas/analytics-Namespace"
        directoryId:
          $ref: "#/components/schemas/analytics-DirectoryId"
        aggregateType:
          $ref: "#/components/schemas/analytics-AggregateType"
        previewDefaultObjectId:
          $ref: "#/components/schemas/analytics-PreviewDefaultObjectId"
      required:
        - id
        - oldId
        - businessProfileId
        - name
        - description
        - author
        - modifier
        - updatedAt
        - createdAt
        - usedAt
        - analysis
        - isPredefinedAnalytic
        - isVisibleForClientProfile
        - isDynamicAnalytic
        - isDeleted
        - analyticVersion
        - namespace
        - directoryId
        - aggregateType
        - previewDefaultObjectId
    analytics-OldId:
      type: integer
      description: A unique numeric ID required for backwards compatibility. Cannot be changed.
    analytics-AggregateUpdateRequest:
      type: object
      description: Definition of the aggregate
      properties:
        analysis:
          $ref: "#/components/schemas/analytics-AggregateAnalysis"
        isVisibleForClientProfile:
          $ref: "#/components/schemas/analytics-IsVisibleForClientProfile"
        aggregateType:
          $ref: "#/components/schemas/analytics-AggregateType"
        previewDefaultObjectId:
          $ref: "#/components/schemas/analytics-PreviewDefaultObjectId"
        inlineAnalytics:
          $ref: "#/components/schemas/analytics-InlineAnalytics"
      required:
        - analysis
        - isVisibleForClientProfile
    analytics-SankeyCalculationResponse:
      type: object
      properties:
        results:
          type: array
          description: |
            
            Each array in this array is one transition.

            Each transition array includes six strings.
            - index 0 is the FROM event in the format `"<layer>_<eventId>_<drilldownResult>"`<br>Layer indexes start at 0. If you are analyzing paths starting at the sourceEvent, that event is layer 0. If you are analyzing paths that end with the sourceEvent, layer 0 is the first event in the path.<br>Drilldown result is nullified if no drilldown is defined for this event at this layer.
            - index 1 is the TO event in the same format
            - index 2 is the number of occurrences
            - index 3 is the average transition time in ms
            - index 4 is the shortest transition time in ms
            - index 5 is the longest transition time in ms

            **EXAMPLE:**

            Consider the following snippet, which includes two transitions:
            <pre><code><span>"results"</span><span>:</span> <span>[</span>
            <span>[</span>
                <span>"0_531_\"Mac OS X\""</span><span>,</span>
                <span>"1_1051_null"</span><span>,</span>
                <span>"2"</span><span>,</span>
                <span>"20"</span><span>,</span>
                <span>"10"</span><span>,</span>
                <span>"30"</span>
            <span>]</span><span>,</span>
            <span>[</span>
                <span>"1_1604_null"</span><span>,</span>
                <span>"2_6961_null"</span><span>,</span>
                <span>"1"</span><span>,</span>
                <span>"4242"</span><span>,</span>
                <span>"4242"</span><span>,</span>
                <span>"4242"</span>
            <span>]</span><span>,</span> </code></pre>
            The results of the first transition can be read as follows:

            Transition was FROM layer 0; sourceEvent (`action.id 531`); drilldown result \"Mac OS X\".

            Transition was TO layer 1; event with ID 1051, drilldown was undefined or result is null.

            Two profiles completed this transition.

            The average transition time was 20 ms, the longest time was 30 ms, and the shortest time was 10 ms.
          items:
            type: array
            items:
              type: string
    analytics-CreateRequestSankeyAnalysis:
      type: object
      properties:
        analysis:
          $ref: "#/components/schemas/analytics-SankeyAnalysis"
        inlineAnalytics:
          $ref: "#/components/schemas/analytics-InlineAnalytics"
      required:
        - analysis
    analytics-SankeyAnalysis:
      type: object
      description: Details of a Sankey analysis
      properties:
        id:
          $ref: "#/components/schemas/analytics-AnalyticId"
        title:
          $ref: "#/components/schemas/analytics-Name"
        description:
          $ref: "#/components/schemas/analytics-Description"
        sourceEvent:
          $ref: "#/components/schemas/analytics-SankeySourceEvent"
        reverseOrder:
          type: boolean
          description: |
            Defines the direction of the analysis:
            - When "false", the analysis shows paths that begin with the `sourceEvent`.
            - When "true", the analysis shows paths that end with the `sourceEvent`.
        numberOfSteps:
          type: integer
          format: int32
          minimum: 0
          description: The number of steps to analyze before or after the source event
        numberOfPaths:
          type: integer
          format: int32
          minimum: 0
          description: The number of paths to analyze
        drillDown:
          type: array
          description: An array of drilldown conditions. On each layer, an event can only have one drilldown assigned.
          items:
            $ref: "#/components/schemas/analytics-SankeyDrillDown"
        drillDownCount:
          type: integer
          nullable: true
          description: Defines the number of displayed top drilldown results.
        dateFilter:
          $ref: "#/components/schemas/analytics-DateFilter"
        filter:
          $ref: "#/components/schemas/analytics-ExpressionFilter"
        eventFilters:
          type: array
          description: An array of events to include or exclude according to the `excludeEvents` setting.
          items:
            $ref: "#/components/schemas/analytics-FunnelStep"
        excludeEvents:
          type: boolean
          description: |
            - When "true", the events defined in `eventFilters` are excluded from the analysis.
            - When "false", ONLY the events defined in `eventFilters` are included in the analysis.
        firstOccurrenceOnly:
          type: boolean
          description: When `true`, only the first occurrence of the source event is counted in the analysis.
      required:
        - id
        - title
        - description
        - sourceEvent
        - reverseOrder
        - numberOfSteps
        - numberOfPaths
        - drillDown
        - drillDownCount
        - dateFilter
        - filter
        - eventFilters
        - excludeEvents
        - firstOccurrenceOnly
    analytics-SankeyDrillDown:
      type: object
      description: A drilldown condition. On each layer, an event can only have one drilldown assigned.
      properties:
        layer:
          type: integer
          format: int32
          minimum: 0
          description: The layer where this drilldown applies. Layer indexes start at 0.
        action:
          $ref: "#/components/schemas/analytics-Action"
        attribute:
          $ref: "#/components/schemas/analytics-EventAttribute"
      required:
        - layer
        - action
        - attribute
    analytics-SankeySourceEvent:
      type: object
      description: The event that serves as the basis of the Sankey analysis
      properties:
        action:
          $ref: "#/components/schemas/analytics-Action"
        expressions:
          $ref: "#/components/schemas/analytics-EventExpressions"
      required:
        - action
        - expressions
    analytics-FunnelCalculationResponse:
      type: object
      properties:
        calculationResult:
          type: array
          description: Funnel calculation results, listed step-by-step
          items:
            $ref: "#/components/schemas/analytics-FunnelCalculationResult"
        metadata:
          $ref: "#/components/schemas/analytics-FunnelMetadata"
        timeBetweenSteps:
          type: array
          description: Data about time between steps. The objects are arranged according to step order (the first object in the array relates to transition between step 1 and step 2). All times are in milliseconds.
          items:
            $ref: "#/components/schemas/analytics-TimeBetweenSteps"
    analytics-TimeBetweenSteps:
      type: object
      description: Data about time between steps. All times are in milliseconds.
      properties:
        min:
          type: integer
          format: int64
          description: Shortest time
        max:
          type: integer
          format: int64
          description: Longest time
        avg:
          type: integer
          format: int64
          description: Average time
      required:
        - min
        - max
        - avg
    analytics-FunnelMetadata:
      type: object
      description: Raw data of the calculation
      properties:
        source:
          type: array
          description: An array of results. The first item of the array is the number of profiles that matched the profile filter (if applicable), but didn't complete any steps. The second number is the number of profiles who completed the first step, and so on.
          items:
            type: integer
            format: int64
    analytics-FunnelCalculationResult:
      type: object
      description: Calculation results, divided into steps
      properties:
        name:
          type: string
          description: Step name
        result:
          type: integer
          format: int64
          description: The number of profiles which completed this step
    analytics-FunnelRequest:
      type: object
      properties:
        analysis:
          $ref: "#/components/schemas/analytics-FunnelAnalysis"
        inlineAnalytics:
          $ref: "#/components/schemas/analytics-InlineAnalytics"
      required:
        - analysis
    analytics-FunnelAnalysis:
      type: object
      description: Details of the funnel
      properties:
        title:
          $ref: "#/components/schemas/analytics-Name"
        description:
          $ref: "#/components/schemas/analytics-Description"
        funnel:
          $ref: "#/components/schemas/analytics-Funnel"
        filter:
          $ref: "#/components/schemas/analytics-ExpressionFilter"
      required:
        - description
        - filter
        - funnel
        - title
    analytics-FunnelView:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/analytics-AnalyticId"
        businessProfileId:
          $ref: "#/components/schemas/analytics-BusinessProfileId"
        name:
          $ref: "#/components/schemas/analytics-Name"
        description:
          $ref: "#/components/schemas/analytics-Description"
        author:
          $ref: "#/components/schemas/analytics-AuthorId"
        modifier:
          $ref: "#/components/schemas/analytics-modifierId"
        updatedAt:
          $ref: "#/components/schemas/analytics-UpdatedAt"
        createdAt:
          $ref: "#/components/schemas/analytics-CreatedAt"
        usedAt:
          $ref: "#/components/schemas/analytics-UsedAt"
        analysis:
          $ref: "#/components/schemas/analytics-FunnelAnalysis"
        inlineAnalytics:
          $ref: "#/components/schemas/analytics-InlineAnalytics"
        isPredefinedAnalytic:
          $ref: "#/components/schemas/analytics-IsPredefinedAnalytic"
        isDynamicAnalytic:
          $ref: "#/components/schemas/analytics-IsDynamicAnalytic"
        isDeleted:
          $ref: "#/components/schemas/analytics-IsDeleted"
        namespace:
          $ref: "#/components/schemas/analytics-Namespace"
        directoryId:
          $ref: "#/components/schemas/analytics-DirectoryId"
      required:
        - id
        - businessProfileId
        - name
        - description
        - author
        - modifier
        - updatedAt
        - createdAt
        - usedAt
        - analysis
        - isPredefinedAnalytic
        - isDynamicAnalytic
        - isDeleted
        - namespace
        - directoryId
    analytics-ReportListItem:
      allOf:
        - type: object
          properties:
            isMultiMetric:
              type: boolean
              description: True when the report has more than one metric.
          required:
            - isMultiMetric
        - $ref: "#/components/schemas/analytics-ListAnalyticsItemCommon"
    analytics-ReportRequest:
      type: object
      properties:
        analysis:
          $ref: "#/components/schemas/analytics-ReportAnalysis"
        allowNull:
          $ref: "#/components/schemas/analytics-AllowNull"
        inlineAnalytics:
          $ref: "#/components/schemas/analytics-InlineAnalytics"
    analytics-ReportView:
      type: object
      description: Full report analysis details
      properties:
        id:
          $ref: "#/components/schemas/analytics-AnalyticId"
        businessProfileId:
          $ref: "#/components/schemas/analytics-BusinessProfileId"
        name:
          $ref: "#/components/schemas/analytics-Name"
        description:
          $ref: "#/components/schemas/analytics-Description"
        author:
          $ref: "#/components/schemas/analytics-AuthorId"
        modifier:
          $ref: "#/components/schemas/analytics-modifierId"
        updatedAt:
          $ref: "#/components/schemas/analytics-UpdatedAt"
        createdAt:
          $ref: "#/components/schemas/analytics-CreatedAt"
        usedAt:
          $ref: "#/components/schemas/analytics-UsedAt"
        analysis:
          $ref: "#/components/schemas/analytics-ReportAnalysis"
        inlineAnalytics:
          $ref: "#/components/schemas/analytics-InlineAnalytics"
        isPredefinedAnalytic:
          $ref: "#/components/schemas/analytics-IsPredefinedAnalytic"
        isDynamicAnalytic:
          $ref: "#/components/schemas/analytics-IsDynamicAnalytic"
        allowNull:
          $ref: "#/components/schemas/analytics-AllowNull"
        isDeleted:
          $ref: "#/components/schemas/analytics-IsDeleted"
        namespace:
          $ref: "#/components/schemas/analytics-Namespace"
        directoryId:
          $ref: "#/components/schemas/analytics-DirectoryId"
      required:
        - id
        - businessProfileId
        - name
        - description
        - author
        - modifier
        - updatedAt
        - createdAt
        - usedAt
        - analysis
        - isPredefinedAnalytic
        - isDynamicAnalytic
        - allowNull
        - isDeleted
        - namespace
        - directoryId
    analytics-TrendRequest:
      type: object
      properties:
        analysis:
          $ref: "#/components/schemas/analytics-TrendAnalysis"
        inlineAnalytics:
          $ref: "#/components/schemas/analytics-InlineAnalytics"
      required:
        - analysis
    analytics-TrendAnalysis:
      type: object
      description: Details of a trend analysis
      properties:
        id:
          $ref: "#/components/schemas/analytics-AnalyticId"
        title:
          $ref: "#/components/schemas/analytics-Name"
        description:
          $ref: "#/components/schemas/analytics-Description"
        filter:
          $ref: "#/components/schemas/analytics-ExpressionFilter"
        trend:
          $ref: "#/components/schemas/analytics-Trend"
      required:
        - filter
        - title
        - trend
    analytics-Trend:
      type: object
      properties:
        aggregateDataBy:
          $ref: "#/components/schemas/analytics-Period"
        dateFilter:
          $ref: "#/components/schemas/analytics-DateFilter"
        trendDefinitions:
          type: array
          description: An array of trends included in the trend analysis
          items:
            $ref: "#/components/schemas/analytics-TrendDefinition"
    analytics-TrendDefinition:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/analytics-AnalyticId"
        title:
          $ref: "#/components/schemas/analytics-Name"
        description:
          $ref: "#/components/schemas/analytics-Description"
        action:
          $ref: "#/components/schemas/analytics-Action"
        expressions:
          $ref: "#/components/schemas/analytics-EventExpressions"
        tabIndex:
          type: integer
          format: int32
          description: Currently unused. For compatibility, set to 0.
          default: 0
        aggregationType:
          type: string
          default: EVENT
          description: Currently unused. For compatibility, set to EVENT
          enum:
            - EVENT
            - CLIENT
        chartType:
          $ref: "#/components/schemas/analytics-ChartType"
      required:
        - title
        - chartType
        - action
        - expressions
        - tabIndex
        - aggregationType
    analytics-TrendView:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/analytics-AnalyticId"
        businessProfileId:
          $ref: "#/components/schemas/analytics-BusinessProfileId"
        name:
          $ref: "#/components/schemas/analytics-Name"
        description:
          $ref: "#/components/schemas/analytics-Description"
        author:
          $ref: "#/components/schemas/analytics-AuthorId"
        modifier:
          $ref: "#/components/schemas/analytics-modifierId"
        updatedAt:
          $ref: "#/components/schemas/analytics-UpdatedAt"
        createdAt:
          $ref: "#/components/schemas/analytics-CreatedAt"
        usedAt:
          $ref: "#/components/schemas/analytics-UsedAt"
        analysis:
          $ref: "#/components/schemas/analytics-TrendAnalysis"
        inlineAnalytics:
          $ref: "#/components/schemas/analytics-InlineAnalytics"
        isPredefinedAnalytic:
          $ref: "#/components/schemas/analytics-IsPredefinedAnalytic"
        isDynamicAnalytic:
          $ref: "#/components/schemas/analytics-IsDynamicAnalytic"
        isDeleted:
          $ref: "#/components/schemas/analytics-IsDeleted"
        namespace:
          $ref: "#/components/schemas/analytics-Namespace"
        directoryId:
          $ref: "#/components/schemas/analytics-DirectoryId"
      required:
        - id
        - businessProfileId
        - name
        - description
        - author
        - modifier
        - updatedAt
        - createdAt
        - usedAt
        - analysis
        - isPredefinedAnalytic
        - isDynamicAnalytic
        - isDeleted
        - namespace
        - directoryId
    analytics-TrendSignedCalculationResponse:
      type: object
      properties:
        name:
          description: Name of the resource
          type: string
        metadata:
          $ref: "#/components/schemas/analytics-TrendMetadata"
        items:
          description: Results, grouped by time unit
          type: array
          items:
            $ref: "#/components/schemas/analytics-TrendTimeDistributionItem"
        legends:
          description: Information about included trends and their display mode
          type: array
          items:
            $ref: "#/components/schemas/analytics-TrendCalculationLegend"
      required:
        - name
        - metadata
        - items
        - legends
    analytics-TrendCalculationLegend:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/analytics-Id"
        title:
          $ref: "#/components/schemas/analytics-Name"
        chartType:
          $ref: "#/components/schemas/analytics-ChartType"
      required:
        - id
        - title
        - chartType
    analytics-TrendTimeDistributionItem:
      type: object
      properties:
        aggregateTimeDescription:
          type: string
          description: Timestamp of the result
          format: date-time
        values:
          description: An array of the results of the included metrics
          type: array
          items:
            $ref: "#/components/schemas/analytics-TrendCalculationExpression"
      required:
        - aggregateTimeDescription
        - values
    analytics-TrendCalculationExpression:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/analytics-AnalyticId"
        countedEvents:
          type: number
          format: double
          description: The number of events that matched the trend. If the trend analyzes profiles, this value is `0.0`.
        countedClients:
          type: number
          format: double
          description: The number of profiles which matched the trend. If the trend analyzes events, this value is `0.0`.
      required:
        - id
        - countedEvents
        - countedClients
    analytics-TrendMetadata:
      type: object
      description: Metadata of the analysis
      properties:
        aggregateDataBy:
          $ref: "#/components/schemas/analytics-TrendAggregateDataBy"
        dateFilter:
          $ref: "#/components/schemas/analytics-DateFilter"
      required:
        - aggregateDataBy
        - dateFilter
    analytics-TrendAggregateDataBy:
      type: object
      description: The interval for grouping data
      properties:
        type:
          $ref: "#/components/schemas/analytics-TimePeriod"
        value:
          $ref: "#/components/schemas/analytics-TimeValue"
      required:
        - type
        - value
    analytics-TrendAnalysisRequest:
      type: object
      description: A trend analysis
      properties:
        analysis:
          $ref: "#/components/schemas/analytics-TrendAnalysis"
        tags:
          description: Currently unused
          type: array
          items:
            type: string
      required:
        - analysis
    analytics-SankeyView:
      type: object
      description: A Sankey analytic view
      properties:
        id:
          $ref: "#/components/schemas/analytics-AnalyticId"
        businessProfileId:
          $ref: "#/components/schemas/analytics-BusinessProfileId"
        name:
          $ref: "#/components/schemas/analytics-Name"
        description:
          $ref: "#/components/schemas/analytics-Description"
        author:
          $ref: "#/components/schemas/analytics-AuthorId"
        modifier:
          $ref: "#/components/schemas/analytics-modifierId"
        updatedAt:
          $ref: "#/components/schemas/analytics-UpdatedAt"
        createdAt:
          $ref: "#/components/schemas/analytics-CreatedAt"
        usedAt:
          $ref: "#/components/schemas/analytics-UsedAt"
        analysis:
          $ref: "#/components/schemas/analytics-SankeyAnalysis"
        inlineAnalytics:
          $ref: "#/components/schemas/analytics-InlineAnalytics"
        isPredefinedAnalytic:
          $ref: "#/components/schemas/analytics-IsPredefinedAnalytic"
        isDynamicAnalytic:
          $ref: "#/components/schemas/analytics-IsDynamicAnalytic"
        isDeleted:
          $ref: "#/components/schemas/analytics-IsDeleted"
        namespace:
          $ref: "#/components/schemas/analytics-Namespace"
        directoryId:
          $ref: "#/components/schemas/analytics-DirectoryId"
      required:
        - id
        - businessProfileId
        - name
        - description
        - author
        - modifier
        - updatedAt
        - createdAt
        - usedAt
        - analysis
        - isPredefinedAnalytic
        - isDynamicAnalytic
        - isDeleted
        - namespace
        - directoryId
    metrics-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
    metrics-AvailableMetrics:
      type: array
      items:
        type: object
        properties:
          id:
            type: string
            description: Metric identifier
          description:
            type: string
            description: Metric description
    metrics-AvailableMetricsIds:
      type: array
      items:
        type: string
  parameters:
    analytics-isReportMetric:
      name: isReportMetric
      in: query
      description: Filter metrics by whether they are report metrics.
      required: false
      style: form
      explode: true
      schema:
        type: boolean
    analytics-isHistogramMetric:
      name: isHistogramMetric
      in: query
      description: Filter metrics by whether they are histogram metrics.
      required: false
      style: form
      explode: true
      schema:
        type: boolean
    analytics-ids:
      name: ids
      in: query
      description: Comma-separated list of IDs (in UUID format) to filter results through
      required: false
      style: form
      explode: false
      schema:
        type: string
    analytics-directoryId:
      name: directoryId
      description: Unique ID of the directory to retrieve analyses from
      in: query
      required: false
      schema:
        type: string
        format: uuid
    analytics-pathNamespace:
      name: Namespace
      in: path
      description: Namespace. Currently, only `profiles` is available.
      required: true
      style: simple
      explode: false
      schema:
        type: string
        enum:
          - profiles
    analytics-sortBy:
      name: sortBy
      description: |
        You can sort the results. The sorting direction is selected by adding `asc` or `desc`, for example `sortBy=name:desc`.
      in: query
      required: false
      style: form
      explode: true
      schema:
        type: string
        example: name:asc
        default: updatedAt:desc
        enum:
          - name:asc
          - name:desc
          - author:asc
          - author:desc
          - updatedAt:asc
          - updatedAt:desc
          - createdAt:asc
          - createdAt:desc
          - id:asc
          - id:desc
          - directoryId:asc
          - directoryId:desc
    analytics-search:
      name: search
      description: A string to search for in analyses' titles
      in: query
      required: false
      schema:
        type: string
    analytics-limit:
      name: limit
      in: query
      description: Limit of items per page
      required: false
      style: form
      explode: true
      schema:
        type: integer
        format: int32
        default: 50
    analytics-page:
      name: page
      description: The number of the page to retrieve
      in: query
      required: false
      style: form
      explode: true
      schema:
        type: integer
        format: int32
        default: 1
        minimum: 1
    analytics-AnalyticIdPathParam:
      name: AnalysisId
      in: path
      description: UUID of the analysis
      required: true
      style: simple
      explode: false
      schema:
        type: string
        format: uuid
    analytics-DirectoryIdPathParam:
      name: DirectoryId
      in: path
      description: ID of a directory
      required: true
      style: simple
      explode: false
      schema:
        type: string
        format: uuid
    analytics-pathIdentifierType:
      name: IdentifierType
      in: path
      description: Profile identifier type
      required: true
      style: simple
      explode: false
      schema:
        type: string
        enum:
          - id
          - uuid
          - email
          - custom_identify
    analytics-actionName:
      name: actionName
      description: Filter event expressions by their action's event name. When omitted, expressions for all actions are returned.
      in: query
      required: false
      schema:
        type: string
    analytics-expressionType:
      name: type
      description: Filter by expression type. When omitted, expressions of all types are returned.
      in: query
      required: false
      schema:
        type: string
        enum:
          - CLIENT
          - EVENT
    analytics-shareType:
      name: shareType
      description: Type of sharing process
      in: query
      required: false
      schema:
        type: string
        enum:
          - CROSSWORKSPACE
          - INTERNAL
    analytics-clientIdAsPathParameter:
      name: ProfileId
      in: path
      description: Unique identifier of a profile
      required: true
      style: simple
      explode: false
      schema:
        type: integer
        format: int64
    analytics-aggregateIdentifierAsPathParam:
      name: AggregateIdentifier
      in: path
      description: Aggregate identifier (UUID or numeric ID)
      required: true
      style: simple
      explode: false
      schema:
        type: string
    analytics-AggregateType:
      name: aggregateType
      in: query
      description: Filter by aggregate type
      required: false
      schema:
        type: string
        enum:
          - AGGREGATE
          - RUNNING_AGGREGATE
    analytics-isMultiMetric:
      name: isMultiMetric
      in: query
      description: Filter reports by whether they have more than one metric.
      required: false
      style: form
      explode: true
      schema:
        type: boolean
  responses:
    analytics-genericError:
      description: See error message for details
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/analytics-Error"
