---
title: "Update Calculated Metric"
method: PUT
path: "/v1/calculated-metrics/{id}"
tags: ["Calculated Metrics"]
---

# Update Calculated Metric

`PUT /v1/calculated-metrics/{id}`

## Request

- Base URL: `https://api.oviond.com`
- URL: `https://api.oviond.com/v1/calculated-metrics/{id}`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

Update a calculated metric

## Path parameters

- `id` string, required

## Request body

- UpdateCalculatedMetricRequest
  - `name` string, required
  - `formula` union, required: Array of formula tokens in evaluation order. CTR = clicks ÷ impressions × 100 is five tokens: METRIC(clicks), OPERATOR(÷), METRIC(impressions), OPERATOR(×), NUMBER(100). Operators accept both the Unicode × ÷ the UI writes and the ASCII * / on migrated rows.
    - FormulaToken[]
      - `id` string, required
      - `type` 'METRIC' | 'NUMBER' | 'OPERATOR', required
      - `query` MetricQuery, nullable
        - `datasource_id` 'advanced-web-ranking' | 'ac' | 'adroll' | 'ahrefs' | 'basecamp' | 'brightlocal' | 'call-rail' | 'drip' | 'keywords' | 'sendin-blue' | 'sendgrid' | 'moosend' | 'mailer-lite' | 'pingdom' | 'uptime-robot' | 'piwik-pro' | 'wordpress' | 'pabbly-connect' | 'ment' | 'twilio' | 'switchy' | 'vimeo' | 'pinterest' | 'pinterest-ads' | 'gtres' | 'paypal' | 'gps' | 'gs' | 'CUSTOM_IMPORT' | 'CUSTOM_DATA' | 'CALCULATION' | 'GOALS' | 'str' | 'wistia' | 'ca-mon' | 'convertkit' | 'woocommerce' | 'xero' | 'matomo' | 'go-high-level' | 'wcs' | 'bing-webmaster-tools' | 'pipedrive' | 'salesforce' | 'tiktok' | 'tiktok-ads' | 'twr' | 'twr-ads' | 'spf' | 'ytbe' | 'google-local-services-ads' | 'klaviyo' | 'gsh' | 'ga4' | 'lkdin-ads' | 'lkdin-pg' | 'mlchmp' | 'inst-ads' | 'inst' | 'fb-ads' | 'fb-pg' | 'gmb' | 'serpstat' | 'hubspot' | 'gadw' | 'sem-rush' | 'se-ranking' | 'microsoft-ads' | 'plausible' | 'snapchat-ads' | 'microsoft-clarity' | 'serp-watch' | 'vbout' | 'moz' | 'chatgpt-ads' | 'omnisend' | 'airtable' | 'nozzle' | 'surnex' | 'jira' | 'clickup' | 'make' | 'freshdesk' | 'chart-mogul' | 'amplitude' | 'harvest' | 'zoho-crm' | 'clockify' | 'adtraction' | 'shopify' | 'copper' | 'help-scout-docs' | 'close-crm' | 'simplesat' | 'help-scout-mailbox' | 'demo'
        - `data_view` string
        - `metrics` MetricSelection[]
          - `value` string, required
          - `label` string
          - `data_view` string
        - `dimensions` DimensionSelection[]
          - `value` string, required
          - `label` string
          - `data_view` string
        - `filters` WidgetFilter[]
          - `id` union
            - number
            - string
          - `field` string
          - `operator` string: Canonical: equals, not_equals, contains, not_contains, starts_with, ends_with, greater_than, less_than, greater_than_or_equal, less_than_or_equal (vendor tokens also accepted).
          - `value` union
            - string
            - number
            - boolean
            - unknown[]
              - …
          - `logicalOperator` 'and' | 'or'
        - `advanced` object
      - `number` number, nullable
      - `operator` '+' | '-' | '*' | '/' | '×' | '÷' | '(' | ')', nullable
    - string
  - `symbol` 'numbers' | 'decimal' | '%' | 'currency', required

## Response `200`

Metric updated

- SuccessResponse
  - `success` true, required

## Other responses

- `404`: Metric not found

## Changes

- **2026-10-20** `4cb0a07daf41`: 1 breaking
  - removed the enum value `amazon-advertising` of the request property `formula/anyOf[subschema #1]/items/query/datasource_id`

[Operation history](https://skmtc.dev/oviond/apis/oviond-backend-api/changes/v1/calculated-metrics/:id/put.md)

---

[API](https://skmtc.dev/oviond/apis/oviond-backend-api.md) · [All operations](https://skmtc.dev/oviond/apis/oviond-backend-api/llms.txt) · [OpenAPI document](https://skmtc.dev/oviond/apis/oviond-backend-api/revisions/4cb0a07daf41?raw)
