> ## Documentation Index
> Fetch the complete documentation index at: https://docs.platinur.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Api Update Semantic Metric

> Edit a governed metric and apply it DIRECTLY to both environments (no PR).

Editable fields: label, description, status (verified/draft/deprecated or '' to clear), and
the DEFINITION — `agg` (sum/avg/min/max/count/count_distinct) + `expr` (a SQL expression over
the metric's mart columns). Body: {label?, description?, status?, agg?, expr?}. When the
definition changes it is validated by RUNNING the aggregation against the staging marts in
the bound warehouse first; on success the metric's measure is updated in both the staging and prod
semantic YAML and committed directly to both git branches. `meta.platinur.status` stays in
git (worker-preserved on rebuild). Requires GitHub configured. Permission: create_proposals.
`owner` was removed and is no longer accepted.



## OpenAPI

````yaml /api/openapi.json post /api/semantic/metrics/{name}
openapi: 3.1.0
info:
  description: >-
    Environment-aware APIs for Platinur configuration, integrations, operations,
    promotions, scheduling, monitoring, and assistant tasks.
  title: Platinur Control Plane API
  version: 1.0.0-rc3
servers:
  - description: Local Platinur control-plane API
    url: http://localhost:8080
security: []
paths:
  /api/semantic/metrics/{name}:
    post:
      tags:
        - Control Plane
      summary: Api Update Semantic Metric
      description: >-
        Edit a governed metric and apply it DIRECTLY to both environments (no
        PR).


        Editable fields: label, description, status (verified/draft/deprecated
        or '' to clear), and

        the DEFINITION — `agg` (sum/avg/min/max/count/count_distinct) + `expr`
        (a SQL expression over

        the metric's mart columns). Body: {label?, description?, status?, agg?,
        expr?}. When the

        definition changes it is validated by RUNNING the aggregation against
        the staging marts in

        the bound warehouse first; on success the metric's measure is updated in
        both the staging and prod

        semantic YAML and committed directly to both git branches.
        `meta.platinur.status` stays in

        git (worker-preserved on rebuild). Requires GitHub configured.
        Permission: create_proposals.

        `owner` was removed and is no longer accepted.
      operationId: api_update_semantic_metric_api_semantic_metrics__name__post
      parameters:
        - in: path
          name: name
          required: true
          schema:
            title: Name
            type: string
      responses:
        '200':
          content:
            application/json:
              schema: {}
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object

````