---
title: "Update an existing calculated metric"
method: PUT
path: "/{globalCompanyId}/calculatedmetrics/{id}"
tags: ["Calculated Metrics"]
---

# Update an existing calculated metric

`PUT /{globalCompanyId}/calculatedmetrics/{id}`

The following fields can be modified through this endpoint: <br/><b>name, description, definition, owner, rsid</b>
Example "defintion" for use in testing API below ("Visits per visitor"):<br/>
"definition": {
      "formula": {
        "func": "divide",
        "col1": {
          "func": "metric",
          "name": "metrics/visits",
          "description": "Visits"
        },
        "col2": {
          "func": "metric",
          "name": "metrics/visitors",
          "description": "Unique Visitors"
        }
      },
      "func": "calc-metric",
      "version": [
        1,
        0,
        0
      ]
    }<br/><br/>Response will be the newly modified calculated metric object after the update request completes.<br/><br/><b><span style="text-decoration: underline;">CalculatedMetricResponse</span></b><br/>A calculated metric response will always include these default items:* id, name, description, rsid, owner* 

Additional attributes can be optionally requested in the 'expansion' field as described in the GET calculated metrics section.

## Path parameters

- `globalCompanyId` string, required
- `id` string, required

## Query parameters

- `locale` string
- `expansion` string[]

## Headers

- `Authorization` string, required
- `x-api-key` string, required

## Request body

- AnalyticsCalculatedMetric
  - `id` string — System generated id
  - `name` string
  - `description` string
  - `rsid` string — The report suite id for which the component was created/updated
  - `reportSuiteName` string — The report suite name for which the component was created/updated
  - `owner` Owner
    - `id` integer, required — the login id of the owner
    - `name` string — the friendly full login name of the owner, included when the expansion parameter ownerFullName is true
    - `login` string — the friendly full login name of the owner, included when the expansion parameter ownerFullName is true
  - `polarity` 'positive' | 'negative' — Set metric polarity, which indicates whether it's good or bad if a given metric goes up. Default=positive
  - `precision` integer — Number of decimal places to include in calculated metric result
  - `type` 'CURRENCY' | 'TIME' | 'DECIMAL' | 'PERCENT'
  - `definition` CalculatedMetricDef, required
  - `categories` string[]
  - `tags` Tag[]
    - `id` integer — the tag id
    - `name` string — the tag name
    - `description` string — the tag description
    - `components` TaggedComponent[] — the list of components that have been tagged with this tag
      - `componentType` string
      - `componentId` string
      - `tags` string[]
  - `siteTitle` string
  - `modified` string, date-time
  - `created` string, date-time — Calculated metric creation date

## Response `200`

successful operation

- AnalyticsCalculatedMetric
  - `id` string — System generated id
  - `name` string
  - `description` string
  - `rsid` string — The report suite id for which the component was created/updated
  - `reportSuiteName` string — The report suite name for which the component was created/updated
  - `owner` Owner
    - `id` integer, required — the login id of the owner
    - `name` string — the friendly full login name of the owner, included when the expansion parameter ownerFullName is true
    - `login` string — the friendly full login name of the owner, included when the expansion parameter ownerFullName is true
  - `polarity` 'positive' | 'negative' — Set metric polarity, which indicates whether it's good or bad if a given metric goes up. Default=positive
  - `precision` integer — Number of decimal places to include in calculated metric result
  - `type` 'CURRENCY' | 'TIME' | 'DECIMAL' | 'PERCENT'
  - `definition` CalculatedMetricDef, required
  - `categories` string[]
  - `tags` Tag[]
    - `id` integer — the tag id
    - `name` string — the tag name
    - `description` string — the tag description
    - `components` TaggedComponent[] — the list of components that have been tagged with this tag
      - `componentType` string
      - `componentId` string
      - `tags` string[]
  - `siteTitle` string
  - `modified` string, date-time
  - `created` string, date-time — Calculated metric creation date

## Other responses

- `400` — Definition must be formatted as a JSON Object
- `401` — Company mismatch; calculated metric ownership can only be transferred within the same organization
- `403` — User does not have permission to update this calculated metric
- `500` — External API error; Calculated metric update or retrieval failed

## Changes

- **2025-08-07** `f13c80692287` — 1 warning
  - deleted the `header` request parameter `x-gw-ims-org-id`
- **2025-08-06** `f49e893a6c2b` — 1 breaking
  - added the new required `header` request parameter `x-gw-ims-org-id`
- **2022-05-10** `dcd4514630c4` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/adobe/apis/adobe-analytics-apis/changes/:globalCompanyId/calculatedmetrics/:id/put.md)

---

[API](https://skmtc.dev/adobe/apis/adobe-analytics-apis.md) · [All operations](https://skmtc.dev/adobe/apis/adobe-analytics-apis/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/adobe/adobe-analytics-apis/revisions/b2e01ce0f30a/schema)
