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

# Update metric

> Change the name, description or tags of a metric. Every revision shows the change. Any other field answers 400: a change to a judge setting is a new revision. The id is a metric id. A revision id answers 404. See [Metrics](https://docs.galtea.ai/concepts/metric).



## OpenAPI

````yaml /openapi.json patch /v2/metrics/{id}
openapi: 3.0.0
info:
  version: 1.0.0
  title: Product Management Service API
  description: API documentation for Product Management Service
  contact:
    name: Galtea AI
servers:
  - url: https://api.galtea.ai
security:
  - bearerAuth: []
tags: []
externalDocs:
  description: Galtea Platform Documentation
  url: https://docs.galtea.ai
paths:
  /v2/metrics/{id}:
    patch:
      tags:
        - metrics-v2
      summary: Update metric
      description: >-
        Change the name, description or tags of a metric. Every revision shows
        the change. Any other field answers 400: a change to a judge setting is
        a new revision. The id is a metric id. A revision id answers 404. See
        [Metrics](https://docs.galtea.ai/concepts/metric).
      operationId: updateMetricV2
      parameters:
        - schema:
            type: string
            minLength: 1
            description: >-
              Metric ID. A revision ID answers 404; read a revision under
              /v2/revisions.
            example: metric_123
          required: true
          description: >-
            Metric ID. A revision ID answers 404; read a revision under
            /v2/revisions.
          name: id
          in: path
        - $ref: '#/components/parameters/Prefer'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MetricV2Update'
      responses:
        '200':
          description: >-
            Metric updated successfully. The body is the resource as its GET
            answers it.
          headers:
            Content-Location:
              schema:
                type: string
                description: >-
                  The path of the resource in the body; absent when there is no
                  body
              required: false
              description: >-
                The path of the resource in the body; absent when there is no
                body
            Preference-Applied:
              schema:
                type: string
                enum:
                  - return=minimal
                description: 'Present when the API honored `Prefer: return=minimal`'
              required: false
              description: 'Present when the API honored `Prefer: return=minimal`'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetricV2'
        '204':
          description: >-
            No body: the client sent `Prefer: return=minimal`, or the read after
            the write failed.
          headers:
            Preference-Applied:
              schema:
                type: string
                enum:
                  - return=minimal
                description: 'Present when the API honored `Prefer: return=minimal`'
              required: false
              description: 'Present when the API honored `Prefer: return=minimal`'
        '400':
          description: >-
            Invalid request body, an unknown field, or a name another metric
            uses
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: The caller may not update this metric
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Metric not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  parameters:
    Prefer:
      schema:
        $ref: '#/components/schemas/Prefer'
      required: false
      description: >-
        Send `return=minimal` to get no body back from a write and skip reading
        the resource: a create answers `201` with only `Location`, and an update
        answers `204`.
      name: Prefer
      in: header
  schemas:
    MetricV2Update:
      type: object
      properties:
        name:
          type: string
          example: Accuracy
        description:
          type: string
          nullable: true
          example: Measures the accuracy of responses
        tags:
          type: array
          items:
            type: string
          example:
            - accuracy
            - quality
      additionalProperties: false
    MetricV2:
      type: object
      properties:
        id:
          type: string
          example: metric_123
          description: Metric ID.
        organizationId:
          type: string
          nullable: true
          example: org_123
          description: The organization of the metric. Null for a Galtea metric.
        userId:
          type: string
          nullable: true
          example: user_123
        name:
          type: string
          example: Accuracy
          description: Metric name, unique in its organization.
        description:
          type: string
          nullable: true
          example: Measures the accuracy of responses
        tags:
          type: array
          items:
            type: string
          example:
            - accuracy
            - quality
        documentationUrl:
          type: string
          nullable: true
          example: https://docs.example.com/metrics/accuracy
        source:
          type: string
          nullable: true
          enum:
            - SELF_HOSTED
            - FULL_PROMPT
            - PARTIAL_PROMPT
            - HUMAN_EVALUATION
            - GEVAL
            - DEEPEVAL
            - DETERMINISTIC
            - CLASSIFIER
          example: PARTIAL_PROMPT
          description: >-
            Evaluation method for the metric. `FULL_PROMPT` is deprecated for
            creation — `POST /metrics` rejects it with a 400. Use
            `PARTIAL_PROMPT` for new AI Evaluation metrics. The value remains in
            the enum because existing FULL_PROMPT metrics are still returned by
            reads and filters. `CLASSIFIER` is the Classifier judge, accepted
            only where the deployment enables it.
        activeRevisionId:
          type: string
          nullable: true
          readOnly: true
          example: revision_123
          description: >-
            The revision that evaluations of this metric run. Null when no
            revision is active.
        createdAt:
          type: string
          format: date-time
        disabledAt:
          type: string
          nullable: true
          format: date-time
          readOnly: true
          description: >-
            The metric's own disabled date. It ignores the evaluator model of
            each revision: read a revision for that.
      required:
        - id
        - organizationId
        - userId
        - name
        - description
        - tags
        - documentationUrl
        - source
        - activeRevisionId
        - createdAt
        - disabledAt
    Error:
      type: object
      properties:
        error:
          type: string
          example: Error type
        message:
          type: string
          example: Error message description
    Prefer:
      type: string
      description: >-
        Send `return=minimal` to get no body back from a write and skip reading
        the resource: a create answers `201` with only `Location`, and an update
        answers `204`.
      example: return=minimal
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key authorization. Pass your API key in the Authorization header as
        a Bearer token. Both new (`gsk_*`) and legacy (`gsk-`) API keys are
        accepted, e.g. `Authorization: Bearer gsk_...` or `Authorization: Bearer
        gsk-...`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.