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

# Evaluate segments

> Evaluates all segments against the AI Checks resolved from the given Content Group.

When no checks are associated with the Content Group, all segments are returned with an empty `results` array — no error is raised.

Requires **ADMIN** or **OWNER** IDM role.



## OpenAPI

````yaml /openapi/phrase-quality-evaluator.json post /v3/evaluation
openapi: 3.1.2
info:
  title: Quality Evaluator API
  description: >
    The Quality Evaluator API enables you to evaluate the quality of translated
    segments using AI-powered checks.

    Create custom AI Checks with specific quality requirements, organize them
    into Quality Profiles, and run

    evaluations to identify translation issues automatically.
  version: 1.0.0
  termsOfService: https://phrase.com/terms/
  contact:
    name: Phrase Support
    url: https://support.phrase.com
servers:
  - url: https://eu.phrase.com/quality-evaluator
    description: Production EU
  - url: https://us.phrase.com/quality-evaluator
    description: Production US
security:
  - bearerAuth: []
tags:
  - name: AI Checks
    description: Create and manage AI Checks with custom quality requirements.
  - name: Analytics
    description: Retrieve aggregated evaluation analytics.
  - name: Evaluation
    description: Evaluate translation quality using AI Checks.
  - name: Quality Profiles
    description: Organize AI Checks into reusable Quality Profiles.
paths:
  /v3/evaluation:
    post:
      tags:
        - Evaluation
      summary: Evaluate segments
      description: >-
        Evaluates all segments against the AI Checks resolved from the given
        Content Group.


        When no checks are associated with the Content Group, all segments are
        returned with an empty `results` array — no error is raised.


        Requires **ADMIN** or **OWNER** IDM role.
      operationId: evaluateV3
      parameters:
        - name: Content-Type
          in: header
          required: true
          schema:
            type: string
            example: application/json
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EvaluationV3Request'
            example:
              contentGroupId: cg-abc123
              segments:
                - id: segment-1
                  source: Hello, world!
                  target: Hallo, Welt!
              sourceLocaleCode: en_us
              targetLocaleCode: de_de
      responses:
        '200':
          description: >-
            Evaluation completed successfully. Returns evaluated segments with
            per-check results.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EvaluationV3Response'
              example:
                contentGroupId: cg-abc123
                segments:
                  - id: segment-1
                    source: Hello, world!
                    target: Hallo, Welt!
                    results:
                      - type: AI_CHECK
                        ruleUid: rule-abc123
                        evaluation:
                          isValid: true
                          explanation: >-
                            The translation uses standard German sentence
                            structure.
        '400':
          description: >-
            Bad Request — missing required fields, a segment is missing `id`, or
            segment `id` values are not unique within the request.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
        '401':
          $ref: '#/components/responses/UnauthorizedResponse'
        '403':
          $ref: '#/components/responses/ForbiddenResponse'
        '503':
          description: Service Unavailable — evaluation was interrupted; retry the request.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
        default:
          $ref: '#/components/responses/ErrorResponse'
components:
  schemas:
    EvaluationV3Request:
      type: object
      description: >-
        Request to evaluate translation segments using AI Checks resolved from a
        Content Group.
      properties:
        contentGroupId:
          type: string
          description: ID of the Content Group whose AI Checks are used for evaluation.
        segments:
          type: array
          description: >-
            Segments to evaluate. Each segment's `id` is required and must be
            unique within the request.
          minItems: 1
          maxItems: 200
          items:
            $ref: '#/components/schemas/RequestSegmentV3'
        sourceLocaleCode:
          $ref: '#/components/schemas/LocaleCode'
        targetLocaleCode:
          $ref: '#/components/schemas/LocaleCode'
      required:
        - contentGroupId
        - segments
        - sourceLocaleCode
        - targetLocaleCode
    EvaluationV3Response:
      type: object
      description: Evaluation results for the v3 endpoint.
      properties:
        contentGroupId:
          type: string
          description: ID of the Content Group whose AI Checks were used for evaluation.
        segments:
          type: array
          description: Evaluated segments with all check results nested per segment.
          items:
            $ref: '#/components/schemas/EvaluatedSegmentV3'
      required:
        - segments
    ProblemDetail:
      type: object
      description: Error response following RFC 9457.
      properties:
        type:
          type: string
          description: A URI reference identifying the problem type.
          example: urn:problem-type:unauthorized
        title:
          type: string
          description: A short, human-readable summary of the problem.
          example: Unauthorized
        status:
          type: integer
          description: The HTTP status code.
          example: 401
        detail:
          type: string
          description: A human-readable explanation specific to this occurrence.
          example: Valid credentials were not supplied
        instance:
          type: string
          description: A URI reference identifying the specific occurrence.
    RequestSegmentV3:
      type: object
      description: >-
        A translation segment to evaluate. `id` is required and must be unique
        among all segments in the request; a missing or duplicate `id` results
        in a 400 Bad Request.
      properties:
        id:
          type: string
          description: >-
            Identifier for the segment. Required and must be unique within the
            request.
        source:
          type: string
          description: Source text that was translated.
        target:
          type: string
          description: Translated text to evaluate.
      required:
        - id
        - source
        - target
    LocaleCode:
      type: string
      description: >-
        Locale code compatible with Phrase locale format. Case-insensitive,
        supports both underscore and hyphen separators (e.g., `en_us`, `en-US`,
        `de_de`, `fr_fr`).
      example: en_us
    EvaluatedSegmentV3:
      type: object
      description: A single segment with all evaluation results from v3 checks.
      properties:
        id:
          type: string
          description: >-
            Segment identifier, matching the `id` supplied for this segment in
            the request.
        source:
          type: string
          description: Source text.
        target:
          type: string
          description: Translated text.
        results:
          type: array
          description: Results from all checks for this segment.
          items:
            $ref: '#/components/schemas/CheckResultV3'
      required:
        - id
        - source
        - target
        - results
    CheckResultV3:
      type: object
      description: Result from a single check for a segment.
      properties:
        type:
          $ref: '#/components/schemas/EvaluationItemType'
          description: Type of check.
        ruleUid:
          type: string
          description: UID of the rule that produced this result.
        evaluation:
          $ref: '#/components/schemas/CheckEvaluationV3'
      required:
        - type
        - evaluation
    EvaluationItemType:
      type: string
      description: Discriminator for the type of check that produced this result.
      enum:
        - AI_CHECK
        - QA_CHECK
    CheckEvaluationV3:
      type: object
      description: >-
        Evaluation result for a v3 check. `isValid` indicates whether the
        segment passed, `explanation` provides the reasoning. When `hasError` is
        true, the LLM call failed.
      properties:
        isValid:
          type: boolean
          description: Whether the segment passed this check.
        explanation:
          type: string
          description: Reasoning from the check explaining the evaluation result.
        hasError:
          type: boolean
          description: True when the check could not produce a result (LLM failure).
        errorMessage:
          type: string
          description: Error description when hasError is true.
  responses:
    UnauthorizedResponse:
      description: Authentication failed or credentials not provided.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ProblemDetail'
          example:
            type: urn:problem-type:unauthorized
            title: Unauthorized
            status: 401
            detail: Valid credentials were not supplied
    ForbiddenResponse:
      description: >-
        Insufficient permissions. This operation requires the ADMIN or OWNER IDM
        role.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ProblemDetail'
          example:
            type: urn:problem-type:forbidden
            title: Forbidden
            status: 403
            detail: Insufficient permissions to perform this action
    ErrorResponse:
      description: An error occurred.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ProblemDetail'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Use a Bearer token obtained from Phrase Platform authentication. See the
        Authentication guide for details on how to obtain a token.

````