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

# Get batch JUnit XML report

> Download the batch as a JUnit XML report for CI test reporters and test management tools such as TestRail (`trcli parse_junit -f report.xml`). Preparation runs are omitted. Returns 409 until every run has finished unless `allowIncomplete=true` is set.



## OpenAPI

````yaml /openapi.json get /v1/batches/{batchId}/junit
openapi: 3.0.0
info:
  title: TestArmy API
  version: 1.0.0
  description: >-
    AI-powered browser automation API for QA testing. Automate web testing
    workflows using natural language prompts.
servers:
  - url: https://tester.army/api
    description: Production API server
security: []
paths:
  /v1/batches/{batchId}/junit:
    get:
      tags:
        - Test Runs
      summary: Get batch JUnit XML report
      description: >-
        Download the batch as a JUnit XML report for CI test reporters and test
        management tools such as TestRail (`trcli parse_junit -f report.xml`).
        Preparation runs are omitted. Returns 409 until every run has finished
        unless `allowIncomplete=true` is set.
      parameters:
        - schema:
            type: string
            format: uuid
            description: Batch ID
          required: true
          description: Batch ID
          name: batchId
          in: path
        - schema:
            type: string
            enum:
              - 'true'
              - 'false'
            description: >-
              Export a batch with in-flight runs; unfinished runs render as
              skipped
          required: false
          description: >-
            Export a batch with in-flight runs; unfinished runs render as
            skipped
          name: allowIncomplete
          in: query
      responses:
        '200':
          description: JUnit XML report (served as an attachment)
          content:
            application/xml:
              schema:
                type: string
                description: >-
                  JUnit XML document. One `testsuite` per group-run batch (named
                  after the group), one `testcase` per test. Passing runs have
                  no child element; a FAILED verdict is a `<failure>`; BLOCKED
                  verdicts, runs that crashed before a verdict, and runs that
                  finished without one are `<error>` (type `BLOCKED`, the run
                  error code, or `MISSING_VERDICT`); cancelled, planner-skipped,
                  and unfinished runs are `<skipped>`. Each testcase carries
                  `testerarmy_*` properties plus TestRail
                  `testrail_result_comment` and `testrail_result_step`
                  properties, and a `test_id` property when the test title
                  contains `[C123]`-style case ids, so `trcli parse_junit`
                  imports it directly.
        '400':
          description: Bad Request - Invalid input parameters
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error code or type
                  message:
                    type: string
                    description: Human-readable error message
                required:
                  - error
                  - message
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error code or type
                  message:
                    type: string
                    description: Human-readable error message
                required:
                  - error
                  - message
        '404':
          description: Batch not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error code or type
                  message:
                    type: string
                    description: Human-readable error message
                required:
                  - error
                  - message
        '409':
          description: >-
            Conflict - Some runs are still queued or running; pass
            `allowIncomplete=true` to export as skipped
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error code or type
                  message:
                    type: string
                    description: Human-readable error message
                required:
                  - error
                  - message
        '429':
          description: Too Many Requests - Usage limit exceeded
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error code or type
                  message:
                    type: string
                    description: Human-readable error message
                required:
                  - error
                  - message
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error code or type
                  message:
                    type: string
                    description: Human-readable error message
                required:
                  - error
                  - message
        '504':
          description: Gateway Timeout - Test execution exceeded time limit
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error code or type
                  message:
                    type: string
                    description: Human-readable error message
                required:
                  - error
                  - message
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: API key authentication using Bearer token format

````