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

# Update Metric Definition

> Only the name and the enabled flag are mutable. The predicate and destination metric are fixed at creation: changing them would splice two different meanings into one series with nothing marking the seam, so a changed definition should be a new definition.

Disabling stops new observations within one flush interval (~10s). Bins already written stay and age out with normal metric retention.

The owning project is not mutable either, so the permission needed here is fixed: `alarms.manage` for an org-wide definition, `projects.alarms.manage` on the owner for a project one.



## OpenAPI

````yaml PATCH /orgs/{org_id}/metrics/definitions/{definition_id}
openapi: 3.1.0
info:
  title: Timbal Platform API
  description: Public API documentation for the Timbal platform
  license:
    name: ''
  version: 2.0.0
servers:
  - url: https://api.timbal.ai
    description: Production
  - url: https://api.dev.timbal.ai
    description: Development
security: []
tags:
  - name: ace
    description: Action Control Engine (ACE) operations
  - name: alarms
    description: Metric series and threshold alarms
  - name: analytics
    description: Org and project analytics
  - name: billing
    description: Subscriptions, usage, and payment-related operations
  - name: channels
    description: Delivery channels alarms notify through
  - name: content
    description: Re-sign stored content URLs
  - name: files
    description: File operations
  - name: iam
    description: IAM — actions, roles, users, and authorization introspection
  - name: k2
    description: Knowledge Bases v2 operations
  - name: orgs
    description: Organization operations
  - name: projects
    description: Project operations
  - name: runs
    description: Execution operations
  - name: templates
    description: Public project template catalog
  - name: users
    description: Authenticated user profile
paths:
  /orgs/{org_id}/metrics/definitions/{definition_id}:
    patch:
      tags:
        - alarms
      summary: Rename or enable/disable a custom metric definition
      description: >-
        Only the name and the enabled flag are mutable. The predicate and
        destination metric are fixed at creation: changing them would splice two
        different meanings into one series with nothing marking the seam, so a
        changed definition should be a new definition.


        Disabling stops new observations within one flush interval (~10s). Bins
        already written stay and age out with normal metric retention.


        The owning project is not mutable either, so the permission needed here
        is fixed: `alarms.manage` for an org-wide definition,
        `projects.alarms.manage` on the owner for a project one.
      operationId: update_org_metric_definition
      parameters:
        - name: org_id
          in: path
          required: true
          schema:
            type: string
        - name: definition_id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateMetricDefinitionReq'
        required: true
      responses:
        '204':
          description: Definition updated
          content:
            application/json:
              schema:
                type: 'null'
                description: Successful responses use HTTP 204 and do not include a body.
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - bearer_auth: []
components:
  schemas:
    UpdateMetricDefinitionReq:
      type: object
      description: >-
        Body for **PATCH** `/orgs/{org_id}/metrics/definitions/{id}`.


        Only the knobs that are safe to change in place. The predicate and the

        destination metric are immutable: editing them would splice two
        different

        meanings into one series with no marker at the seam, so a changed

        definition should be a new definition.
      properties:
        enabled:
          type:
            - boolean
            - 'null'
        name:
          type:
            - string
            - 'null'
    ErrorMessage:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          description: Machine-readable error code (e.g. `ALREADY_EXISTS`, `BAD_REQUEST`).
        message:
          type: string
          description: Human-readable description.
  securitySchemes:
    bearer_auth:
      type: http
      scheme: bearer
      description: >-
        Timbal API key. Obtain your API key from the Timbal platform settings.
        See [Authentication](/api-reference/authentication) for more
        information.

````