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

# Update Evaluator

> Update evaluator configuration.



## OpenAPI

````yaml PATCH /prompts/{promptId}/evaluators/{evaluatorId}
openapi: 3.1.1
info:
  title: Adaline API
  version: 2.0.0
  description: >-
    Public API for managing Adaline projects, prompts, datasets, evaluators,
    evaluations, providers, models, and deployments.


    Generated from Zod schemas — this spec is the single source of truth.
servers:
  - url: https://api.adaline.ai/v2
    description: Production API
security: []
tags:
  - name: datasets
    description: Manage prompt datasets and their columns and rows.
  - name: projects
    description: List and manage Adaline projects.
  - name: providers
    description: List configured LLM providers and their settings.
  - name: models
    description: List available models across providers.
  - name: prompts
    description: Create and manage prompts and their drafts.
  - name: evaluators
    description: Configure evaluators attached to a prompt.
  - name: evaluations
    description: Run and inspect evaluation results.
  - name: deployments
    description: Retrieve deployed prompt snapshots.
  - name: logs
    description: Ingest execution traces and spans for observability.
paths:
  /prompts/{promptId}/evaluators/{evaluatorId}:
    patch:
      tags:
        - evaluators
      summary: Update an evaluator
      description: Update evaluator configuration.
      operationId: updateEvaluator
      parameters:
        - schema:
            $ref: '#/components/schemas/BaseEntityId'
          required: true
          name: promptId
          in: path
        - schema:
            $ref: '#/components/schemas/BaseEntityId'
          required: true
          name: evaluatorId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                title:
                  $ref: '#/components/schemas/EvaluatorTitle'
                datasetId:
                  $ref: '#/components/schemas/BaseEntityId'
                config:
                  $ref: '#/components/schemas/EvaluatorConfig'
      responses:
        '200':
          description: Evaluator updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Evaluator'
          headers:
            X-Request-Id:
              description: >-
                Unique identifier for the request. Returned in every response.
                Send a custom value to correlate requests, or omit to receive a
                generated UUID.
              schema:
                type: string
                format: uuid
        '400':
          description: Bad request — validation error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized — invalid or missing API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden — API key lacks access.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    BaseEntityId:
      title: Base Entity ID
      type: string
      description: Unique identifier for an entity, between 20 and 80 characters.
      minLength: 20
      maxLength: 80
    EvaluatorTitle:
      title: Evaluator Title
      type: string
      description: Display title for an evaluator, up to 200 characters.
      minLength: 1
      maxLength: 200
    EvaluatorConfig:
      title: Evaluator Config
      description: Evaluator configuration, discriminated by `type`.
      oneOf:
        - title: LLM as a Judge
          type: object
          required:
            - type
            - value
          properties:
            type:
              type: string
              enum:
                - llm-as-a-judge
            value:
              type: string
              description: The judge prompt or identifier.
        - title: Response Length
          type: object
          required:
            - type
            - value
          properties:
            type:
              type: string
              enum:
                - response-length
            value:
              $ref: '#/components/schemas/EvaluatorComparisonRule'
        - title: Latency
          type: object
          required:
            - type
            - value
          properties:
            type:
              type: string
              enum:
                - latency
            value:
              $ref: '#/components/schemas/EvaluatorComparisonRule'
        - title: Cost
          type: object
          required:
            - type
            - value
          properties:
            type:
              type: string
              enum:
                - cost
            value:
              $ref: '#/components/schemas/EvaluatorComparisonRule'
        - title: JavaScript
          type: object
          required:
            - type
            - value
          properties:
            type:
              type: string
              enum:
                - javascript
            value:
              type: string
              description: JavaScript code for the evaluator.
        - title: Text Matcher
          type: object
          required:
            - type
            - value
          properties:
            type:
              type: string
              enum:
                - text-matcher
            value:
              type: object
              required:
                - value
                - operator
              properties:
                value:
                  oneOf:
                    - type: string
                    - type: array
                      items:
                        type: string
                  description: Pattern or values to match against.
                operator:
                  type: string
                  enum:
                    - regex
                    - equals
                    - starts-with
                    - ends-with
                    - contains-all
                    - contains-any
                    - not-contains-any
      discriminator:
        propertyName: type
    Evaluator:
      title: Evaluator
      type: object
      description: An evaluator configuration for running evaluations on datasets.
      properties:
        id:
          $ref: '#/components/schemas/BaseEntityId'
        promptId:
          $ref: '#/components/schemas/BaseEntityId'
        title:
          $ref: '#/components/schemas/EvaluatorTitle'
        datasetId:
          $ref: '#/components/schemas/BaseEntityId'
        config:
          $ref: '#/components/schemas/EvaluatorConfig'
        status:
          type: string
          description: Evaluator lifecycle status.
          enum:
            - active
            - archived
        createdAt:
          $ref: '#/components/schemas/UnixTimestamp'
        updatedAt:
          $ref: '#/components/schemas/UnixTimestamp'
      required:
        - id
        - promptId
        - title
        - datasetId
        - config
        - status
        - createdAt
        - updatedAt
    ErrorResponse:
      title: Error Response
      type: object
      description: >-
        Standard error response envelope. Permits backend-specific sibling
        fields (e.g. Zod issue details) alongside the typed `error`.
      properties:
        error:
          description: >-
            Error details — typed envelope, or a raw string reason when the
            backend's validator produces a short summary (e.g. Zod validation
            fallback).
          oneOf:
            - type: string
            - type: object
              properties:
                code:
                  type: string
                  description: Machine-readable error code.
                  enum:
                    - VALIDATION_ERROR
                    - INVALID_CURSOR
                    - AUTHENTICATION_REQUIRED
                    - FORBIDDEN
                    - RESOURCE_NOT_FOUND
                    - CONFLICT
                    - PAYLOAD_TOO_LARGE
                    - RATE_LIMITED
                    - INTERNAL_ERROR
                message:
                  type: string
                  description: Human-readable error message.
                details:
                  type: array
                  description: Optional field-level validation details.
                  items:
                    type: object
                    properties:
                      field:
                        type: string
                      issue:
                        type: string
                    required:
                      - field
                      - issue
              required:
                - code
                - message
              additionalProperties: true
      required:
        - error
      additionalProperties: true
    EvaluatorComparisonRule:
      title: Evaluator Comparison Rule
      description: >-
        A threshold comparison rule used by evaluator types (latency, cost,
        response-length). The `value` field holds the numeric/expression
        threshold, `unit` is type-specific (e.g. ms, s, USD, words, characters,
        tokens), and `operator` determines the comparison direction.
      type: object
      required:
        - value
        - unit
        - operator
      properties:
        value:
          oneOf:
            - type: number
            - type: string
        unit:
          type: string
        operator:
          type: string
          enum:
            - less
            - greater
            - equals
    UnixTimestamp:
      title: Unix Timestamp
      type: integer
      format: int64
      description: Unix timestamp in milliseconds.
      minimum: 1672511400000
      maximum: 33229420200000
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: 'Workspace API key. Pass as `Authorization: Bearer <key>`.'

````