{
  "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.\nCreate custom AI Checks with specific quality requirements, organize them into Quality Profiles, and run\nevaluations to identify translation issues automatically.\n",
    "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": {
    "/v1/aiChecks": {
      "get": {
        "operationId": "listAiChecks",
        "deprecated": true,
        "tags": [
          "AI Checks"
        ],
        "summary": "List AI Checks",
        "description": "Returns all AI Checks belonging to the caller's organization, sorted by the requested field.",
        "parameters": [
          {
            "name": "sort",
            "in": "query",
            "description": "Field to sort by.",
            "schema": {
              "type": "string",
              "enum": [
                "uid",
                "name"
              ],
              "default": "name"
            }
          },
          {
            "name": "order",
            "in": "query",
            "description": "Sort order.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "asc"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of AI Checks.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiCheckListResponse"
                },
                "example": {
                  "items": [
                    {
                      "uid": "6804a3f2e1b2c3d4e5f60789",
                      "name": "No Yoda Speech",
                      "qualityRequirements": "The translation must not use Yoda-style inverted sentence structure."
                    },
                    {
                      "uid": "6804a3f2e1b2c3d4e5f6078a",
                      "name": "Formal Register",
                      "qualityRequirements": "The translation must use formal language and avoid colloquialisms."
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedResponse"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenResponse"
          },
          "default": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      },
      "post": {
        "operationId": "createAiCheck",
        "deprecated": true,
        "tags": [
          "AI Checks"
        ],
        "summary": "Create AI Check",
        "description": "Creates a new AI Check with custom quality requirements.\n\nRequires **ADMIN** or **OWNER** IDM role.",
        "parameters": [
          {
            "name": "Content-Type",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "example": "application/json"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AiCheckCreateRequest"
              },
              "example": {
                "name": "No Yoda Speech",
                "qualityRequirements": "The translation must not use Yoda-style inverted sentence structure."
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created — the new AI Check.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiCheckResponse"
                },
                "example": {
                  "uid": "6804a3f2e1b2c3d4e5f60789",
                  "name": "No Yoda Speech",
                  "qualityRequirements": "The translation must not use Yoda-style inverted sentence structure."
                }
              }
            }
          },
          "400": {
            "description": "Bad Request — validation failed (missing required fields or value out of range).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedResponse"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenResponse"
          },
          "default": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/v1/aiChecks/{uid}": {
      "parameters": [
        {
          "name": "uid",
          "in": "path",
          "required": true,
          "description": "Unique identifier of the AI Check.",
          "schema": {
            "type": "string",
            "example": "6804a3f2e1b2c3d4e5f60789"
          }
        }
      ],
      "get": {
        "operationId": "getAiCheck",
        "deprecated": true,
        "tags": [
          "AI Checks"
        ],
        "summary": "Get AI Check",
        "description": "Returns a single AI Check by UID. Returns 404 if the UID does not exist.",
        "responses": {
          "200": {
            "description": "AI Check details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiCheckResponse"
                },
                "example": {
                  "uid": "6804a3f2e1b2c3d4e5f60789",
                  "name": "No Yoda Speech",
                  "qualityRequirements": "The translation must not use Yoda-style inverted sentence structure."
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedResponse"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenResponse"
          },
          "404": {
            "description": "AI Check not found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      },
      "put": {
        "operationId": "updateAiCheck",
        "deprecated": true,
        "tags": [
          "AI Checks"
        ],
        "summary": "Update AI Check",
        "description": "Updates an existing AI Check.",
        "parameters": [
          {
            "name": "Content-Type",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "example": "application/json"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AiCheckUpdateRequest"
              },
              "example": {
                "name": "No Yoda Speech",
                "qualityRequirements": "The translation must not use Yoda-style inverted sentence structure. Sentences should follow standard subject-verb-object word order."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "AI Check updated successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiCheckResponse"
                },
                "example": {
                  "uid": "6804a3f2e1b2c3d4e5f60789",
                  "name": "No Yoda Speech",
                  "qualityRequirements": "The translation must not use Yoda-style inverted sentence structure. Sentences should follow standard subject-verb-object word order."
                }
              }
            }
          },
          "400": {
            "description": "Bad Request — validation failed (missing required fields or value out of range).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedResponse"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenResponse"
          },
          "404": {
            "description": "Not Found — no AI Check with this UID exists.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      },
      "delete": {
        "operationId": "deleteAiCheck",
        "deprecated": true,
        "tags": [
          "AI Checks"
        ],
        "summary": "Delete AI Check",
        "description": "Deletes an AI Check by UID. If the check is referenced by any Quality Profile, its UID is automatically removed from those profiles.",
        "responses": {
          "204": {
            "description": "AI Check deleted successfully."
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedResponse"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenResponse"
          },
          "404": {
            "description": "AI Check not found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/v2/aiChecks/{uid}": {
      "parameters": [
        {
          "name": "uid",
          "in": "path",
          "required": true,
          "description": "Unique identifier of the AI Check.",
          "schema": {
            "type": "string",
            "example": "6804a3f2e1b2c3d4e5f60789"
          }
        }
      ],
      "put": {
        "operationId": "updateAiCheckV2",
        "deprecated": true,
        "tags": [
          "AI Checks"
        ],
        "summary": "Update AI Check",
        "description": "Replaces the name and quality requirements of an existing AI Check, and optionally updates its locale restrictions. Returns 404 if the UID does not exist.\n\nWhen `locales` is absent from the request, existing locale restrictions are preserved. When `locales` is an empty array, any previously stored locale restrictions are cleared and the check applies to all locales.\n\nRequires **ADMIN** or **OWNER** IDM role.",
        "parameters": [
          {
            "name": "Content-Type",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "example": "application/json"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AiCheckUpdateRequestV2"
              },
              "examples": {
                "withLocales": {
                  "summary": "Update with locale restrictions",
                  "value": {
                    "name": "No Yoda Speech",
                    "qualityRequirements": "The translation must not use Yoda-style inverted sentence structure.",
                    "locales": [
                      "en_us",
                      "en_gb"
                    ]
                  }
                },
                "clearLocales": {
                  "summary": "Clear locale restrictions (applies to all locales)",
                  "value": {
                    "name": "No Yoda Speech",
                    "qualityRequirements": "The translation must not use Yoda-style inverted sentence structure.",
                    "locales": []
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "AI Check updated successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiCheckResponse"
                },
                "example": {
                  "uid": "6804a3f2e1b2c3d4e5f60789",
                  "name": "No Yoda Speech",
                  "qualityRequirements": "The translation must not use Yoda-style inverted sentence structure.",
                  "locales": [
                    "en_us",
                    "en_gb"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad Request — validation failed (missing required fields or value out of range).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedResponse"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenResponse"
          },
          "404": {
            "description": "Not Found — no AI Check with this UID exists.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/v1/analytics": {
      "get": {
        "operationId": "getAnalytics",
        "tags": [
          "Analytics"
        ],
        "summary": "Get analytics",
        "description": "Returns aggregated daily evaluation rollup data for the caller's organization. Filtered by optional quality profile and date range.",
        "parameters": [
          {
            "name": "qualityProfileUid",
            "in": "query",
            "description": "Filter analytics by Quality Profile UID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "dayAfter",
            "in": "query",
            "description": "Start of the date range, inclusive (UTC). Defaults to the first day of 11 months ago (UTC) if not provided.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "dayBefore",
            "in": "query",
            "description": "End of the date range, inclusive (UTC). Defaults to today (UTC) if not provided.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Analytics data.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyticsListResponse"
                },
                "example": {
                  "items": [
                    {
                      "qualityProfileUid": "6804b1c2d3e4f5a6b7c80123",
                      "day": "2024-03-20T00:00:00Z",
                      "sumProcessed": 1250,
                      "sumLocked": 980,
                      "sumAiuConsumed": 3750
                    },
                    {
                      "qualityProfileUid": "6804b1c2d3e4f5a6b7c80123",
                      "day": "2024-03-19T00:00:00Z",
                      "sumProcessed": 890,
                      "sumLocked": 710,
                      "sumAiuConsumed": 2670
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedResponse"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenResponse"
          },
          "default": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/v2/evaluation": {
      "post": {
        "operationId": "evaluate",
        "deprecated": true,
        "tags": [
          "Evaluation"
        ],
        "summary": "Evaluate segments",
        "description": "**Deprecated.** Use `POST /v3/evaluation` instead.\n\nEvaluates all segments against each AI Check.\n\nExactly one of `qualityProfileUid` or `aiCheckUids` must be provided.\n\nRequires **ADMIN** or **OWNER** IDM role.",
        "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. Returns evaluated segments with per-check results.",
            "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'."
                          }
                        }
                      ]
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad Request — missing required fields, exactly one of `qualityProfileUid` or `aiCheckUids` was not provided, `aiCheckUids` contains more than 3 items, or a referenced UID does not exist in the caller's organization.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedResponse"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenResponse"
          },
          "404": {
            "description": "Not Found — the quality profile or one of the AI Check UIDs does not exist.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/v3/evaluation": {
      "post": {
        "operationId": "evaluateV3",
        "tags": [
          "Evaluation"
        ],
        "summary": "Evaluate segments",
        "description": "Evaluates all segments against the AI Checks resolved from the given Content Group.\n\nWhen no checks are associated with the Content Group, all segments are returned with an empty `results` array — no error is raised.\n\nRequires **ADMIN** or **OWNER** IDM role.",
        "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"
          }
        }
      }
    },
    "/v1/qualityProfiles": {
      "get": {
        "operationId": "listQualityProfiles",
        "deprecated": true,
        "tags": [
          "Quality Profiles"
        ],
        "summary": "List Quality Profiles",
        "description": "**Deprecated.** Quality Profiles are now managed through Content Groups. Use `GET /v3/qualityProfiles/{contentGroupId}` to retrieve a Quality Profile resolved from a Content Group.\n\nReturns all Quality Profiles belonging to the caller's organization. Supports filtering by creator and partial name match. Results are sorted by the requested field.",
        "parameters": [
          {
            "name": "sort",
            "in": "query",
            "description": "Field to sort by.",
            "schema": {
              "type": "string",
              "enum": [
                "name",
                "uid",
                "createdDate",
                "lastModifiedDate",
                "createdByUid"
              ],
              "default": "name"
            }
          },
          {
            "name": "order",
            "in": "query",
            "description": "Sort order.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "asc"
            }
          },
          {
            "name": "createdByUid",
            "in": "query",
            "description": "Filter by the UID of the user who created the profile.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "name",
            "in": "query",
            "description": "Filter by name (case-insensitive, partial match).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of Quality Profiles.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QualityProfileListResponse"
                },
                "example": {
                  "items": [
                    {
                      "uid": "6804b1c2d3e4f5a6b7c80123",
                      "name": "Marketing Content Profile",
                      "aiCheckUids": [
                        "6804a3f2e1b2c3d4e5f60789",
                        "6804a3f2e1b2c3d4e5f6078a"
                      ],
                      "createdDate": "2024-01-15T10:30:00Z",
                      "lastModifiedDate": "2024-03-20T14:45:00Z",
                      "createdByUid": "6804c9d0e1f2a3b4c5d60456"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedResponse"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenResponse"
          },
          "default": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      },
      "post": {
        "operationId": "createQualityProfile",
        "deprecated": true,
        "tags": [
          "Quality Profiles"
        ],
        "summary": "Create Quality Profile",
        "description": "**Deprecated.** Quality Profiles are now managed through Content Groups.\n\nCreates a new Quality Profile. Up to 3 AI Check UIDs may be specified.\n\nRequires **ADMIN** or **OWNER** IDM role.",
        "parameters": [
          {
            "name": "Content-Type",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "example": "application/json"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QualityProfileCreateRequest"
              },
              "example": {
                "name": "Marketing Content Profile",
                "aiCheckUids": [
                  "6804a3f2e1b2c3d4e5f60789",
                  "6804a3f2e1b2c3d4e5f6078a"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created — the new Quality Profile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QualityProfileResponse"
                },
                "example": {
                  "uid": "6804b1c2d3e4f5a6b7c80123",
                  "name": "Marketing Content Profile",
                  "aiChecks": [
                    {
                      "uid": "6804a3f2e1b2c3d4e5f60789",
                      "name": "No Yoda Speech",
                      "qualityRequirements": "The translation must not use Yoda-style inverted sentence structure."
                    },
                    {
                      "uid": "6804a3f2e1b2c3d4e5f6078a",
                      "name": "Formal Register",
                      "qualityRequirements": "The translation must use formal language and avoid colloquialisms."
                    }
                  ],
                  "createdDate": "2024-01-15T10:30:00Z",
                  "lastModifiedDate": "2024-01-15T10:30:00Z",
                  "createdByUid": "6804c9d0e1f2a3b4c5d60456"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request — `name` is missing, an AI Check UID does not exist, or more than 3 AI Check UIDs are supplied.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedResponse"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenResponse"
          },
          "default": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/v1/qualityProfiles/{uid}": {
      "parameters": [
        {
          "name": "uid",
          "in": "path",
          "required": true,
          "description": "Unique identifier of the Quality Profile.",
          "schema": {
            "type": "string",
            "example": "6804b1c2d3e4f5a6b7c80123"
          }
        }
      ],
      "get": {
        "operationId": "getQualityProfile",
        "deprecated": true,
        "tags": [
          "Quality Profiles"
        ],
        "summary": "Get Quality Profile",
        "description": "**Deprecated.** Use `GET /v3/qualityProfiles/{contentGroupId}` instead.\n\nReturns a Quality Profile with its associated AI Checks. Returns 404 if the UID does not exist.",
        "responses": {
          "200": {
            "description": "Quality Profile details, including its AI Checks.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QualityProfileResponse"
                },
                "example": {
                  "uid": "6804b1c2d3e4f5a6b7c80123",
                  "name": "Marketing Content Profile",
                  "aiChecks": [
                    {
                      "uid": "6804a3f2e1b2c3d4e5f60789",
                      "name": "No Yoda Speech",
                      "qualityRequirements": "The translation must not use Yoda-style inverted sentence structure."
                    },
                    {
                      "uid": "6804a3f2e1b2c3d4e5f6078a",
                      "name": "Formal Register",
                      "qualityRequirements": "The translation must use formal language and avoid colloquialisms."
                    }
                  ],
                  "createdDate": "2024-01-15T10:30:00Z",
                  "lastModifiedDate": "2024-03-20T14:45:00Z",
                  "createdByUid": "6804c9d0e1f2a3b4c5d60456"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedResponse"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenResponse"
          },
          "404": {
            "description": "Quality Profile not found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      },
      "put": {
        "operationId": "updateQualityProfile",
        "deprecated": true,
        "tags": [
          "Quality Profiles"
        ],
        "summary": "Update Quality Profile",
        "description": "**Deprecated.** Quality Profiles are now managed through Content Groups.\n\nReplaces the name and AI Check list of a Quality Profile. Up to 3 AI Check UIDs may be specified.",
        "parameters": [
          {
            "name": "Content-Type",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "example": "application/json"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QualityProfileUpdateRequest"
              },
              "example": {
                "name": "Marketing Content Profile",
                "aiCheckUids": [
                  "6804a3f2e1b2c3d4e5f60789",
                  "6804a3f2e1b2c3d4e5f6078a",
                  "6804a3f2e1b2c3d4e5f6078b"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Quality Profile updated successfully. Returns the updated profile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QualityProfileResponse"
                },
                "example": {
                  "uid": "6804b1c2d3e4f5a6b7c80123",
                  "name": "Marketing Content Profile",
                  "aiChecks": [
                    {
                      "uid": "6804a3f2e1b2c3d4e5f60789",
                      "name": "No Yoda Speech",
                      "qualityRequirements": "The translation must not use Yoda-style inverted sentence structure."
                    },
                    {
                      "uid": "6804a3f2e1b2c3d4e5f6078a",
                      "name": "Formal Register",
                      "qualityRequirements": "The translation must use formal language and avoid colloquialisms."
                    },
                    {
                      "uid": "6804a3f2e1b2c3d4e5f6078b",
                      "name": "Brand Terminology",
                      "qualityRequirements": "The translation must use approved brand terminology as defined in the glossary."
                    }
                  ],
                  "createdDate": "2024-01-15T10:30:00Z",
                  "lastModifiedDate": "2024-03-20T14:45:00Z",
                  "createdByUid": "6804c9d0e1f2a3b4c5d60456"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request — an AI Check UID does not exist, or more than 3 AI Check UIDs are supplied.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedResponse"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenResponse"
          },
          "404": {
            "description": "Not Found — no Quality Profile with this UID exists.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      },
      "delete": {
        "operationId": "deleteQualityProfile",
        "deprecated": true,
        "tags": [
          "Quality Profiles"
        ],
        "summary": "Delete Quality Profile",
        "description": "**Deprecated.** Quality Profiles are now managed through Content Groups.\n\nPermanently deletes a Quality Profile. The AI Checks referenced by this profile are not deleted.",
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedResponse"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenResponse"
          },
          "404": {
            "description": "Not Found — no Quality Profile with this UID exists.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetail"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    },
    "/v3/qualityProfiles/{contentGroupId}": {
      "parameters": [
        {
          "name": "contentGroupId",
          "in": "path",
          "required": true,
          "description": "ID of the Content Group whose Quality Profile is to be retrieved.",
          "schema": {
            "type": "string",
            "example": "cg-abc123"
          }
        },
        {
          "name": "locale",
          "in": "query",
          "required": false,
          "description": "When provided, only rules that apply to the given locale are returned. When absent, all rules for the Content Group are returned regardless of locale restrictions.",
          "schema": {
            "$ref": "#/components/schemas/LocaleCode"
          }
        }
      ],
      "get": {
        "operationId": "getQualityProfileV3",
        "tags": [
          "Quality Profiles"
        ],
        "summary": "Get Quality Profile by Content Group",
        "description": "Returns the Quality Profile for the given Content Group, listing all active rules that have AI check support enabled. The profile is resolved dynamically to reflect the current state of the linked Content Group.\n\nOptionally filter by locale to retrieve only rules that apply to a specific language.",
        "responses": {
          "200": {
            "description": "Quality Profile resolved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QualityProfileV3Response"
                },
                "example": {
                  "rules": [
                    {
                      "id": "rule-abc123",
                      "text": "The translation must not use passive voice.",
                      "locales": []
                    },
                    {
                      "id": "rule-def456",
                      "text": "The translation must use formal language.",
                      "locales": [
                        "de_de",
                        "de_at"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/UnauthorizedResponse"
          },
          "403": {
            "$ref": "#/components/responses/ForbiddenResponse"
          },
          "default": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    }
  },
  "components": {
    "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."
      }
    },
    "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"
            }
          }
        }
      }
    },
    "schemas": {
      "EvaluationRequest": {
        "type": "object",
        "description": "Request to evaluate translation segments. Exactly one of `qualityProfileUid` or `aiCheckUids` must be provided. Supplying both or neither will result in a 400 Bad Request error.",
        "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"
        ]
      },
      "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"
        ]
      },
      "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"
        ]
      },
      "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"
        ]
      },
      "EvaluationItemType": {
        "type": "string",
        "description": "Discriminator for the type of check that produced this result.",
        "enum": [
          "AI_CHECK",
          "QA_CHECK"
        ]
      },
      "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"
        ]
      },
      "AiCheckEvaluation": {
        "type": "object",
        "description": "Evaluation result for an AI Check. `isValid` indicates whether the segment passed,\n`explanation` provides the reasoning. When `hasError` is true, the LLM call failed.\n",
        "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."
          }
        }
      },
      "AiCheckCreateRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Display name for the AI Check.",
            "example": "No Yoda Speech"
          },
          "qualityRequirements": {
            "type": "string",
            "description": "Natural language description of the quality requirements to check.",
            "maxLength": 2000,
            "example": "The translation must not use Yoda-style inverted sentence structure."
          }
        },
        "required": [
          "name",
          "qualityRequirements"
        ]
      },
      "AiCheckUpdateRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Display name for the AI Check.",
            "example": "No Yoda Speech"
          },
          "qualityRequirements": {
            "type": "string",
            "description": "Natural language description of the quality requirements to check.",
            "maxLength": 2000,
            "example": "The translation must not use Yoda-style inverted sentence structure. Sentences should follow standard subject-verb-object word order."
          }
        },
        "required": [
          "name",
          "qualityRequirements"
        ]
      },
      "AiCheckResponse": {
        "type": "object",
        "properties": {
          "uid": {
            "type": "string",
            "example": "6804a3f2e1b2c3d4e5f60789"
          },
          "name": {
            "type": "string",
            "example": "No Yoda Speech"
          },
          "qualityRequirements": {
            "type": "string",
            "maxLength": 2000,
            "example": "The translation must not use Yoda-style inverted sentence structure."
          },
          "locales": {
            "type": "array",
            "description": "Locale codes this AI Check applies to. Absent or empty means the check applies to all locales.",
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/LocaleCode"
            }
          }
        },
        "required": [
          "uid",
          "name",
          "qualityRequirements"
        ]
      },
      "AiCheckListResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AiCheckResponse"
            }
          }
        },
        "required": [
          "items"
        ]
      },
      "QualityProfileCreateRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Display name for the Quality Profile.",
            "example": "Marketing Content Profile"
          },
          "aiCheckUids": {
            "type": "array",
            "description": "UIDs of AI Checks to include in this profile. All must belong to the caller's organization. Maximum 3 items.",
            "maxItems": 3,
            "items": {
              "type": "string",
              "example": "6804a3f2e1b2c3d4e5f60789"
            }
          }
        },
        "required": [
          "name"
        ]
      },
      "QualityProfileUpdateRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Display name for the Quality Profile.",
            "example": "Marketing Content Profile"
          },
          "aiCheckUids": {
            "type": "array",
            "description": "UIDs of AI Checks to include in this profile. All must belong to the caller's organization. Maximum 3 items.",
            "maxItems": 3,
            "items": {
              "type": "string",
              "example": "6804a3f2e1b2c3d4e5f60789"
            }
          }
        },
        "required": [
          "name"
        ]
      },
      "QualityProfileResponse": {
        "type": "object",
        "properties": {
          "uid": {
            "type": "string",
            "example": "6804b1c2d3e4f5a6b7c80123"
          },
          "name": {
            "type": "string",
            "example": "Marketing Content Profile"
          },
          "aiChecks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AiCheckResponse"
            }
          },
          "createdDate": {
            "type": "string",
            "format": "date-time",
            "example": "2024-01-15T10:30:00Z"
          },
          "lastModifiedDate": {
            "type": "string",
            "format": "date-time",
            "example": "2024-03-20T14:45:00Z"
          },
          "createdByUid": {
            "type": "string",
            "example": "6804c9d0e1f2a3b4c5d60456"
          }
        },
        "required": [
          "uid",
          "name",
          "createdDate",
          "createdByUid"
        ]
      },
      "QualityProfileListItemResponse": {
        "type": "object",
        "properties": {
          "uid": {
            "type": "string",
            "example": "6804b1c2d3e4f5a6b7c80123"
          },
          "name": {
            "type": "string",
            "example": "Marketing Content Profile"
          },
          "aiCheckUids": {
            "type": "array",
            "items": {
              "type": "string",
              "example": "6804a3f2e1b2c3d4e5f60789"
            }
          },
          "createdDate": {
            "type": "string",
            "format": "date-time",
            "example": "2024-01-15T10:30:00Z"
          },
          "lastModifiedDate": {
            "type": "string",
            "format": "date-time",
            "example": "2024-03-20T14:45:00Z"
          },
          "createdByUid": {
            "type": "string",
            "example": "6804c9d0e1f2a3b4c5d60456"
          }
        },
        "required": [
          "uid",
          "name",
          "createdDate",
          "createdByUid"
        ]
      },
      "QualityProfileListResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QualityProfileListItemResponse"
            }
          }
        },
        "required": [
          "items"
        ]
      },
      "AnalyticsResponse": {
        "type": "object",
        "properties": {
          "qualityProfileUid": {
            "type": "string",
            "example": "6804b1c2d3e4f5a6b7c80123"
          },
          "day": {
            "type": "string",
            "format": "date-time",
            "example": "2024-03-20T00:00:00Z"
          },
          "sumProcessed": {
            "type": "integer",
            "format": "int64",
            "description": "Total segments processed.",
            "example": 1250
          },
          "sumLocked": {
            "type": "integer",
            "format": "int64",
            "description": "Total segments locked.",
            "example": 980
          },
          "sumAiuConsumed": {
            "type": "integer",
            "format": "int64",
            "description": "Total AI units consumed.",
            "example": 3750
          }
        },
        "required": [
          "day",
          "sumProcessed",
          "sumLocked",
          "sumAiuConsumed"
        ]
      },
      "AnalyticsListResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AnalyticsResponse"
            }
          }
        },
        "required": [
          "items"
        ]
      },
      "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"
      },
      "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."
          }
        }
      },
      "AiCheckUpdateRequestV2": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Display name for the AI Check.",
            "example": "No Yoda Speech"
          },
          "qualityRequirements": {
            "type": "string",
            "description": "Natural language description of the quality requirements to check.",
            "maxLength": 2000,
            "example": "The translation must not use Yoda-style inverted sentence structure."
          },
          "locales": {
            "type": "array",
            "description": "Locale codes this AI Check applies to. When absent, existing locale restrictions are preserved. When an empty array, locale restrictions are cleared and the check applies to all locales.",
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/LocaleCode"
            }
          }
        },
        "required": [
          "name",
          "qualityRequirements"
        ]
      },
      "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"
        ]
      },
      "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"
        ]
      },
      "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"
        ]
      },
      "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"
        ]
      },
      "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."
          }
        }
      },
      "QualityProfileV3Response": {
        "type": "object",
        "description": "Quality Profile resolved from a Content Group — a list of active AI-check-enabled rules.",
        "properties": {
          "rules": {
            "type": "array",
            "description": "Active rules with AI check support enabled for the given Content Group.",
            "items": {
              "$ref": "#/components/schemas/QualityProfileV3Rule"
            }
          }
        },
        "required": [
          "rules"
        ]
      },
      "QualityProfileV3Rule": {
        "type": "object",
        "description": "A single rule that forms part of the Quality Profile.",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier of the rule.",
            "example": "rule-abc123"
          },
          "text": {
            "type": "string",
            "description": "The rule requirement text sent to the LLM for evaluation.",
            "example": "The translation must not use passive voice."
          },
          "locales": {
            "type": "array",
            "description": "Locales the rule is restricted to. An empty array means the rule applies to all locales.",
            "items": {
              "$ref": "#/components/schemas/LocaleCode"
            }
          }
        },
        "required": [
          "id",
          "text",
          "locales"
        ]
      }
    }
  }
}