> ## 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.

# Run quality assurance on selected segments

> Runs quality assurance checks on the given segments and returns any warnings found. Checks can detect issues such as tags and formatting (missing, misplaced, or malformed tags; inconsistent tag content; missing or redundant line breaks), numbers, terminology, spelling, forbidden strings, translation length, whitespace, repeated words, unresolved comments and conversations, and source/target consistency. The response reports per-warning detail (for example tag counts for a JoinTags warning, the misplaced tag for a NestedTags warning, or source/target character positions), pinpointing exactly which segments and tags need attention. By default runs only fast running checks. Source and target language of jobs have to match. Every segment id must belong to the job named in the request, otherwise the request is rejected with 400.



## OpenAPI

````yaml /openapi/phrase-tms-latest.json post /api2/v4/projects/{projectUid}/jobs/qualityAssurances/segments/run
openapi: 3.0.0
info:
  description: |-
    Welcome to Phrase's TMS API documentation. 

     Please visit our [help center](https://support.phrase.com/hc/en-us/sections/5709662083612) for more information about the APIs. 

     If you have any questions, please contact [Support](https://support.phrase.com/hc/requests/new). 

     Please, include the `User-Agent` header with the name of your application or project. It might be a good idea to include some sort of contact information as well, so that we can get in touch if necessary. Examples of excellent `User-Agent` headers:
     > User-Agent: Example mobile app (example@phrase.com) <br/> User-Agent: ACME Inc Java 1.8 Client (http://acmeinc.com/contact)
  version: Latest
  title: Phrase TMS API
servers:
  - url: https://cloud.memsource.com/web
security:
  - ApiToken: []
  - OAuth2: []
tags:
  - name: Additional Workflow Step
  - name: Analysis
  - name: Async Request
  - name: Authentication
  - name: Automations
  - name: Bilingual File
  - name: Business Unit
  - name: Buyer
  - name: Client
  - name: Connections
  - name: Connector
  - name: Conversations
  - name: Cost Center
  - name: Custom Fields
  - name: Custom File Type
  - name: Domain
  - name: Due Date Scheme
  - name: Email Template
  - name: File
  - name: Glossary
  - name: Import settings
  - name: Job
  - name: Language AI
  - name: Language Assets
  - name: Language Quality Assessment
  - name: Machine Translation
  - name: Machine Translation Settings
  - name: Mapping
  - name: Metabase
  - name: Net Rate Scheme
  - name: Notifications
  - name: Price List
  - name: Project
  - name: Project Template
  - name: Provider
  - name: Quality Assurance
  - name: Quality Profile
  - name: Quote
  - name: Reference File
  - name: Segment
  - name: Segmentation Rules
  - name: Service
  - name: Setup
  - name: Spell Check
  - name: SubDomain
  - name: Supported Languages
  - name: Term Base
  - name: Translation
  - name: Translation Memory
  - name: User
  - name: User Profile
  - name: Vendor
  - name: Webhook
  - name: Workflow Step
  - name: Workflow changes
  - name: XML Assistant
paths:
  /api2/v4/projects/{projectUid}/jobs/qualityAssurances/segments/run:
    post:
      tags:
        - Quality Assurance
      summary: Run quality assurance on selected segments
      description: >-
        Runs quality assurance checks on the given segments and returns any
        warnings found. Checks can detect issues such as tags and formatting
        (missing, misplaced, or malformed tags; inconsistent tag content;
        missing or redundant line breaks), numbers, terminology, spelling,
        forbidden strings, translation length, whitespace, repeated words,
        unresolved comments and conversations, and source/target consistency.
        The response reports per-warning detail (for example tag counts for a
        JoinTags warning, the misplaced tag for a NestedTags warning, or
        source/target character positions), pinpointing exactly which segments
        and tags need attention. By default runs only fast running checks.
        Source and target language of jobs have to match. Every segment id must
        belong to the job named in the request, otherwise the request is
        rejected with 400.
      operationId: runQaForSegmentsV4
      parameters:
        - name: projectUid
          in: path
          description: UID of the project
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QualityAssuranceSegmentsRunDtoV3'
        description: Segments QA run configuration
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QualityAssuranceResponseDtoV3'
        '400':
          description: Bad Request
        '401':
          description: Not authorized
        '403':
          description: Forbidden
        '404':
          description: Not Found
        '405':
          description: Method not allowed
        '408':
          description: Timeout
        '410':
          description: Gone
        '415':
          description: Unsupported media type
        '429':
          description: Too many requests
        '500':
          description: Internal server error
        '501':
          description: Not implemented
components:
  schemas:
    QualityAssuranceSegmentsRunDtoV3:
      type: object
      required:
        - jobsAndSegments
      properties:
        jobsAndSegments:
          type: array
          description: Jobs and their specific segment IDs to run QA on; 1–100 entries
          items:
            $ref: '#/components/schemas/JobPartSegmentsDtoV3'
          maxItems: 100
          minItems: 1
        maxQaWarningsCount:
          type: integer
          format: int32
          description: >-
            Maximum number of QA warnings in result, default: 100. For
            efficiency reasons QA

            warnings are processed with minimum segments chunk size 10,
            therefore slightly more warnings are returned.
          minimum: 1
          maximum: 1000
        warningTypes:
          type: array
          description: >-
            Filter results to these warning types; when empty only fast checks
            run. Each

            value flags:

            - `Formatting`: tags/formatting are missing or invalid, or there are
            missing or redundant line breaks

            - `JoinTags`: the tag count in a joined segment's translation does
            not match the source

            - `EmptyPairTags`: a paired tag has no content between its opening
            and closing tag

            - `InconsistentTagContent`: the same tag holds different content
            across repeated occurrences in the segment

            - `EmptyTagContent`: a tag's metadata content is empty when it
            should not be

            - `NestedTags`: a tag is nested in the wrong position relative to
            its sibling tags (missing/misplaced tags)

            - `Malformed`: the segment's tag markup is malformed and could not
            be parsed

            - `MissingNumbersV3`: a number present in the source is missing from
            the translation

            - `ExtraNumbersV3`: the translation contains a number not present in
            the source

            - `NonConformingTerm`: the translated term does not match the
            assigned term base entry; `strict` tells whether the finding is
            Strict, and each entry of `suggestedTargetTerms` has its own
            `strict` value (always `true` or `false` on this warning type,
            omitted on terms of other warning types)

            - `ForbiddenTerm`: the translation uses a term marked forbidden in
            the term base

            - `SpellCheck`: the translation contains a misspelled word

            - `ForbiddenString`: the translation contains a string prohibited
            for the project

            - `TranslationLength`: the target length is outside the range
            configured in the project's target-length settings

            - `AbsoluteLength`: the target length exceeds the absolute character
            limit configured for target length

            - `RelativeLength`: the target length is outside the percentage
            limit (vs. source length) configured for target length

            - `MultipleSpacesV3`: the translation has consecutive spaces the
            source does not have

            - `LeadingAndTrailingSpaces`: the translation has extra or missing
            whitespace at its start or end

            - `RepeatedWord`: a word is repeated consecutively in the
            translation

            - `UnresolvedComment`: deprecated, no longer produced by new QA runs

            - `UnresolvedConversation`: the segment has an unresolved LQA
            conversation

            - `InconsistentTranslationTargetSource`: the same translation is
            used for different source segments

            - `InconsistentTranslationSourceTarget`: the same source text is
            translated inconsistently across segments

            - `TargetSourceIdentical`: the translation is identical to the
            source text
          items:
            type: string
            enum:
              - EmptyTranslation
              - TrailingPunctuation
              - Formatting
              - JoinTags
              - MissingNumbersV3
              - MultipleSpacesV3
              - NonConformingTerm
              - NotConfirmed
              - TranslationLength
              - AbsoluteLength
              - RelativeLength
              - UnresolvedComment
              - EmptyPairTags
              - InconsistentTranslationTargetSource
              - InconsistentTranslationSourceTarget
              - ForbiddenString
              - SpellCheck
              - RepeatedWord
              - InconsistentTagContent
              - EmptyTagContent
              - Malformed
              - ForbiddenTerm
              - NewerAtLowerLevel
              - LeadingAndTrailingSpaces
              - LeadingSpaces
              - TrailingSpaces
              - TargetSourceIdentical
              - SourceOrTargetRegexp
              - UnmodifiedFuzzyTranslation
              - UnmodifiedFuzzyTranslationTM
              - UnmodifiedFuzzyTranslationMTNT
              - Moravia
              - ExtraNumbersV3
              - UnresolvedConversation
              - NestedTags
              - FuzzyInconsistencyTargetSource
              - FuzzyInconsistencySourceTarget
              - CustomQA
              - MissingNonTranslatableAnnotation
          maxItems: 100
          minItems: 0
    QualityAssuranceResponseDtoV3:
      type: object
      properties:
        finished:
          type: boolean
          description: >-
            True if all QA checks completed; false if truncated by
            maxQaWarningsCount
        segmentWarnings:
          type: array
          description: >-
            Warnings grouped by segment; only segments with warnings are
            included
          items:
            $ref: >-
              #/components/schemas/QualityAssuranceResponseDtoSegmentWarningsDtoV3
    JobPartSegmentsDtoV3:
      type: object
      required:
        - job
        - segments
      properties:
        job:
          $ref: '#/components/schemas/UidReference'
        segments:
          type: array
          description: Segment identifiers within the job to run QA on
          items:
            type: string
    QualityAssuranceResponseDtoSegmentWarningsDtoV3:
      type: object
      properties:
        ignoredChecks:
          type: array
          description: QA check types that were ignored for this segment
          items:
            type: string
        segmentId:
          type: string
          description: Identifier of the segment
        warnings:
          type: array
          description: QA warnings for this segment
          items:
            $ref: '#/components/schemas/SegmentWarningDtoV3'
    UidReference:
      type: object
      required:
        - uid
      properties:
        uid:
          type: string
          example: 3HYnHHLkTPJfMxBCDbPXFe
          description: Unique identifier of the referenced object
      description: Reference to an object by its unique identifier
    SegmentWarningDtoV3:
      type: object
      required:
        - type
      discriminator:
        propertyName: type
      properties:
        id:
          type: string
        ignored:
          type: boolean
        repetitionGroupId:
          type: string
        type:
          type: string
          description: Response differs based on the warning type.
  securitySchemes:
    ApiToken:
      description: >-
        Get a token from `auth/login` [endpoint](#operation/login) and then pass
        it in the `Authorization` HTTP header in every subsequent API call. For
        more information visit our [help
        center](https://support.phrase.com/hc/en-us/articles/5709662181404-API-Authentication-TMS-#token-0-0).
      type: apiKey
      name: Authorization
      in: header
    OAuth2:
      description: >-
        A standard OAuth 2.0 authorization code flow. For more information visit
        our [help
        center](https://support.phrase.com/hc/en-us/articles/5709662181404-API-Authentication-TMS-#oauth-2-0-0-1).
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://cloud.memsource.com/web/oauth/authorize
          tokenUrl: https://cloud.memsource.com/web/oauth/token
          scopes: {}

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.