> ## 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 the quality of supplied translation segments using AI Checks from a Quality Profile
or a list of specific AI Check UIDs.

Exactly one of `qualityProfileUid` or `aiCheckUids` must be provided.

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



## OpenAPI

````yaml /openapi/phrase-quality-evaluator.json post /v2/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:
  /v2/evaluation:
    post:
      tags:
        - Evaluation
      summary: Evaluate segments
      description: >-
        Evaluates the quality of supplied translation segments using AI Checks
        from a Quality Profile

        or a list of specific AI Check UIDs.


        Exactly one of `qualityProfileUid` or `aiCheckUids` must be provided.


        Requires **ADMIN** or **OWNER** IDM role.
      operationId: evaluate
      parameters:
        - name: Content-Type
          description: Media type of the request body.
          in: header
          required: true
          schema:
            type: string
            example: application/json
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EvaluationRequest'
            examples:
              qualityProfile:
                summary: Using a Quality Profile
                value:
                  qualityProfileUid: 6804b1c2d3e4f5a6b7c80123
                  segments:
                    - id: segment-1
                      source: Hello, world!
                      target: Hallo, Welt!
                  sourceLocaleCode: en_us
                  targetLocaleCode: de_de
              aiChecks:
                summary: Using specific AI Checks
                value:
                  aiCheckUids:
                    - 6804a3f2e1b2c3d4e5f60789
                    - 6804a3f2e1b2c3d4e5f6078a
                  segments:
                    - source: Hello, world!
                      target: Hallo, Welt!
                  sourceLocaleCode: en_us
                  targetLocaleCode: de_de
      responses:
        '200':
          description: Evaluation completed successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EvaluationResponse'
              example:
                qualityProfileUid: 6804b1c2d3e4f5a6b7c80123
                segments:
                  - id: segment-1
                    source: Hello, world!
                    target: Hallo, Welt!
                    results:
                      - type: AI_CHECK
                        aiCheckUid: 6804a3f2e1b2c3d4e5f60789
                        evaluation:
                          isValid: true
                          explanation: >-
                            The translation uses standard German sentence
                            structure.
                      - type: AI_CHECK
                        aiCheckUid: 6804a3f2e1b2c3d4e5f6078a
                        evaluation:
                          isValid: false
                          explanation: >-
                            The translation uses informal greeting 'Hallo'
                            instead of formal 'Guten Tag'.
        '401':
          $ref: '#/components/responses/UnauthorizedResponse'
        '403':
          $ref: '#/components/responses/ForbiddenResponse'
        '404':
          description: Quality Profile or AI Check not found.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
        default:
          $ref: '#/components/responses/ErrorResponse'
components:
  schemas:
    EvaluationRequest:
      type: object
      description: >
        Request to evaluate translation segments. Exactly one of
        `qualityProfileUid` or `aiCheckUids` must be provided.
      properties:
        qualityProfileUid:
          type: string
          description: >-
            UID of the Quality Profile to use for evaluation. Cannot be combined
            with `aiCheckUids`.
        aiCheckUids:
          type: array
          description: >-
            List of AI Check UIDs to evaluate against. Cannot be combined with
            `qualityProfileUid`. Maximum 3 items.
          maxItems: 3
          items:
            type: string
        segments:
          type: array
          description: Segments to evaluate.
          minItems: 1
          maxItems: 200
          items:
            $ref: '#/components/schemas/RequestSegment'
        sourceLocaleCode:
          $ref: '#/components/schemas/LocaleCode'
        targetLocaleCode:
          $ref: '#/components/schemas/LocaleCode'
      required:
        - segments
        - sourceLocaleCode
        - targetLocaleCode
    EvaluationResponse:
      type: object
      description: Evaluation results for v2 endpoint.
      properties:
        qualityProfileUid:
          type: string
          description: >-
            UID of the Quality Profile used for evaluation. Null when evaluating
            by AI Check UIDs directly.
        segments:
          type: array
          description: Evaluated segments with all AI Check results nested per segment.
          items:
            $ref: '#/components/schemas/EvaluatedSegment'
      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.
    RequestSegment:
      type: object
      description: A translation segment to evaluate.
      properties:
        id:
          type: string
          description: Optional identifier for the segment.
        source:
          type: string
          description: Source text that was translated.
        target:
          type: string
          description: Translated text to evaluate.
      required:
        - source
        - target
    LocaleCode:
      type: string
      description: >
        Locale code (e.g., `en_us`, `de_de`, `fr_fr`). Case-insensitive,
        supports both underscore and hyphen separators.
      example: en_us
    EvaluatedSegment:
      type: object
      description: A single segment with all AI Check evaluation results.
      properties:
        id:
          type: string
          description: >-
            Segment identifier. If provided in the request, it is returned here;
            otherwise omitted.
        source:
          type: string
          description: Source text.
        target:
          type: string
          description: Translated text.
        results:
          type: array
          description: Results from all AI Checks for this segment.
          items:
            $ref: '#/components/schemas/AiCheckResult'
      required:
        - source
        - target
        - results
    AiCheckResult:
      type: object
      description: Result from a single AI Check for a segment.
      properties:
        type:
          $ref: '#/components/schemas/EvaluationItemType'
          description: Type of check (always AI_CHECK for v2).
        aiCheckUid:
          type: string
          description: UID of the AI Check that produced this result.
        evaluation:
          $ref: '#/components/schemas/AiCheckEvaluation'
      required:
        - type
        - aiCheckUid
        - evaluation
    EvaluationItemType:
      type: string
      description: Discriminator for the type of check that produced this result.
      enum:
        - AI_CHECK
    AiCheckEvaluation:
      type: object
      description: >
        Evaluation result for an AI 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 AI Check.
        explanation:
          type: string
          description: Reasoning from the AI Check explaining the evaluation result.
        hasError:
          type: boolean
          description: True when the AI 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.

````