openapi: 3.0.0
info:
  title: Analytics Suite - Synerise Public API
  version: 1.2.2
servers:
  - description: Microsoft Azure EU
    url: https://api.synerise.com
  - description: Microsoft Azure USA
    url: https://api.azu.synerise.com
  - description: Google Cloud Platform
    url: https://api.geb.synerise.com
tags:
  - name: "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"
      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"
        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' \
              --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", 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");
            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",
              "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'
            ]);

            $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")
              .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":{"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":"EVENT","title":"string","occurrenceType":"FIRST","aggregation":{"type":"COUNT","level":0.01,"attribute":{"type":"PARAM","param":"string","id":0}},"action":{"id":0,"name":"page.visit"},"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":"FUNNEL","matching":true,"funnel":{"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}},"exact":false,"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}],"title":"string"}}],"expression":{}},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}},"isVisibleForClientProfile":true}}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"analysis\":{\"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\":\"EVENT\",\"title\":\"string\",\"occurrenceType\":\"FIRST\",\"aggregation\":{\"type\":\"COUNT\",\"level\":0.01,\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0}},\"action\":{\"id\":0,\"name\":\"page.visit\"},\"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\":\"FUNNEL\",\"matching\":true,\"funnel\":{\"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}},\"exact\":false,\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}],\"title\":\"string\"}}],\"expression\":{}},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}},\"isVisibleForClientProfile\":true}}"

            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": {
                "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": "EVENT",
                    "title": "string",
                    "occurrenceType": "FIRST",
                    "aggregation": {
                      "type": "COUNT",
                      "level": 0.01,
                      "attribute": {
                        "type": "PARAM",
                        "param": "string",
                        "id": 0
                      }
                    },
                    "action": {
                      "id": 0,
                      "name": "page.visit"
                    },
                    "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": "FUNNEL",
                          "matching": true,
                          "funnel": {
                            "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
                              }
                            },
                            "exact": false,
                            "steps": [
                              {
                                "title": "string",
                                "action": {
                                  "id": 0,
                                  "name": "page.visit"
                                },
                                "expressions": [
                                  {
                                    "attribute": {
                                      "type": "PARAM",
                                      "param": "string",
                                      "id": 0
                                    },
                                    "constraint": {
                                      "type": "BOOL",
                                      "logic": "IS_TRUE"
                                    }
                                  }
                                ]
                              }
                            ],
                            "title": "string"
                          }
                        }
                      ],
                      "expression": {}
                    },
                    "expressions": [
                      {
                        "attribute": {
                          "type": "PARAM",
                          "param": "string",
                          "id": 0
                        },
                        "constraint": {
                          "type": "BOOL",
                          "logic": "IS_TRUE"
                        }
                      }
                    ]
                  }
                },
                "isVisibleForClientProfile": 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/%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: {
                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: 'EVENT',
                    title: 'string',
                    occurrenceType: 'FIRST',
                    aggregation: {type: 'COUNT', level: 0.01, attribute: {type: 'PARAM', param: 'string', id: 0}},
                    action: {id: 0, name: 'page.visit'},
                    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: 'FUNNEL',
                          matching: true,
                          funnel: {
                            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
                              }
                            },
                            exact: false,
                            steps: [
                              {
                                title: 'string',
                                action: {id: 0, name: 'page.visit'},
                                expressions: [
                                  {
                                    attribute: {type: 'PARAM', param: 'string', id: 0},
                                    constraint: {type: 'BOOL', logic: 'IS_TRUE'}
                                  }
                                ]
                              }
                            ],
                            title: 'string'
                          }
                        }
                      ],
                      expression: {}
                    },
                    expressions: [
                      {
                        attribute: {type: 'PARAM', param: 'string', id: 0},
                        constraint: {type: 'BOOL', logic: 'IS_TRUE'}
                      }
                    ]
                  }
                },
                isVisibleForClientProfile: true
              }
            }));
            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":{"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":"EVENT","title":"string","occurrenceType":"FIRST","aggregation":{"type":"COUNT","level":0.01,"attribute":{"type":"PARAM","param":"string","id":0}},"action":{"id":0,"name":"page.visit"},"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":"FUNNEL","matching":true,"funnel":{"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}},"exact":false,"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}],"title":"string"}}],"expression":{}},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}},"isVisibleForClientProfile":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/%7Bnamespace%7D/metrics")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"analysis\":{\"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\":\"EVENT\",\"title\":\"string\",\"occurrenceType\":\"FIRST\",\"aggregation\":{\"type\":\"COUNT\",\"level\":0.01,\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0}},\"action\":{\"id\":0,\"name\":\"page.visit\"},\"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\":\"FUNNEL\",\"matching\":true,\"funnel\":{\"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}},\"exact\":false,\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}],\"title\":\"string\"}}],\"expression\":{}},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}},\"isVisibleForClientProfile\":true}}")
              .asString();
  /analytics/{namespace}/metrics/{metricId}:
    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-metricIdAsPathParam"
        - $ref: "#/components/parameters/analytics-pathNamespace"
      responses:
        "200":
          description: Metric details
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/analytics-Metric"
        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/%7BmetricId%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/%7BmetricId%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/%7BmetricId%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/%7BmetricId%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/%7BmetricId%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/%7BmetricId%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-metricIdAsPathParam"
        - $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-Metric"
        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/%7BmetricId%7D \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"analysis":{"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":"EVENT","title":"string","occurrenceType":"FIRST","aggregation":{"type":"COUNT","level":0.01,"attribute":{"type":"PARAM","param":"string","id":0}},"action":{"id":0,"name":"page.visit"},"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":"FUNNEL","matching":true,"funnel":{"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}},"exact":false,"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}],"title":"string"}}],"expression":{}},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}},"isVisibleForClientProfile":true}}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"analysis\":{\"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\":\"EVENT\",\"title\":\"string\",\"occurrenceType\":\"FIRST\",\"aggregation\":{\"type\":\"COUNT\",\"level\":0.01,\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0}},\"action\":{\"id\":0,\"name\":\"page.visit\"},\"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\":\"FUNNEL\",\"matching\":true,\"funnel\":{\"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}},\"exact\":false,\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}],\"title\":\"string\"}}],\"expression\":{}},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}},\"isVisibleForClientProfile\":true}}"

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

            conn.request("PUT", "/analytics/%7Bnamespace%7D/metrics/%7BmetricId%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",
                "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": "EVENT",
                    "title": "string",
                    "occurrenceType": "FIRST",
                    "aggregation": {
                      "type": "COUNT",
                      "level": 0.01,
                      "attribute": {
                        "type": "PARAM",
                        "param": "string",
                        "id": 0
                      }
                    },
                    "action": {
                      "id": 0,
                      "name": "page.visit"
                    },
                    "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": "FUNNEL",
                          "matching": true,
                          "funnel": {
                            "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
                              }
                            },
                            "exact": false,
                            "steps": [
                              {
                                "title": "string",
                                "action": {
                                  "id": 0,
                                  "name": "page.visit"
                                },
                                "expressions": [
                                  {
                                    "attribute": {
                                      "type": "PARAM",
                                      "param": "string",
                                      "id": 0
                                    },
                                    "constraint": {
                                      "type": "BOOL",
                                      "logic": "IS_TRUE"
                                    }
                                  }
                                ]
                              }
                            ],
                            "title": "string"
                          }
                        }
                      ],
                      "expression": {}
                    },
                    "expressions": [
                      {
                        "attribute": {
                          "type": "PARAM",
                          "param": "string",
                          "id": 0
                        },
                        "constraint": {
                          "type": "BOOL",
                          "logic": "IS_TRUE"
                        }
                      }
                    ]
                  }
                },
                "isVisibleForClientProfile": true
              }
            });

            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/%7BmetricId%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/%7BmetricId%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',
                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: 'EVENT',
                    title: 'string',
                    occurrenceType: 'FIRST',
                    aggregation: {type: 'COUNT', level: 0.01, attribute: {type: 'PARAM', param: 'string', id: 0}},
                    action: {id: 0, name: 'page.visit'},
                    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: 'FUNNEL',
                          matching: true,
                          funnel: {
                            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
                              }
                            },
                            exact: false,
                            steps: [
                              {
                                title: 'string',
                                action: {id: 0, name: 'page.visit'},
                                expressions: [
                                  {
                                    attribute: {type: 'PARAM', param: 'string', id: 0},
                                    constraint: {type: 'BOOL', logic: 'IS_TRUE'}
                                  }
                                ]
                              }
                            ],
                            title: 'string'
                          }
                        }
                      ],
                      expression: {}
                    },
                    expressions: [
                      {
                        attribute: {type: 'PARAM', param: 'string', id: 0},
                        constraint: {type: 'BOOL', logic: 'IS_TRUE'}
                      }
                    ]
                  }
                },
                isVisibleForClientProfile: true
              }
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

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

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

            $request->setBody('{"analysis":{"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":"EVENT","title":"string","occurrenceType":"FIRST","aggregation":{"type":"COUNT","level":0.01,"attribute":{"type":"PARAM","param":"string","id":0}},"action":{"id":0,"name":"page.visit"},"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":"FUNNEL","matching":true,"funnel":{"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}},"exact":false,"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}],"title":"string"}}],"expression":{}},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}},"isVisibleForClientProfile":true}}');

            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/%7BmetricId%7D")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"analysis\":{\"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\":\"EVENT\",\"title\":\"string\",\"occurrenceType\":\"FIRST\",\"aggregation\":{\"type\":\"COUNT\",\"level\":0.01,\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0}},\"action\":{\"id\":0,\"name\":\"page.visit\"},\"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\":\"FUNNEL\",\"matching\":true,\"funnel\":{\"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}},\"exact\":false,\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}],\"title\":\"string\"}}],\"expression\":{}},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}},\"isVisibleForClientProfile\":true}}")
              .asString();
    delete:
      tags:
        - "Analytics: Metrics"
      summary: Delete metric analysis
      operationId: analytics2-metrics-delete
      parameters:
        - $ref: "#/components/parameters/analytics-metricIdAsPathParam"
        - $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/%7BmetricId%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/%7BmetricId%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/%7BmetricId%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/%7BmetricId%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/%7BmetricId%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/%7BmetricId%7D")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
  /analytics/analytics/v4/reports/{reportId}/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-reportIdAsPathParam"
      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/%7BreportId%7D/recalculate/override \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"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":"FUNNEL","matching":true,"funnel":{"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}},"exact":false,"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}],"title":"string"}}],"expression":{}},"variables":[{"name":"string","value":"string"}]}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"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\":\"FUNNEL\",\"matching\":true,\"funnel\":{\"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}},\"exact\":false,\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}],\"title\":\"string\"}}],\"expression\":{}},\"variables\":[{\"name\":\"string\",\"value\":\"string\"}]}"

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

            conn.request("POST", "/analytics/analytics/v4/reports/%7BreportId%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({
              "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": "FUNNEL",
                    "matching": true,
                    "funnel": {
                      "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
                        }
                      },
                      "exact": false,
                      "steps": [
                        {
                          "title": "string",
                          "action": {
                            "id": 0,
                            "name": "page.visit"
                          },
                          "expressions": [
                            {
                              "attribute": {
                                "type": "PARAM",
                                "param": "string",
                                "id": 0
                              },
                              "constraint": {
                                "type": "BOOL",
                                "logic": "IS_TRUE"
                              }
                            }
                          ]
                        }
                      ],
                      "title": "string"
                    }
                  }
                ],
                "expression": {}
              },
              "variables": [
                {
                  "name": "string",
                  "value": "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/analytics/v4/reports/%7BreportId%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/%7BreportId%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({
              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: 'FUNNEL',
                    matching: true,
                    funnel: {
                      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
                        }
                      },
                      exact: false,
                      steps: [
                        {
                          title: 'string',
                          action: {id: 0, name: 'page.visit'},
                          expressions: [
                            {
                              attribute: {type: 'PARAM', param: 'string', id: 0},
                              constraint: {type: 'BOOL', logic: 'IS_TRUE'}
                            }
                          ]
                        }
                      ],
                      title: 'string'
                    }
                  }
                ],
                expression: {}
              },
              variables: [{name: 'string', value: 'string'}]
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

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

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

            $request->setBody('{"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":"FUNNEL","matching":true,"funnel":{"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}},"exact":false,"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}],"title":"string"}}],"expression":{}},"variables":[{"name":"string","value":"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/analytics/v4/reports/%7BreportId%7D/recalculate/override")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"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\":\"FUNNEL\",\"matching\":true,\"funnel\":{\"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}},\"exact\":false,\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}],\"title\":\"string\"}}],\"expression\":{}},\"variables\":[{\"name\":\"string\",\"value\":\"string\"}]}")
              .asString();
  /analytics/analytics/v4/reports/{reportId}/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-reportIdAsPathParam"
      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/%7BreportId%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/%7BreportId%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/%7BreportId%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/%7BreportId%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/%7BreportId%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/%7BreportId%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-ReportRequest"
      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 '{"analysis":{"title":"string","description":"string","filter":{"matching":true,"expressions":[{"type":"FUNNEL","matching":true,"funnel":{"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}},"exact":false,"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}],"title":"string"}}],"expression":{}},"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"},"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":"SEGMENTATION","id":"497f6eca-6276-4993-bfeb-53cbbbba6f08"}}]}]},"allowNull":true}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"analysis\":{\"title\":\"string\",\"description\":\"string\",\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"FUNNEL\",\"matching\":true,\"funnel\":{\"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}},\"exact\":false,\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}],\"title\":\"string\"}}],\"expression\":{}},\"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\"},\"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\":\"SEGMENTATION\",\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\"}}]}]},\"allowNull\":true}"

            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({
              "analysis": {
                "title": "string",
                "description": "string",
                "filter": {
                  "matching": true,
                  "expressions": [
                    {
                      "type": "FUNNEL",
                      "matching": true,
                      "funnel": {
                        "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
                          }
                        },
                        "exact": false,
                        "steps": [
                          {
                            "title": "string",
                            "action": {
                              "id": 0,
                              "name": "page.visit"
                            },
                            "expressions": [
                              {
                                "attribute": {
                                  "type": "PARAM",
                                  "param": "string",
                                  "id": 0
                                },
                                "constraint": {
                                  "type": "BOOL",
                                  "logic": "IS_TRUE"
                                }
                              }
                            ]
                          }
                        ],
                        "title": "string"
                      }
                    }
                  ],
                  "expression": {}
                },
                "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"
                    },
                    "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": "SEGMENTATION",
                          "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
                        }
                      }
                    ]
                  }
                ]
              },
              "allowNull": 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/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({
              analysis: {
                title: 'string',
                description: 'string',
                filter: {
                  matching: true,
                  expressions: [
                    {
                      type: 'FUNNEL',
                      matching: true,
                      funnel: {
                        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
                          }
                        },
                        exact: false,
                        steps: [
                          {
                            title: 'string',
                            action: {id: 0, name: 'page.visit'},
                            expressions: [
                              {
                                attribute: {type: 'PARAM', param: 'string', id: 0},
                                constraint: {type: 'BOOL', logic: 'IS_TRUE'}
                              }
                            ]
                          }
                        ],
                        title: 'string'
                      }
                    }
                  ],
                  expression: {}
                },
                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'},
                    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: 'SEGMENTATION', id: '497f6eca-6276-4993-bfeb-53cbbbba6f08'}
                      }
                    ]
                  }
                ]
              },
              allowNull: true
            }));
            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('{"analysis":{"title":"string","description":"string","filter":{"matching":true,"expressions":[{"type":"FUNNEL","matching":true,"funnel":{"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}},"exact":false,"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}],"title":"string"}}],"expression":{}},"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"},"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":"SEGMENTATION","id":"497f6eca-6276-4993-bfeb-53cbbbba6f08"}}]}]},"allowNull":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/analytics/v4/reports/preview")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"analysis\":{\"title\":\"string\",\"description\":\"string\",\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"FUNNEL\",\"matching\":true,\"funnel\":{\"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}},\"exact\":false,\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}],\"title\":\"string\"}}],\"expression\":{}},\"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\"},\"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\":\"SEGMENTATION\",\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\"}}]}]},\"allowNull\":true}")
              .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-ReportRequest"
      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 '{"analysis":{"title":"string","description":"string","filter":{"matching":true,"expressions":[{"type":"FUNNEL","matching":true,"funnel":{"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}},"exact":false,"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}],"title":"string"}}],"expression":{}},"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"},"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":"SEGMENTATION","id":"497f6eca-6276-4993-bfeb-53cbbbba6f08"}}]}]},"allowNull":true}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"analysis\":{\"title\":\"string\",\"description\":\"string\",\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"FUNNEL\",\"matching\":true,\"funnel\":{\"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}},\"exact\":false,\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}],\"title\":\"string\"}}],\"expression\":{}},\"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\"},\"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\":\"SEGMENTATION\",\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\"}}]}]},\"allowNull\":true}"

            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({
              "analysis": {
                "title": "string",
                "description": "string",
                "filter": {
                  "matching": true,
                  "expressions": [
                    {
                      "type": "FUNNEL",
                      "matching": true,
                      "funnel": {
                        "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
                          }
                        },
                        "exact": false,
                        "steps": [
                          {
                            "title": "string",
                            "action": {
                              "id": 0,
                              "name": "page.visit"
                            },
                            "expressions": [
                              {
                                "attribute": {
                                  "type": "PARAM",
                                  "param": "string",
                                  "id": 0
                                },
                                "constraint": {
                                  "type": "BOOL",
                                  "logic": "IS_TRUE"
                                }
                              }
                            ]
                          }
                        ],
                        "title": "string"
                      }
                    }
                  ],
                  "expression": {}
                },
                "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"
                    },
                    "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": "SEGMENTATION",
                          "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
                        }
                      }
                    ]
                  }
                ]
              },
              "allowNull": 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/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({
              analysis: {
                title: 'string',
                description: 'string',
                filter: {
                  matching: true,
                  expressions: [
                    {
                      type: 'FUNNEL',
                      matching: true,
                      funnel: {
                        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
                          }
                        },
                        exact: false,
                        steps: [
                          {
                            title: 'string',
                            action: {id: 0, name: 'page.visit'},
                            expressions: [
                              {
                                attribute: {type: 'PARAM', param: 'string', id: 0},
                                constraint: {type: 'BOOL', logic: 'IS_TRUE'}
                              }
                            ]
                          }
                        ],
                        title: 'string'
                      }
                    }
                  ],
                  expression: {}
                },
                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'},
                    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: 'SEGMENTATION', id: '497f6eca-6276-4993-bfeb-53cbbbba6f08'}
                      }
                    ]
                  }
                ]
              },
              allowNull: true
            }));
            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('{"analysis":{"title":"string","description":"string","filter":{"matching":true,"expressions":[{"type":"FUNNEL","matching":true,"funnel":{"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}},"exact":false,"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}],"title":"string"}}],"expression":{}},"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"},"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":"SEGMENTATION","id":"497f6eca-6276-4993-bfeb-53cbbbba6f08"}}]}]},"allowNull":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/analytics/v4/reports/preview-csv")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"analysis\":{\"title\":\"string\",\"description\":\"string\",\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"FUNNEL\",\"matching\":true,\"funnel\":{\"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}},\"exact\":false,\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}],\"title\":\"string\"}}],\"expression\":{}},\"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\"},\"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\":\"SEGMENTATION\",\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\"}}]}]},\"allowNull\":true}")
              .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:
        - name: directoryId
          in: path
          description: ID of a directory
          required: true
          style: simple
          explode: false
          schema:
            type: string
            format: uuid
      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:
        - name: directoryId
          in: path
          description: ID of a directory
          required: true
          style: simple
          explode: false
          schema:
            type: string
            format: uuid
      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/{analyticId}:
    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:
        - name: analyticId
          in: path
          description: ID of the analysis
          required: true
          style: simple
          explode: false
          schema:
            type: string
            format: uuid
      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/%7BanalyticId%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/%7BanalyticId%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/%7BanalyticId%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/%7BanalyticId%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/%7BanalyticId%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/%7BanalyticId%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":{"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":"EVENT","title":"string","occurrenceType":"FIRST","aggregation":{"type":"COUNT","level":0.01,"attribute":{"type":"PARAM","param":"string","id":0}},"action":{"id":0,"name":"page.visit"},"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":"FUNNEL","matching":true,"funnel":{"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}},"exact":false,"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}],"title":"string"}}],"expression":{}},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}},"isVisibleForClientProfile":true}}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"analysis\":{\"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\":\"EVENT\",\"title\":\"string\",\"occurrenceType\":\"FIRST\",\"aggregation\":{\"type\":\"COUNT\",\"level\":0.01,\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0}},\"action\":{\"id\":0,\"name\":\"page.visit\"},\"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\":\"FUNNEL\",\"matching\":true,\"funnel\":{\"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}},\"exact\":false,\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}],\"title\":\"string\"}}],\"expression\":{}},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}},\"isVisibleForClientProfile\":true}}"

            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": {
                "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": "EVENT",
                    "title": "string",
                    "occurrenceType": "FIRST",
                    "aggregation": {
                      "type": "COUNT",
                      "level": 0.01,
                      "attribute": {
                        "type": "PARAM",
                        "param": "string",
                        "id": 0
                      }
                    },
                    "action": {
                      "id": 0,
                      "name": "page.visit"
                    },
                    "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": "FUNNEL",
                          "matching": true,
                          "funnel": {
                            "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
                              }
                            },
                            "exact": false,
                            "steps": [
                              {
                                "title": "string",
                                "action": {
                                  "id": 0,
                                  "name": "page.visit"
                                },
                                "expressions": [
                                  {
                                    "attribute": {
                                      "type": "PARAM",
                                      "param": "string",
                                      "id": 0
                                    },
                                    "constraint": {
                                      "type": "BOOL",
                                      "logic": "IS_TRUE"
                                    }
                                  }
                                ]
                              }
                            ],
                            "title": "string"
                          }
                        }
                      ],
                      "expression": {}
                    },
                    "expressions": [
                      {
                        "attribute": {
                          "type": "PARAM",
                          "param": "string",
                          "id": 0
                        },
                        "constraint": {
                          "type": "BOOL",
                          "logic": "IS_TRUE"
                        }
                      }
                    ]
                  }
                },
                "isVisibleForClientProfile": 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/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: {
                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: 'EVENT',
                    title: 'string',
                    occurrenceType: 'FIRST',
                    aggregation: {type: 'COUNT', level: 0.01, attribute: {type: 'PARAM', param: 'string', id: 0}},
                    action: {id: 0, name: 'page.visit'},
                    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: 'FUNNEL',
                          matching: true,
                          funnel: {
                            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
                              }
                            },
                            exact: false,
                            steps: [
                              {
                                title: 'string',
                                action: {id: 0, name: 'page.visit'},
                                expressions: [
                                  {
                                    attribute: {type: 'PARAM', param: 'string', id: 0},
                                    constraint: {type: 'BOOL', logic: 'IS_TRUE'}
                                  }
                                ]
                              }
                            ],
                            title: 'string'
                          }
                        }
                      ],
                      expression: {}
                    },
                    expressions: [
                      {
                        attribute: {type: 'PARAM', param: 'string', id: 0},
                        constraint: {type: 'BOOL', logic: 'IS_TRUE'}
                      }
                    ]
                  }
                },
                isVisibleForClientProfile: true
              }
            }));
            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":{"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":"EVENT","title":"string","occurrenceType":"FIRST","aggregation":{"type":"COUNT","level":0.01,"attribute":{"type":"PARAM","param":"string","id":0}},"action":{"id":0,"name":"page.visit"},"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":"FUNNEL","matching":true,"funnel":{"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}},"exact":false,"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}],"title":"string"}}],"expression":{}},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}},"isVisibleForClientProfile":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/analytics/v3/metrics/preview")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"analysis\":{\"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\":\"EVENT\",\"title\":\"string\",\"occurrenceType\":\"FIRST\",\"aggregation\":{\"type\":\"COUNT\",\"level\":0.01,\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0}},\"action\":{\"id\":0,\"name\":\"page.visit\"},\"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\":\"FUNNEL\",\"matching\":true,\"funnel\":{\"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}},\"exact\":false,\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}],\"title\":\"string\"}}],\"expression\":{}},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}},\"isVisibleForClientProfile\":true}}")
              .asString();
  /analytics/analytics/v3/metrics/{metricId}/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-metricIdAsPathParam"
      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/%7BmetricId%7D/recalculate/override \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"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":"FUNNEL","matching":true,"funnel":{"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}},"exact":false,"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}],"title":"string"}}],"expression":{}},"variables":[{"name":"string","value":"string"}]}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"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\":\"FUNNEL\",\"matching\":true,\"funnel\":{\"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}},\"exact\":false,\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}],\"title\":\"string\"}}],\"expression\":{}},\"variables\":[{\"name\":\"string\",\"value\":\"string\"}]}"

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

            conn.request("POST", "/analytics/analytics/v3/metrics/%7BmetricId%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({
              "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": "FUNNEL",
                    "matching": true,
                    "funnel": {
                      "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
                        }
                      },
                      "exact": false,
                      "steps": [
                        {
                          "title": "string",
                          "action": {
                            "id": 0,
                            "name": "page.visit"
                          },
                          "expressions": [
                            {
                              "attribute": {
                                "type": "PARAM",
                                "param": "string",
                                "id": 0
                              },
                              "constraint": {
                                "type": "BOOL",
                                "logic": "IS_TRUE"
                              }
                            }
                          ]
                        }
                      ],
                      "title": "string"
                    }
                  }
                ],
                "expression": {}
              },
              "variables": [
                {
                  "name": "string",
                  "value": "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/analytics/v3/metrics/%7BmetricId%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/%7BmetricId%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({
              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: 'FUNNEL',
                    matching: true,
                    funnel: {
                      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
                        }
                      },
                      exact: false,
                      steps: [
                        {
                          title: 'string',
                          action: {id: 0, name: 'page.visit'},
                          expressions: [
                            {
                              attribute: {type: 'PARAM', param: 'string', id: 0},
                              constraint: {type: 'BOOL', logic: 'IS_TRUE'}
                            }
                          ]
                        }
                      ],
                      title: 'string'
                    }
                  }
                ],
                expression: {}
              },
              variables: [{name: 'string', value: 'string'}]
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

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

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

            $request->setBody('{"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":"FUNNEL","matching":true,"funnel":{"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}},"exact":false,"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}],"title":"string"}}],"expression":{}},"variables":[{"name":"string","value":"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/analytics/v3/metrics/%7BmetricId%7D/recalculate/override")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"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\":\"FUNNEL\",\"matching\":true,\"funnel\":{\"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}},\"exact\":false,\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}],\"title\":\"string\"}}],\"expression\":{}},\"variables\":[{\"name\":\"string\",\"value\":\"string\"}]}")
              .asString();
  /analytics/analytics/v3/metrics/{metricId}/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-metricIdAsPathParam"
      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/%7BmetricId%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/%7BmetricId%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/%7BmetricId%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/%7BmetricId%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/%7BmetricId%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/%7BmetricId%7D/recalculate")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
  /analytics/analytics/v3/metrics/{metricId}/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-metricIdAsPathParam"
      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/%7BmetricId%7D/dynamic/value \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"variables":[{"name":"event.params.PARAMNAME","value":"string"}]}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"variables\":[{\"name\":\"event.params.PARAMNAME\",\"value\":\"string\"}]}"

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

            conn.request("POST", "/analytics/analytics/v3/metrics/%7BmetricId%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": "event.params.PARAMNAME",
                  "value": "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/analytics/v3/metrics/%7BmetricId%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/%7BmetricId%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: 'event.params.PARAMNAME', value: 'string'}]}));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

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

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

            $request->setBody('{"variables":[{"name":"event.params.PARAMNAME","value":"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/analytics/v3/metrics/%7BmetricId%7D/dynamic/value")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"variables\":[{\"name\":\"event.params.PARAMNAME\",\"value\":\"string\"}]}")
              .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-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:-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/{expressionId}/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-expressionIdAsPathParam"
        - $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:
                oneOf:
                  - type: string
                  - type: number
                  - type: boolean
                  - type: object
                  - type: array
                    items: {}
        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/%7BexpressionId%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/%7BexpressionId%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/%7BexpressionId%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/%7BexpressionId%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/%7BexpressionId%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/%7BexpressionId%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"
      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"
        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' \
              --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", 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");
            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",
              "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'
            ]);

            $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")
              .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":"string","value":{"type":"EVENT","attribute":{"type":"PARAM","param":"string","id":0}}}}}'
        - 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\":\"string\",\"value\":{\"type\":\"EVENT\",\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0}}}}}"

            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": "string",
                  "value": {
                    "type": "EVENT",
                    "attribute": {
                      "type": "PARAM",
                      "param": "string",
                      "id": 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/%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: 'string',
                  value: {type: 'EVENT', attribute: {type: 'PARAM', param: 'string', id: 0}}
                }
              }
            }));
            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":"string","value":{"type":"EVENT","attribute":{"type":"PARAM","param":"string","id":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/%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\":\"string\",\"value\":{\"type\":\"EVENT\",\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0}}}}}")
              .asString();
  /analytics/{namespace}/expressions/{expressionId}:
    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-expressionIdAsPathParam"
      responses:
        "200":
          description: Get expression details
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/analytics-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-get
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url https://api.synerise.com/analytics/%7Bnamespace%7D/expressions/%7BexpressionId%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/%7BexpressionId%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/%7BexpressionId%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/%7BexpressionId%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/%7BexpressionId%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/%7BexpressionId%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-expressionIdAsPathParam"
      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/%7BexpressionId%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":"string","value":{"type":"EVENT","attribute":{"type":"PARAM","param":"string","id":0}}}}}'
        - 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\":\"string\",\"value\":{\"type\":\"EVENT\",\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0}}}}}"

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

            conn.request("PUT", "/analytics/%7Bnamespace%7D/expressions/%7BexpressionId%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": "string",
                  "value": {
                    "type": "EVENT",
                    "attribute": {
                      "type": "PARAM",
                      "param": "string",
                      "id": 0
                    }
                  }
                }
              }
            });

            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/%7BexpressionId%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/%7BexpressionId%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: 'string',
                  value: {type: 'EVENT', attribute: {type: 'PARAM', param: 'string', id: 0}}
                }
              }
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/analytics/%7Bnamespace%7D/expressions/%7BexpressionId%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":"string","value":{"type":"EVENT","attribute":{"type":"PARAM","param":"string","id":0}}}}}');

            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/%7BexpressionId%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\":\"string\",\"value\":{\"type\":\"EVENT\",\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0}}}}}")
              .asString();
    delete:
      tags:
        - "Analytics: Expressions"
      summary: Delete expression
      operationId: analytics2-expressions-delete
      parameters:
        - $ref: "#/components/parameters/analytics-pathNamespace"
        - $ref: "#/components/parameters/analytics-expressionIdAsPathParam"
      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/%7BexpressionId%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/%7BexpressionId%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/%7BexpressionId%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/%7BexpressionId%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/%7BexpressionId%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/%7BexpressionId%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":{"type":"CLIENT","name":"string","description":"string","expression":{"type":"VALUE","title":"string","value":{"type":"CLIENT","attribute":{"type":"SEGMENTATION","id":"497f6eca-6276-4993-bfeb-53cbbbba6f08"}}}}}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"identifierValue\":\"string\",\"expression\":{\"type\":\"CLIENT\",\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"string\",\"value\":{\"type\":\"CLIENT\",\"attribute\":{\"type\":\"SEGMENTATION\",\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\"}}}}}"

            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": {
                "type": "CLIENT",
                "name": "string",
                "description": "string",
                "expression": {
                  "type": "VALUE",
                  "title": "string",
                  "value": {
                    "type": "CLIENT",
                    "attribute": {
                      "type": "SEGMENTATION",
                      "id": "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/%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: {
                type: 'CLIENT',
                name: 'string',
                description: 'string',
                expression: {
                  type: 'VALUE',
                  title: 'string',
                  value: {
                    type: 'CLIENT',
                    attribute: {type: 'SEGMENTATION', id: '497f6eca-6276-4993-bfeb-53cbbbba6f08'}
                  }
                }
              }
            }));
            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":{"type":"CLIENT","name":"string","description":"string","expression":{"type":"VALUE","title":"string","value":{"type":"CLIENT","attribute":{"type":"SEGMENTATION","id":"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/%7Bnamespace%7D/expressions/preview/by/%7BidentifierType%7D")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"identifierValue\":\"string\",\"expression\":{\"type\":\"CLIENT\",\"name\":\"string\",\"description\":\"string\",\"expression\":{\"type\":\"VALUE\",\"title\":\"string\",\"value\":{\"type\":\"CLIENT\",\"attribute\":{\"type\":\"SEGMENTATION\",\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\"}}}}}")
              .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"
        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":"c2cc9ad9-a69d-40a3-8e01-a95e09e71978","chartType":"COLUMN","title":"string"}]}}}'
        - 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\":\"c2cc9ad9-a69d-40a3-8e01-a95e09e71978\",\"chartType\":\"COLUMN\",\"title\":\"string\"}]}}}"

            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": "c2cc9ad9-a69d-40a3-8e01-a95e09e71978",
                      "chartType": "COLUMN",
                      "title": "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/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: 'c2cc9ad9-a69d-40a3-8e01-a95e09e71978',
                      chartType: 'COLUMN',
                      title: 'string'
                    }
                  ]
                }
              }
            }));
            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":"c2cc9ad9-a69d-40a3-8e01-a95e09e71978","chartType":"COLUMN","title":"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/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\":\"c2cc9ad9-a69d-40a3-8e01-a95e09e71978\",\"chartType\":\"COLUMN\",\"title\":\"string\"}]}}}")
              .asString();
  /analytics/{namespace}/histograms/{histogramId}:
    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-histogramIdAsPathParam"
      responses:
        "200":
          description: Histogram analysis details
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/analytics-Histogram"
        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/%7BhistogramId%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/%7BhistogramId%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/%7BhistogramId%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/%7BhistogramId%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/%7BhistogramId%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/%7BhistogramId%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-histogramIdAsPathParam"
      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/%7BhistogramId%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":"c2cc9ad9-a69d-40a3-8e01-a95e09e71978","chartType":"COLUMN","title":"string"}]}}}'
        - 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\":\"c2cc9ad9-a69d-40a3-8e01-a95e09e71978\",\"chartType\":\"COLUMN\",\"title\":\"string\"}]}}}"

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

            conn.request("PUT", "/analytics/%7Bnamespace%7D/histograms/%7BhistogramId%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": "c2cc9ad9-a69d-40a3-8e01-a95e09e71978",
                      "chartType": "COLUMN",
                      "title": "string"
                    }
                  ]
                }
              }
            });

            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/%7BhistogramId%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/%7BhistogramId%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: 'c2cc9ad9-a69d-40a3-8e01-a95e09e71978',
                      chartType: 'COLUMN',
                      title: 'string'
                    }
                  ]
                }
              }
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/analytics/%7Bnamespace%7D/histograms/%7BhistogramId%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":"c2cc9ad9-a69d-40a3-8e01-a95e09e71978","chartType":"COLUMN","title":"string"}]}}}');

            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/%7BhistogramId%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\":\"c2cc9ad9-a69d-40a3-8e01-a95e09e71978\",\"chartType\":\"COLUMN\",\"title\":\"string\"}]}}}")
              .asString();
    delete:
      tags:
        - "Analytics: Histograms"
      summary: Delete histogram
      operationId: analytics2-histograms-delete
      parameters:
        - $ref: "#/components/parameters/analytics-pathNamespace"
        - $ref: "#/components/parameters/analytics-histogramIdAsPathParam"
      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/%7BhistogramId%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/%7BhistogramId%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/%7BhistogramId%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/%7BhistogramId%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/%7BhistogramId%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/%7BhistogramId%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/{segmentationId}/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-segmentationIdAsPathParam"
      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/%7BsegmentationId%7D/dynamic/value \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"variables":[{"name":"event.params.PARAMNAME","value":"string"}]}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"variables\":[{\"name\":\"event.params.PARAMNAME\",\"value\":\"string\"}]}"

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

            conn.request("POST", "/analytics/analytics/v2/segmentations/%7BsegmentationId%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": "event.params.PARAMNAME",
                  "value": "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/analytics/v2/segmentations/%7BsegmentationId%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/%7BsegmentationId%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: 'event.params.PARAMNAME', value: 'string'}]}));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

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

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

            $request->setBody('{"variables":[{"name":"event.params.PARAMNAME","value":"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/analytics/v2/segmentations/%7BsegmentationId%7D/dynamic/value")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"variables\":[{\"name\":\"event.params.PARAMNAME\",\"value\":\"string\"}]}")
              .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":{"title":"string","description":"string","segments":[{"title":"string","description":"string","filter":{"matching":true,"expressions":[{"type":"FUNNEL","matching":true,"funnel":{"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}},"exact":false,"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}],"title":"string"}}],"expression":{}}}],"unique":true},"allowNull":true}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"analysis\":{\"title\":\"string\",\"description\":\"string\",\"segments\":[{\"title\":\"string\",\"description\":\"string\",\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"FUNNEL\",\"matching\":true,\"funnel\":{\"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}},\"exact\":false,\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}],\"title\":\"string\"}}],\"expression\":{}}}],\"unique\":true},\"allowNull\":true}"

            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": {
                "title": "string",
                "description": "string",
                "segments": [
                  {
                    "title": "string",
                    "description": "string",
                    "filter": {
                      "matching": true,
                      "expressions": [
                        {
                          "type": "FUNNEL",
                          "matching": true,
                          "funnel": {
                            "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
                              }
                            },
                            "exact": false,
                            "steps": [
                              {
                                "title": "string",
                                "action": {
                                  "id": 0,
                                  "name": "page.visit"
                                },
                                "expressions": [
                                  {
                                    "attribute": {
                                      "type": "PARAM",
                                      "param": "string",
                                      "id": 0
                                    },
                                    "constraint": {
                                      "type": "BOOL",
                                      "logic": "IS_TRUE"
                                    }
                                  }
                                ]
                              }
                            ],
                            "title": "string"
                          }
                        }
                      ],
                      "expression": {}
                    }
                  }
                ],
                "unique": true
              },
              "allowNull": 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/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: {
                title: 'string',
                description: 'string',
                segments: [
                  {
                    title: 'string',
                    description: 'string',
                    filter: {
                      matching: true,
                      expressions: [
                        {
                          type: 'FUNNEL',
                          matching: true,
                          funnel: {
                            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
                              }
                            },
                            exact: false,
                            steps: [
                              {
                                title: 'string',
                                action: {id: 0, name: 'page.visit'},
                                expressions: [
                                  {
                                    attribute: {type: 'PARAM', param: 'string', id: 0},
                                    constraint: {type: 'BOOL', logic: 'IS_TRUE'}
                                  }
                                ]
                              }
                            ],
                            title: 'string'
                          }
                        }
                      ],
                      expression: {}
                    }
                  }
                ],
                unique: true
              },
              allowNull: true
            }));
            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":{"title":"string","description":"string","segments":[{"title":"string","description":"string","filter":{"matching":true,"expressions":[{"type":"FUNNEL","matching":true,"funnel":{"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}},"exact":false,"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}],"title":"string"}}],"expression":{}}}],"unique":true},"allowNull":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/analytics/v2/segmentations/preview")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"analysis\":{\"title\":\"string\",\"description\":\"string\",\"segments\":[{\"title\":\"string\",\"description\":\"string\",\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"FUNNEL\",\"matching\":true,\"funnel\":{\"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}},\"exact\":false,\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}],\"title\":\"string\"}}],\"expression\":{}}}],\"unique\":true},\"allowNull\":true}")
              .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":{"title":"string","description":"string","segments":[{"title":"string","description":"string","filter":{"matching":true,"expressions":[{"type":"FUNNEL","matching":true,"funnel":{"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}},"exact":false,"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}],"title":"string"}}],"expression":{}}}],"unique":true},"allowNull":true}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"analysis\":{\"title\":\"string\",\"description\":\"string\",\"segments\":[{\"title\":\"string\",\"description\":\"string\",\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"FUNNEL\",\"matching\":true,\"funnel\":{\"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}},\"exact\":false,\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}],\"title\":\"string\"}}],\"expression\":{}}}],\"unique\":true},\"allowNull\":true}"

            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": {
                "title": "string",
                "description": "string",
                "segments": [
                  {
                    "title": "string",
                    "description": "string",
                    "filter": {
                      "matching": true,
                      "expressions": [
                        {
                          "type": "FUNNEL",
                          "matching": true,
                          "funnel": {
                            "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
                              }
                            },
                            "exact": false,
                            "steps": [
                              {
                                "title": "string",
                                "action": {
                                  "id": 0,
                                  "name": "page.visit"
                                },
                                "expressions": [
                                  {
                                    "attribute": {
                                      "type": "PARAM",
                                      "param": "string",
                                      "id": 0
                                    },
                                    "constraint": {
                                      "type": "BOOL",
                                      "logic": "IS_TRUE"
                                    }
                                  }
                                ]
                              }
                            ],
                            "title": "string"
                          }
                        }
                      ],
                      "expression": {}
                    }
                  }
                ],
                "unique": true
              },
              "allowNull": 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/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: {
                title: 'string',
                description: 'string',
                segments: [
                  {
                    title: 'string',
                    description: 'string',
                    filter: {
                      matching: true,
                      expressions: [
                        {
                          type: 'FUNNEL',
                          matching: true,
                          funnel: {
                            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
                              }
                            },
                            exact: false,
                            steps: [
                              {
                                title: 'string',
                                action: {id: 0, name: 'page.visit'},
                                expressions: [
                                  {
                                    attribute: {type: 'PARAM', param: 'string', id: 0},
                                    constraint: {type: 'BOOL', logic: 'IS_TRUE'}
                                  }
                                ]
                              }
                            ],
                            title: 'string'
                          }
                        }
                      ],
                      expression: {}
                    }
                  }
                ],
                unique: true
              },
              allowNull: true
            }));
            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":{"title":"string","description":"string","segments":[{"title":"string","description":"string","filter":{"matching":true,"expressions":[{"type":"FUNNEL","matching":true,"funnel":{"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}},"exact":false,"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}],"title":"string"}}],"expression":{}}}],"unique":true},"allowNull":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/analytics/v2/segmentations/preview/clients")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"analysis\":{\"title\":\"string\",\"description\":\"string\",\"segments\":[{\"title\":\"string\",\"description\":\"string\",\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"FUNNEL\",\"matching\":true,\"funnel\":{\"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}},\"exact\":false,\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}],\"title\":\"string\"}}],\"expression\":{}}}],\"unique\":true},\"allowNull\":true}")
              .asString();
  /analytics/analytics/v2/metrics/histograms/{histogramId}/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-histogramIdAsPathParam"
      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/%7BhistogramId%7D/recalculate/override \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"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":"FUNNEL","matching":true,"funnel":{"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}},"exact":false,"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}],"title":"string"}}],"expression":{}},"variables":[{"name":"string","value":"string"}]}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"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\":\"FUNNEL\",\"matching\":true,\"funnel\":{\"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}},\"exact\":false,\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}],\"title\":\"string\"}}],\"expression\":{}},\"variables\":[{\"name\":\"string\",\"value\":\"string\"}]}"

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

            conn.request("POST", "/analytics/analytics/v2/metrics/histograms/%7BhistogramId%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({
              "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": "FUNNEL",
                    "matching": true,
                    "funnel": {
                      "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
                        }
                      },
                      "exact": false,
                      "steps": [
                        {
                          "title": "string",
                          "action": {
                            "id": 0,
                            "name": "page.visit"
                          },
                          "expressions": [
                            {
                              "attribute": {
                                "type": "PARAM",
                                "param": "string",
                                "id": 0
                              },
                              "constraint": {
                                "type": "BOOL",
                                "logic": "IS_TRUE"
                              }
                            }
                          ]
                        }
                      ],
                      "title": "string"
                    }
                  }
                ],
                "expression": {}
              },
              "variables": [
                {
                  "name": "string",
                  "value": "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/analytics/v2/metrics/histograms/%7BhistogramId%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/%7BhistogramId%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({
              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: 'FUNNEL',
                    matching: true,
                    funnel: {
                      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
                        }
                      },
                      exact: false,
                      steps: [
                        {
                          title: 'string',
                          action: {id: 0, name: 'page.visit'},
                          expressions: [
                            {
                              attribute: {type: 'PARAM', param: 'string', id: 0},
                              constraint: {type: 'BOOL', logic: 'IS_TRUE'}
                            }
                          ]
                        }
                      ],
                      title: 'string'
                    }
                  }
                ],
                expression: {}
              },
              variables: [{name: 'string', value: 'string'}]
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

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

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

            $request->setBody('{"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":"FUNNEL","matching":true,"funnel":{"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}},"exact":false,"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}],"title":"string"}}],"expression":{}},"variables":[{"name":"string","value":"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/analytics/v2/metrics/histograms/%7BhistogramId%7D/recalculate/override")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"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\":\"FUNNEL\",\"matching\":true,\"funnel\":{\"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}},\"exact\":false,\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}],\"title\":\"string\"}}],\"expression\":{}},\"variables\":[{\"name\":\"string\",\"value\":\"string\"}]}")
              .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":"c2cc9ad9-a69d-40a3-8e01-a95e09e71978","chartType":"COLUMN","title":"string"}]}}}'
        - 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\":\"c2cc9ad9-a69d-40a3-8e01-a95e09e71978\",\"chartType\":\"COLUMN\",\"title\":\"string\"}]}}}"

            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": "c2cc9ad9-a69d-40a3-8e01-a95e09e71978",
                      "chartType": "COLUMN",
                      "title": "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/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: 'c2cc9ad9-a69d-40a3-8e01-a95e09e71978',
                      chartType: 'COLUMN',
                      title: 'string'
                    }
                  ]
                }
              }
            }));
            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":"c2cc9ad9-a69d-40a3-8e01-a95e09e71978","chartType":"COLUMN","title":"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/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\":\"c2cc9ad9-a69d-40a3-8e01-a95e09e71978\",\"chartType\":\"COLUMN\",\"title\":\"string\"}]}}}")
              .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":{"title":"string","description":"string","segments":[{"title":"string","description":"string","filter":{"matching":true,"expressions":[{"type":"FUNNEL","matching":true,"funnel":{"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}},"exact":false,"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{}]}],"title":"string"}}],"expression":{}}}],"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\":{\"title\":\"string\",\"description\":\"string\",\"segments\":[{\"title\":\"string\",\"description\":\"string\",\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"FUNNEL\",\"matching\":true,\"funnel\":{\"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}},\"exact\":false,\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{}]}],\"title\":\"string\"}}],\"expression\":{}}}],\"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": {
                      "title": "string",
                      "description": "string",
                      "segments": [
                        {
                          "title": "string",
                          "description": "string",
                          "filter": {
                            "matching": true,
                            "expressions": [
                              {
                                "type": "FUNNEL",
                                "matching": true,
                                "funnel": {
                                  "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
                                    }
                                  },
                                  "exact": false,
                                  "steps": [
                                    {
                                      "title": "string",
                                      "action": {
                                        "id": 0,
                                        "name": "page.visit"
                                      },
                                      "expressions": [
                                        {}
                                      ]
                                    }
                                  ],
                                  "title": "string"
                                }
                              }
                            ],
                            "expression": {}
                          }
                        }
                      ],
                      "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: {
                      title: 'string',
                      description: 'string',
                      segments: [
                        {
                          title: 'string',
                          description: 'string',
                          filter: {
                            matching: true,
                            expressions: [
                              {
                                type: 'FUNNEL',
                                matching: true,
                                funnel: {
                                  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
                                    }
                                  },
                                  exact: false,
                                  steps: [{title: 'string', action: {id: 0, name: 'page.visit'}, expressions: [{}]}],
                                  title: 'string'
                                }
                              }
                            ],
                            expression: {}
                          }
                        }
                      ],
                      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":{"title":"string","description":"string","segments":[{"title":"string","description":"string","filter":{"matching":true,"expressions":[{"type":"FUNNEL","matching":true,"funnel":{"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}},"exact":false,"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{}]}],"title":"string"}}],"expression":{}}}],"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\":{\"title\":\"string\",\"description\":\"string\",\"segments\":[{\"title\":\"string\",\"description\":\"string\",\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"FUNNEL\",\"matching\":true,\"funnel\":{\"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}},\"exact\":false,\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{}]}],\"title\":\"string\"}}],\"expression\":{}}}],\"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-SegmentationListItem"
                  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:-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-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-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":{"title":"string","description":"string","segments":[{"title":"string","description":"string","filter":{"matching":true,"expressions":[{"type":"FUNNEL","matching":true,"funnel":{"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}},"exact":false,"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}],"title":"string"}}],"expression":{}}}],"unique":true},"isVisibleForClientProfile":true}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"analysis\":{\"title\":\"string\",\"description\":\"string\",\"segments\":[{\"title\":\"string\",\"description\":\"string\",\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"FUNNEL\",\"matching\":true,\"funnel\":{\"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}},\"exact\":false,\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}],\"title\":\"string\"}}],\"expression\":{}}}],\"unique\":true},\"isVisibleForClientProfile\":true}"

            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": {
                "title": "string",
                "description": "string",
                "segments": [
                  {
                    "title": "string",
                    "description": "string",
                    "filter": {
                      "matching": true,
                      "expressions": [
                        {
                          "type": "FUNNEL",
                          "matching": true,
                          "funnel": {
                            "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
                              }
                            },
                            "exact": false,
                            "steps": [
                              {
                                "title": "string",
                                "action": {
                                  "id": 0,
                                  "name": "page.visit"
                                },
                                "expressions": [
                                  {
                                    "attribute": {
                                      "type": "PARAM",
                                      "param": "string",
                                      "id": 0
                                    },
                                    "constraint": {
                                      "type": "BOOL",
                                      "logic": "IS_TRUE"
                                    }
                                  }
                                ]
                              }
                            ],
                            "title": "string"
                          }
                        }
                      ],
                      "expression": {}
                    }
                  }
                ],
                "unique": true
              },
              "isVisibleForClientProfile": 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/%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: {
                title: 'string',
                description: 'string',
                segments: [
                  {
                    title: 'string',
                    description: 'string',
                    filter: {
                      matching: true,
                      expressions: [
                        {
                          type: 'FUNNEL',
                          matching: true,
                          funnel: {
                            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
                              }
                            },
                            exact: false,
                            steps: [
                              {
                                title: 'string',
                                action: {id: 0, name: 'page.visit'},
                                expressions: [
                                  {
                                    attribute: {type: 'PARAM', param: 'string', id: 0},
                                    constraint: {type: 'BOOL', logic: 'IS_TRUE'}
                                  }
                                ]
                              }
                            ],
                            title: 'string'
                          }
                        }
                      ],
                      expression: {}
                    }
                  }
                ],
                unique: true
              },
              isVisibleForClientProfile: true
            }));
            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":{"title":"string","description":"string","segments":[{"title":"string","description":"string","filter":{"matching":true,"expressions":[{"type":"FUNNEL","matching":true,"funnel":{"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}},"exact":false,"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}],"title":"string"}}],"expression":{}}}],"unique":true},"isVisibleForClientProfile":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/%7Bnamespace%7D/segmentations")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"analysis\":{\"title\":\"string\",\"description\":\"string\",\"segments\":[{\"title\":\"string\",\"description\":\"string\",\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"FUNNEL\",\"matching\":true,\"funnel\":{\"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}},\"exact\":false,\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}],\"title\":\"string\"}}],\"expression\":{}}}],\"unique\":true},\"isVisibleForClientProfile\":true}")
              .asString();
  /analytics/{namespace}/segmentations/{segmentationId}:
    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-segmentationIdAsPathParam"
        - $ref: "#/components/parameters/analytics-pathNamespace"
      responses:
        "200":
          description: Segmentation details
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/analytics-segmentation"
        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/%7BsegmentationId%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/%7BsegmentationId%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/%7BsegmentationId%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/%7BsegmentationId%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/%7BsegmentationId%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/%7BsegmentationId%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-segmentationIdAsPathParam"
        - $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/%7BsegmentationId%7D \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"analysis":{"title":"string","description":"string","segments":[{"title":"string","description":"string","filter":{"matching":true,"expressions":[{"type":"FUNNEL","matching":true,"funnel":{"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}},"exact":false,"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}],"title":"string"}}],"expression":{}}}],"unique":true},"isVisibleForClientProfile":true}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"analysis\":{\"title\":\"string\",\"description\":\"string\",\"segments\":[{\"title\":\"string\",\"description\":\"string\",\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"FUNNEL\",\"matching\":true,\"funnel\":{\"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}},\"exact\":false,\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}],\"title\":\"string\"}}],\"expression\":{}}}],\"unique\":true},\"isVisibleForClientProfile\":true}"

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

            conn.request("PUT", "/analytics/%7Bnamespace%7D/segmentations/%7BsegmentationId%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",
                "segments": [
                  {
                    "title": "string",
                    "description": "string",
                    "filter": {
                      "matching": true,
                      "expressions": [
                        {
                          "type": "FUNNEL",
                          "matching": true,
                          "funnel": {
                            "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
                              }
                            },
                            "exact": false,
                            "steps": [
                              {
                                "title": "string",
                                "action": {
                                  "id": 0,
                                  "name": "page.visit"
                                },
                                "expressions": [
                                  {
                                    "attribute": {
                                      "type": "PARAM",
                                      "param": "string",
                                      "id": 0
                                    },
                                    "constraint": {
                                      "type": "BOOL",
                                      "logic": "IS_TRUE"
                                    }
                                  }
                                ]
                              }
                            ],
                            "title": "string"
                          }
                        }
                      ],
                      "expression": {}
                    }
                  }
                ],
                "unique": true
              },
              "isVisibleForClientProfile": true
            });

            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/%7BsegmentationId%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/%7BsegmentationId%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',
                segments: [
                  {
                    title: 'string',
                    description: 'string',
                    filter: {
                      matching: true,
                      expressions: [
                        {
                          type: 'FUNNEL',
                          matching: true,
                          funnel: {
                            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
                              }
                            },
                            exact: false,
                            steps: [
                              {
                                title: 'string',
                                action: {id: 0, name: 'page.visit'},
                                expressions: [
                                  {
                                    attribute: {type: 'PARAM', param: 'string', id: 0},
                                    constraint: {type: 'BOOL', logic: 'IS_TRUE'}
                                  }
                                ]
                              }
                            ],
                            title: 'string'
                          }
                        }
                      ],
                      expression: {}
                    }
                  }
                ],
                unique: true
              },
              isVisibleForClientProfile: true
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

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

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

            $request->setBody('{"analysis":{"title":"string","description":"string","segments":[{"title":"string","description":"string","filter":{"matching":true,"expressions":[{"type":"FUNNEL","matching":true,"funnel":{"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}},"exact":false,"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}],"title":"string"}}],"expression":{}}}],"unique":true},"isVisibleForClientProfile":true}');

            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/%7BsegmentationId%7D")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"analysis\":{\"title\":\"string\",\"description\":\"string\",\"segments\":[{\"title\":\"string\",\"description\":\"string\",\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"FUNNEL\",\"matching\":true,\"funnel\":{\"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}},\"exact\":false,\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}],\"title\":\"string\"}}],\"expression\":{}}}],\"unique\":true},\"isVisibleForClientProfile\":true}")
              .asString();
    delete:
      tags:
        - "Analytics: Segmentations"
      summary: Delete segmentation
      operationId: analytics2-segmentation-delete
      parameters:
        - $ref: "#/components/parameters/analytics-segmentationIdAsPathParam"
        - $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/%7BsegmentationId%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/%7BsegmentationId%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/%7BsegmentationId%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/%7BsegmentationId%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/%7BsegmentationId%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/%7BsegmentationId%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-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 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/{aggregateId}/client/{clientId}/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-aggregateIdAsPathParam"
        - $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/%7BaggregateId%7D/client/%7BclientId%7D/calculate/histogram \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"variables":[{"name":"string","value":"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}}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"variables\":[{\"name\":\"string\",\"value\":\"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}}"

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

            conn.request("POST", "/analytics/analytics/definitions-manager/aggregates/%7BaggregateId%7D/client/%7BclientId%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": "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
              }
            });

            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/%7BaggregateId%7D/client/%7BclientId%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/%7BaggregateId%7D/client/%7BclientId%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: '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}
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/analytics/analytics/definitions-manager/aggregates/%7BaggregateId%7D/client/%7BclientId%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":"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}}');

            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/%7BaggregateId%7D/client/%7BclientId%7D/calculate/histogram")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"variables\":[{\"name\":\"string\",\"value\":\"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}}")
              .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-PreviewAggregateRequest"
      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 '{"aggregate":{"oldId":0,"aggregateType":"AGGREGATE","name":"string","description":"string","action":{"id":0,"name":"page.visit"},"attribute":{"type":"PARAM","param":"string","id":0},"type":"AVG","level":0.01,"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}},"size":0,"unique":false,"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]},"identifierValue":"string"}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"aggregate\":{\"oldId\":0,\"aggregateType\":\"AGGREGATE\",\"name\":\"string\",\"description\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"type\":\"AVG\",\"level\":0.01,\"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}},\"size\":0,\"unique\":false,\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]},\"identifierValue\":\"string\"}"

            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({
              "aggregate": {
                "oldId": 0,
                "aggregateType": "AGGREGATE",
                "name": "string",
                "description": "string",
                "action": {
                  "id": 0,
                  "name": "page.visit"
                },
                "attribute": {
                  "type": "PARAM",
                  "param": "string",
                  "id": 0
                },
                "type": "AVG",
                "level": 0.01,
                "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
                  }
                },
                "size": 0,
                "unique": false,
                "expressions": [
                  {
                    "attribute": {
                      "type": "PARAM",
                      "param": "string",
                      "id": 0
                    },
                    "constraint": {
                      "type": "BOOL",
                      "logic": "IS_TRUE"
                    }
                  }
                ]
              },
              "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/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({
              aggregate: {
                oldId: 0,
                aggregateType: 'AGGREGATE',
                name: 'string',
                description: 'string',
                action: {id: 0, name: 'page.visit'},
                attribute: {type: 'PARAM', param: 'string', id: 0},
                type: 'AVG',
                level: 0.01,
                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
                  }
                },
                size: 0,
                unique: false,
                expressions: [
                  {
                    attribute: {type: 'PARAM', param: 'string', id: 0},
                    constraint: {type: 'BOOL', logic: 'IS_TRUE'}
                  }
                ]
              },
              identifierValue: 'string'
            }));
            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('{"aggregate":{"oldId":0,"aggregateType":"AGGREGATE","name":"string","description":"string","action":{"id":0,"name":"page.visit"},"attribute":{"type":"PARAM","param":"string","id":0},"type":"AVG","level":0.01,"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}},"size":0,"unique":false,"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]},"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/preview/by/%7BidentifierType%7D")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"aggregate\":{\"oldId\":0,\"aggregateType\":\"AGGREGATE\",\"name\":\"string\",\"description\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"type\":\"AVG\",\"level\":0.01,\"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}},\"size\":0,\"unique\":false,\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]},\"identifierValue\":\"string\"}")
              .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/{aggregateId}/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-aggregateIdAsPathParam"
        - $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/%7BaggregateId%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/%7BaggregateId%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/%7BaggregateId%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/%7BaggregateId%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/%7BaggregateId%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/%7BaggregateId%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-analyticAggregateResponse"
        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":"RUNNING_AGGREGATE","excludeCurrent":true,"timeWindow":{"type":"YEARS","value":0},"name":"string","description":"string","action":{"id":0,"name":"page.visit"},"attribute":{"type":"PARAM","param":"string","id":0},"type":"AVG","level":0.01,"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}},"size":0,"unique":false,"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]},"isVisibleForClientProfile":true,"previewDefaultObjectId":0}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"analysis\":{\"aggregateType\":\"RUNNING_AGGREGATE\",\"excludeCurrent\":true,\"timeWindow\":{\"type\":\"YEARS\",\"value\":0},\"name\":\"string\",\"description\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"type\":\"AVG\",\"level\":0.01,\"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}},\"size\":0,\"unique\":false,\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]},\"isVisibleForClientProfile\":true,\"previewDefaultObjectId\":0}"

            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": "RUNNING_AGGREGATE",
                "excludeCurrent": true,
                "timeWindow": {
                  "type": "YEARS",
                  "value": 0
                },
                "name": "string",
                "description": "string",
                "action": {
                  "id": 0,
                  "name": "page.visit"
                },
                "attribute": {
                  "type": "PARAM",
                  "param": "string",
                  "id": 0
                },
                "type": "AVG",
                "level": 0.01,
                "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
                  }
                },
                "size": 0,
                "unique": false,
                "expressions": [
                  {
                    "attribute": {
                      "type": "PARAM",
                      "param": "string",
                      "id": 0
                    },
                    "constraint": {
                      "type": "BOOL",
                      "logic": "IS_TRUE"
                    }
                  }
                ]
              },
              "isVisibleForClientProfile": true,
              "previewDefaultObjectId": 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/%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: 'RUNNING_AGGREGATE',
                excludeCurrent: true,
                timeWindow: {type: 'YEARS', value: 0},
                name: 'string',
                description: 'string',
                action: {id: 0, name: 'page.visit'},
                attribute: {type: 'PARAM', param: 'string', id: 0},
                type: 'AVG',
                level: 0.01,
                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
                  }
                },
                size: 0,
                unique: false,
                expressions: [
                  {
                    attribute: {type: 'PARAM', param: 'string', id: 0},
                    constraint: {type: 'BOOL', logic: 'IS_TRUE'}
                  }
                ]
              },
              isVisibleForClientProfile: true,
              previewDefaultObjectId: 0
            }));
            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":"RUNNING_AGGREGATE","excludeCurrent":true,"timeWindow":{"type":"YEARS","value":0},"name":"string","description":"string","action":{"id":0,"name":"page.visit"},"attribute":{"type":"PARAM","param":"string","id":0},"type":"AVG","level":0.01,"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}},"size":0,"unique":false,"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]},"isVisibleForClientProfile":true,"previewDefaultObjectId":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/%7Bnamespace%7D/aggregates")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"analysis\":{\"aggregateType\":\"RUNNING_AGGREGATE\",\"excludeCurrent\":true,\"timeWindow\":{\"type\":\"YEARS\",\"value\":0},\"name\":\"string\",\"description\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"type\":\"AVG\",\"level\":0.01,\"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}},\"size\":0,\"unique\":false,\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]},\"isVisibleForClientProfile\":true,\"previewDefaultObjectId\":0}")
              .asString();
  /analytics/{namespace}/aggregates/{aggregateId}:
    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-aggregateIdAsPathParam"
      responses:
        "200":
          description: Details of the aggregate
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/analytics-Aggregate"
        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/%7BaggregateId%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/%7BaggregateId%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/%7BaggregateId%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/%7BaggregateId%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/%7BaggregateId%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/%7BaggregateId%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-aggregateIdAsPathParam"
      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/%7BaggregateId%7D \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"analysis":{"oldId":0,"aggregateType":"RUNNING_AGGREGATE","excludeCurrent":true,"timeWindow":{"type":"YEARS","value":0},"name":"string","description":"string","action":{"id":0,"name":"page.visit"},"attribute":{"type":"PARAM","param":"string","id":0},"type":"AVG","level":0.01,"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}},"size":0,"unique":false,"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]},"isVisibleForClientProfile":true,"previewDefaultObjectId":0}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"analysis\":{\"oldId\":0,\"aggregateType\":\"RUNNING_AGGREGATE\",\"excludeCurrent\":true,\"timeWindow\":{\"type\":\"YEARS\",\"value\":0},\"name\":\"string\",\"description\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"type\":\"AVG\",\"level\":0.01,\"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}},\"size\":0,\"unique\":false,\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]},\"isVisibleForClientProfile\":true,\"previewDefaultObjectId\":0}"

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

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

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

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "analysis": {
                "oldId": 0,
                "aggregateType": "RUNNING_AGGREGATE",
                "excludeCurrent": true,
                "timeWindow": {
                  "type": "YEARS",
                  "value": 0
                },
                "name": "string",
                "description": "string",
                "action": {
                  "id": 0,
                  "name": "page.visit"
                },
                "attribute": {
                  "type": "PARAM",
                  "param": "string",
                  "id": 0
                },
                "type": "AVG",
                "level": 0.01,
                "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
                  }
                },
                "size": 0,
                "unique": false,
                "expressions": [
                  {
                    "attribute": {
                      "type": "PARAM",
                      "param": "string",
                      "id": 0
                    },
                    "constraint": {
                      "type": "BOOL",
                      "logic": "IS_TRUE"
                    }
                  }
                ]
              },
              "isVisibleForClientProfile": true,
              "previewDefaultObjectId": 0
            });

            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/%7BaggregateId%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/%7BaggregateId%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: {
                oldId: 0,
                aggregateType: 'RUNNING_AGGREGATE',
                excludeCurrent: true,
                timeWindow: {type: 'YEARS', value: 0},
                name: 'string',
                description: 'string',
                action: {id: 0, name: 'page.visit'},
                attribute: {type: 'PARAM', param: 'string', id: 0},
                type: 'AVG',
                level: 0.01,
                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
                  }
                },
                size: 0,
                unique: false,
                expressions: [
                  {
                    attribute: {type: 'PARAM', param: 'string', id: 0},
                    constraint: {type: 'BOOL', logic: 'IS_TRUE'}
                  }
                ]
              },
              isVisibleForClientProfile: true,
              previewDefaultObjectId: 0
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

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

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

            $request->setBody('{"analysis":{"oldId":0,"aggregateType":"RUNNING_AGGREGATE","excludeCurrent":true,"timeWindow":{"type":"YEARS","value":0},"name":"string","description":"string","action":{"id":0,"name":"page.visit"},"attribute":{"type":"PARAM","param":"string","id":0},"type":"AVG","level":0.01,"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}},"size":0,"unique":false,"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]},"isVisibleForClientProfile":true,"previewDefaultObjectId":0}');

            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/%7BaggregateId%7D")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"analysis\":{\"oldId\":0,\"aggregateType\":\"RUNNING_AGGREGATE\",\"excludeCurrent\":true,\"timeWindow\":{\"type\":\"YEARS\",\"value\":0},\"name\":\"string\",\"description\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"type\":\"AVG\",\"level\":0.01,\"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}},\"size\":0,\"unique\":false,\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]},\"isVisibleForClientProfile\":true,\"previewDefaultObjectId\":0}")
              .asString();
    delete:
      tags:
        - "Analytics: Aggregates"
      summary: Delete aggregate
      operationId: analytics2-aggregate-delete
      parameters:
        - $ref: "#/components/parameters/analytics-pathNamespace"
        - $ref: "#/components/parameters/analytics-aggregateIdAsPathParam"
      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/%7BaggregateId%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/%7BaggregateId%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/%7BaggregateId%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/%7BaggregateId%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/%7BaggregateId%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/%7BaggregateId%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":{"title":"string","description":"string","sourceEvent":{"action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]},"reverseOrder":true,"numberOfSteps":0,"numberOfPaths":0,"drillDown":[{"eventName":"page.visit","attribute":{"type":"PARAM","param":"string","id":0},"layer":0}],"drillDownCount":null,"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":"FUNNEL","matching":true,"funnel":{"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}},"exact":false,"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}],"title":"string"}}],"expression":{}},"eventFilters":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}],"excludeEvents":true,"firstOccurrenceOnly":true}}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"analysis\":{\"title\":\"string\",\"description\":\"string\",\"sourceEvent\":{\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]},\"reverseOrder\":true,\"numberOfSteps\":0,\"numberOfPaths\":0,\"drillDown\":[{\"eventName\":\"page.visit\",\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"layer\":0}],\"drillDownCount\":null,\"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\":\"FUNNEL\",\"matching\":true,\"funnel\":{\"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}},\"exact\":false,\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}],\"title\":\"string\"}}],\"expression\":{}},\"eventFilters\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}],\"excludeEvents\":true,\"firstOccurrenceOnly\":true}}"

            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": {
                "title": "string",
                "description": "string",
                "sourceEvent": {
                  "action": {
                    "id": 0,
                    "name": "page.visit"
                  },
                  "expressions": [
                    {
                      "attribute": {
                        "type": "PARAM",
                        "param": "string",
                        "id": 0
                      },
                      "constraint": {
                        "type": "BOOL",
                        "logic": "IS_TRUE"
                      }
                    }
                  ]
                },
                "reverseOrder": true,
                "numberOfSteps": 0,
                "numberOfPaths": 0,
                "drillDown": [
                  {
                    "eventName": "page.visit",
                    "attribute": {
                      "type": "PARAM",
                      "param": "string",
                      "id": 0
                    },
                    "layer": 0
                  }
                ],
                "drillDownCount": null,
                "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": "FUNNEL",
                      "matching": true,
                      "funnel": {
                        "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
                          }
                        },
                        "exact": false,
                        "steps": [
                          {
                            "title": "string",
                            "action": {
                              "id": 0,
                              "name": "page.visit"
                            },
                            "expressions": [
                              {
                                "attribute": {
                                  "type": "PARAM",
                                  "param": "string",
                                  "id": 0
                                },
                                "constraint": {
                                  "type": "BOOL",
                                  "logic": "IS_TRUE"
                                }
                              }
                            ]
                          }
                        ],
                        "title": "string"
                      }
                    }
                  ],
                  "expression": {}
                },
                "eventFilters": [
                  {
                    "title": "string",
                    "action": {
                      "id": 0,
                      "name": "page.visit"
                    },
                    "expressions": [
                      {
                        "attribute": {
                          "type": "PARAM",
                          "param": "string",
                          "id": 0
                        },
                        "constraint": {
                          "type": "BOOL",
                          "logic": "IS_TRUE"
                        }
                      }
                    ]
                  }
                ],
                "excludeEvents": true,
                "firstOccurrenceOnly": 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/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: {
                title: 'string',
                description: 'string',
                sourceEvent: {
                  action: {id: 0, name: 'page.visit'},
                  expressions: [
                    {
                      attribute: {type: 'PARAM', param: 'string', id: 0},
                      constraint: {type: 'BOOL', logic: 'IS_TRUE'}
                    }
                  ]
                },
                reverseOrder: true,
                numberOfSteps: 0,
                numberOfPaths: 0,
                drillDown: [
                  {
                    eventName: 'page.visit',
                    attribute: {type: 'PARAM', param: 'string', id: 0},
                    layer: 0
                  }
                ],
                drillDownCount: null,
                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: 'FUNNEL',
                      matching: true,
                      funnel: {
                        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
                          }
                        },
                        exact: false,
                        steps: [
                          {
                            title: 'string',
                            action: {id: 0, name: 'page.visit'},
                            expressions: [
                              {
                                attribute: {type: 'PARAM', param: 'string', id: 0},
                                constraint: {type: 'BOOL', logic: 'IS_TRUE'}
                              }
                            ]
                          }
                        ],
                        title: 'string'
                      }
                    }
                  ],
                  expression: {}
                },
                eventFilters: [
                  {
                    title: 'string',
                    action: {id: 0, name: 'page.visit'},
                    expressions: [
                      {
                        attribute: {type: 'PARAM', param: 'string', id: 0},
                        constraint: {type: 'BOOL', logic: 'IS_TRUE'}
                      }
                    ]
                  }
                ],
                excludeEvents: true,
                firstOccurrenceOnly: true
              }
            }));
            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":{"title":"string","description":"string","sourceEvent":{"action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]},"reverseOrder":true,"numberOfSteps":0,"numberOfPaths":0,"drillDown":[{"eventName":"page.visit","attribute":{"type":"PARAM","param":"string","id":0},"layer":0}],"drillDownCount":null,"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":"FUNNEL","matching":true,"funnel":{"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}},"exact":false,"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}],"title":"string"}}],"expression":{}},"eventFilters":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}],"excludeEvents":true,"firstOccurrenceOnly":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/analytics/v2/sankeys/preview")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"analysis\":{\"title\":\"string\",\"description\":\"string\",\"sourceEvent\":{\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]},\"reverseOrder\":true,\"numberOfSteps\":0,\"numberOfPaths\":0,\"drillDown\":[{\"eventName\":\"page.visit\",\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"layer\":0}],\"drillDownCount\":null,\"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\":\"FUNNEL\",\"matching\":true,\"funnel\":{\"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}},\"exact\":false,\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}],\"title\":\"string\"}}],\"expression\":{}},\"eventFilters\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}],\"excludeEvents\":true,\"firstOccurrenceOnly\":true}}")
              .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":{"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}},"exact":false,"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}],"title":"string"},"filter":{"matching":true,"expressions":[{"type":"FUNNEL","matching":true,"funnel":{"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}},"exact":false,"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}],"title":"string"}}],"expression":{}}}}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"analysis\":{\"title\":\"string\",\"description\":\"string\",\"funnel\":{\"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}},\"exact\":false,\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}],\"title\":\"string\"},\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"FUNNEL\",\"matching\":true,\"funnel\":{\"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}},\"exact\":false,\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}],\"title\":\"string\"}}],\"expression\":{}}}}"

            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": {
                  "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
                    }
                  },
                  "exact": false,
                  "steps": [
                    {
                      "title": "string",
                      "action": {
                        "id": 0,
                        "name": "page.visit"
                      },
                      "expressions": [
                        {
                          "attribute": {
                            "type": "PARAM",
                            "param": "string",
                            "id": 0
                          },
                          "constraint": {
                            "type": "BOOL",
                            "logic": "IS_TRUE"
                          }
                        }
                      ]
                    }
                  ],
                  "title": "string"
                },
                "filter": {
                  "matching": true,
                  "expressions": [
                    {
                      "type": "FUNNEL",
                      "matching": true,
                      "funnel": {
                        "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
                          }
                        },
                        "exact": false,
                        "steps": [
                          {
                            "title": "string",
                            "action": {
                              "id": 0,
                              "name": "page.visit"
                            },
                            "expressions": [
                              {
                                "attribute": {
                                  "type": "PARAM",
                                  "param": "string",
                                  "id": 0
                                },
                                "constraint": {
                                  "type": "BOOL",
                                  "logic": "IS_TRUE"
                                }
                              }
                            ]
                          }
                        ],
                        "title": "string"
                      }
                    }
                  ],
                  "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/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: {
                  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
                    }
                  },
                  exact: false,
                  steps: [
                    {
                      title: 'string',
                      action: {id: 0, name: 'page.visit'},
                      expressions: [
                        {
                          attribute: {type: 'PARAM', param: 'string', id: 0},
                          constraint: {type: 'BOOL', logic: 'IS_TRUE'}
                        }
                      ]
                    }
                  ],
                  title: 'string'
                },
                filter: {
                  matching: true,
                  expressions: [
                    {
                      type: 'FUNNEL',
                      matching: true,
                      funnel: {
                        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
                          }
                        },
                        exact: false,
                        steps: [
                          {
                            title: 'string',
                            action: {id: 0, name: 'page.visit'},
                            expressions: [
                              {
                                attribute: {type: 'PARAM', param: 'string', id: 0},
                                constraint: {type: 'BOOL', logic: 'IS_TRUE'}
                              }
                            ]
                          }
                        ],
                        title: 'string'
                      }
                    }
                  ],
                  expression: {}
                }
              }
            }));
            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":{"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}},"exact":false,"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}],"title":"string"},"filter":{"matching":true,"expressions":[{"type":"FUNNEL","matching":true,"funnel":{"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}},"exact":false,"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}],"title":"string"}}],"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/analytics/v2/funnels/preview")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"analysis\":{\"title\":\"string\",\"description\":\"string\",\"funnel\":{\"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}},\"exact\":false,\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}],\"title\":\"string\"},\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"FUNNEL\",\"matching\":true,\"funnel\":{\"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}},\"exact\":false,\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}],\"title\":\"string\"}}],\"expression\":{}}}}")
              .asString();
  /analytics/analytics/v2/funnels/{funnelId}/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-funnelIdAsPathParam"
      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/%7BfunnelId%7D/recalculate/override \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"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":"FUNNEL","matching":true,"funnel":{"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}},"exact":false,"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}],"title":"string"}}],"expression":{}},"variables":[{"name":"string","value":"string"}]}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"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\":\"FUNNEL\",\"matching\":true,\"funnel\":{\"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}},\"exact\":false,\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}],\"title\":\"string\"}}],\"expression\":{}},\"variables\":[{\"name\":\"string\",\"value\":\"string\"}]}"

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

            conn.request("POST", "/analytics/analytics/v2/funnels/%7BfunnelId%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({
              "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": "FUNNEL",
                    "matching": true,
                    "funnel": {
                      "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
                        }
                      },
                      "exact": false,
                      "steps": [
                        {
                          "title": "string",
                          "action": {
                            "id": 0,
                            "name": "page.visit"
                          },
                          "expressions": [
                            {
                              "attribute": {
                                "type": "PARAM",
                                "param": "string",
                                "id": 0
                              },
                              "constraint": {
                                "type": "BOOL",
                                "logic": "IS_TRUE"
                              }
                            }
                          ]
                        }
                      ],
                      "title": "string"
                    }
                  }
                ],
                "expression": {}
              },
              "variables": [
                {
                  "name": "string",
                  "value": "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/analytics/v2/funnels/%7BfunnelId%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/%7BfunnelId%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({
              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: 'FUNNEL',
                    matching: true,
                    funnel: {
                      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
                        }
                      },
                      exact: false,
                      steps: [
                        {
                          title: 'string',
                          action: {id: 0, name: 'page.visit'},
                          expressions: [
                            {
                              attribute: {type: 'PARAM', param: 'string', id: 0},
                              constraint: {type: 'BOOL', logic: 'IS_TRUE'}
                            }
                          ]
                        }
                      ],
                      title: 'string'
                    }
                  }
                ],
                expression: {}
              },
              variables: [{name: 'string', value: 'string'}]
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

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

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

            $request->setBody('{"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":"FUNNEL","matching":true,"funnel":{"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}},"exact":false,"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}],"title":"string"}}],"expression":{}},"variables":[{"name":"string","value":"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/analytics/v2/funnels/%7BfunnelId%7D/recalculate/override")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"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\":\"FUNNEL\",\"matching\":true,\"funnel\":{\"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}},\"exact\":false,\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}],\"title\":\"string\"}}],\"expression\":{}},\"variables\":[{\"name\":\"string\",\"value\":\"string\"}]}")
              .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"
        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-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:-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":{"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}},"exact":false,"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}],"title":"string"},"filter":{"matching":true,"expressions":[{"type":"FUNNEL","matching":true,"funnel":{"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}},"exact":false,"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}],"title":"string"}}],"expression":{}}}}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"analysis\":{\"title\":\"string\",\"description\":\"string\",\"funnel\":{\"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}},\"exact\":false,\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}],\"title\":\"string\"},\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"FUNNEL\",\"matching\":true,\"funnel\":{\"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}},\"exact\":false,\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}],\"title\":\"string\"}}],\"expression\":{}}}}"

            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": {
                  "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
                    }
                  },
                  "exact": false,
                  "steps": [
                    {
                      "title": "string",
                      "action": {
                        "id": 0,
                        "name": "page.visit"
                      },
                      "expressions": [
                        {
                          "attribute": {
                            "type": "PARAM",
                            "param": "string",
                            "id": 0
                          },
                          "constraint": {
                            "type": "BOOL",
                            "logic": "IS_TRUE"
                          }
                        }
                      ]
                    }
                  ],
                  "title": "string"
                },
                "filter": {
                  "matching": true,
                  "expressions": [
                    {
                      "type": "FUNNEL",
                      "matching": true,
                      "funnel": {
                        "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
                          }
                        },
                        "exact": false,
                        "steps": [
                          {
                            "title": "string",
                            "action": {
                              "id": 0,
                              "name": "page.visit"
                            },
                            "expressions": [
                              {
                                "attribute": {
                                  "type": "PARAM",
                                  "param": "string",
                                  "id": 0
                                },
                                "constraint": {
                                  "type": "BOOL",
                                  "logic": "IS_TRUE"
                                }
                              }
                            ]
                          }
                        ],
                        "title": "string"
                      }
                    }
                  ],
                  "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/%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: {
                  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
                    }
                  },
                  exact: false,
                  steps: [
                    {
                      title: 'string',
                      action: {id: 0, name: 'page.visit'},
                      expressions: [
                        {
                          attribute: {type: 'PARAM', param: 'string', id: 0},
                          constraint: {type: 'BOOL', logic: 'IS_TRUE'}
                        }
                      ]
                    }
                  ],
                  title: 'string'
                },
                filter: {
                  matching: true,
                  expressions: [
                    {
                      type: 'FUNNEL',
                      matching: true,
                      funnel: {
                        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
                          }
                        },
                        exact: false,
                        steps: [
                          {
                            title: 'string',
                            action: {id: 0, name: 'page.visit'},
                            expressions: [
                              {
                                attribute: {type: 'PARAM', param: 'string', id: 0},
                                constraint: {type: 'BOOL', logic: 'IS_TRUE'}
                              }
                            ]
                          }
                        ],
                        title: 'string'
                      }
                    }
                  ],
                  expression: {}
                }
              }
            }));
            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":{"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}},"exact":false,"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}],"title":"string"},"filter":{"matching":true,"expressions":[{"type":"FUNNEL","matching":true,"funnel":{"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}},"exact":false,"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}],"title":"string"}}],"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/%7Bnamespace%7D/funnels")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"analysis\":{\"title\":\"string\",\"description\":\"string\",\"funnel\":{\"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}},\"exact\":false,\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}],\"title\":\"string\"},\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"FUNNEL\",\"matching\":true,\"funnel\":{\"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}},\"exact\":false,\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}],\"title\":\"string\"}}],\"expression\":{}}}}")
              .asString();
  /analytics/{namespace}/funnels/{funnelId}:
    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-funnelIdAsPathParam"
      responses:
        "200":
          description: Details of the funnel
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/analytics-Funnel"
        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/%7BfunnelId%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/%7BfunnelId%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/%7BfunnelId%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/%7BfunnelId%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/%7BfunnelId%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/%7BfunnelId%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-funnelIdAsPathParam"
      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/%7BfunnelId%7D \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"analysis":{"title":"string","description":"string","funnel":{"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}},"exact":false,"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}],"title":"string"},"filter":{"matching":true,"expressions":[{"type":"FUNNEL","matching":true,"funnel":{"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}},"exact":false,"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}],"title":"string"}}],"expression":{}}}}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"analysis\":{\"title\":\"string\",\"description\":\"string\",\"funnel\":{\"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}},\"exact\":false,\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}],\"title\":\"string\"},\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"FUNNEL\",\"matching\":true,\"funnel\":{\"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}},\"exact\":false,\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}],\"title\":\"string\"}}],\"expression\":{}}}}"

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

            conn.request("PUT", "/analytics/%7Bnamespace%7D/funnels/%7BfunnelId%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": {
                  "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
                    }
                  },
                  "exact": false,
                  "steps": [
                    {
                      "title": "string",
                      "action": {
                        "id": 0,
                        "name": "page.visit"
                      },
                      "expressions": [
                        {
                          "attribute": {
                            "type": "PARAM",
                            "param": "string",
                            "id": 0
                          },
                          "constraint": {
                            "type": "BOOL",
                            "logic": "IS_TRUE"
                          }
                        }
                      ]
                    }
                  ],
                  "title": "string"
                },
                "filter": {
                  "matching": true,
                  "expressions": [
                    {
                      "type": "FUNNEL",
                      "matching": true,
                      "funnel": {
                        "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
                          }
                        },
                        "exact": false,
                        "steps": [
                          {
                            "title": "string",
                            "action": {
                              "id": 0,
                              "name": "page.visit"
                            },
                            "expressions": [
                              {
                                "attribute": {
                                  "type": "PARAM",
                                  "param": "string",
                                  "id": 0
                                },
                                "constraint": {
                                  "type": "BOOL",
                                  "logic": "IS_TRUE"
                                }
                              }
                            ]
                          }
                        ],
                        "title": "string"
                      }
                    }
                  ],
                  "expression": {}
                }
              }
            });

            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/%7BfunnelId%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/%7BfunnelId%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: {
                  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
                    }
                  },
                  exact: false,
                  steps: [
                    {
                      title: 'string',
                      action: {id: 0, name: 'page.visit'},
                      expressions: [
                        {
                          attribute: {type: 'PARAM', param: 'string', id: 0},
                          constraint: {type: 'BOOL', logic: 'IS_TRUE'}
                        }
                      ]
                    }
                  ],
                  title: 'string'
                },
                filter: {
                  matching: true,
                  expressions: [
                    {
                      type: 'FUNNEL',
                      matching: true,
                      funnel: {
                        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
                          }
                        },
                        exact: false,
                        steps: [
                          {
                            title: 'string',
                            action: {id: 0, name: 'page.visit'},
                            expressions: [
                              {
                                attribute: {type: 'PARAM', param: 'string', id: 0},
                                constraint: {type: 'BOOL', logic: 'IS_TRUE'}
                              }
                            ]
                          }
                        ],
                        title: 'string'
                      }
                    }
                  ],
                  expression: {}
                }
              }
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/analytics/%7Bnamespace%7D/funnels/%7BfunnelId%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":{"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}},"exact":false,"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}],"title":"string"},"filter":{"matching":true,"expressions":[{"type":"FUNNEL","matching":true,"funnel":{"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}},"exact":false,"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}],"title":"string"}}],"expression":{}}}}');

            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/%7BfunnelId%7D")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"analysis\":{\"title\":\"string\",\"description\":\"string\",\"funnel\":{\"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}},\"exact\":false,\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}],\"title\":\"string\"},\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"FUNNEL\",\"matching\":true,\"funnel\":{\"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}},\"exact\":false,\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}],\"title\":\"string\"}}],\"expression\":{}}}}")
              .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-funnelIdAsPathParam"
      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/%7BfunnelId%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/%7BfunnelId%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/%7BfunnelId%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/%7BfunnelId%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/%7BfunnelId%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/%7BfunnelId%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"
        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-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:-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":{"title":"string","description":"string","filter":{"matching":true,"expressions":[{"type":"FUNNEL","matching":true,"funnel":{"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}},"exact":false,"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}],"title":"string"}}],"expression":{}},"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"},"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":"SEGMENTATION","id":"497f6eca-6276-4993-bfeb-53cbbbba6f08"}}]}]},"allowNull":true}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"analysis\":{\"title\":\"string\",\"description\":\"string\",\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"FUNNEL\",\"matching\":true,\"funnel\":{\"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}},\"exact\":false,\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}],\"title\":\"string\"}}],\"expression\":{}},\"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\"},\"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\":\"SEGMENTATION\",\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\"}}]}]},\"allowNull\":true}"

            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": {
                "title": "string",
                "description": "string",
                "filter": {
                  "matching": true,
                  "expressions": [
                    {
                      "type": "FUNNEL",
                      "matching": true,
                      "funnel": {
                        "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
                          }
                        },
                        "exact": false,
                        "steps": [
                          {
                            "title": "string",
                            "action": {
                              "id": 0,
                              "name": "page.visit"
                            },
                            "expressions": [
                              {
                                "attribute": {
                                  "type": "PARAM",
                                  "param": "string",
                                  "id": 0
                                },
                                "constraint": {
                                  "type": "BOOL",
                                  "logic": "IS_TRUE"
                                }
                              }
                            ]
                          }
                        ],
                        "title": "string"
                      }
                    }
                  ],
                  "expression": {}
                },
                "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"
                    },
                    "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": "SEGMENTATION",
                          "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
                        }
                      }
                    ]
                  }
                ]
              },
              "allowNull": 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/%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: {
                title: 'string',
                description: 'string',
                filter: {
                  matching: true,
                  expressions: [
                    {
                      type: 'FUNNEL',
                      matching: true,
                      funnel: {
                        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
                          }
                        },
                        exact: false,
                        steps: [
                          {
                            title: 'string',
                            action: {id: 0, name: 'page.visit'},
                            expressions: [
                              {
                                attribute: {type: 'PARAM', param: 'string', id: 0},
                                constraint: {type: 'BOOL', logic: 'IS_TRUE'}
                              }
                            ]
                          }
                        ],
                        title: 'string'
                      }
                    }
                  ],
                  expression: {}
                },
                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'},
                    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: 'SEGMENTATION', id: '497f6eca-6276-4993-bfeb-53cbbbba6f08'}
                      }
                    ]
                  }
                ]
              },
              allowNull: true
            }));
            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":{"title":"string","description":"string","filter":{"matching":true,"expressions":[{"type":"FUNNEL","matching":true,"funnel":{"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}},"exact":false,"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}],"title":"string"}}],"expression":{}},"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"},"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":"SEGMENTATION","id":"497f6eca-6276-4993-bfeb-53cbbbba6f08"}}]}]},"allowNull":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/%7Bnamespace%7D/reports")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"analysis\":{\"title\":\"string\",\"description\":\"string\",\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"FUNNEL\",\"matching\":true,\"funnel\":{\"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}},\"exact\":false,\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}],\"title\":\"string\"}}],\"expression\":{}},\"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\"},\"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\":\"SEGMENTATION\",\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\"}}]}]},\"allowNull\":true}")
              .asString();
  /analytics/{namespace}/reports/{reportId}:
    get:
      tags:
        - "Analytics: Reports"
      summary: Get report analysis details
      operationId: analytics2-reports-get
      parameters:
        - $ref: "#/components/parameters/analytics-reportIdAsPathParam"
        - $ref: "#/components/parameters/analytics-pathNamespace"
      responses:
        "200":
          description: Get report analysis details
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/analytics-Report"
        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/%7BreportId%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/%7BreportId%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/%7BreportId%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/%7BreportId%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/%7BreportId%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/%7BreportId%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-reportIdAsPathParam"
        - $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/%7BreportId%7D \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"analysis":{"title":"string","description":"string","filter":{"matching":true,"expressions":[{"type":"FUNNEL","matching":true,"funnel":{"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}},"exact":false,"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}],"title":"string"}}],"expression":{}},"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"},"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":"SEGMENTATION","id":"497f6eca-6276-4993-bfeb-53cbbbba6f08"}}]}]},"allowNull":true}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"analysis\":{\"title\":\"string\",\"description\":\"string\",\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"FUNNEL\",\"matching\":true,\"funnel\":{\"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}},\"exact\":false,\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}],\"title\":\"string\"}}],\"expression\":{}},\"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\"},\"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\":\"SEGMENTATION\",\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\"}}]}]},\"allowNull\":true}"

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

            conn.request("PUT", "/analytics/%7Bnamespace%7D/reports/%7BreportId%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",
                "filter": {
                  "matching": true,
                  "expressions": [
                    {
                      "type": "FUNNEL",
                      "matching": true,
                      "funnel": {
                        "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
                          }
                        },
                        "exact": false,
                        "steps": [
                          {
                            "title": "string",
                            "action": {
                              "id": 0,
                              "name": "page.visit"
                            },
                            "expressions": [
                              {
                                "attribute": {
                                  "type": "PARAM",
                                  "param": "string",
                                  "id": 0
                                },
                                "constraint": {
                                  "type": "BOOL",
                                  "logic": "IS_TRUE"
                                }
                              }
                            ]
                          }
                        ],
                        "title": "string"
                      }
                    }
                  ],
                  "expression": {}
                },
                "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"
                    },
                    "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": "SEGMENTATION",
                          "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
                        }
                      }
                    ]
                  }
                ]
              },
              "allowNull": true
            });

            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/%7BreportId%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/%7BreportId%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',
                filter: {
                  matching: true,
                  expressions: [
                    {
                      type: 'FUNNEL',
                      matching: true,
                      funnel: {
                        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
                          }
                        },
                        exact: false,
                        steps: [
                          {
                            title: 'string',
                            action: {id: 0, name: 'page.visit'},
                            expressions: [
                              {
                                attribute: {type: 'PARAM', param: 'string', id: 0},
                                constraint: {type: 'BOOL', logic: 'IS_TRUE'}
                              }
                            ]
                          }
                        ],
                        title: 'string'
                      }
                    }
                  ],
                  expression: {}
                },
                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'},
                    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: 'SEGMENTATION', id: '497f6eca-6276-4993-bfeb-53cbbbba6f08'}
                      }
                    ]
                  }
                ]
              },
              allowNull: true
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

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

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

            $request->setBody('{"analysis":{"title":"string","description":"string","filter":{"matching":true,"expressions":[{"type":"FUNNEL","matching":true,"funnel":{"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}},"exact":false,"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}],"title":"string"}}],"expression":{}},"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"},"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":"SEGMENTATION","id":"497f6eca-6276-4993-bfeb-53cbbbba6f08"}}]}]},"allowNull":true}');

            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/%7BreportId%7D")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"analysis\":{\"title\":\"string\",\"description\":\"string\",\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"FUNNEL\",\"matching\":true,\"funnel\":{\"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}},\"exact\":false,\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}],\"title\":\"string\"}}],\"expression\":{}},\"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\"},\"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\":\"SEGMENTATION\",\"id\":\"497f6eca-6276-4993-bfeb-53cbbbba6f08\"}}]}]},\"allowNull\":true}")
              .asString();
    delete:
      tags:
        - "Analytics: Reports"
      summary: Delete report analysis
      operationId: analytics2-reports-delete
      parameters:
        - $ref: "#/components/parameters/analytics-reportIdAsPathParam"
        - $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/%7BreportId%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/%7BreportId%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/%7BreportId%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/%7BreportId%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/%7BreportId%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/%7BreportId%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-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:-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":{"title":"string","description":"string","filter":{"matching":true,"expressions":[{"type":"FUNNEL","matching":true,"funnel":{"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}},"exact":false,"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}],"title":"string"}}],"expression":{}},"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":[{"title":"string","description":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}],"tabIndex":0,"aggregationType":"EVENT","chartType":"COLUMN"}]}}}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"analysis\":{\"title\":\"string\",\"description\":\"string\",\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"FUNNEL\",\"matching\":true,\"funnel\":{\"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}},\"exact\":false,\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}],\"title\":\"string\"}}],\"expression\":{}},\"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\":[{\"title\":\"string\",\"description\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}],\"tabIndex\":0,\"aggregationType\":\"EVENT\",\"chartType\":\"COLUMN\"}]}}}"

            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": {
                "title": "string",
                "description": "string",
                "filter": {
                  "matching": true,
                  "expressions": [
                    {
                      "type": "FUNNEL",
                      "matching": true,
                      "funnel": {
                        "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
                          }
                        },
                        "exact": false,
                        "steps": [
                          {
                            "title": "string",
                            "action": {
                              "id": 0,
                              "name": "page.visit"
                            },
                            "expressions": [
                              {
                                "attribute": {
                                  "type": "PARAM",
                                  "param": "string",
                                  "id": 0
                                },
                                "constraint": {
                                  "type": "BOOL",
                                  "logic": "IS_TRUE"
                                }
                              }
                            ]
                          }
                        ],
                        "title": "string"
                      }
                    }
                  ],
                  "expression": {}
                },
                "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": [
                    {
                      "title": "string",
                      "description": "string",
                      "action": {
                        "id": 0,
                        "name": "page.visit"
                      },
                      "expressions": [
                        {
                          "attribute": {
                            "type": "PARAM",
                            "param": "string",
                            "id": 0
                          },
                          "constraint": {
                            "type": "BOOL",
                            "logic": "IS_TRUE"
                          }
                        }
                      ],
                      "tabIndex": 0,
                      "aggregationType": "EVENT",
                      "chartType": "COLUMN"
                    }
                  ]
                }
              }
            });

            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: {
                title: 'string',
                description: 'string',
                filter: {
                  matching: true,
                  expressions: [
                    {
                      type: 'FUNNEL',
                      matching: true,
                      funnel: {
                        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
                          }
                        },
                        exact: false,
                        steps: [
                          {
                            title: 'string',
                            action: {id: 0, name: 'page.visit'},
                            expressions: [
                              {
                                attribute: {type: 'PARAM', param: 'string', id: 0},
                                constraint: {type: 'BOOL', logic: 'IS_TRUE'}
                              }
                            ]
                          }
                        ],
                        title: 'string'
                      }
                    }
                  ],
                  expression: {}
                },
                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: [
                    {
                      title: 'string',
                      description: 'string',
                      action: {id: 0, name: 'page.visit'},
                      expressions: [
                        {
                          attribute: {type: 'PARAM', param: 'string', id: 0},
                          constraint: {type: 'BOOL', logic: 'IS_TRUE'}
                        }
                      ],
                      tabIndex: 0,
                      aggregationType: 'EVENT',
                      chartType: 'COLUMN'
                    }
                  ]
                }
              }
            }));
            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":{"title":"string","description":"string","filter":{"matching":true,"expressions":[{"type":"FUNNEL","matching":true,"funnel":{"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}},"exact":false,"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}],"title":"string"}}],"expression":{}},"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":[{"title":"string","description":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}],"tabIndex":0,"aggregationType":"EVENT","chartType":"COLUMN"}]}}}');

            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\":{\"title\":\"string\",\"description\":\"string\",\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"FUNNEL\",\"matching\":true,\"funnel\":{\"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}},\"exact\":false,\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}],\"title\":\"string\"}}],\"expression\":{}},\"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\":[{\"title\":\"string\",\"description\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}],\"tabIndex\":0,\"aggregationType\":\"EVENT\",\"chartType\":\"COLUMN\"}]}}}")
              .asString();
  /analytics/{namespace}/trends/{trendId}:
    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-trendIdAsPathParam"
      responses:
        "200":
          description: Details of a trend
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/analytics-Trend"
        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/%7BtrendId%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/%7BtrendId%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/%7BtrendId%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/%7BtrendId%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/%7BtrendId%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/%7BtrendId%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-trendIdAsPathParam"
      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/%7BtrendId%7D \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"analysis":{"title":"string","description":"string","filter":{"matching":true,"expressions":[{"type":"FUNNEL","matching":true,"funnel":{"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}},"exact":false,"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}],"title":"string"}}],"expression":{}},"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":[{"title":"string","description":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}],"tabIndex":0,"aggregationType":"EVENT","chartType":"COLUMN"}]}}}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"analysis\":{\"title\":\"string\",\"description\":\"string\",\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"FUNNEL\",\"matching\":true,\"funnel\":{\"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}},\"exact\":false,\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}],\"title\":\"string\"}}],\"expression\":{}},\"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\":[{\"title\":\"string\",\"description\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}],\"tabIndex\":0,\"aggregationType\":\"EVENT\",\"chartType\":\"COLUMN\"}]}}}"

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

            conn.request("PUT", "/analytics/%7Bnamespace%7D/trends/%7BtrendId%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",
                "filter": {
                  "matching": true,
                  "expressions": [
                    {
                      "type": "FUNNEL",
                      "matching": true,
                      "funnel": {
                        "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
                          }
                        },
                        "exact": false,
                        "steps": [
                          {
                            "title": "string",
                            "action": {
                              "id": 0,
                              "name": "page.visit"
                            },
                            "expressions": [
                              {
                                "attribute": {
                                  "type": "PARAM",
                                  "param": "string",
                                  "id": 0
                                },
                                "constraint": {
                                  "type": "BOOL",
                                  "logic": "IS_TRUE"
                                }
                              }
                            ]
                          }
                        ],
                        "title": "string"
                      }
                    }
                  ],
                  "expression": {}
                },
                "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": [
                    {
                      "title": "string",
                      "description": "string",
                      "action": {
                        "id": 0,
                        "name": "page.visit"
                      },
                      "expressions": [
                        {
                          "attribute": {
                            "type": "PARAM",
                            "param": "string",
                            "id": 0
                          },
                          "constraint": {
                            "type": "BOOL",
                            "logic": "IS_TRUE"
                          }
                        }
                      ],
                      "tabIndex": 0,
                      "aggregationType": "EVENT",
                      "chartType": "COLUMN"
                    }
                  ]
                }
              }
            });

            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/%7BtrendId%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/%7BtrendId%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',
                filter: {
                  matching: true,
                  expressions: [
                    {
                      type: 'FUNNEL',
                      matching: true,
                      funnel: {
                        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
                          }
                        },
                        exact: false,
                        steps: [
                          {
                            title: 'string',
                            action: {id: 0, name: 'page.visit'},
                            expressions: [
                              {
                                attribute: {type: 'PARAM', param: 'string', id: 0},
                                constraint: {type: 'BOOL', logic: 'IS_TRUE'}
                              }
                            ]
                          }
                        ],
                        title: 'string'
                      }
                    }
                  ],
                  expression: {}
                },
                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: [
                    {
                      title: 'string',
                      description: 'string',
                      action: {id: 0, name: 'page.visit'},
                      expressions: [
                        {
                          attribute: {type: 'PARAM', param: 'string', id: 0},
                          constraint: {type: 'BOOL', logic: 'IS_TRUE'}
                        }
                      ],
                      tabIndex: 0,
                      aggregationType: 'EVENT',
                      chartType: 'COLUMN'
                    }
                  ]
                }
              }
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

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

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

            $request->setBody('{"analysis":{"title":"string","description":"string","filter":{"matching":true,"expressions":[{"type":"FUNNEL","matching":true,"funnel":{"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}},"exact":false,"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}],"title":"string"}}],"expression":{}},"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":[{"title":"string","description":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}],"tabIndex":0,"aggregationType":"EVENT","chartType":"COLUMN"}]}}}');

            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/%7BtrendId%7D")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"analysis\":{\"title\":\"string\",\"description\":\"string\",\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"FUNNEL\",\"matching\":true,\"funnel\":{\"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}},\"exact\":false,\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}],\"title\":\"string\"}}],\"expression\":{}},\"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\":[{\"title\":\"string\",\"description\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}],\"tabIndex\":0,\"aggregationType\":\"EVENT\",\"chartType\":\"COLUMN\"}]}}}")
              .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-trendIdAsPathParam"
      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/%7BtrendId%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/%7BtrendId%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/%7BtrendId%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/%7BtrendId%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/%7BtrendId%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/%7BtrendId%7D")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
  /analytics/analytics/v2/trends/{trendId}/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-trendIdAsPathParam"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/analytics-OverrideQueryRequest"
      responses:
        "200":
          description: Trend calculation result
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/analytics-TrendCalculationResponse"
        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/%7BtrendId%7D/recalculate/override \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"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":"FUNNEL","matching":true,"funnel":{"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}},"exact":false,"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}],"title":"string"}}],"expression":{}},"variables":[{"name":"string","value":"string"}]}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"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\":\"FUNNEL\",\"matching\":true,\"funnel\":{\"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}},\"exact\":false,\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}],\"title\":\"string\"}}],\"expression\":{}},\"variables\":[{\"name\":\"string\",\"value\":\"string\"}]}"

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

            conn.request("POST", "/analytics/analytics/v2/trends/%7BtrendId%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({
              "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": "FUNNEL",
                    "matching": true,
                    "funnel": {
                      "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
                        }
                      },
                      "exact": false,
                      "steps": [
                        {
                          "title": "string",
                          "action": {
                            "id": 0,
                            "name": "page.visit"
                          },
                          "expressions": [
                            {
                              "attribute": {
                                "type": "PARAM",
                                "param": "string",
                                "id": 0
                              },
                              "constraint": {
                                "type": "BOOL",
                                "logic": "IS_TRUE"
                              }
                            }
                          ]
                        }
                      ],
                      "title": "string"
                    }
                  }
                ],
                "expression": {}
              },
              "variables": [
                {
                  "name": "string",
                  "value": "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/analytics/v2/trends/%7BtrendId%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/%7BtrendId%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({
              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: 'FUNNEL',
                    matching: true,
                    funnel: {
                      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
                        }
                      },
                      exact: false,
                      steps: [
                        {
                          title: 'string',
                          action: {id: 0, name: 'page.visit'},
                          expressions: [
                            {
                              attribute: {type: 'PARAM', param: 'string', id: 0},
                              constraint: {type: 'BOOL', logic: 'IS_TRUE'}
                            }
                          ]
                        }
                      ],
                      title: 'string'
                    }
                  }
                ],
                expression: {}
              },
              variables: [{name: 'string', value: 'string'}]
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

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

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

            $request->setBody('{"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":"FUNNEL","matching":true,"funnel":{"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}},"exact":false,"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}],"title":"string"}}],"expression":{}},"variables":[{"name":"string","value":"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/analytics/v2/trends/%7BtrendId%7D/recalculate/override")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"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\":\"FUNNEL\",\"matching\":true,\"funnel\":{\"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}},\"exact\":false,\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}],\"title\":\"string\"}}],\"expression\":{}},\"variables\":[{\"name\":\"string\",\"value\":\"string\"}]}")
              .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-TrendAnalysis"
              required:
                - analysis
      responses:
        "200":
          description: Calculation result
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/analytics-TrendCalculationResponse"
        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":{"title":"string","description":"string","filter":{"matching":true,"expressions":[{"type":"FUNNEL","matching":true,"funnel":{"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}},"exact":false,"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}],"title":"string"}}],"expression":{}},"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":[{"title":"string","description":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}],"tabIndex":0,"aggregationType":"EVENT","chartType":"COLUMN"}]}}}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"analysis\":{\"title\":\"string\",\"description\":\"string\",\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"FUNNEL\",\"matching\":true,\"funnel\":{\"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}},\"exact\":false,\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}],\"title\":\"string\"}}],\"expression\":{}},\"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\":[{\"title\":\"string\",\"description\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}],\"tabIndex\":0,\"aggregationType\":\"EVENT\",\"chartType\":\"COLUMN\"}]}}}"

            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": {
                "title": "string",
                "description": "string",
                "filter": {
                  "matching": true,
                  "expressions": [
                    {
                      "type": "FUNNEL",
                      "matching": true,
                      "funnel": {
                        "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
                          }
                        },
                        "exact": false,
                        "steps": [
                          {
                            "title": "string",
                            "action": {
                              "id": 0,
                              "name": "page.visit"
                            },
                            "expressions": [
                              {
                                "attribute": {
                                  "type": "PARAM",
                                  "param": "string",
                                  "id": 0
                                },
                                "constraint": {
                                  "type": "BOOL",
                                  "logic": "IS_TRUE"
                                }
                              }
                            ]
                          }
                        ],
                        "title": "string"
                      }
                    }
                  ],
                  "expression": {}
                },
                "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": [
                    {
                      "title": "string",
                      "description": "string",
                      "action": {
                        "id": 0,
                        "name": "page.visit"
                      },
                      "expressions": [
                        {
                          "attribute": {
                            "type": "PARAM",
                            "param": "string",
                            "id": 0
                          },
                          "constraint": {
                            "type": "BOOL",
                            "logic": "IS_TRUE"
                          }
                        }
                      ],
                      "tabIndex": 0,
                      "aggregationType": "EVENT",
                      "chartType": "COLUMN"
                    }
                  ]
                }
              }
            });

            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: {
                title: 'string',
                description: 'string',
                filter: {
                  matching: true,
                  expressions: [
                    {
                      type: 'FUNNEL',
                      matching: true,
                      funnel: {
                        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
                          }
                        },
                        exact: false,
                        steps: [
                          {
                            title: 'string',
                            action: {id: 0, name: 'page.visit'},
                            expressions: [
                              {
                                attribute: {type: 'PARAM', param: 'string', id: 0},
                                constraint: {type: 'BOOL', logic: 'IS_TRUE'}
                              }
                            ]
                          }
                        ],
                        title: 'string'
                      }
                    }
                  ],
                  expression: {}
                },
                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: [
                    {
                      title: 'string',
                      description: 'string',
                      action: {id: 0, name: 'page.visit'},
                      expressions: [
                        {
                          attribute: {type: 'PARAM', param: 'string', id: 0},
                          constraint: {type: 'BOOL', logic: 'IS_TRUE'}
                        }
                      ],
                      tabIndex: 0,
                      aggregationType: 'EVENT',
                      chartType: 'COLUMN'
                    }
                  ]
                }
              }
            }));
            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":{"title":"string","description":"string","filter":{"matching":true,"expressions":[{"type":"FUNNEL","matching":true,"funnel":{"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}},"exact":false,"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}],"title":"string"}}],"expression":{}},"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":[{"title":"string","description":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}],"tabIndex":0,"aggregationType":"EVENT","chartType":"COLUMN"}]}}}');

            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\":{\"title\":\"string\",\"description\":\"string\",\"filter\":{\"matching\":true,\"expressions\":[{\"type\":\"FUNNEL\",\"matching\":true,\"funnel\":{\"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}},\"exact\":false,\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}],\"title\":\"string\"}}],\"expression\":{}},\"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\":[{\"title\":\"string\",\"description\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}],\"tabIndex\":0,\"aggregationType\":\"EVENT\",\"chartType\":\"COLUMN\"}]}}}")
              .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"
        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-SankeyRequest"
      responses:
        "200":
          description: ID of the created analysis
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/analytics-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:-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":{"title":"string","description":"string","sourceEvent":{"action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]},"reverseOrder":true,"numberOfSteps":0,"numberOfPaths":0,"drillDown":[{"eventName":"page.visit","attribute":{"type":"PARAM","param":"string","id":0},"layer":0}],"drillDownCount":null,"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":"FUNNEL","matching":true,"funnel":{"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}},"exact":false,"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}],"title":"string"}}],"expression":{}},"eventFilters":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}],"excludeEvents":true,"firstOccurrenceOnly":true}}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"analysis\":{\"title\":\"string\",\"description\":\"string\",\"sourceEvent\":{\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]},\"reverseOrder\":true,\"numberOfSteps\":0,\"numberOfPaths\":0,\"drillDown\":[{\"eventName\":\"page.visit\",\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"layer\":0}],\"drillDownCount\":null,\"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\":\"FUNNEL\",\"matching\":true,\"funnel\":{\"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}},\"exact\":false,\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}],\"title\":\"string\"}}],\"expression\":{}},\"eventFilters\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}],\"excludeEvents\":true,\"firstOccurrenceOnly\":true}}"

            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": {
                "title": "string",
                "description": "string",
                "sourceEvent": {
                  "action": {
                    "id": 0,
                    "name": "page.visit"
                  },
                  "expressions": [
                    {
                      "attribute": {
                        "type": "PARAM",
                        "param": "string",
                        "id": 0
                      },
                      "constraint": {
                        "type": "BOOL",
                        "logic": "IS_TRUE"
                      }
                    }
                  ]
                },
                "reverseOrder": true,
                "numberOfSteps": 0,
                "numberOfPaths": 0,
                "drillDown": [
                  {
                    "eventName": "page.visit",
                    "attribute": {
                      "type": "PARAM",
                      "param": "string",
                      "id": 0
                    },
                    "layer": 0
                  }
                ],
                "drillDownCount": null,
                "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": "FUNNEL",
                      "matching": true,
                      "funnel": {
                        "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
                          }
                        },
                        "exact": false,
                        "steps": [
                          {
                            "title": "string",
                            "action": {
                              "id": 0,
                              "name": "page.visit"
                            },
                            "expressions": [
                              {
                                "attribute": {
                                  "type": "PARAM",
                                  "param": "string",
                                  "id": 0
                                },
                                "constraint": {
                                  "type": "BOOL",
                                  "logic": "IS_TRUE"
                                }
                              }
                            ]
                          }
                        ],
                        "title": "string"
                      }
                    }
                  ],
                  "expression": {}
                },
                "eventFilters": [
                  {
                    "title": "string",
                    "action": {
                      "id": 0,
                      "name": "page.visit"
                    },
                    "expressions": [
                      {
                        "attribute": {
                          "type": "PARAM",
                          "param": "string",
                          "id": 0
                        },
                        "constraint": {
                          "type": "BOOL",
                          "logic": "IS_TRUE"
                        }
                      }
                    ]
                  }
                ],
                "excludeEvents": true,
                "firstOccurrenceOnly": 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/%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: {
                title: 'string',
                description: 'string',
                sourceEvent: {
                  action: {id: 0, name: 'page.visit'},
                  expressions: [
                    {
                      attribute: {type: 'PARAM', param: 'string', id: 0},
                      constraint: {type: 'BOOL', logic: 'IS_TRUE'}
                    }
                  ]
                },
                reverseOrder: true,
                numberOfSteps: 0,
                numberOfPaths: 0,
                drillDown: [
                  {
                    eventName: 'page.visit',
                    attribute: {type: 'PARAM', param: 'string', id: 0},
                    layer: 0
                  }
                ],
                drillDownCount: null,
                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: 'FUNNEL',
                      matching: true,
                      funnel: {
                        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
                          }
                        },
                        exact: false,
                        steps: [
                          {
                            title: 'string',
                            action: {id: 0, name: 'page.visit'},
                            expressions: [
                              {
                                attribute: {type: 'PARAM', param: 'string', id: 0},
                                constraint: {type: 'BOOL', logic: 'IS_TRUE'}
                              }
                            ]
                          }
                        ],
                        title: 'string'
                      }
                    }
                  ],
                  expression: {}
                },
                eventFilters: [
                  {
                    title: 'string',
                    action: {id: 0, name: 'page.visit'},
                    expressions: [
                      {
                        attribute: {type: 'PARAM', param: 'string', id: 0},
                        constraint: {type: 'BOOL', logic: 'IS_TRUE'}
                      }
                    ]
                  }
                ],
                excludeEvents: true,
                firstOccurrenceOnly: true
              }
            }));
            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":{"title":"string","description":"string","sourceEvent":{"action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]},"reverseOrder":true,"numberOfSteps":0,"numberOfPaths":0,"drillDown":[{"eventName":"page.visit","attribute":{"type":"PARAM","param":"string","id":0},"layer":0}],"drillDownCount":null,"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":"FUNNEL","matching":true,"funnel":{"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}},"exact":false,"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}],"title":"string"}}],"expression":{}},"eventFilters":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}],"excludeEvents":true,"firstOccurrenceOnly":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/%7Bnamespace%7D/sankeys")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"analysis\":{\"title\":\"string\",\"description\":\"string\",\"sourceEvent\":{\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]},\"reverseOrder\":true,\"numberOfSteps\":0,\"numberOfPaths\":0,\"drillDown\":[{\"eventName\":\"page.visit\",\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"layer\":0}],\"drillDownCount\":null,\"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\":\"FUNNEL\",\"matching\":true,\"funnel\":{\"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}},\"exact\":false,\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}],\"title\":\"string\"}}],\"expression\":{}},\"eventFilters\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}],\"excludeEvents\":true,\"firstOccurrenceOnly\":true}}")
              .asString();
  /analytics/{namespace}/sankeys/{sankeyId}:
    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-sankeyIdAsPathParam"
      responses:
        "200":
          description: Sankey analysis details
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/analytics-Sankey"
        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/%7BsankeyId%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/%7BsankeyId%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/%7BsankeyId%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/%7BsankeyId%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/%7BsankeyId%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/%7BsankeyId%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-sankeyIdAsPathParam"
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/analytics-SankeyRequest"
      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/%7BsankeyId%7D \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"analysis":{"title":"string","description":"string","sourceEvent":{"action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]},"reverseOrder":true,"numberOfSteps":0,"numberOfPaths":0,"drillDown":[{"eventName":"page.visit","attribute":{"type":"PARAM","param":"string","id":0},"layer":0}],"drillDownCount":null,"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":"FUNNEL","matching":true,"funnel":{"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}},"exact":false,"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}],"title":"string"}}],"expression":{}},"eventFilters":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}],"excludeEvents":true,"firstOccurrenceOnly":true}}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

            payload = "{\"analysis\":{\"title\":\"string\",\"description\":\"string\",\"sourceEvent\":{\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]},\"reverseOrder\":true,\"numberOfSteps\":0,\"numberOfPaths\":0,\"drillDown\":[{\"eventName\":\"page.visit\",\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"layer\":0}],\"drillDownCount\":null,\"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\":\"FUNNEL\",\"matching\":true,\"funnel\":{\"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}},\"exact\":false,\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}],\"title\":\"string\"}}],\"expression\":{}},\"eventFilters\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}],\"excludeEvents\":true,\"firstOccurrenceOnly\":true}}"

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

            conn.request("PUT", "/analytics/%7Bnamespace%7D/sankeys/%7BsankeyId%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",
                "sourceEvent": {
                  "action": {
                    "id": 0,
                    "name": "page.visit"
                  },
                  "expressions": [
                    {
                      "attribute": {
                        "type": "PARAM",
                        "param": "string",
                        "id": 0
                      },
                      "constraint": {
                        "type": "BOOL",
                        "logic": "IS_TRUE"
                      }
                    }
                  ]
                },
                "reverseOrder": true,
                "numberOfSteps": 0,
                "numberOfPaths": 0,
                "drillDown": [
                  {
                    "eventName": "page.visit",
                    "attribute": {
                      "type": "PARAM",
                      "param": "string",
                      "id": 0
                    },
                    "layer": 0
                  }
                ],
                "drillDownCount": null,
                "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": "FUNNEL",
                      "matching": true,
                      "funnel": {
                        "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
                          }
                        },
                        "exact": false,
                        "steps": [
                          {
                            "title": "string",
                            "action": {
                              "id": 0,
                              "name": "page.visit"
                            },
                            "expressions": [
                              {
                                "attribute": {
                                  "type": "PARAM",
                                  "param": "string",
                                  "id": 0
                                },
                                "constraint": {
                                  "type": "BOOL",
                                  "logic": "IS_TRUE"
                                }
                              }
                            ]
                          }
                        ],
                        "title": "string"
                      }
                    }
                  ],
                  "expression": {}
                },
                "eventFilters": [
                  {
                    "title": "string",
                    "action": {
                      "id": 0,
                      "name": "page.visit"
                    },
                    "expressions": [
                      {
                        "attribute": {
                          "type": "PARAM",
                          "param": "string",
                          "id": 0
                        },
                        "constraint": {
                          "type": "BOOL",
                          "logic": "IS_TRUE"
                        }
                      }
                    ]
                  }
                ],
                "excludeEvents": true,
                "firstOccurrenceOnly": true
              }
            });

            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/%7BsankeyId%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/%7BsankeyId%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',
                sourceEvent: {
                  action: {id: 0, name: 'page.visit'},
                  expressions: [
                    {
                      attribute: {type: 'PARAM', param: 'string', id: 0},
                      constraint: {type: 'BOOL', logic: 'IS_TRUE'}
                    }
                  ]
                },
                reverseOrder: true,
                numberOfSteps: 0,
                numberOfPaths: 0,
                drillDown: [
                  {
                    eventName: 'page.visit',
                    attribute: {type: 'PARAM', param: 'string', id: 0},
                    layer: 0
                  }
                ],
                drillDownCount: null,
                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: 'FUNNEL',
                      matching: true,
                      funnel: {
                        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
                          }
                        },
                        exact: false,
                        steps: [
                          {
                            title: 'string',
                            action: {id: 0, name: 'page.visit'},
                            expressions: [
                              {
                                attribute: {type: 'PARAM', param: 'string', id: 0},
                                constraint: {type: 'BOOL', logic: 'IS_TRUE'}
                              }
                            ]
                          }
                        ],
                        title: 'string'
                      }
                    }
                  ],
                  expression: {}
                },
                eventFilters: [
                  {
                    title: 'string',
                    action: {id: 0, name: 'page.visit'},
                    expressions: [
                      {
                        attribute: {type: 'PARAM', param: 'string', id: 0},
                        constraint: {type: 'BOOL', logic: 'IS_TRUE'}
                      }
                    ]
                  }
                ],
                excludeEvents: true,
                firstOccurrenceOnly: true
              }
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

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

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

            $request->setBody('{"analysis":{"title":"string","description":"string","sourceEvent":{"action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]},"reverseOrder":true,"numberOfSteps":0,"numberOfPaths":0,"drillDown":[{"eventName":"page.visit","attribute":{"type":"PARAM","param":"string","id":0},"layer":0}],"drillDownCount":null,"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":"FUNNEL","matching":true,"funnel":{"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}},"exact":false,"steps":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}],"title":"string"}}],"expression":{}},"eventFilters":[{"title":"string","action":{"id":0,"name":"page.visit"},"expressions":[{"attribute":{"type":"PARAM","param":"string","id":0},"constraint":{"type":"BOOL","logic":"IS_TRUE"}}]}],"excludeEvents":true,"firstOccurrenceOnly":true}}');

            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/%7BsankeyId%7D")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"analysis\":{\"title\":\"string\",\"description\":\"string\",\"sourceEvent\":{\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]},\"reverseOrder\":true,\"numberOfSteps\":0,\"numberOfPaths\":0,\"drillDown\":[{\"eventName\":\"page.visit\",\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"layer\":0}],\"drillDownCount\":null,\"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\":\"FUNNEL\",\"matching\":true,\"funnel\":{\"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}},\"exact\":false,\"steps\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}],\"title\":\"string\"}}],\"expression\":{}},\"eventFilters\":[{\"title\":\"string\",\"action\":{\"id\":0,\"name\":\"page.visit\"},\"expressions\":[{\"attribute\":{\"type\":\"PARAM\",\"param\":\"string\",\"id\":0},\"constraint\":{\"type\":\"BOOL\",\"logic\":\"IS_TRUE\"}}]}],\"excludeEvents\":true,\"firstOccurrenceOnly\":true}}")
              .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-sankeyIdAsPathParam"
      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/%7BsankeyId%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/%7BsankeyId%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/%7BsankeyId%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/%7BsankeyId%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/%7BsankeyId%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/%7BsankeyId%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
    analytics-link:
      type: object
      properties:
        url:
          type: string
          description: URL of the page, used for navigation
        rel:
          type: string
          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:
              type: array
              items:
                $ref: "#/components/schemas/analytics-Action"
            eventName:
              $ref: "#/components/schemas/analytics-ActionName"
            eventNames:
              type: array
              items:
                $ref: "#/components/schemas/analytics-ActionName"
            actionId:
              $ref: "#/components/schemas/analytics-ActionId"
            actionIds:
              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:
        type: object
        properties:
          name:
            type: string
            description: The name of the dynamic key
            example: event.params.PARAMNAME
          value:
            type: string
            description: The default value to use if the parameter referenced by `name` doesn't exist.
    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
        iconUrl:
          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 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
      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"
    analytics-MetricAnalysis:
      type: object
      description: Structure of the analytical query
      properties:
        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-MetricExpression"
        isVisibleForClientProfile:
          $ref: "#/components/schemas/analytics-isVisibleForClientProfile"
      required:
        - comparison
        - description
        - expression
        - format
        - isVisibleForClientProfile
        - metricType
        - title
    analytics-isVisibleForClientProfile:
      type: boolean
      description: When set to `true`, information about this analysis is shown on a profile's card.
    analytics-MetricExpression:
      description: |
        A simple metric can only contain a single argument (only VALUE-type). A formula-type metric allows you to build more complex queries. In a formula metric, the schemas are recursive - functions can contain functions.

        **WARNING**: For metrics compatible with Synerise Portal, you should encapsulate the contents of this object in a `BRACKET` function:

        ```
        "expression" {
            "type": "FUNCTION",
            "function": "BRACKET",
            "arg": {
                // the actual content of the metric, for example:
                  "type": "VALUE",
                  "value": {
                      "type": "NUMBER",
                      "value": 15
                    }
              }
        }
        ```
      oneOf:
        - type: object
          title: Value
          properties:
            type:
              type: string
              enum:
                - VALUE
              description: "This type lets you refer to: profile attributes, event parameters, static numerical values. It's the only type that can be used when the metric type is SIMPLE."
            value:
              $ref: "#/components/schemas/analytics-MetricExpressionValue"
        - type: object
          title: Single-argument function
          properties:
            type:
              type: string
              enum:
                - FUNCTION
            function:
              type: string
              description: |
                The type of function.

                * ABS - absolute value

                * CEIL - ceiling function

                * FLOOR - floor function

                * EXP - exponential function

                * LN - natural logarithm

                * ROUND - rounds down if `fraction < x.5` and up if `fraction >= x.5`
              enum:
                - ABS
                - CEIL
                - EXP
                - FLOOR
                - LN
                - ROUND
            arg:
              $ref: "#/components/schemas/analytics-MetricExpression"
        - type: object
          title: Two-argument function
          properties:
            type:
              type: string
              enum:
                - FUNCTION
            function:
              type: string
              description: |
                
                The type of mathematical or logical operation.

                * MULTIPLY, DIVIDE, SUM, SUB - mathematical operations, (SUB - subtraction)

                * IF_NULL - returns the value of arg2 if the value of arg1 is null

                * MAX - returns the higher argument value

                * MIN - returns the lower argument value

                * MOD - modulo operation

                * EQUALS - returns `1` if the argument values are equal, `0` otherwise

                * NOT_EQUALS - returns `0` if the argument values are equal, `1` otherwise

                * GREATER - returns `1` if the value of arg1 is higher than the value of arg2, `0` otherwise

                * GREATER_OR_EQUALS - returns `1` if the value of arg1 is higher than or equal to the value of arg2, `0` otherwise

                * LESS - returns `1` if the value of arg1 is lower than the value of arg2, `0` otherwise

                * LESS_OR_EQUALS - returns `1` if the value of arg1 is lower than or equal to the value of arg2, `0` otherwise
              enum:
                - SUM
                - SUB
                - MULTIPLY
                - DIVIDE
                - IF_NULL
                - MAX
                - MIN
                - MOD
                - EQUALS
                - GREATER
                - GREATER_OR_EQUALS
                - LESS
                - LESS_OR_EQUALS
                - NOT_EQUALS
                - ADD_YEARS
            arg1:
              $ref: "#/components/schemas/analytics-MetricExpression"
            arg2:
              $ref: "#/components/schemas/analytics-MetricExpression"
        - type: object
          title: IF function
          properties:
            type:
              type: string
              enum:
                - FUNCTION
            function:
              type: string
              description: |
                
                The IF function takes three arguments:

                * arg1 is the condition (VALUE-type arguments are considered true)

                * arg2 is the value returned if the condition is true

                * arg3 is the value returned if the condition is false
              enum:
                - IF
            arg1:
              $ref: "#/components/schemas/analytics-MetricExpression"
            arg2:
              $ref: "#/components/schemas/analytics-MetricExpression"
            arg3:
              $ref: "#/components/schemas/analytics-MetricExpression"
        - type: object
          title: Bracket
          properties:
            type:
              type: string
              enum:
                - FUNCTION
            function:
              type: string
              description: |
                Brackets can be used to group expressions and set the order in which they are processed (starting with the deepest, like in mathematics). 

                For metrics compatible with the Synerise Web Portal, the top-level function (first descendant of the `expression` object) should be a bracket, for example:
                ```
                "expression" {
                    "type": "FUNCTION",
                    "function": "BRACKET",
                    "arg": {
                        // the actual content of the metric, for example:
                          "type": "VALUE",
                          "value": {
                              "type": "NUMBER",
                              "value": 15
                            }
                      }
                }
                ```
              enum:
                - BRACKET
            arg:
              description: The values in the bracket.
              oneOf:
                - type: object
                  title: Two values
                  properties:
                    arg1:
                      $ref: "#/components/schemas/analytics-MetricExpression"
                    arg2:
                      $ref: "#/components/schemas/analytics-MetricExpression"
                - type: object
                  title: One value
                  properties:
                    arg:
                      $ref: "#/components/schemas/analytics-MetricExpression"
    analytics-MetricExpressionValue:
      description: The value to retrieve with this argument.
      oneOf:
        - $ref: "#/components/schemas/analytics-MetricArgValueTypeEvent"
        - $ref: "#/components/schemas/analytics-MetricArgValueTypeClient"
        - $ref: "#/components/schemas/analytics-MetricArgValueNumber"
    analytics-MetricArgValueNumber:
      type: object
      title: Number
      properties:
        type:
          type: string
          enum:
            - NUMBER
        value:
          type: number
          description: A numerical value
      required:
        - type
        - value
    analytics-MetricArgValueTypeClient:
      type: object
      title: Profile
      properties:
        type:
          type: string
          enum:
            - CLIENT
        title:
          $ref: "#/components/schemas/analytics-name"
        aggregation:
          $ref: "#/components/schemas/analytics-MetricClientAggregation"
        filter:
          $ref: "#/components/schemas/analytics-ProfileFilter"
      required:
        - type
        - title
        - aggregation
        - filter
    analytics-ProfileFilter:
      type: object
      description: This filter lets you limit the results to profiles that match it. For no filter, leave the object empty.
      properties:
        matching:
          $ref: "#/components/schemas/analytics-matching"
        expressions:
          $ref: "#/components/schemas/analytics-filterExpressions"
        expression:
          type: object
          description: Legacy parameter.
          deprecated: true
      required:
        - expressions
        - matching
    analytics-filterExpressions:
      type: array
      items:
        oneOf:
          - $ref: "#/components/schemas/analytics-filterExpressionFunnel"
          - $ref: "#/components/schemas/analytics-filterExpressionAttribute"
          - type: object
            title: AND/OR operator
            properties:
              type:
                type: string
                enum:
                  - OPERATOR
                description: |
                  The logical operator must be placed in the array between expressions.

                  **Example**:

                  ```
                  "expressions" [
                  {
                      "type": "ATTRIBUTE",
                      "matching": true,
                      "attribute": {
                          "expressions": [
                              {
                                  ...
                              }
                          ]
                      }
                  },
                  {
                      "type": "OPERATOR",
                      "logic": "AND"
                  },
                  {
                      "type": "ATTRIBUTE",
                      "matching": true,
                      "attribute": {
                          "expressions": [
                              {
                                  ...
                              }
                          ]
                      }
                  }]
                  ```
              logic:
                type: string
                enum:
                  - AND
                  - OR
            required:
              - type
              - logic
      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.
    analytics-filterExpressionAttribute:
      type: object
      title: Profile attribute
      properties:
        type:
          type: string
          enum:
            - ATTRIBUTE
        matching:
          $ref: "#/components/schemas/analytics-matching"
        attribute:
          type: object
          description: An attribute to test against a constraint
          properties:
            matching:
              $ref: "#/components/schemas/analytics-matching"
            expressions:
              type: array
              description: |
                An array of conditions. All conditions must be met.  

                <span style="color:red"><strong>WARNING</strong>: The Synerise Portal doesn't currently support multiple objects in this array.</span> 

                To create multiple conditions compatible with the Synerise Portal, add more objects to the `expressions` array that is the parent of this object, and use the AND/OR operator between them.
              items:
                type: object
                properties:
                  constraint:
                    $ref: "#/components/schemas/analytics-EventConstraint"
                  attribute:
                    $ref: "#/components/schemas/analytics-ProfileAttribute"
    analytics-ProfileAttribute:
      description: The profile attribute to access
      oneOf:
        - type: object
          title: Segmentation/expression/aggregate
          properties:
            type:
              type: string
              enum:
                - SEGMENTATION
                - EXPRESSION
                - AGGREGATE
            id:
              type: string
              format: uuid
              description: UUID of the referenced analysis
          required:
            - type
            - id
        - type: object
          title: Special
          properties:
            type:
              type: string
              enum:
                - SPECIAL
            special:
              type: string
              enum:
                - CLIENT_ID
              description: The name of the special parameter
          required:
            - type
            - special
        - type: object
          title: Parameter
          properties:
            type:
              type: string
              enum:
                - PARAM
            param:
              type: string
              description: The name of the profile parameter
          required:
            - type
            - param
        - type: object
          title: Tag
          properties:
            type:
              type: string
              enum:
                - TAG
            tag:
              type: string
              description: The name of the tag
          required:
            - type
            - tag
    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**.
      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-DateFilterEventConstraint"
    analytics-DateFilterEventConstraint:
      type: object
      title: Date filter
      properties:
        type:
          type: string
          enum:
            - DATE_FILTER
        logic:
          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.
      oneOf:
        - $ref: "#/components/schemas/analytics-absoluteDateFilter"
        - $ref: "#/components/schemas/analytics-relativeDateFilter"
    analytics-relativeDateFilter:
      type: object
      title: Relative
      properties:
        type:
          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"
    analytics-customMonthlyDateFilter:
      type: object
      title: Monthly
      properties:
        type:
          type: string
          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:
          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"
    analytics-monthDateRule:
      type: object
      title: Days of the month
      properties:
        type:
          type: string
          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
      properties:
        type:
          type: string
          enum:
            - WEEK
        weeks:
          type: array
          description: Weeks 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
      properties:
        type:
          type: string
          enum:
            - WEEKLY
          description: Weekly filters let you define separate rules for each day of the week.
        nestingType:
          type: string
          enum:
            - IN_PLACE
        days:
          type: array
          description: An array of rules for different days of the week.
          items:
            $ref: "#/components/schemas/analytics-dayOf"
      required:
        - days
        - nestingType
        - type
    analytics-customDailyDateFilter:
      type: object
      title: Daily
      properties:
        type:
          type: string
          enum:
            - DAILY
          description: Daily filters limit the data scope to a range of hours every day.
        nestingType:
          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
      description: The unit of time
      enum:
        - YEARS
        - MONTHS
        - WEEKS
        - DAYS
        - HOURS
        - MINUTES
        - SECONDS
        - UNKNOWN
    analytics-absoluteDateFilter:
      type: object
      title: Absolute
      properties:
        type:
          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:
      type: object
      title: Date range
      properties:
        type:
          type: string
          enum:
            - DATE_TWO
        logic:
          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.
      oneOf:
        - $ref: "#/components/schemas/analytics-ConstantValue"
        - $ref: "#/components/schemas/analytics-VariableValue"
        - $ref: "#/components/schemas/analytics-ClientParameter"
        - $ref: "#/components/schemas/analytics-EventParameter"
    analytics-EventParameter:
      type: object
      title: Event parameter
      properties:
        type:
          type: string
          enum:
            - EVENT
        attribute:
          $ref: "#/components/schemas/analytics-EventAttribute"
      required:
        - type
        - attribute
    analytics-EventAttribute:
      description: Definition of an event attribute to access.
      oneOf:
        - $ref: "#/components/schemas/analytics-ParameterEventAttribute"
        - $ref: "#/components/schemas/analytics-RunningAggregateEventAttribute"
        - $ref: "#/components/schemas/analytics-ExpressionEventAttribute"
        - $ref: "#/components/schemas/analytics-SpecialEventAttribute"
    analytics-SpecialEventAttribute:
      type: object
      title: Special property
      properties:
        type:
          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:
          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:
          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:
          enum:
            - PARAM
          description: This `type` refers to parameters in an event.
        param:
          type: string
          description: Name of the parameter
        id:
          type: integer
          description: Only present in responses. ID of this attribute in the database.
      required:
        - type
        - param
    analytics-ClientParameter:
      type: object
      title: Profile attribute
      properties:
        type:
          type: string
          enum:
            - CLIENT
        attribute:
          $ref: "#/components/schemas/analytics-ProfileAttribute"
      required:
        - type
        - attribute
    analytics-VariableValue:
      type: object
      title: Dynamic value
      properties:
        type:
          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-ConstantValue:
      type: object
      title: Static value
      properties:
        type:
          type: string
          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
              maxLength: 21000
            - type: number
            - type: boolean
            - type: array
              maxItems: 65000
              items:
                type: string
                maxLength: 21000
      required:
        - type
        - constant
    analytics-DateOneConstraintEventConstraint:
      type: object
      title: Date
      properties:
        type:
          type: string
          enum:
            - DATE_ONE
        logic:
          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:
          type: string
          enum:
            - DATE_ZERO
          description: Compare a date from `attribute` to the current date
        logic:
          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:
          type: string
          enum:
            - "NULL"
        logic:
          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:
          type: string
          enum:
            - ARRAY_STRING_ONE_DEPRECATED
          description: "`value` should be an array"
        logic:
          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:
          type: string
          enum:
            - STRING_ARRAY
          description: "`value` needs to return an array of strings"
        logic:
          type: string
          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:
          type: string
          enum:
            - NUMBER_TWO
          description: Checks if the `attribute` is between two numbers, defined in `value1` and `value2`.
        logic:
          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:
          type: string
          enum:
            - NUMBER_ONE
          description: This type is used to test values that are a single number
        logic:
          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:
          type: string
          enum:
            - STRING_ONE
          description: This type is used to test values that are a single string.
        logic:
          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
      properties:
        type:
          type: string
          enum:
            - STRING_ZERO
        logic:
          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:
          type: string
          enum:
            - BOOL
        logic:
          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-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.
    analytics-filterExpressionFunnel:
      type: object
      title: Funnel
      properties:
        type:
          type: string
          enum:
            - FUNNEL
        matching:
          $ref: "#/components/schemas/analytics-matching"
        funnel:
          $ref: "#/components/schemas/analytics-funnelStructure"
    analytics-funnelStructure:
      type: object
      properties:
        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:
              $ref: "#/components/schemas/analytics-timeValue"
        dateFilter:
          $ref: "#/components/schemas/analytics-dateFilter"
        exact:
          type: boolean
          default: false
          description: |
            <span style="color:red"><strong>WARNING</strong>: The Synerise Portal doesn't currently support this parameter.</span> Analyses created from the Portal assume the default value, false.

            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.
        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"
        title:
          type: string
          description: Title of the funnel.
      description: Funnel conditions
      required:
        - title
        - steps
    analytics-FunnelStep:
      required:
        - action
        - title
        - expressions
      type: object
      properties:
        title:
          type: string
          description: The name of the step
        action:
          $ref: "#/components/schemas/analytics-Action"
        expressions:
          type: array
          description: Conditions of the event. All of the conditions must be met in order for the step to be completed. For no additional conditions, leave this array empty.
          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:
        attribute:
          $ref: "#/components/schemas/analytics-EventAttribute"
        constraint:
          $ref: "#/components/schemas/analytics-EventConstraint"
    analytics-MetricClientAggregation:
      type: object
      description: Defines the mathematical or logical formula of the metric
      properties:
        type:
          $ref: "#/components/schemas/analytics-MetricAggregationType"
        level:
          $ref: "#/components/schemas/analytics-QuantileLevel"
        attribute:
          $ref: "#/components/schemas/analytics-ProfileAttribute"
      required:
        - type
    analytics-QuantileLevel:
      type: number
      minimum: 0.01
      maximum: 1
      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-MetricAggregationType:
      type: string
      enum:
        - COUNT
        - COUNT_DISTINCT
        - SUM
        - MIN
        - MAX
        - AVG
        - EXISTS
        - MEDIAN
        - QUANTILE
      description: |
        
        The type of calculation.

        - COUNT allows you to count the total number of the entities that meet the filters. Doesn't use `attribute`.
        - COUNT_DISTINCT allows you to count the total number of distinct (unique) attribute values in entities which match the filters.
        - SUM, MIN, MAX, AVG, MEDIAN and QUANTILE (requires `level`) 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". Doesn't use `attribute`.
    analytics-MetricArgValueTypeEvent:
      type: object
      title: Event
      properties:
        type:
          type: string
          enum:
            - EVENT
        title:
          $ref: "#/components/schemas/analytics-name"
        occurrenceType:
          type: string
          enum:
            - FIRST
            - LAST
            - ALL
          description: Defines which instance of the event per profile is taken into consideration.
        aggregation:
          $ref: "#/components/schemas/analytics-MetricEventAggregation"
        action:
          $ref: "#/components/schemas/analytics-Action"
        dateFilter:
          $ref: "#/components/schemas/analytics-dateFilter"
        filter:
          $ref: "#/components/schemas/analytics-ProfileFilter"
        expressions:
          $ref: "#/components/schemas/analytics-AggregateExpressions"
      required:
        - type
        - title
        - aggregation
        - filter
        - occurrenceType
        - dateFilter
        - action
    analytics-AggregateExpressions:
      type: array
      minLength: 0
      description: An array of conditions that the analyzed event must meet
      items:
        $ref: "#/components/schemas/analytics-EventExpression"
    analytics-MetricEventAggregation:
      type: object
      description: Defines the mathematical or logical formula of the metric
      properties:
        type:
          $ref: "#/components/schemas/analytics-MetricAggregationType"
        level:
          $ref: "#/components/schemas/analytics-QuantileLevel"
        attribute:
          $ref: "#/components/schemas/analytics-EventAttribute"
      required:
        - type
    analytics-MetricType:
      type: string
      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
          nullable: true
          enum:
            - EUR
            - USD
            - PLN
            - JPY
          description: The currency to use when `dataFormat` is `cash`
        dataFormat:
          type: string
          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-Metric:
      allOf:
        - type: object
          properties:
            analysis:
              $ref: "#/components/schemas/analytics-MetricAnalysis"
            isReportMetric:
              type: boolean
            isMetricHistogram:
              $ref: "#/components/schemas/analytics-isMetricHistogram"
        - $ref: "#/components/schemas/analytics-AnalysisGetCommon"
      required:
        - analysis
        - isReportMetric
        - isMetricHistogram
    analytics-AnalysisGetCommon:
      type: object
      description: Common elements retrieved in details of all analyses
      properties:
        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:
        - author
        - businessProfileId
        - createdAt
        - description
        - directoryId
        - id
        - isDeleted
        - isDynamicAnalytic
        - isPredefinedAnalytic
        - modifier
        - name
        - namespace
        - updatedAt
        - usedAt
    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-businessProfileId:
      type: integer
      format: int32
      description: ID of the workspace (formerly business profile)
      example: 48
    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:
          type: string
          format: uuid
        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:
        dateFilter:
          $ref: "#/components/schemas/analytics-dateFilter"
        aggregateDataBy:
          allOf:
            - type: object
              description: Data aggregation (if applicable for this analysis type)
            - $ref: "#/components/schemas/analytics-period"
        filter:
          $ref: "#/components/schemas/analytics-ProfileFilter"
        variables:
          type: array
          description: A list of variable values to use in this calculation
          items:
            $ref: "#/components/schemas/analytics-Variable"
      required:
        - variables
    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:
          oneOf:
            - $ref: "#/components/schemas/analytics-stringType"
            - $ref: "#/components/schemas/analytics-numberType"
            - $ref: "#/components/schemas/analytics-booleanType"
            - $ref: "#/components/schemas/analytics-stringArray"
            - $ref: "#/components/schemas/analytics-numberArray"
            - $ref: "#/components/schemas/analytics-dateFilter"
      required:
        - name
        - value
    analytics-numberArray:
      type: array
      items:
        type: integer
    analytics-stringArray:
      type: array
      items:
        type: string
    analytics-booleanType:
      type: boolean
    analytics-numberType:
      type: integer
    analytics-stringType:
      type: string
    analytics-ReportRequest:
      type: object
      properties:
        analysis:
          $ref: "#/components/schemas/analytics-ReportAnalysis"
        allowNull:
          $ref: "#/components/schemas/analytics-AllowNull"
    analytics-AllowNull:
      type: boolean
      default: true
      description: When `true`, null values can be included in the results.
    analytics-ReportAnalysis:
      type: object
      description: Structure of the report analysis
      properties:
        title:
          $ref: "#/components/schemas/analytics-name"
        description:
          $ref: "#/components/schemas/analytics-description"
        filter:
          $ref: "#/components/schemas/analytics-ProfileFilter"
        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"
      required:
        - description
        - filter
        - reportMetrics
        - title
    analytics-ReportMetricDefinition:
      type: object
      properties:
        metricId:
          $ref: "#/components/schemas/analytics-uuid"
        dateFilter:
          allOf:
            - type: object
              description: This date filter overrides the date filter in the metric.
            - $ref: "#/components/schemas/analytics-dateFilter"
        action:
          allOf:
            - type: object
              description: |
                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.
            - $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:
          type: object
          description: |
            The type and number of results to show. "TOP" shows the highest results. "LAST" shows the most recent results.
          oneOf:
            - type: object
              title: Top
              required:
                - type
                - top
              properties:
                type:
                  type: string
                  enum:
                    - TOP
                top:
                  type: integer
                  description: The number of results to show in the report
            - type: object
              title: Last
              required:
                - type
                - last
              properties:
                type:
                  type: string
                  enum:
                    - LAST
                last:
                  type: integer
                  description: The number of results to show in the report
        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.

            **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:
            type: object
            required:
              - type
              - attribute
            properties:
              title:
                type: string
                description: The name of the dimension
              format:
                $ref: "#/components/schemas/analytics-MetricFormat"
              type:
                type: string
                description: Defines the source type of the data shown in the report.
                enum:
                  - CLIENT
                  - EVENT
              attribute:
                description: Defines the data shown in the report.
                oneOf:
                  - $ref: "#/components/schemas/analytics-ProfileAttribute"
                  - $ref: "#/components/schemas/analytics-EventAttribute"
      required:
        - action
        - dateFilter
        - format
        - grouping
        - groups
        - metricId
    analytics-uuid:
      type: string
      format: uuid
      description: Unique ID of the resource
    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-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"
      required:
        - analysis
    analytics-DynamicVariablesRequest:
      type: object
      properties:
        variables:
          $ref: "#/components/schemas/analytics-variables"
      required:
        - variables
    analytics-calculatedAnalytic:
      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-analyticId:
      type: string
      format: uuid
      description: UUID of the analysis
      example: 5370bf3c-2dfa-4e89-98ff-07100cffee6c
    analytics-identifierValue:
      type: string
      description: Value of the selected identifier. Note that IDs must also be sent as strings.
    analytics-ExpressionListItem:
      allOf:
        - type: object
          properties:
            action:
              $ref: "#/components/schemas/analytics-Action"
              nullable: true
            type:
              $ref: "#/components/schemas/analytics-ExpressionType"
          required:
            - action
            - type
        - $ref: "#/components/schemas/analytics-ListAnalyticsItemCommon"
    analytics-ExpressionType:
      type: string
      enum:
        - EVENT
        - CLIENT
    analytics-expressionCreateRequestBody:
      type: object
      properties:
        isVisibleForClientProfile:
          $ref: "#/components/schemas/analytics-isVisibleForClientProfile"
        analysis:
          description: Details of an expression analysis
          oneOf:
            - $ref: "#/components/schemas/analytics-EventExpressionEntity"
            - $ref: "#/components/schemas/analytics-ClientExpressionEntity"
      required:
        - isVisibleForClientProfile
        - analysis
    analytics-ClientExpressionEntity:
      type: object
      title: Profile expression
      description: Details of a profile expression. In the Synerise Portal, they are called _attribute_ expressions.
      properties:
        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:
        - expression
        - name
        - type
        - description
    analytics-ClientExpressionContentEntity:
      description: Structure of the expression. This is a recursive schema - functions can contain more functions.
      oneOf:
        - type: object
          title: Value
          properties:
            type:
              type: string
              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
        - type: object
          title: Single-argument function
          example:
            type: FUNCTION
            function: LN
            arg:
              type: VALUE
              title: title
              value:
                type: CONSTANT
                constant: 10
          properties:
            type:
              type: string
              enum:
                - FUNCTION
            function:
              $ref: "#/components/schemas/analytics-UnaryFunctionType"
            arg:
              $ref: "#/components/schemas/analytics-ClientExpressionContentEntity"
        - type: object
          title: Two-argument function
          properties:
            type:
              type: string
              enum:
                - FUNCTION
            function:
              $ref: "#/components/schemas/analytics-BinaryFunctionType"
            arg1:
              $ref: "#/components/schemas/analytics-ClientExpressionContentEntity"
            arg2:
              $ref: "#/components/schemas/analytics-ClientExpressionContentEntity"
        - type: object
          title: IF function
          properties:
            type:
              type: string
              enum:
                - FUNCTION
            function:
              $ref: "#/components/schemas/analytics-TernaryFunctionType"
            arg1:
              $ref: "#/components/schemas/analytics-ClientExpressionContentEntity"
            arg2:
              $ref: "#/components/schemas/analytics-ClientExpressionContentEntity"
            arg3:
              $ref: "#/components/schemas/analytics-ClientExpressionContentEntity"
        - type: object
          title: Current time function
          example:
            type: FUNCTION
            function: NOW
          properties:
            type:
              type: string
              enum:
                - FUNCTION
            function:
              $ref: "#/components/schemas/analytics-NullaryFunctionType"
    analytics-NullaryFunctionType:
      type: string
      description: Returns the current time in ISO format, with the time zone of the workspace. For example `2025-02-06T14:09:56.321+01:00`
      enum:
        - NOW
    analytics-TernaryFunctionType:
      type: string
      description: |
        
        The IF function takes three arguments:

        * arg1 is the condition (VALUE-type arguments are considered true)

        * arg2 is the value returned if the condition is true

        * arg3 is the value returned if the condition is false
      enum:
        - IF
    analytics-BinaryFunctionType:
      type: string
      description: |
        
        The type of mathematical or logical operation.

        * MULTIPLY, DIVIDE, SUM, SUB - mathematical operations, (SUB - subtraction)

        * IF_NULL - returns the value of arg2 if the value of arg1 is null

        * MAX - returns the higher argument value

        * MIN - returns the lower argument value

        * MOD - modulo operation

        * EQUALS - returns `1` if the argument values are equal, `0` otherwise

        * NOT_EQUALS - returns `0` if the argument values are equal, `1` otherwise

        * GREATER - returns `1` if the value of arg1 is higher than the value of arg2, `0` otherwise

        * GREATER_OR_EQUALS - returns `1` if the value of arg1 is higher than or equal to the value of arg2, `0` otherwise

        * LESS - returns `1` if the value of arg1 is lower than the value of arg2, `0` otherwise

        * LESS_OR_EQUALS - returns `1` if the value of arg1 is lower than or equal to the value of arg2, `0` otherwise

        * CONCAT - concatenates the values and returns them as a string (even if both values are numerical)

        * REGEXP - arg1 is the string to transform (can be calculated from a function). arg2 is a regular expression that defines the transformation (which can also be calculated from a function, otherwise use the "constant" value type). For example, if arg1 is "123", and arg2 is "2.", the result is "23".
      enum:
        - DIVIDE
        - IF_NULL
        - MAX
        - MIN
        - MOD
        - MULTIPLY
        - SUB
        - SUM
        - GREATER
        - GREATER_OR_EQUALS
        - LESS
        - LESS_OR_EQUAL
        - NOT_EQUAL
        - EQUALS
        - ADD_YEARS
        - CONCAT
        - REGEXP
    analytics-UnaryFunctionType:
      type: string
      description: |
        The type of function.


        * ABS - absolute value

        * CEIL - ceiling function

        * FLOOR - floor function

        * EXP - exponential function

        * LN - natural logarithm

        * ROUND - rounds down if `fraction < x.5` and up if `fraction >= x.5`

        * TO_NUMBER and TO_STRING - return the argument value in a given format

        * TO_MONEY - returns a numerical value with an accuracy of two decimal places

        * DAY_OF_* - returns a numerical value. The argument must be a date (yyyy-mm-dd) or the "now" function

        * HOUR/WEEK/MONTH/YEAR - returns a part of date/time. The argument must be a date (ISO 8601) or the "now" function.

        * BRACKET - allows you to group elements, like in mathematics. The most deeply-nested brackets are processed first.
      enum:
        - 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
    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.
      oneOf:
        - type: object
          title: Value
          properties:
            type:
              type: string
              enum:
                - VALUE
            title:
              type: string
              description: Title of the value
            value:
              oneOf:
                - $ref: "#/components/schemas/analytics-EventParameter"
                - $ref: "#/components/schemas/analytics-ClientParameter"
                - $ref: "#/components/schemas/analytics-ConstantValue"
                - $ref: "#/components/schemas/analytics-VariableValue"
          required:
            - title
            - type
            - value
        - type: object
          title: Single-argument function
          example:
            type: FUNCTION
            function: LN
            arg:
              type: VALUE
              title: title
              value:
                type: CONSTANT
                constant: 10
          properties:
            type:
              type: string
              enum:
                - FUNCTION
            function:
              $ref: "#/components/schemas/analytics-UnaryFunctionType"
            arg:
              $ref: "#/components/schemas/analytics-EventExpressionContentEntity"
        - type: object
          title: Two-argument function
          properties:
            type:
              type: string
              enum:
                - FUNCTION
            function:
              $ref: "#/components/schemas/analytics-BinaryFunctionType"
            arg1:
              $ref: "#/components/schemas/analytics-EventExpressionContentEntity"
            arg2:
              $ref: "#/components/schemas/analytics-EventExpressionContentEntity"
        - type: object
          title: IF function
          properties:
            type:
              type: string
              enum:
                - FUNCTION
            function:
              $ref: "#/components/schemas/analytics-TernaryFunctionType"
            arg1:
              $ref: "#/components/schemas/analytics-EventExpressionContentEntity"
            arg2:
              $ref: "#/components/schemas/analytics-EventExpressionContentEntity"
            arg3:
              $ref: "#/components/schemas/analytics-EventExpressionContentEntity"
        - type: object
          title: Current time function
          example:
            type: FUNCTION
            function: NOW
          properties:
            type:
              type: string
              enum:
                - FUNCTION
            function:
              $ref: "#/components/schemas/analytics-NullaryFunctionType"
    analytics-Expression:
      allOf:
        - type: object
          properties:
            analysis:
              description: Details of the analysis
              oneOf:
                - $ref: "#/components/schemas/analytics-EventExpressionEntity"
                - $ref: "#/components/schemas/analytics-ClientExpressionEntity"
            analyticVersion:
              $ref: "#/components/schemas/analytics-analyticVersion"
            isVisibleForClientProfile:
              $ref: "#/components/schemas/analytics-isVisibleForClientProfile"
        - $ref: "#/components/schemas/analytics-AnalysisGetCommon"
      required:
        - analysis
        - analyticVersion
        - isVisibleForClientProfile
    analytics-analyticVersion:
      type: string
      format: uuid
      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"
      required:
        - expression
        - identifierValue
    analytics-HistogramRequest:
      type: object
      properties:
        analysis:
          $ref: "#/components/schemas/analytics-HistogramAnalysis"
      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-TrendAggregateDataBy"
        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-uuid"
        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-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-Histogram:
      allOf:
        - type: object
          properties:
            analysis:
              $ref: "#/components/schemas/analytics-HistogramAnalysis"
        - $ref: "#/components/schemas/analytics-AnalysisGetCommon"
      required:
        - analysis
    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"
      required:
        - analysis
    analytics-SegmentationAnalysis:
      type: object
      description: Definition of the segmentation.
      properties:
        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:
        - description
        - segments
        - title
    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
      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-ProfileFilter"
      required:
        - title
        - description
        - filter
    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-TrendAggregateDataBy"
        dateFilter:
          $ref: "#/components/schemas/analytics-dateFilter"
      required:
        - aggregateDataBy
        - dateFilter
    analytics-HistogramLegacyPreviewRequest:
      type: object
      properties:
        analysis:
          $ref: "#/components/schemas/analytics-HistogramAnalysis"
    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-SegmentationListItem:
      allOf:
        - type: object
          properties:
            segments:
              type: integer
            starred:
              type: boolean
              description: "`true` if the segmentation is added to starred items"
            isPredefinedAnalytic:
              $ref: "#/components/schemas/analytics-isPredefinedAnalytic"
            sharing:
              $ref: "#/components/schemas/analytics-SharingData"
        - $ref: "#/components/schemas/analytics-ListAnalyticsItemCommon"
    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:
          type: string
        id:
          type: integer
          format: int64
      required:
        - name
        - id
    analytics-SharingProcessSimple:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        shareType:
          type: string
          enum:
            - CROSSWORKSPACE
            - INTERNAL
        automationId:
          type: string
          format: uuid
        status:
          type: string
          enum:
            - ACTIVE
            - INACTIVE
            - DELETED
      required:
        - id
        - name
        - shareType
        - status
    analytics-SegmentationRequest:
      type: object
      properties:
        analysis:
          $ref: "#/components/schemas/analytics-SegmentationAnalysis"
        isVisibleForClientProfile:
          $ref: "#/components/schemas/analytics-isVisibleForClientProfile"
      required:
        - analysis
        - isVisibleForClientProfile
    analytics-segmentation:
      allOf:
        - type: object
          properties:
            analysis:
              $ref: "#/components/schemas/analytics-SegmentationAnalysis"
            isVisibleForClientProfile:
              $ref: "#/components/schemas/analytics-isVisibleForClientProfile"
            sharing:
              $ref: "#/components/schemas/analytics-SharingData"
        - $ref: "#/components/schemas/analytics-AnalysisGetCommon"
      required:
        - analysis
        - isVisibleForClientProfile
    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-HistogramTimeDistributionChartItemValue"
      required:
        - aggregateTimeDescription
        - values
    analytics-HistogramTimeDistributionChartItemValue:
      type: object
      properties:
        metricId:
          type: string
          format: uuid
        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-TrendAggregateDataBy"
      required:
        - aggregateDataBy
        - dateFilter
        - variables
    analytics-AggregateTypedCalculationResponse:
      type: object
      properties:
        aggregateId:
          type: string
          format: uuid
        aggregateuuid:
          type: string
          format: uuid
        clientId:
          type: number
          format: int64
        title:
          type: string
        result:
          type: object
        variables:
          type: array
          items:
            $ref: "#/components/schemas/analytics-Variable"
        dateFilter:
          $ref: "#/components/schemas/analytics-dateFilter"
        analyticVersion:
          type: string
          format: uuid
    analytics-PreviewAggregateRequest:
      type: object
      properties:
        aggregate:
          allOf:
            - type: object
              description: Structure of the analysis. For previews, the `oldId` parameter can have any value.
              properties:
                oldId:
                  $ref: "#/components/schemas/analytics-oldId"
              required:
                - oldId
            - $ref: "#/components/schemas/analytics-ClientAggregate"
        identifierValue:
          $ref: "#/components/schemas/analytics-identifierValue"
      required:
        - aggregate
        - identifierValue
    analytics-ClientAggregate:
      allOf:
        - type: object
          title: Profile aggregate
          description: Profile aggregate definition
          properties:
            aggregateType:
              type: string
              description: Type of the aggregate. `AGGREGATE` is a profile aggregate.
              enum:
                - AGGREGATE
          required:
            - aggregateType
        - $ref: "#/components/schemas/analytics-AggregateCommon"
    analytics-AggregateCommon:
      type: object
      required:
        - actionId
        - attribute
        - dateFilter
        - type
        - name
        - description
      properties:
        name:
          $ref: "#/components/schemas/analytics-name"
        description:
          $ref: "#/components/schemas/analytics-description"
        action:
          $ref: "#/components/schemas/analytics-Action"
        attribute:
          $ref: "#/components/schemas/analytics-AggregateAttribute"
        type:
          $ref: "#/components/schemas/analytics-AggregateExpressionType"
        level:
          $ref: "#/components/schemas/analytics-QuantileLevel"
        dateFilter:
          $ref: "#/components/schemas/analytics-dateFilter"
        size:
          $ref: "#/components/schemas/analytics-AggregateSize"
        unique:
          $ref: "#/components/schemas/analytics-AggregateUnique"
        expressions:
          type: array
          $ref: "#/components/schemas/analytics-AggregateExpressions"
    analytics-AggregateUnique:
      type: boolean
      default: false
      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
      description: Only applies and is required when `type` is *_MULTI. Defines how many results to return.
    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-AggregateAttribute:
      allOf:
        - type: object
          description: The event attribute, special property, or aggregate result analyzed by this aggregate.
        - 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:
          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-oldId:
      type: integer
      description: A unique numeric ID required for backwards compatibility. Cannot be changed.
    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-analyticAggregateResponse:
      type: object
      properties:
        meta:
          $ref: "#/components/schemas/analytics-meta"
        data:
          type: array
          description: Array of aggregates
          items:
            $ref: "#/components/schemas/analytics-AggregateListItem"
      required:
        - data
        - meta
    analytics-AggregateListItem:
      allOf:
        - type: object
          properties:
            aggregateType:
              $ref: "#/components/schemas/analytics-AggregateType"
        - $ref: "#/components/schemas/analytics-ListAnalyticsItemCommon"
      required:
        - aggregateType
    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"
        previewDefaultObjectId:
          $ref: "#/components/schemas/analytics-previewDefaultObjectId"
      required:
        - analysis
        - isVisibleForClientProfile
    analytics-previewDefaultObjectId:
      type: number
      format: int64
      description: The ID of the default profile for generating a preview of the results.
    analytics-AggregateAnalysis:
      description: Definition of the aggregate
      required:
        - aggregateType
      oneOf:
        - $ref: "#/components/schemas/analytics-RunningAggregate"
        - $ref: "#/components/schemas/analytics-ClientAggregate"
    analytics-RunningAggregate:
      allOf:
        - type: object
          title: Event aggregate
          properties:
            aggregateType:
              type: string
              description: |
                Type of the aggregate. `RUNNING_AGGREGATE` is an event aggregate.

                Event aggregates take into account events that occurred before the event that is the subject of the aggregate. If `excludeCurrent` is `false`, the data from that event is included too.

                `timeWindow` is a sliding time window anchored to the timestamp of the event currently being evaluated: only elements from events whose timestamp falls within `[currentEvent.timestamp - timeWindow, currentEvent.timestamp]` contribute to the result. It is required when `type` is `LAST_TIME`, `FIRST_TIME`, `LAST_MULTI_TIME`, or `FIRST_MULTI_TIME`, and ignored for all other aggregate types.
              enum:
                - RUNNING_AGGREGATE
            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.
            timeWindow:
              $ref: "#/components/schemas/analytics-period"
          required:
            - aggregateType
            - excludeCurrent
        - $ref: "#/components/schemas/analytics-AggregateCommon"
    analytics-Aggregate:
      allOf:
        - type: object
          properties:
            oldId:
              $ref: "#/components/schemas/analytics-oldId"
            analysis:
              allOf:
                - type: object
                  properties:
                    id:
                      $ref: "#/components/schemas/analytics-id"
                    uuid:
                      $ref: "#/components/schemas/analytics-uuid"
                    oldId:
                      $ref: "#/components/schemas/analytics-oldId"
                - $ref: "#/components/schemas/analytics-AggregateAnalysis"
            isVisibleForClientProfile:
              $ref: "#/components/schemas/analytics-isVisibleForClientProfile"
            aggregateType:
              $ref: "#/components/schemas/analytics-AggregateType"
            previewDefaultObjectId:
              $ref: "#/components/schemas/analytics-previewDefaultObjectId"
            analyticVersion:
              $ref: "#/components/schemas/analytics-analyticVersion"
        - $ref: "#/components/schemas/analytics-AnalysisGetCommon"
      required:
        - oldId
        - analysis
        - aggregateType
        - isVisibleForClientProfile
        - analyticVersion
    analytics-AggregateUpdateRequest:
      type: object
      description: Definition of the aggregate
      properties:
        analysis:
          allOf:
            - type: object
              description: Structure of the analysis
              properties:
                oldId:
                  $ref: "#/components/schemas/analytics-oldId"
              required:
                - oldId
            - $ref: "#/components/schemas/analytics-AggregateAnalysis"
        isVisibleForClientProfile:
          $ref: "#/components/schemas/analytics-isVisibleForClientProfile"
        previewDefaultObjectId:
          $ref: "#/components/schemas/analytics-previewDefaultObjectId"
      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"
      required:
        - analysis
    analytics-SankeyAnalysis:
      type: object
      description: Details of a Sankey analysis
      properties:
        title:
          $ref: "#/components/schemas/analytics-name"
        description:
          $ref: "#/components/schemas/analytics-description"
        sourceEvent:
          required:
            - action
            - expressions
          type: object
          description: The event that serves as the basis of the Sankey analysis
          properties:
            action:
              $ref: "#/components/schemas/analytics-Action"
            expressions:
              type: array
              description: An array of conditions that the event must meet
              items:
                $ref: "#/components/schemas/analytics-EventExpression"
        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:
          minimum: 0
          description: The number of steps to analyze before or after the source event
          exclusiveMinimum: false
          type: integer
          format: int32
        numberOfPaths:
          minimum: 0
          description: Information for the Synerise Web UI about the number of paths to analyze. This many most common paths are returned as standalone results, the rest is aggregated as "other". This does not affect the JSON content of the response from the analytics engine.
          exclusiveMinimum: false
          type: integer
          format: int32
        drillDown:
          type: array
          description: An array of drilldown conditions. On each layer, an event can only have one drilldown assigned.
          items:
            required:
              - action
              - attribute
              - layer
            type: object
            properties:
              eventName:
                $ref: "#/components/schemas/analytics-ActionName"
              attribute:
                $ref: "#/components/schemas/analytics-EventAttribute"
              layer:
                minimum: 0
                description: The layer where this drilldown applies. 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.
                exclusiveMinimum: false
                type: integer
                format: int32
        drillDownCount:
          type: integer
          nullable: true
          default: null
          description: Defines the number of displayed top drilldown results.
        dateFilter:
          $ref: "#/components/schemas/analytics-dateFilter"
        filter:
          $ref: "#/components/schemas/analytics-ProfileFilter"
        eventFilters:
          type: array
          description: An array of events to include or exclude according to the `excludeEvents` setting.
          items:
            required:
              - event
            type: object
            properties:
              title:
                type: string
                description: The name of the filter. Currently not used in the Synerise Web UI.
              action:
                $ref: "#/components/schemas/analytics-Action"
              expressions:
                type: array
                description: Conditions of the event. All of the conditions must be met.
                items:
                  $ref: "#/components/schemas/analytics-EventExpression"
        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. Every subsequent occurrence of the same event will be ignored in the analysis.
      required:
        - dateFilter
        - description
        - drillDown
        - eventFilters
        - excludeEvents
        - filter
        - firstOccurrenceOnly
        - numbersOfPaths
        - numbersOfSteps
        - reverseOrder
        - sourceEvent
        - title
    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:
            type: object
            properties:
              avg:
                type: integer
                format: int64
                description: Average time
              max:
                type: integer
                format: int64
                description: Longest time
              min:
                type: integer
                format: int64
                description: Shortest time
    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"
    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-funnelStructure"
        filter:
          $ref: "#/components/schemas/analytics-ProfileFilter"
      required:
        - description
        - filter
        - funnel
        - title
    analytics-Funnel:
      allOf:
        - type: object
          properties:
            analysis:
              $ref: "#/components/schemas/analytics-FunnelAnalysis"
        - $ref: "#/components/schemas/analytics-AnalysisGetCommon"
      required:
        - analysis
    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-Report:
      allOf:
        - type: object
          properties:
            analysis:
              $ref: "#/components/schemas/analytics-ReportAnalysis"
            allowNull:
              $ref: "#/components/schemas/analytics-AllowNull"
        - $ref: "#/components/schemas/analytics-AnalysisGetCommon"
      required:
        - allowNull
        - analysis
    analytics-TrendRequest:
      type: object
      properties:
        analysis:
          $ref: "#/components/schemas/analytics-TrendAnalysis"
      required:
        - analysis
    analytics-TrendAnalysis:
      type: object
      description: Details of a trend analysis
      properties:
        title:
          $ref: "#/components/schemas/analytics-name"
        description:
          $ref: "#/components/schemas/analytics-description"
        filter:
          $ref: "#/components/schemas/analytics-ProfileFilter"
        trend:
          $ref: "#/components/schemas/analytics-TrendTrend"
      required:
        - description
        - filter
        - title
        - trend
    analytics-TrendTrend:
      type: object
      description: Trend analysis conditions
      properties:
        aggregateDataBy:
          $ref: "#/components/schemas/analytics-TrendAggregateDataBy"
        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"
      required:
        - aggregateDataBy
        - dateFilter
        - trendDefinitions
    analytics-TrendDefinition:
      type: object
      properties:
        title:
          $ref: "#/components/schemas/analytics-name"
        description:
          $ref: "#/components/schemas/analytics-description"
        action:
          $ref: "#/components/schemas/analytics-Action"
        expressions:
          type: array
          minLength: 0
          description: An array of conditions that the event must meet
          items:
            $ref: "#/components/schemas/analytics-EventExpression"
        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-Trend:
      allOf:
        - type: object
          properties:
            analysis:
              $ref: "#/components/schemas/analytics-TrendAnalysis"
        - $ref: "#/components/schemas/analytics-AnalysisGetCommon"
      required:
        - analysis
    analytics-TrendCalculationResponse:
      type: object
      properties:
        name:
          $ref: "#/components/schemas/analytics-name"
        metadata:
          $ref: "#/components/schemas/analytics-TrendMetadata"
        items:
          type: array
          description: Results, grouped by time unit
          items:
            $ref: "#/components/schemas/analytics-TrendItems"
        legends:
          type: array
          description: Information about included trends and their display mode
          items:
            $ref: "#/components/schemas/analytics-TrendLegends"
      required:
        - items
        - legends
        - metadata
        - name
    analytics-TrendLegends:
      type: object
      properties:
        id:
          type: string
          description: Dynamically-generated UUID for a trend. This UUID is used to correlate a legend with a result from the `items` array.
          format: uuid
        title:
          type: string
          description: Title of the trend
        chartType:
          $ref: "#/components/schemas/analytics-ChartType"
      required:
        - chartType
        - id
        - title
    analytics-TrendItems:
      type: object
      properties:
        aggregateTimeDescription:
          type: string
          description: Timestamp for which the data was calculated
          format: date-time
        values:
          type: array
          description: An array of values for each trend
          items:
            $ref: "#/components/schemas/analytics-TrendItemsValues"
      required:
        - aggregateTimeDescription
        - values
    analytics-TrendItemsValues:
      type: object
      properties:
        trendId:
          type: string
          format: uuid
          description: Dynamically-generated UUID for a trend. To identify which results belongs to which trend, locate this UUID in an object in the `legends` array.
        countedEvents:
          type: number
          description: The number of events that matched the trend. If the trend analyzes profiles, this value is `0.0`.
          format: double
        countedClients:
          type: number
          description: The number of profiles which matched the trend. If the trend analyzes events, this value is `0.0`.
          format: double
      required:
        - countedClients
        - countedEvents
        - trendId
    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-SankeyRequest:
      type: object
      properties:
        analysis:
          $ref: "#/components/schemas/analytics-SankeyAnalysis"
      required:
        - analysis
    analytics-Sankey:
      allOf:
        - type: object
          properties:
            analysis:
              $ref: "#/components/schemas/analytics-SankeyAnalysis"
        - $ref: "#/components/schemas/analytics-AnalysisGetCommon"
      required:
        - analysis
    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-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-metricIdAsPathParam:
      name: metricId
      in: path
      description: Metric UUID
      required: true
      style: simple
      explode: false
      schema:
        type: string
        format: uuid
    analytics-reportIdAsPathParam:
      name: reportId
      in: path
      description: Report ID
      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-expressionIdAsPathParam:
      name: expressionId
      in: path
      description: Expression ID
      required: true
      style: simple
      explode: false
      schema:
        type: string
        format: uuid
    analytics-histogramIdAsPathParam:
      name: histogramId
      in: path
      description: Histogram ID
      required: true
      style: simple
      explode: false
      schema:
        type: string
        format: uuid
    analytics-segmentationIdAsPathParam:
      name: segmentationId
      in: path
      description: Segmentation UUID
      required: true
      style: simple
      explode: false
      schema:
        type: string
        format: uuid
    analytics-shareType:
      name: shareType
      description: Type of sharing process
      in: query
      required: false
      schema:
        type: string
        enum:
          - CROSSWORKSPACE
          - INTERNAL
    analytics-clientIdAsPathParameter:
      name: clientId
      in: path
      description: Client ID
      required: true
      style: simple
      explode: false
      schema:
        type: integer
        format: int64
    analytics-aggregateIdAsPathParam:
      name: aggregateId
      in: path
      description: Aggregate ID
      required: true
      style: simple
      explode: false
      schema:
        type: string
        format: uuid
    analytics-aggregateType:
      name: aggregateType
      in: query
      description: Filter by aggregate type
      required: false
      schema:
        type: string
        enum:
          - AGGREGATE
          - RUNNING_AGGREGATE
    analytics-funnelIdAsPathParam:
      name: funnelId
      in: path
      description: Funnel UUID
      required: true
      style: simple
      explode: false
      schema:
        type: string
        format: uuid
    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
    analytics-trendIdAsPathParam:
      name: trendId
      in: path
      description: Trend UUID
      required: true
      style: simple
      explode: false
      schema:
        type: string
        format: uuid
    analytics-sankeyIdAsPathParam:
      name: sankeyId
      in: path
      description: Sankey UUID
      required: true
      style: simple
      explode: false
      schema:
        type: string
        format: uuid
  responses:
    analytics-genericError:
      description: See error message for details
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/analytics-Error"
