# Calculate dynamic metric

- Operation ID: `analytics2-calculate-metric-override-variables`
- HTTP method: `POST`
- Path: `/analytics/analytics/v3/metrics/{AnalysisId}/dynamic/value`
- [Human-readable API reference](https://hub.synerise.com/api-reference/analytics-suite#tag/Analytics:-Metrics/operation/analytics2-calculate-metric-override-variables)

## Self-contained OpenAPI method

The fenced document below contains this method's documentation and all of its local references. It is self-contained; no category or master specification fetch is required.

```yaml
openapi: 3.0.0
info:
  title: Synerise Public API
  version: 1.9.1
paths:
  /analytics/analytics/v3/metrics/{AnalysisId}/dynamic/value:
    post:
      tags:
        - "Analytics: Metrics"
      summary: Calculate dynamic metric
      description: |
        Calculate a metric that includes variables (dynamic keys).

        ---

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

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

        **User role permission required:** `analytics: read`
      operationId: analytics2-calculate-metric-override-variables
      parameters:
        - name: AnalysisId
          in: path
          description: UUID of the analysis
          required: true
          style: simple
          explode: false
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                variables:
                  type: array
                  description: Dynamic keys used in this analysis
                  items:
                    type: object
                    properties:
                      name:
                        type: string
                        description: The name of the variable (dynamic key) which will receive this value for the current calculation.
                      value:
                        description: |
                          The value of the variable. Can be one of: string, integer, boolean, string[], integer[], or a DateFilter object (with type ABSOLUTE/RELATIVE).
                        example: example-string-value
                    required:
                      - name
                      - value
              required:
                - variables
      responses:
        "200":
          description: Metric calculation result
          content:
            application/json:
              schema:
                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:
                    type: object
                    description: Basic information about the metric
                    properties:
                      name:
                        type: string
                        description: Name of the resource
                      description:
                        type: string
                        description: Description of the resource
                      format:
                        type: object
                        description: |
                          
                          This object defines the display format of the data in the Synerise Web UI. The JSON format of the results is not affected.

                          Values other than in the enums or min-max ranges are accepted by the backend, but may not be displayed properly by the Synerise Web UI.
                        properties:
                          compactNumbers:
                            type: boolean
                            default: false
                            description: When `true`, numbers are shortened. For example, "20500" becomes "20.5k".
                          currency:
                            type: string
                            x-class-name: Currency
                            nullable: true
                            title: CurrencyName
                            enum:
                              - EUR
                              - USD
                              - PLN
                              - JPY
                            description: The currency to use when `dataFormat` is `cash`
                          dataFormat:
                            type: string
                            title: DateFormatName
                            x-class-name: DateFormatName
                            nullable: true
                            enum:
                              - cash
                              - numeric
                              - percent
                            description: Format of the data
                          fixedLength:
                            description: The number of digits after the decimal point
                            type: integer
                            format: int32
                            default: 0
                            minimum: 0
                            maximum: 4
                          useSeparator:
                            type: boolean
                            default: false
                            description: Enables the use of a comma as the thousands separator. When `false`, no separator is used.
                      initialDateFilter:
                        description: |
                          Definition of a date filter. Only data that meets the result of the filter will be included in the analysis. For no filter, leave this object empty.

                          An absolute date filter lets you define static dates and times that always apply to the analysis.

                          A relative date filter lets you create a date filter that goes back a certain time from the moment of calculating the analysis.
                        discriminator:
                          propertyName: type
                          mapping:
                            ABSOLUTE: "#/components/schemas/analytics-AbsoluteDateFilter"
                            RELATIVE: "#/components/schemas/analytics-RelativeDateFilter"
                        oneOf:
                          - type: object
                            title: AbsoluteDateFilter
                            properties:
                              type:
                                title: AbsoluteDateFilterType
                                x-class-name: AbsoluteDateFilterType
                                x-interface-name-ts: AbsoluteDateFilterType
                                type: string
                                enum:
                                  - ABSOLUTE
                                description: Absolute filters have the same start and end regardless of when the analysis is calculated.
                              from:
                                type: string
                                format: date-time
                                description: The lower boundary of the date filter.
                              to:
                                type: string
                                format: date-time
                                description: The upper boundary of the date filter. Must be later than `from`.
                              filter:
                                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:
                                  - type: object
                                    title: Daily
                                    x-class-name: CustomDailyFilter
                                    x-interface-name-ts: CustomDailyFilter
                                    properties:
                                      type:
                                        type: string
                                        x-class-name: CustomDailyFilterType
                                        x-interface-name-ts: CustomDailyFilterType
                                        enum:
                                          - DAILY
                                        description: Daily filters limit the data scope to a range of hours every day.
                                      nestingType:
                                        x-class-name: CustomDailyFilterNestingType
                                        type: string
                                        enum:
                                          - IN_PLACE
                                      from:
                                        type: string
                                        description: Lower boundary of the pattern's timeframe, in HH:MM:SS format.
                                      to:
                                        type: string
                                        description: Upper boundary of the pattern's timeframe, in HH:MM:SS format.
                                      inverted:
                                        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."
                                    required:
                                      - nestingType
                                      - type
                                      - from
                                      - to
                                  - type: object
                                    title: Weekly
                                    x-class-name: CustomWeeklyFilter
                                    x-interface-name-ts: CustomWeeklyFilter
                                    properties:
                                      type:
                                        type: string
                                        x-class-name: CustomWeeklyFilterType
                                        x-interface-name-ts: CustomWeeklyFilterType
                                        enum:
                                          - WEEKLY
                                        description: Weekly filters let you define separate rules for each day of the week.
                                      nestingType:
                                        x-class-name: CustomWeeklyFilterNestingType
                                        type: string
                                        enum:
                                          - IN_PLACE
                                      days:
                                        type: array
                                        description: An array of rules for different days of the week.
                                        items:
                                          type: object
                                          properties:
                                            day:
                                              type: integer
                                              description: The day that this rule applies to. In weekly patterns, `1` is Monday (Sunday if inverted).
                                            from:
                                              type: string
                                              description: Lower boundary of the pattern's timeframe, in HH:MM:SS format.
                                            to:
                                              type: string
                                              description: Upper boundary of the pattern's timeframe, in HH:MM:SS format.
                                            mode:
                                              type: string
                                              enum:
                                                - Range
                                                - Hour
                                            inverted:
                                              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."
                                          required:
                                            - day
                                            - from
                                            - inverted
                                            - to
                                    required:
                                      - days
                                      - nestingType
                                      - type
                                  - type: object
                                    title: Monthly
                                    x-class-name: CustomMonthlyFilterType
                                    x-interface-name-ts: CustomMonthlyFilterType
                                    properties:
                                      type:
                                        type: string
                                        x-class-name: CustomMonthlyFilterType
                                        x-interface-name-ts: CustomMonthlyFilterType
                                        enum:
                                          - MONTHLY
                                        description: Monthly filters allow you to build rules for days of the month and/or weeks, including rules for different days of the week.
                                      nestingType:
                                        x-class-name: CustomMonthlyFilterNestingType
                                        type: string
                                        enum:
                                          - IN_PLACE
                                      rules:
                                        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:
                                          - type: object
                                            title: Days of the week
                                            x-class-name: WeekDateRule
                                            x-interface-name-ts: WeekDateRule
                                            properties:
                                              type:
                                                type: string
                                                x-class-name: WeekDateRuleType
                                                x-interface-name-ts: WeekDateRuleType
                                                enum:
                                                  - WEEK
                                                description: Weekly filters limit the scope to days in a week
                                              weeks:
                                                type: array
                                                description: Weeks of the month included in the pattern
                                                items:
                                                  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:
                                                        type: object
                                                        properties:
                                                          day:
                                                            type: integer
                                                            description: The day that this rule applies to. In weekly patterns, `1` is Monday (Sunday if inverted).
                                                          from:
                                                            type: string
                                                            description: Lower boundary of the pattern's timeframe, in HH:MM:SS format.
                                                          to:
                                                            type: string
                                                            description: Upper boundary of the pattern's timeframe, in HH:MM:SS format.
                                                          mode:
                                                            type: string
                                                            enum:
                                                              - Range
                                                              - Hour
                                                          inverted:
                                                            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."
                                                        required:
                                                          - day
                                                          - from
                                                          - inverted
                                                          - to
                                                  required:
                                                    - days
                                                    - type
                                              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
                                          - type: object
                                            title: Days of the month
                                            x-class-name: MonthDateRule
                                            x-interface-name-ts: MonthDateRule
                                            properties:
                                              type:
                                                description: Rules for days of the month
                                                type: string
                                                x-class-name: MonthDateRuleType
                                                x-interface-name-ts: MonthDateRuleType
                                                enum:
                                                  - MONTH
                                              days:
                                                type: array
                                                description: Days of the month included in the pattern.
                                                items:
                                                  type: object
                                                  properties:
                                                    day:
                                                      type: integer
                                                      description: The day that this rule applies to. In weekly patterns, `1` is Monday (Sunday if inverted).
                                                    from:
                                                      type: string
                                                      description: Lower boundary of the pattern's timeframe, in HH:MM:SS format.
                                                    to:
                                                      type: string
                                                      description: Upper boundary of the pattern's timeframe, in HH:MM:SS format.
                                                    mode:
                                                      type: string
                                                      enum:
                                                        - Range
                                                        - Hour
                                                    inverted:
                                                      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."
                                                  required:
                                                    - day
                                                    - from
                                                    - inverted
                                                    - to
                                              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
                                        discriminator:
                                          propertyName: type
                                          mapping:
                                            WEEK: "#/components/schemas/analytics-WeekDateRule"
                                            MONTH: "#/components/schemas/analytics-MonthDateRule"
                                    required:
                                      - nestingType
                                      - rules
                                      - type
                                discriminator:
                                  propertyName: type
                                  mapping:
                                    DAILY: "#/components/schemas/analytics-CustomDailyDateFilter"
                                    WEEKLY: "#/components/schemas/analytics-CustomWeeklyDateFilter"
                                    MONTHLY: "#/components/schemas/analytics-CustomMonthlyDateFilter"
                            required:
                              - type
                          - type: object
                            title: RelativeDateFilter
                            properties:
                              type:
                                title: RelativeDateFilterType
                                x-class-name: RelativeDateFilterType
                                x-interface-name-ts: RelativeDateFilterType
                                type: string
                                enum:
                                  - RELATIVE
                                description: |
                                  Relative filters allow you to create a filter that depends on when the analysis is calculated. 

                                  - `duration` is the length of time that the filter covers.
                                  - `offset` is the time that the filter goes back to set the beginning of the duration.
                              duration:
                                type: object
                                description: The definition of a length of time.
                                properties:
                                  type:
                                    type: string
                                    x-class-name: TimePeriod
                                    x-interface-name-ts: TimePeriod
                                    description: The unit of time
                                    enum:
                                      - YEARS
                                      - MONTHS
                                      - WEEKS
                                      - DAYS
                                      - HOURS
                                      - MINUTES
                                      - SECONDS
                                      - UNKNOWN
                                  value:
                                    type: integer
                                    description: The number of time units
                                    format: int64
                                required:
                                  - type
                                  - value
                              offset:
                                type: object
                                description: The definition of a length of time.
                                properties:
                                  type:
                                    type: string
                                    x-class-name: TimePeriod
                                    x-interface-name-ts: TimePeriod
                                    description: The unit of time
                                    enum:
                                      - YEARS
                                      - MONTHS
                                      - WEEKS
                                      - DAYS
                                      - HOURS
                                      - MINUTES
                                      - SECONDS
                                      - UNKNOWN
                                  value:
                                    type: integer
                                    description: The number of time units
                                    format: int64
                                required:
                                  - type
                                  - value
                              filter:
                                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:
                                  - type: object
                                    title: Daily
                                    x-class-name: CustomDailyFilter
                                    x-interface-name-ts: CustomDailyFilter
                                    properties:
                                      type:
                                        type: string
                                        x-class-name: CustomDailyFilterType
                                        x-interface-name-ts: CustomDailyFilterType
                                        enum:
                                          - DAILY
                                        description: Daily filters limit the data scope to a range of hours every day.
                                      nestingType:
                                        x-class-name: CustomDailyFilterNestingType
                                        type: string
                                        enum:
                                          - IN_PLACE
                                      from:
                                        type: string
                                        description: Lower boundary of the pattern's timeframe, in HH:MM:SS format.
                                      to:
                                        type: string
                                        description: Upper boundary of the pattern's timeframe, in HH:MM:SS format.
                                      inverted:
                                        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."
                                    required:
                                      - nestingType
                                      - type
                                      - from
                                      - to
                                  - type: object
                                    title: Weekly
                                    x-class-name: CustomWeeklyFilter
                                    x-interface-name-ts: CustomWeeklyFilter
                                    properties:
                                      type:
                                        type: string
                                        x-class-name: CustomWeeklyFilterType
                                        x-interface-name-ts: CustomWeeklyFilterType
                                        enum:
                                          - WEEKLY
                                        description: Weekly filters let you define separate rules for each day of the week.
                                      nestingType:
                                        x-class-name: CustomWeeklyFilterNestingType
                                        type: string
                                        enum:
                                          - IN_PLACE
                                      days:
                                        type: array
                                        description: An array of rules for different days of the week.
                                        items:
                                          type: object
                                          properties:
                                            day:
                                              type: integer
                                              description: The day that this rule applies to. In weekly patterns, `1` is Monday (Sunday if inverted).
                                            from:
                                              type: string
                                              description: Lower boundary of the pattern's timeframe, in HH:MM:SS format.
                                            to:
                                              type: string
                                              description: Upper boundary of the pattern's timeframe, in HH:MM:SS format.
                                            mode:
                                              type: string
                                              enum:
                                                - Range
                                                - Hour
                                            inverted:
                                              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."
                                          required:
                                            - day
                                            - from
                                            - inverted
                                            - to
                                    required:
                                      - days
                                      - nestingType
                                      - type
                                  - type: object
                                    title: Monthly
                                    x-class-name: CustomMonthlyFilterType
                                    x-interface-name-ts: CustomMonthlyFilterType
                                    properties:
                                      type:
                                        type: string
                                        x-class-name: CustomMonthlyFilterType
                                        x-interface-name-ts: CustomMonthlyFilterType
                                        enum:
                                          - MONTHLY
                                        description: Monthly filters allow you to build rules for days of the month and/or weeks, including rules for different days of the week.
                                      nestingType:
                                        x-class-name: CustomMonthlyFilterNestingType
                                        type: string
                                        enum:
                                          - IN_PLACE
                                      rules:
                                        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:
                                          - type: object
                                            title: Days of the week
                                            x-class-name: WeekDateRule
                                            x-interface-name-ts: WeekDateRule
                                            properties:
                                              type:
                                                type: string
                                                x-class-name: WeekDateRuleType
                                                x-interface-name-ts: WeekDateRuleType
                                                enum:
                                                  - WEEK
                                                description: Weekly filters limit the scope to days in a week
                                              weeks:
                                                type: array
                                                description: Weeks of the month included in the pattern
                                                items:
                                                  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:
                                                        type: object
                                                        properties:
                                                          day:
                                                            type: integer
                                                            description: The day that this rule applies to. In weekly patterns, `1` is Monday (Sunday if inverted).
                                                          from:
                                                            type: string
                                                            description: Lower boundary of the pattern's timeframe, in HH:MM:SS format.
                                                          to:
                                                            type: string
                                                            description: Upper boundary of the pattern's timeframe, in HH:MM:SS format.
                                                          mode:
                                                            type: string
                                                            enum:
                                                              - Range
                                                              - Hour
                                                          inverted:
                                                            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."
                                                        required:
                                                          - day
                                                          - from
                                                          - inverted
                                                          - to
                                                  required:
                                                    - days
                                                    - type
                                              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
                                          - type: object
                                            title: Days of the month
                                            x-class-name: MonthDateRule
                                            x-interface-name-ts: MonthDateRule
                                            properties:
                                              type:
                                                description: Rules for days of the month
                                                type: string
                                                x-class-name: MonthDateRuleType
                                                x-interface-name-ts: MonthDateRuleType
                                                enum:
                                                  - MONTH
                                              days:
                                                type: array
                                                description: Days of the month included in the pattern.
                                                items:
                                                  type: object
                                                  properties:
                                                    day:
                                                      type: integer
                                                      description: The day that this rule applies to. In weekly patterns, `1` is Monday (Sunday if inverted).
                                                    from:
                                                      type: string
                                                      description: Lower boundary of the pattern's timeframe, in HH:MM:SS format.
                                                    to:
                                                      type: string
                                                      description: Upper boundary of the pattern's timeframe, in HH:MM:SS format.
                                                    mode:
                                                      type: string
                                                      enum:
                                                        - Range
                                                        - Hour
                                                    inverted:
                                                      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."
                                                  required:
                                                    - day
                                                    - from
                                                    - inverted
                                                    - to
                                              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
                                        discriminator:
                                          propertyName: type
                                          mapping:
                                            WEEK: "#/components/schemas/analytics-WeekDateRule"
                                            MONTH: "#/components/schemas/analytics-MonthDateRule"
                                    required:
                                      - nestingType
                                      - rules
                                      - type
                                discriminator:
                                  propertyName: type
                                  mapping:
                                    DAILY: "#/components/schemas/analytics-CustomDailyDateFilter"
                                    WEEKLY: "#/components/schemas/analytics-CustomWeeklyDateFilter"
                                    MONTHLY: "#/components/schemas/analytics-CustomMonthlyDateFilter"
                            required:
                              - duration
                              - offset
                              - type
                    required:
                      - description
                      - format
                      - initialDateFilter
                      - name
                required:
                  - metricData
                  - result
        4XX:
          description: See error message for details
          content:
            application/json:
              schema:
                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:
                          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
                  - 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
        5XX:
          description: See error message for details
          content:
            application/json:
              schema:
                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:
                          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
                  - 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
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/analytics-suite#tag/Analytics:-Metrics/operation/analytics2-calculate-metric-override-variables
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/analytics/analytics/v3/metrics/%7BAnalysisId%7D/dynamic/value \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"variables":[{"name":"string","value":"example-string-value"}]}'
        - lang: Python
          label: Python
          source: |-
            import http.client

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

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

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

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

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

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

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

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

            xhr.open("POST", "https://api.synerise.com/analytics/analytics/v3/metrics/%7BAnalysisId%7D/dynamic/value");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
            xhr.setRequestHeader("content-type", "application/json");

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

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

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

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

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

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

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

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

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

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

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.post("https://api.synerise.com/analytics/analytics/v3/metrics/%7BAnalysisId%7D/dynamic/value")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"variables\":[{\"name\":\"string\",\"value\":\"example-string-value\"}]}")
              .asString();
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: Metrics"
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.
```
