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

# Create New Evaluator Rule

> Create a new Evaluator Rule



## OpenAPI

````yaml POST /v3/evaluator-rules
openapi: 3.0.3
info:
  title: Fiddler API - 2.0
  description: APIs to interact with Fiddler
  termsOfService: https://fiddler.ai/about/terms
  contact:
    email: support@fiddler.ai
  license:
    name: Proprietary
    url: '2.0'
  version: '2.0'
servers: []
security:
  - BearerAuth: []
tags:
  - name: access-key
    description: CRUD operations for API keys
  - name: span-v3
  - name: aggregation-invalidation-request-v3
    description: Endpoints related to retrieving aggregation invalidation requests
  - name: alert-rules-v3
    description: CRUD for Alert Rules, Summary, and Stats APIs
  - name: application-v3
  - name: attribute-v3
  - name: auth
    description: Authentication strategies and login flows
  - name: baseline-v3
    description: CRUD for baseline
  - name: catalog-v3
    description: >-
      Entity catalog provides paginated, searchable discovery of entity names
      (attribute keys, agent names, span types, span names) and their distinct
      values. Powered by ClickHouse materialized views — no worker or PostgreSQL
      dependency.
  - name: chart-annotation-v3
    description: Endpoints related to retrieving chart annotations
  - name: chart-v3
    description: CRUD for chart
  - name: queries-v3
    description: v3 queries API
  - name: configuration-v3
    description: CRUD for configurations
  - name: custom-metrics-v3
  - name: dimensionality-reduction-v3
  - name: environment-v3
    description: Endpoints related to environment management
  - name: evals
  - name: datasets
  - name: evaluation-v3
  - name: evaluator-v3
  - name: rule-evaluators-v3
  - name: experiment-v3
  - name: explainability-v3
  - name: llm_rca-v3
  - name: file-upload
    description: Endpoints related to file uploading.
  - name: fql-expressions-v3
    description: >
      Endpoints for listing FQL (Fiddler Query Language) functions available for
      GenAI custom metrics. Used by the frontend for autocomplete and signature
      hints in the FQL editor.
  - name: genai-alert-rules-v3
    description: CRUD API for GenAI Alert Rules
  - name: genai-custom-metrics-v3
    description: API for GenAI Custom Metrics
  - name: genai-metrics-v3
    description: >-
      Endpoints for pre-aggregated GenAI metrics. All metric data is
      pre-aggregated by an hourly ClickHouse refreshable materialized view; no
      real-time aggregation is performed at request time.
  - name: guardrails-api
    description: Endpoints related to retrieving Guardrails specific data
  - name: ingestion-v3
  - name: intercom-api
    description: Endpoints related to intercom APIs
  - name: jobs-v3
  - name: llm-gateway-v3
  - name: auth-login
  - name: auth-logout
  - name: metrics-v3
    description: Metrics endpoints
  - name: model-v3
  - name: dashboard-v3
  - name: model-deployment-v3
  - name: monitoring-summary-v3
  - name: histograms-v3
  - name: organization-roles-v3
    description: Update user org role
  - name: organization-settings-v3
    description: Update organization settings such as timezone, email configuration, etc.
  - name: pagerduty-api
    description: CRUD for Pagerduty services.
  - name: project-v3
  - name: project-roles-v3
    description: Project role assignment management
  - name: scores-v3
    description: Unified CRUD for scores and annotations
  - name: searchable-text-key-v3
    description: >-
      Manage the global searchable text keys table that controls which OTel
      attribute keys are routed to the full-text-searchable `ValueContent`
      column in the unified attributes table. Changes propagate to the backing
      ClickHouse dictionary within 1-2 minutes and affect all tenants.
  - name: segments-v3
  - name: semantic-mapping-v3
    description: >-
      Manage the global semantic name mappings table that maps raw OTel
      attribute keys to canonical semantic concepts. Changes propagate to the
      backing ClickHouse dictionary within 1-2 minutes and affect all tenants.
  - name: server-info-v3
    description: Endpoints related to retrieving server information
  - name: sessions-v3
    description: v3 session APIs
  - name: team-roles-v3
  - name: team-v3
  - name: traces-v3
    description: v3 trace api for monitoring
  - name: fetch-sessions-v3
    description: v3 fetch sessions api for monitoring
  - name: user-access-key
    description: >
      CRUD operations for user API keys. All endpoints are user-scoped — each
      user can only operate on their own API keys. No one including Org admins
      have access to other users' API keys.
  - name: users-v3
  - name: version-compatibility-v3
  - name: webhooks
externalDocs:
  url: https://docs.fiddler.ai
  description: Find out more about Fiddler
paths:
  /v3/evaluator-rules:
    post:
      tags:
        - evaluator-rules-v3
      summary: Create New Evaluator Rule
      description: Create a new Evaluator Rule
      operationId: createEvaluatorRuleV3
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RuleEvaluatorRequest'
      responses:
        '200':
          description: Details of the created evaluator rule
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/RuleEvaluator'
        '400':
          $ref: '#/components/responses/400'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
components:
  schemas:
    RuleEvaluatorRequest:
      type: object
      title: Rule Evaluator Request
      description: Request body for creating a Rule evaluator with filters
      required:
        - name
        - application_id
        - evaluator_id
      properties:
        name:
          type: string
          description: Name of the Rule evaluator
        application_id:
          type: string
          format: uuid
          description: Application UUID
        evaluator_id:
          type: string
          format: uuid
          description: UUID of the corresponding evaluator
        mapped_input_keys:
          type: object
          nullable: true
          additionalProperties:
            anyOf:
              - type: string
              - type: array
                items:
                  type: string
          description: >-
            Mapping of input field names to verbatim span attribute keys
            (framework-specific). Mutually exclusive with
            `mapped_semantic_names` — provide exactly one.
        mapped_semantic_names:
          type: object
          nullable: true
          additionalProperties:
            anyOf:
              - type: string
              - type: array
                items:
                  type: string
          description: >-
            Mapping of input field names to semantic concept names
            (framework-agnostic). Same structure as `mapped_input_keys` but
            values are semantic concepts instead of literal attribute keys. The
            enrichment worker resolves each concept to all mapped attribute keys
            at evaluation time via the semantic mapping cache. Valid concepts:
            `input`, `output`, `system_instructions`, `retrieval_context`,
            `tool_input`, `tool_output`. Mutually exclusive with
            `mapped_input_keys` — provide exactly one.
        filters:
          $ref: '#/components/schemas/EvaluatorRuleFilters'
        backfill:
          description: Whether to backfill already ingested spans
          type: boolean
          default: false
        sampling_rate:
          description: >-
            Fraction of matching spans on which this evaluator runs, in the
            half-open range (0.0, 1.0]. Defaults to 1.0 (every matching span).
            Traces are always persisted even when downsampling is enabled. To
            pause evaluation entirely, create the rule and then PATCH it with
            `enabled=false` — a small `sampling_rate` is not a pause mechanism
            (and `enabled` is not accepted on this create request).
          default: 1
          allOf:
            - $ref: '#/components/schemas/SamplingRate'
        backfill_start_time:
          description: >-
            Starting point for backfill in case backfill is not required for the
            entire period
          type: string
          format: date-time
          nullable: true
    ApiResponse:
      type: object
      description: |
        Response object for standard API responses.
      properties:
        api_version:
          type: string
          default: '3.0'
          enum:
            - '2.0'
            - '3.0'
          description: |
            API version.
        kind:
          type: string
          default: NORMAL
          enum:
            - NORMAL
          description: |
            Type of response, indicating a normal response.
    RuleEvaluator:
      type: object
      description: Rule Evaluator
      required:
        - id
        - name
        - evaluator_id
        - evaluator_name
        - evaluator_type
        - evaluator_type_display_name
        - mapped_input_keys
        - enabled
        - filters
        - outputs
        - backfill
        - created_at
        - updated_at
      allOf:
        - $ref: '#/components/schemas/CreateUpdateTimestamp'
        - type: object
          properties:
            id:
              description: Unique identifier of the Rule evaluator
              type: string
              format: uuid
            name:
              type: string
              description: Name of the Rule evaluator
            evaluator_id:
              type: string
              format: uuid
              description: UUID of the corresponding evaluator
            evaluator_name:
              type: string
              description: Name of the corresponding evaluator
            evaluator_type:
              $ref: '#/components/schemas/EnrichmentName'
            evaluator_type_display_name:
              type: string
              description: Human-readable display name for the evaluator type
            mapped_input_keys:
              type: object
              nullable: true
              additionalProperties:
                anyOf:
                  - type: string
                  - type: array
                    items:
                      type: string
              description: >-
                Mapping of input field names to verbatim span attribute keys.
                Null when `mapped_semantic_names` is set.
            mapped_semantic_names:
              type: object
              nullable: true
              additionalProperties:
                anyOf:
                  - type: string
                  - type: array
                    items:
                      type: string
              description: >-
                Mapping of input field names to semantic concept names. Null
                when `mapped_input_keys` is set.
            filters:
              $ref: '#/components/schemas/EvaluatorRuleFilters'
            outputs:
              $ref: '#/components/schemas/RuleEvaluatorOutputList'
            enabled:
              type: boolean
              description: Indicates if the evaluator is enabled or disabled
            sampling_rate:
              description: >-
                Fraction of matching spans on which this evaluator runs, in
                (0.0, 1.0]. Always present; defaults to 1.0 for rules created
                before this field existed.
              allOf:
                - $ref: '#/components/schemas/SamplingRate'
            application:
              $ref: '#/components/schemas/ApplicationCompact'
            backfill:
              $ref: '#/components/schemas/EvaluatorRuleBackfill'
    EvaluatorRuleFilters:
      type: object
      description: Filters for applying Rule evaluator
      required:
        - condition
        - rules
      properties:
        condition:
          $ref: '#/components/schemas/QueryConditionType'
        rules:
          type: array
          items:
            anyOf:
              - $ref: '#/components/schemas/QueryConditionType'
              - $ref: '#/components/schemas/QueryRule'
    SamplingRate:
      type: number
      format: float
      description: >-
        Shared numeric constraint for an evaluator rule's `sampling_rate`: a
        fraction in the half-open range (0.0, 1.0]. 0.0 is rejected — to pause
        evaluation entirely, PATCH the rule with `enabled=false` instead.
        Referenced via `allOf` so each usage can add its own
        description/default.
      maximum: 1
      minimum: 0
      exclusiveMinimum: true
    CreateUpdateTimestamp:
      type: object
      required:
        - created_at
        - updated_at
      properties:
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: |
            Date and time when the object was created.
        updated_at:
          type: string
          format: date-time
          readOnly: true
          description: |
            Date and time when the object was last updated.
    EnrichmentName:
      type: string
      description: Type of enrichment
      enum:
        - topic_classification
        - embedding
        - token_count
        - answer_relevance
        - coherence
        - conciseness
        - rag_faithfulness
        - pii_detection
        - ftl_prompt_safety
        - secret_detection
        - sentiment_analysis
        - ftl_response_faithfulness
        - llm_as_a_judge
    RuleEvaluatorOutputList:
      type: array
      description: List of outputs for the rule evaluator
      items:
        $ref: '#/components/schemas/RuleEvaluatorOutput'
    ApplicationCompact:
      type: object
      title: ApplicationCompact
      description: >
        Compact version of an application which can be included in the response
        of relevant APIs.
      required:
        - id
        - name
      properties:
        id:
          type: string
          format: uuid
          description: |
            Unique identifier of the application.
        name:
          type: string
          description: |
            Name of the application.
    EvaluatorRuleBackfill:
      type: object
      description: Details of the evaluator rule backfill
      required:
        - id
        - status
        - backfill_start_time
      properties:
        id:
          type: string
          format: uuid
        backfill_start_time:
          type: string
          format: date-time
          nullable: true
        status:
          type: string
          enum:
            - PENDING
            - IN_PROGRESS
            - COMPLETED
            - FAILED
            - PARTIALLY_COMPLETED
    ErrorResponse:
      type: object
      description: |
        Response object for errors returned by the API.
      properties:
        api_version:
          type: string
          default: '3.0'
          enum:
            - '2.0'
            - '3.0'
          description: |
            API version of the response.
        kind:
          type: string
          default: ERROR
          enum:
            - ERROR
          description: |
            Type of response, usually indicating an error.
        error:
          type: object
          properties:
            code:
              type: integer
              format: int32
              description: >
                Represents the code for this error, typically an HTTP response
                code.
              default: 400
              enum:
                - 400
                - 403
                - 404
                - 500
            message:
              type: string
              description: >
                A human-readable message providing more details about the error.
                If there are multiple errors, it will be the message for the
                first error.
              example: Resource Not Found
            errors:
              type: array
              description: >
                Container for additional information regarding the error,
                especially for multiple errors.
              items:
                type: object
                properties:
                  reason:
                    type: string
                    description: >
                      Unique identifier for this error, different from the error
                      code.
                    example: ResourceNotFoundException
                  message:
                    type: string
                    description: >
                      A human-readable message providing more details about the
                      error. If there is only one error, this field will match
                      error.message.
                    example: Resource Not Found
                  help:
                    type: string
                    description: >
                      Link to support or documentation providing more
                      information on the error.
    QueryConditionType:
      type: string
      description: Condition type to apply for filters
      enum:
        - AND
        - OR
    QueryRule:
      type: object
      description: Rule to apply for filters
      required:
        - field
        - operator
        - value
      properties:
        field:
          type: string
          description: Name of the field to apply the filter on
        operator:
          $ref: '#/components/schemas/OperatorType'
        value:
          description: value of the filter
          anyOf:
            - type: string
            - type: number
            - type: boolean
            - type: array
              items:
                type: string
    RuleEvaluatorOutput:
      type: object
      description: Output name and type
      properties:
        name:
          type: string
          description: output name
        type:
          description: output type
          type: string
          enum:
            - boolean
            - string
            - number
            - integer
        possible_values:
          description: List of possible values for categorical outputs
          type: array
          items:
            type: string
    OperatorType:
      type: string
      description: Type of operator
      enum:
        - EQUAL
        - NOT_EQUAL
        - IN
        - NOT_IN
        - LESS
        - LESS_OR_EQUAL
        - GREATER
        - GREATER_OR_EQUAL
        - BETWEEN
  responses:
    '400':
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    '429':
      description: Rate limit exceeded
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
      headers:
        Retry-After:
          schema:
            type: integer
          description: Seconds to wait before retrying
        X-RateLimit-Limit:
          schema:
            type: string
          description: Rate limit policy
        X-RateLimit-Remaining:
          schema:
            type: integer
          description: Remaining requests in current window
        X-RateLimit-Reset:
          schema:
            type: integer
          description: Unix timestamp when the rate limit resets
    '500':
      description: Internal Server Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````