> ## 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 annotation

> Correct the score and reason of an annotation, for every revision of its metric. The caller becomes the annotator. The id is an annotation id. See [Evaluations](https://docs.galtea.ai/concepts/product/version/session/evaluation).



## OpenAPI

````yaml /openapi.json patch /annotations/{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:
  /annotations/{id}:
    patch:
      tags:
        - annotations
      summary: Update annotation
      description: >-
        Correct the score and reason of an annotation, for every revision of its
        metric. The caller becomes the annotator. The id is an annotation id.
        See
        [Evaluations](https://docs.galtea.ai/concepts/product/version/session/evaluation).
      operationId: updateAnnotation
      parameters:
        - schema:
            type: string
            minLength: 1
            description: Annotation ID.
            example: annotation_123
          required: true
          description: Annotation ID.
          name: id
          in: path
        - $ref: '#/components/parameters/Prefer'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateAnnotationBody'
      responses:
        '200':
          description: >-
            Annotation 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/Annotation'
        '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, or a score outside 0 to 1
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            No user group of the caller grants the session's product with
            evaluation.humanAnnotation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Annotation not found, or of another organization
          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:
    UpdateAnnotationBody:
      type: object
      properties:
        score:
          type: number
          minimum: 0
          maximum: 1
          description: The human score, from 0 to 1.
          example: 0.75
        reason:
          type: string
          nullable: true
          description: >-
            Why the annotator gave this score. Leave it out to keep the current
            reason; null clears it.
          example: Accurate
      required:
        - score
      additionalProperties: false
    Annotation:
      type: object
      properties:
        id:
          type: string
          example: annotation_123
        sessionId:
          type: string
          example: session_123
          description: The annotated session.
        metricId:
          type: string
          description: >-
            Metric ID, shared by every revision of the metric. A revision ID
            answers 404.
          example: metric_123
        inferenceResultId:
          type: string
          nullable: true
          example: inferenceResult_123
          description: >-
            The annotated turn of the session. Null for an annotation of the
            whole session.
        annotatorId:
          type: string
          nullable: true
          example: user_123
          description: The user who last wrote the score. Null once that user is deleted.
        score:
          type: number
          example: 0.75
          description: The human score, from 0 to 1.
        reason:
          type: string
          nullable: true
          example: Accurate
          description: Why the annotator gave this score.
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      required:
        - id
        - sessionId
        - metricId
        - inferenceResultId
        - annotatorId
        - score
        - reason
        - createdAt
        - updatedAt
    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.