---
title: "Update a metric policy"
method: PUT
path: "/v1/metric/policies/{policyId}"
tags: ["Metric Policy"]
---

# Update a metric policy

`PUT /v1/metric/policies/{policyId}`

Updates an existing metric policy. System policies cannot be modified.

## Path parameters

- `policyId` string, uuid, required

## Request body

- UpdateMetricPolicyInput — Input for updating an existing metric policy
  - `name` string — Name of the metric policy
  - `status` 'ACTIVE' | 'INACTIVE' — Status of the policy
  - `conditions` object[] — Condition groups. Omit to keep existing, provide empty array to remove all conditions.
    - `conditions` object[], required
      - `conditionType` 'AGENT' | 'CALL_SOURCE' | 'CALL_PROPERTY' | 'INTEGRATION', required — Type of condition: AGENT (match by agent ID), CALL_SOURCE (match by source e.g. VAPI, RETELL), CALL_PROPERTY (match by call property key/value)
      - `conditionKey` string, required — Key to match against. For AGENT: the agent ID. For CALL_SOURCE: the source name. For CALL_PROPERTY: the property key.
      - `conditionOperator` 'EQUALS' | 'NOT_EQUALS' | 'CONTAINS' | 'STARTS_WITH' | 'GREATER_THAN' | 'LESS_THAN' | 'GREATER_THAN_OR_EQUALS' | 'LESS_THAN_OR_EQUALS', nullable — Comparison operator. Required for CALL_PROPERTY conditions.
      - `conditionValue` string, nullable — Value to compare against. Required for CALL_PROPERTY conditions.
  - `metrics` object[] — Metric definitions to collect when this policy matches
    - `id` string, uuid, required

## Response `200`

The updated metric policy

- object
  - `data` MetricPolicyResponse, required — A metric policy defining when metrics should be collected
    - `id` string, uuid, required — Unique identifier of the metric policy
    - `name` string, required — Name of the metric policy
    - `type` 'SYSTEM' | 'USER', required — Type of the metric policy (SYSTEM or USER)
    - `status` 'ACTIVE' | 'INACTIVE', required — Status of the metric policy (ACTIVE or INACTIVE)
    - `conditions` object[], nullable, required — Condition groups for this policy. Null means the policy matches all calls.
      - `conditions` object[], required
        - `conditionType` 'AGENT' | 'CALL_SOURCE' | 'CALL_PROPERTY' | 'INTEGRATION', required — Type of condition: AGENT (match by agent ID), CALL_SOURCE (match by source e.g. VAPI, RETELL), CALL_PROPERTY (match by call property key/value)
        - `conditionKey` string, required — Key to match against. For AGENT: the agent ID. For CALL_SOURCE: the source name. For CALL_PROPERTY: the property key.
        - `conditionOperator` 'EQUALS' | 'NOT_EQUALS' | 'CONTAINS' | 'STARTS_WITH' | 'GREATER_THAN' | 'LESS_THAN' | 'GREATER_THAN_OR_EQUALS' | 'LESS_THAN_OR_EQUALS', nullable, required — Comparison operator. Required for CALL_PROPERTY conditions.
        - `conditionValue` string, nullable, required — Value to compare against. Required for CALL_PROPERTY conditions.
    - `metrics` object[], required — Metric definitions associated with this policy
      - `id` string, uuid, required
    - `createdAt` string, required — When the policy was created
    - `updatedAt` string, required — When the policy was last updated

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `404` — Not Found
- `429` — Too Many Requests
- `500` — Internal Server Error

---

[API](https://skmtc.net/roarkhq/apis/roark-analytics-api.md) · [All operations](https://skmtc.net/roarkhq/apis/roark-analytics-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/roarkhq/roark-analytics-api/versions/83528d3618ef/schema)
