openapi: 3.1.0
info:
  title: TMT API
  description: API working with Test folders in TMT
  version: 1.0.0
paths:
  /api/v2/rpc (GET_TEST_RUN):
    post:
      summary: Get test run
      description: >
        Get a test run document by its document reference using the
        GET_TMT_DOCUMENT operation.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GetTmtDocumentRequest'
              examples:
                $ref: example/GET_TEST_RUN-request.json
      responses:
        '200':
          description: GET_TMT_DOCUMENT result containing the test run document
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetTmtDocumentResponse'
                examples:
                  $ref: example/GET_TEST_RUN-response.json
  /api/v2/rpc (LIST_DOCUMENT):
    post:
      summary: List test run documents
      description: List test run documents for given search criteria.
      parameters:
        - $ref: '#/components/parameters/ProjectIdHeader'
        - $ref: '#/components/parameters/SubProjectIdHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ListTestRunDocumentRequest'
              examples:
                jsonrpc: '2.0'
                id: query-test-cases
                method: QUERY
                params:
                  query:
                    projectionName: document
                    targetDocumentModel: TestRun-dm
                    sort:
                      - field: /Root/General/Title
                        direction: ASC
                        ignoreCase: true
                        nullHandling: NULLS_LAST
                    constraint:
                      operator: and
                      operands:
                        - operator: exact_match
                          field: /Root/General/ProjectId
                          value: P_6
                        - operator: exact_match
                          field: /Root/General/SubprojectId
                          value: _
                        - operator: exact_match
                          field: /Root/General/ProjectVersionNumber
                          value: 5.0.0
                    paging:
                      pageNumber: 0
                      pageSize: 50
      responses:
        '200':
          description: List of test runs matched the search criteria
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListTestRunDocumentResponse'
                examples:
                  jsonrpc: '2.0'
                  id: query-test-cases
                  result:
                    fullSize: 1
                    page:
                      pageNumber: 0
                      pageSize: 50
                    entries:
                      - docRef: TestRun-dm/f90f07d9-af24-4cf9-b8ab-26c808d2876a
                        document:
                          Root:
                            General:
                              Id: R_24
                              ProjectId: P_6
                              ProjectVersionNumber: 5.0.0
                              Status: inProgress
                              SubprojectId: _
                              TechnicalId: 11d8382a-710e-4a54-af9a-f08af587a0af
                              TenantId: T_1
                              Title: 'Test run #1'
                            Metadata:
                              CreatedBy: tmtdev
                              CreatedOn: 1776155913699
                              DisplayCreatedOn: '2026-04-14T08:38:33'
                              DisplayEditedOn: '2026-05-07T04:20:16'
                              EditedBy: tmtdoc
                              EditedOn: 1778127616706
                          __meta:
                            createdAt: '2026-04-14T08:38:33'
                            creator: SYSTEM
                            docRef: TestRun-dm/f90f07d9-af24-4cf9-b8ab-26c808d2876a
                            modelReference: TestRun-dm
                            modelVersion: null
                            modifiedAt: '2026-05-07T04:20:16'
                            modifier: tmtdoc
                        type: ROOT
                        depth: 0
                        documentModelName: TestRun-dm
                    links: []
                    otherResults: {}
  /api/v2/rpc (ADD_DOCUMENT):
    post:
      summary: Create a test run
      description: Create a new test run
      parameters:
        - $ref: '#/components/parameters/ProjectIdHeader'
        - $ref: '#/components/parameters/SubProjectIdHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddTestRunRequest'
              examples:
                $ref: example/ADD_TEST_RUN-request.json
      responses:
        '200':
          description: Document reference of created test run
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AddDocumentResponse'
                examples:
                  $ref: example/ADD_TEST_RUN-response.json
  /api/v2/rpc (MODIFY_DOCUMENT):
    post:
      summary: Update test run
      description: Update test run content
      parameters:
        - $ref: '#/components/parameters/ProjectIdHeader'
        - $ref: '#/components/parameters/SubProjectIdHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ModifyTestRunRequest'
              examples:
                $ref: example/MODIFY_TEST_RUN-request.json
      responses:
        '200':
          description: Updated test run's content
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModifyDocumentResponse'
                examples:
                  $ref: example/MODIFY_TEST_RUN-response.json
  /api/v2/rpc (DELETE_TEST_RUN):
    post:
      summary: Delete a test run
      description: >-
        It is only possible to delete an empty run. For non empty test run, you
        must remove its test suites first, which can be done by calling
        DELETE_SUITE_FROM_RUN operation
      parameters:
        - $ref: '#/components/parameters/ProjectIdHeader'
        - $ref: '#/components/parameters/SubProjectIdHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeleteTestRunRequest'
              examples:
                $ref: example/DELETE_TEST_RUN-request.json
      responses:
        '200':
          description: true if successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BooleanDocumentResponse'
                examples:
                  $ref: example/DELETE_TEST_RUN-response.json
  /api/v2/rpc (CHECK_TEST_RUN_EMPTY):
    post:
      summary: Check a run is empty
      description: >-
        Check a run is empty or not. You should call this endpoint before
        deleting a test run.
      parameters:
        - $ref: '#/components/parameters/ProjectIdHeader'
        - $ref: '#/components/parameters/SubProjectIdHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CheckRunEmptyRequest'
              examples:
                $ref: example/CHECK_TEST_RUN_EMPTY-request.json
      responses:
        '200':
          description: true if test run is empty.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BooleanDocumentResponse'
                examples:
                  $ref: example/CHECK_TEST_RUN_EMPTY-response.json
  /api/v2/rpc (GET_AVAILABLE_TEST_SUITES):
    post:
      summary: Get available test suites to add to run
      description: >-
        List all suites that are available to add into Run, which excludes the
        suites already in Run. **This is not applicable for closed run**
      parameters:
        - $ref: '#/components/parameters/ProjectIdHeader'
        - $ref: '#/components/parameters/SubProjectIdHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GetAvailableSuiteRequest'
              examples:
                $ref: example/GET_AVAILABLE_TEST_SUITES-request.json
      responses:
        '200':
          description: Return list of suites
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetAvailableSuiteResponse'
                examples:
                  $ref: example/GET_AVAILABLE_TEST_SUITES-response.json
  /api/v2/rpc (ADD_TEST_SUITES_TO_RUN):
    post:
      summary: Add test suites to open run
      description: Add available test suites to an open run
      parameters:
        - $ref: '#/components/parameters/ProjectIdHeader'
        - $ref: '#/components/parameters/SubProjectIdHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddAvailableSuiteToRunRequest'
              examples:
                $ref: example/ADD_TEST_SUITES_TO_RUN-request.json
      responses:
        '200':
          description: list of relationship spec of test suites that added into run
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AddAvailableSuiteToRunResponse'
                examples:
                  $ref: example/ADD_TEST_SUITES_TO_RUN-response.json
  /api/v2/rpc (DELETE_TEST_SUITES_FROM_RUN):
    post:
      summary: Delete test suites from open run
      description: >-
        Delete the test suites from an open run. **This is not applicable to
        closed run**
      parameters:
        - $ref: '#/components/parameters/ProjectIdHeader'
        - $ref: '#/components/parameters/SubProjectIdHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeleteTestSuiteFromRunRequest'
              examples:
                $ref: example/DELETE_TEST_SUITES_FROM_RUN-request.json
      responses:
        '200':
          description: list of relationship spec of test suites that added into run
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NullDocumentResponse'
                examples:
                  $ref: example/DELETE_TEST_SUITES_FROM_RUN-response.json
security:
  - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
  schemas:
    ModifyTestRunRequest:
      allOf:
        - $ref: '#/components/schemas/ModifyDocumentRequest'
        - type: object
          required:
            - method
            - params
          properties:
            method:
              description: MODIFY_DOCUMENT
            params:
              required:
                - docRef
                - locale
                - document
              properties:
                document:
                  $ref: '#/components/schemas/TestRunDocument'
      examples:
        - id: MODIFY_TEST_RUN
          method: MODIFY_DOCUMENT
          params:
            document:
              Root:
                General:
                  ProjectId: P_9
                  ProjectVersionNumber: 1.2.0
                  SubprojectId: SP_1
                  Status: active
                  Title: Performance test
                  Configuration: qftest, chrome
                  Description: Test the app performance around the order's actions
                  TenantId: T_1
                  TechnicalId: 19612ea0-bd5d-49da-9004-32f54d63645a
                  Id: R_4
                Metadata:
                  CreatedBy: trung
                  DisplayCreatedOn: '2024-11-13T02:09:50'
                  CreatedOn: 1731463790165
                  EditedBy: trung
                  DisplayEditedOn: '2024-11-13T02:09:50'
                  EditedOn: 1731463790165
                Attachments:
                  - FileName: bapserver-metrix-snapshot 10.55.51.png
                    CreatedAt: '2024-11-13T02:09:45'
                    UploadOn: '2024-11-13'
                    OriginalFileName: bapserver-metrix-snapshot 10.55.51.png
                    UploadBy: trung
                    Referenced: false
                    CopyNumber: 0
                    ThumbnailId: 74303fd3-a9e7-498d-bd71-83c05ecdaad6
                    File:
                      content: null
                      attachment_id: d3e5dbda-603f-478d-9b1f-c0c5f10ff776
                      internal_filename: 1731463781565-0886b4f1-f863-473c-9e3d-0aba8cf06158.png
                      original_filename: bapserver-metrix-snapshot 10.55.51.png
                      size: 635194
                      mime_type: image/png
              __meta:
                creator: trung
                modifier: trung
                createdAt: '2024-11-13T02:09:50'
                modifiedAt: '2024-11-13T02:09:50'
                modelReference: TestRun-dm
                docRef: TestRun-dm/3b53beea-a611-462c-9553-703c4df4d669
                modelVersion: null
            locale: en
            docRef: TestRun-dm/3b53beea-a611-462c-9553-703c4df4d669
    AddTestRunRequest:
      allOf:
        - $ref: '#/components/schemas/AddDocumentRequest'
        - type: object
        - required:
            - params
        - properties:
            method:
              type: string
              description: ADD_DOCUMENT
            params:
              type: object
              properties:
                documentModelName:
                  type: string
                  description: TestRun-dm
                document:
                  $ref: '#/components/schemas/TestRunDocumentToAdd'
      examples:
        - id: ADD_TEST_RUN
          method: ADD_DOCUMENT
          params:
            document:
              Root:
                General:
                  ProjectId: P_9
                  ProjectVersionNumber: 1.2.0
                  SubprojectId: SP_1
                  Status: active
                  Title: Performance test
                  Configuration: qftest
                  Description: Test the app performance around the order's actions
                Attachments:
                  - FileName: bapserver-metrix-snapshot 10.55.51.png
                    File:
                      content: null
                      attachment_id: d3e5dbda-603f-478d-9b1f-c0c5f10ff776
                      internal_filename: 1731463781565-0886b4f1-f863-473c-9e3d-0aba8cf06158.png
                      original_filename: bapserver-metrix-snapshot 10.55.51.png
                      size: 635194
                      mime_type: image/png
                    CreatedAt: '2024-11-13T02:09:45'
                    UploadOn: '2024-11-13'
                    OriginalFileName: bapserver-metrix-snapshot 10.55.51.png
                    UploadBy: trung
                    Referenced: false
                    CopyNumber: 0
                    ThumbnailId: 74303fd3-a9e7-498d-bd71-83c05ecdaad6
            documentModelName: TestRun-dm
            locale: en
    TestRunDocumentResponse:
      allOf:
        - $ref: '#/components/schemas/RpcResult'
        - type: object
          properties:
            result:
              allOf:
                - $ref: '#/components/schemas/TestRunDocumentResult'
    ListTestRunDocumentRequest:
      allOf:
        - $ref: '#/components/schemas/QueryOperationRequest'
        - type: object
          properties:
            params:
              properties:
                query:
                  description: |
                    QUERY params. Set `targetDocumentModel` to `TestRun-dm`.
    ListTestRunDocumentResponse:
      allOf:
        - $ref: '#/components/schemas/QueryOperationResponse'
    ListTestRunRequest:
      allOf:
        - $ref: '#/components/schemas/RpcRequestWithIdAndJsonRpc'
        - required:
            - method
            - params
        - properties:
            method:
              description: LIST_TEST_RUNS
            params:
              type: object
              required:
                - page
                - sort
                - filter
              properties:
                filter:
                  $ref: '#/components/schemas/FilterSpec'
                page:
                  $ref: '#/components/schemas/PageSpec'
                sort:
                  type: array
                  $ref: '#/components/schemas/SortSpecArray'
    ListTestRunResponse:
      allOf:
        - $ref: '#/components/schemas/RpcResult'
        - type: object
          properties:
            result:
              properties:
                filterItemMap:
                  type: object
                  properties:
                    Root.DisplayFields.TesterOfTestCases:
                      type: array<string>
                      description: list of testers of all test cases in run
                result:
                  type: object
                  properties:
                    fullSize:
                      type: integer
                      description: Total number of the found item
                    page:
                      $ref: '#/components/schemas/PageSpec'
                    entries:
                      type: array
                      items:
                        allOf:
                          - $ref: '#/components/schemas/TestRunDocumentResultWithId'
    CheckRunEmptyRequest:
      allOf:
        - $ref: '#/components/schemas/RpcRequestWithIdAndJsonRpc'
        - type: object
          required:
            - method
            - params
          properties:
            method:
              type: string
              description: CHECK_TEST_RUN_EMPTY
            params:
              required:
                - testRunDocRef
              properties:
                docRef:
                  type: string
                  description: document reference
      examples:
        - id: CHECK_TEST_RUN_EMPTY_6f1f3601-88bb-47e0-b4b5-42f4ff3596be
          jsonrpc: '2.0'
          method: CHECK_TEST_RUN_EMPTY
          params:
            testRunDocRef: TestRun-dm/3b53beea-a611-462c-9553-703c4df4d669
    DeleteTestRunRequest:
      allOf:
        - $ref: '#/components/schemas/RpcRequestWithIdAndJsonRpc'
        - type: object
          required:
            - method
            - params
          properties:
            method:
              type: string
              description: DELETE_TEST_RUN
            params:
              required:
                - testRunDocRef
              properties:
                docRef:
                  type: string
                  description: document reference
      examples:
        - id: DELETE_TEST_RUN_TestRun-dm/11825df5-4460-479d-a282-e996d804b571
          jsonrpc: '2.0'
          method: DELETE_TEST_RUN
          params:
            testRunDocRef: TestRun-dm/11825df5-4460-479d-a282-e996d804b571
    GetAvailableSuiteRequest:
      allOf:
        - $ref: '#/components/schemas/RpcRequestWithIdAndJsonRpc'
        - type: object
          properties:
            method:
              type: string
              description: GET_AVAILABLE_TEST_SUITES
            params:
              type: object
              required:
                - testRunDocRef
                - query
              properties:
                testRunDocRef:
                  type: string
                  description: test run document reference
                query:
                  $ref: '#/components/schemas/QueryApiRoot'
      examples:
        - jsonrpc: '2.0'
          id: GET_AVAILABLE_TEST_SUITES_fa070684-48b0-48c3-83bc-980403b28513
          method: GET_AVAILABLE_TEST_SUITES
          params:
            testRunDocRef: TestRun-dm/f90f07d9-af24-4cf9-b8ab-26c808d2876a
            query:
              targetDocumentModel: TestSuite-dm
              projectionName: document
              constraint: null
              sort:
                - field: /Root/General/Order
                  direction: ASC
                  nullHandling: NULLS_LAST
                  ignoreCase: true
              paging:
                pageNumber: 0
                pageSize: 50
    GetAvailableSuiteResponse:
      allOf:
        - $ref: '#/components/schemas/QueryOperationResponse'
      examples:
        - jsonrpc: '2.0'
          id: GET_AVAILABLE_TEST_SUITES_fa070684-48b0-48c3-83bc-980403b28513
          result:
            fullSize: 5
            page:
              pageNumber: 0
              pageSize: 50
            entries:
              - docRef: TestSuite-dm/5a6e558b-9f66-491f-9dce-95cc170d4d4b
                documentModelName: TestSuite-dm
                document:
                  Root:
                    General:
                      Id: S_21
                      ProjectId: P_6
                      ProjectVersionNumber: 5.0.0
                      SubprojectId: _
                      Tags: ''
                      TenantId: T_1
                      Title: '1'
                      RecommendedPriority:
                        Value: MEDIUM
                    Metadata:
                      IsFrozenByClosedVersion: false
                    DisplayFields:
                      TotalTestCases: 0
                  __meta:
                    docRef: TestSuite-dm/5a6e558b-9f66-491f-9dce-95cc170d4d4b
              - docRef: TestSuite-dm/80c16135-046c-4eb1-a821-6362683b4a70
                documentModelName: TestSuite-dm
                document:
                  Root:
                    General:
                      Id: S_20
                      ProjectId: P_6
                      ProjectVersionNumber: 5.0.0
                      SubprojectId: _
                      Tags: ''
                      TenantId: T_1
                      Title: '1'
                      RecommendedPriority:
                        Value: MEDIUM
                    Metadata:
                      IsFrozenByClosedVersion: false
                    DisplayFields:
                      TotalTestCases: 0
                  __meta:
                    docRef: TestSuite-dm/80c16135-046c-4eb1-a821-6362683b4a70
              - docRef: TestSuite-dm/3bebee20-fa5c-455e-b965-9c99699f8d73
                documentModelName: TestSuite-dm
                document:
                  Root:
                    General:
                      Id: S_19
                      ProjectId: P_6
                      ProjectVersionNumber: 5.0.0
                      SubprojectId: _
                      Tags: ''
                      TenantId: T_1
                      Title: '1'
                      RecommendedPriority:
                        Value: MEDIUM
                    Metadata:
                      IsFrozenByClosedVersion: false
                    DisplayFields:
                      TotalTestCases: 0
                  __meta:
                    docRef: TestSuite-dm/3bebee20-fa5c-455e-b965-9c99699f8d73
              - docRef: TestSuite-dm/e0a40b91-d3ba-4e96-b16e-6f50ea635774
                documentModelName: TestSuite-dm
                document:
                  Root:
                    General:
                      Id: S_18
                      ProjectId: P_6
                      ProjectVersionNumber: 5.0.0
                      SubprojectId: _
                      Tags: ''
                      TenantId: T_1
                      Title: '1'
                      RecommendedPriority:
                        Value: MEDIUM
                    Metadata:
                      IsFrozenByClosedVersion: false
                    DisplayFields:
                      TotalTestCases: 0
                  __meta:
                    docRef: TestSuite-dm/e0a40b91-d3ba-4e96-b16e-6f50ea635774
              - docRef: TestSuite-dm/c7c50f56-f266-4cf8-8f87-1905fff404e8
                documentModelName: TestSuite-dm
                document:
                  Root:
                    General:
                      Id: S_17
                      ProjectId: P_6
                      ProjectVersionNumber: 5.0.0
                      SubprojectId: _
                      Tags: ''
                      TenantId: T_1
                      Title: '1'
                      RecommendedPriority:
                        Value: MEDIUM
                    Metadata:
                      IsFrozenByClosedVersion: false
                    DisplayFields:
                      TotalTestCases: 0
                  __meta:
                    docRef: TestSuite-dm/c7c50f56-f266-4cf8-8f87-1905fff404e8
            links: null
            otherResults: null
    AddAvailableSuiteToRunRequest:
      allOf:
        - $ref: '#/components/schemas/RpcRequestWithIdAndJsonRpc'
        - type: object
        - required:
            - method
            - params
          properties:
            method:
              type: string
              description: ADD_TEST_SUITES_TO_RUN
            params:
              required:
                - testRunDocRef
                - testSuiteDocRefs
              properties:
                testRunDocRef:
                  type: string
                  description: test run document reference
                testSuiteDocRefs:
                  type: array<string>
                  description: list of test suite's document references
      examples:
        - id: ADD_TEST_SUITES_TO_RUN_1
          method: ADD_TEST_SUITES_TO_RUN
          params:
            testRunDocRef: TestRun-dm/3b53beea-a611-462c-9553-703c4df4d669
            testSuiteDocRefs:
              - TestSuite-dm/20740
              - TestSuite-dm/20742
    AddAvailableSuiteToRunResponse:
      allOf:
        - $ref: '#/components/schemas/RpcResult'
        - type: object
          properties:
            result:
              type: array
              items:
                $ref: '#/components/schemas/LinkRef'
    DeleteTestSuiteFromRunRequest:
      allOf:
        - $ref: '#/components/schemas/RpcRequestWithIdAndJsonRpc'
        - type: object
        - required:
            - method
            - params
          properties:
            method:
              type: string
              description: DELETE_TEST_SUITES_FROM_RUN
            params:
              required:
                - testRunDocRef
                - testSuiteDocRefs
              properties:
                testRunDocRef:
                  type: string
                  description: test run document reference
                testSuiteDocRefs:
                  type: array<string>
                  description: list of test suite's document references
      examples:
        - id: DELETE_TEST_SUITES_FROM_RUN_1
          method: DELETE_TEST_SUITES_FROM_RUN
          params:
            testRunDocRef: TestRun-dm/3b53beea-a611-462c-9553-703c4df4d669
            testSuiteDocRefs:
              - TestSuite-dm/20740
              - TestSuite-dm/20742
    RpcRequestWithIdAndJsonRpc:
      type: object
      required:
        - id
        - jsonrpc
      properties:
        id:
          type: string
          description: id of the operation
        jsonrpc:
          type: string
          description: must be 2.0
          example: '2.0'
    GetTmtDocumentRequest:
      allOf:
        - $ref: '#/components/schemas/RpcRequestWithIdAndJsonRpc'
        - type: object
          required:
            - method
            - params
          properties:
            method:
              type: string
              description: GET_TMT_DOCUMENT
            params:
              required:
                - docRef
              properties:
                docRef:
                  type: string
                  description: document reference
      examples:
        - id: GET_TMT_DOCUMENT-1
          method: GET_TMT_DOCUMENT
          jsonrpc: '2.0'
          params:
            docRef: TestRun-dm/f90f07d9-af24-4cf9-b8ab-26c808d2876a
    RpcResult:
      type: object
      properties:
        jsonrpc:
          type: string
          description: request jsonrpc version
        id:
          type: string
          description: id of the operation
        result:
          type: object
    GetTmtDocumentResponse:
      allOf:
        - $ref: '#/components/schemas/RpcResult'
        - type: object
          properties:
            result:
              type: object
              required:
                - docRef
                - documentModelName
                - document
              properties:
                docRef:
                  type: string
                  description: Document reference of the returned document.
                documentModelName:
                  type: string
                  description: Document Model name of the returned document.
                document:
                  type: object
                  description: >-
                    Document content. Includes a `Root` object with the document
                    model fields and a `__meta` object with document metadata.
      examples:
        - jsonrpc: '2.0'
          id: GET_TMT_DOCUMENT-1
          result:
            docRef: TestRun-dm/f90f07d9-af24-4cf9-b8ab-26c808d2876a
            documentModelName: TestRun-dm
            document:
              Root:
                General:
                  Id: R_24
                  ProjectId: P_6
                  ProjectVersionNumber: 5.0.0
                  Status: inProgress
                  SubprojectId: _
                  TechnicalId: 11d8382a-710e-4a54-af9a-f08af587a0af
                  TenantId: T_1
                  Title: 'Test run #1'
                Metadata:
                  CreatedBy: tmtdev
                  CreatedOn: 1776155913699
                  DisplayCreatedOn: '2026-04-14T08:38:33'
                  DisplayEditedOn: '2026-05-07T04:20:16'
                  EditedBy: tmtdoc
                  EditedOn: 1778127616706
              __meta:
                createdAt: '2026-04-14T08:38:33'
                creator: SYSTEM
                docRef: TestRun-dm/f90f07d9-af24-4cf9-b8ab-26c808d2876a
                modelReference: TestRun-dm
                modelVersion: null
                modifiedAt: '2026-05-07T04:20:16'
                modifier: tmtdoc
    QueryPaging:
      type: object
      properties:
        pageNumber:
          type: integer
          description: Zero-based index of the first item to return in the query result.
        pageSize:
          type: integer
          description: Maximum number of items to return in the query result.
    QueryOrder:
      type: object
      properties:
        field:
          type: string
          description: Document Model field name to sort by.
        direction:
          type: string
          enum:
            - ASC
            - DESC
          description: Sorting direction, either ascending (`ASC`) or descending (`DESC`).
          default: ASC
        ignoreCase:
          type: boolean
          description: Whether the sorting should be case-sensitive
          default: false
        nullHandling:
          type: string
          enum:
            - NATIVE
            - NULLS_FIRST
            - NULLS_LAST
          description: >
            Specifies how null values should be handled in the sorting order.

            - `NULLS_FIRST` A hint to the used data store to order entries with
            null values before non null entries.

            - `NULLS_LAST` A hint to the used data store to order entries with
            null values after non null entries.

            - `NATIVE` Lets the data store decide what to do with nulls.
          default: NATIVE
    QueryLink:
      type: object
      properties:
        relationshipModel:
          type: string
          description: >-
            Specifies the Relationship Model, which document data shall be
            retrieved for..
        targetRole:
          type: string
          description: >-
            Specifies the target role in the relationship that will be linked to
            the root document. Data Services differentiates for document types
            "ROOT", "CHILD" and "LINK".
        constraint:
          type: object
          description: >-
            Defines a condition on the target document of the relationship,
            which allows for filtering of the link documents.
        linkDocumentConstraint:
          type: object
          description: >-
            Defines a condition on the link document, which allows for filtering
            the list of links. This is only allowed when a Link Document Model
            is defined for the relationship.
        fields:
          type: array
          items:
            type: string
          description: >-
            Specifies which fields of the "CHILD" documents should be included
            in the query result. If not explicitly provided, all fields are
            included.
        linkDocumentFields:
          type: array
          items:
            type: string
          description: >-
            Specifies which fields of the "LINK" documents should be included in
            the query result. If not explicitly provided, all fields are
            included.
        links:
          type: object
          description: >-
            Allows for linking additional documents to the link documents. It is
            possible to define either recursive or nested structures.
        maxDepth:
          type: integer
          description: >-
            Relevant for self-referencing relationships. Specifies how many
            references will be resolved. Required when a self-referencing
            relationship is detected in a link during query validation.
    QueryApiRoot:
      type: object
      required:
        - targetDocumentModel
        - projectionName
        - paging
      properties:
        targetDocumentModel:
          type: string
          description: Document Model name for which the query should be performed.
        projectionName:
          type: string
          required: true
          description: >-
            Specifies which projection type should be used for the query.
            Pre-defined are `"document"`, `"cdd"`, and `"document-graph"` as
            projection names.
        paging:
          type: object
          description: Specifies the pagination of the query result
          $ref: '#/components/schemas/QueryPaging'
        sort:
          type: array
          description: >-
            Specifies the sorting of the query result documents. Data Services
            does not apply any sorting per default.
          items:
            $ref: '#/components/schemas/QueryOrder'
        constraint:
          type: object
          description: >-
            Restricts the query result based on operators (e.g. logic operators
            on Document Model fields).
        fields:
          type: array
          description: >-
            Specifies which Document Model fields should be included in the
            query result. If not explicitly provided, all fields are included.
          items:
            type: string
        links:
          description: >-
            Specifies which link documents should be included in the query
            result.
          $ref: '#/components/schemas/QueryLink'
        aggregation:
          type: string
          description: >-
            Specifies a function which can be applied to the query result.
            Supported functions are `"avg"`, `"count"`, `"min"`, `"max"`, and
            `"sum"`.
        exclude:
          type: boolean
          description: >-
            Specifies whether root documents should be excluded from the query
            result. This is useful when only link documents are required.
    QueryOperationRequest:
      allOf:
        - $ref: '#/components/schemas/RpcRequestWithIdAndJsonRpc'
        - type: object
          required:
            - method
            - params
          properties:
            method:
              type: string
              description: QUERY
            params:
              type: object
              required:
                - query
              properties:
                query:
                  $ref: '#/components/schemas/QueryApiRoot'
    QueryResultEntry:
      type: object
      description: A single entry returned by a QUERY operation.
      properties:
        docRef:
          type: string
          description: Document reference of the returned document.
        document:
          type: object
          description: >-
            Document content. Includes a `Root` object with the document model
            fields and a `__meta` object with document metadata.
        type:
          type: string
          description: >-
            Type of the entry within the projection (e.g. `ROOT` for the root
            document of a document graph).
        depth:
          type: integer
          description: Depth of the entry in the document graph. `0` for the root document.
        documentModelName:
          type: string
          description: Document Model name of the returned document.
    QueryApiResult:
      type: object
      properties:
        fullSize:
          type: integer
          description: Total number of items found by the query (across all pages).
        page:
          type: object
          description: Pagination information of the current result page.
          properties:
            pageNumber:
              type: integer
              description: Zero-based index of the returned page.
            pageSize:
              type: integer
              description: Number of entries returned in this page.
        entries:
          type: array
          description: Result entries returned by the query.
          items:
            $ref: '#/components/schemas/QueryResultEntry'
        links:
          type: array
          description: >-
            If the result items are of type {@link DocumentTreeResult}, the
            entries list contains only documents of type LINK or CHILD.
            Otherwise, this list remains empty.
          items:
            type: object
        otherResults:
          type: object
          description: >-
            Additional aggregation or auxiliary results returned alongside the
            main entries (e.g. when an `aggregation` function is specified in
            the request).
    QueryOperationResponse:
      allOf:
        - $ref: '#/components/schemas/RpcResult'
        - type: object
          properties:
            result:
              $ref: '#/components/schemas/QueryApiResult'
    AddDocumentRequest:
      allOf:
        - $ref: '#/components/schemas/RpcRequestWithIdAndJsonRpc'
        - type: object
          required:
            - method
            - params
          properties:
            method:
              type: string
            params:
              required:
                - docRef
              properties:
                documentModelName:
                  type: string
                locale:
                  type: string
                  description: locale of the request. 'en' or 'de'
                document:
                  type: object
                  description: added document content
    GeneralToAdd:
      type: object
      properties:
        ProjectId:
          type: string
          description: Project's Id that containing this test run
        ProjectVersionNumber:
          type: string
          description: Sub Project's version number that containing this test run
        SubprojectId:
          type: string
          description: Sub Project's Id that containing this test run
        Title:
          type: string
          description: Title of the test run
        Description:
          type: string
          description: Description for the test run
        Configuration:
          type: string
          description: Configuration for the test run
        Status:
          type: string
          description: >-
            Status of the test run. Must be **active** in case of adding new
            test run
          enum:
            - active
            - inactive
    File:
      type: object
      properties:
        content:
          type: string
          nullable: true
          description: Content of the file in base64 format.
        attachment_id:
          type: string
          description: Unique identifier for the attachment.
        internal_filename:
          type: string
          description: Internal storage filename for the attachment.
        original_filename:
          type: string
          description: Original name of the uploaded file.
        size:
          type: integer
          description: Size of the file in bytes.
        mime_type:
          type: string
          description: MIME type of the file.
    Attachment:
      type: object
      properties:
        FileName:
          type: string
          description: Name of the file attached.
        CreatedAt:
          type: string
          format: date-time
          description: Timestamp when the attachment was created.
        UploadOn:
          type: string
          format: date
          description: Date when the file was uploaded.
        OriginalFileName:
          type: string
          description: Original filename as provided during upload.
        UploadBy:
          type: string
          description: Username of the uploader.
        Referenced:
          type: boolean
          description: Indicates if the attachment is referenced elsewhere.
        CopyNumber:
          type: integer
          description: Number of times the attachment has been copied.
        ThumbnailId:
          type: string
          description: Identifier for the attachment’s thumbnail image.
        File:
          $ref: '#/components/schemas/File'
    TestRunDocumentToAdd:
      type: object
      properties:
        Root:
          type: object
          properties:
            General:
              $ref: '#/components/schemas/GeneralToAdd'
            Attachments:
              type: array
              items:
                $ref: '#/components/schemas/Attachment'
    AddDocumentResponse:
      allOf:
        - $ref: '#/components/schemas/RpcResult'
        - type: object
          properties:
            result:
              type: object
              properties:
                docRef:
                  type: string
                  description: document reference of the created document
      examples:
        - jsonrpc: '2.0'
          id: ADD_TEST_RUN
          result:
            docRef: TestRun-dm/3b53beea-a611-462c-9553-703c4df4d669
    ModifyDocumentRequest:
      allOf:
        - $ref: '#/components/schemas/RpcRequestWithIdAndJsonRpc'
        - type: object
          required:
            - method
            - params
          properties:
            method:
              type: string
              description: MODIFY_DOCUMENT
            params:
              required:
                - docRef
              properties:
                docRef:
                  type: string
                  description: document reference
                locale:
                  type: string
                  description: locale of the request. 'en' or 'de'
                document:
                  type: object
                  description: modified document content
    General:
      allOf:
        - $ref: '#/components/schemas/GeneralToAdd'
        - type: object
          properties:
            Id:
              type: string
              description: Business id of the test suite. It is unique in a sub project
            TenantId:
              type: string
              description: Tenant Id
            TechnicalId:
              type: string
              format: uuid
              description: Technical id of the test suite. It is unique in the whole system
    Metadata:
      type: object
      readOnly: true
      description: >-
        \[**Read only**] Metadata of the document. It will be ignored if
        included in the request of the add/update operations (e.g ADD_DOCUMENT,
        MODIFY_DOCUMENT)
      properties:
        CreatedBy:
          type: string
          description: who created this project
        DisplayCreatedOn:
          type: string
          format: date-time
          description: creation time in the human readable format (UTC time zone)
        CreatedOn:
          type: integer
          description: creation time of the project
        EditedBy:
          description: the last person who edited this project document
          type: string
        DisplayEditedOn:
          type: string
          format: date-time
          description: edited time in the human readable format (UTC time zone)
        EditedOn:
          description: the last edited time of the project
          type: integer
    TestRunMetadata:
      allOf:
        - $ref: '#/components/schemas/Metadata'
        - type: object
        - properties:
            ClosedBy:
              type: string
              readOnly: true
              description: who closed this test run
            ClosedOn:
              type: string
              readOnly: true
              description: when is this test run closed
            DisplayClosedOn:
              type: string
              readOnly: true
              description: when is this test run closed in form of human readable
    Root:
      type: object
      properties:
        General:
          $ref: '#/components/schemas/General'
        Metadata:
          $ref: '#/components/schemas/TestRunMetadata'
        Attachments:
          type: array
          items:
            $ref: '#/components/schemas/Attachment'
    Meta:
      type: object
      readOnly: true
      description: >-
        \[**Read only**] Contain the meta data information of the document. **It
        will be ignored if included in the request of the update operations**
        (e.g MODIFY_DOCUMENT)
      properties:
        creator:
          type: string
          readOnly: true
          description: The user who created the document
        modifier:
          type: string
          readOnly: true
          description: The user who last modified the document
        docRef:
          type: string
          description: Reference to the document
        modelReference:
          type: string
          description: Reference to the model associated with the document
        createdAt:
          type: string
          format: date-time
          description: Timestamp when the document was created
        modifiedAt:
          type: string
          format: date-time
          description: Timestamp when the document was last modified
        modelVersion:
          type: string
          nullable: true
          description: Version of the model associated with the document
    TestRunDocument:
      type: object
      properties:
        Root:
          $ref: '#/components/schemas/Root'
        __meta:
          $ref: '#/components/schemas/Meta'
    ModifyDocumentResponse:
      allOf:
        - $ref: '#/components/schemas/RpcResult'
        - type: object
          properties:
            result:
              type: object
              description: null value
      examples:
        - jsonrpc: '2.0'
          id: MODIFY_TEST_RUN
          result: null
    BooleanDocumentResponse:
      allOf:
        - $ref: '#/components/schemas/RpcResult'
        - type: object
          properties:
            result:
              type: boolean
              description: true/false
      examples:
        - jsonrpc: '2.0'
          id: DELETE_TEST_RUN_TestRun-dm/11825df5-4460-479d-a282-e996d804b571
          result: true
    Entity:
      type: object
      properties:
        role:
          type: string
          description: Role of the entity that participates into this relationship
        modelName:
          type: string
          description: Model name of the entity that participates into this relationship
        docRef:
          type: string
          description: Document reference of the entity
    LinkDescriptor:
      type: object
      description: Information of entities in the relationship
      properties:
        relationshipModel:
          type: string
          description: Name of the relationship model
        entities:
          type: array
          description: Contains 2 items which are the parent and child
          items:
            $ref: '#/components/schemas/Entity'
        predecessorLinkRef:
          type: string
          description: Link reference of the predecessor
          nullable: true
        position:
          type: number
          description: The position of the node to the predecessorLinkRef
    LinkRef:
      type: object
      description: Represent the link contains the documents
      properties:
        linkDescriptor:
          $ref: '#/components/schemas/LinkDescriptor'
        id:
          type: string
          description: id of the relationship link
    NullDocumentResponse:
      allOf:
        - $ref: '#/components/schemas/RpcResult'
        - type: object
          properties:
            result:
              type: object
              description: null value
      examples:
        - jsonrpc: '2.0'
          id: DELETE_TEST_SUITES_FROM_RUN_1
          result: null
    DocumentResult:
      type: object
      properties:
        docRef:
          type: string
          description: document reference
        documentModelName:
          type: string
          description: model name
        document:
          type: object
    TestRunDocumentResult:
      allOf:
        - $ref: '#/components/schemas/DocumentResult'
        - type: object
        - properties:
            document:
              description: Test run document
              $ref: '#/components/schemas/TestRunDocument'
    FilterSpec:
      description: filter specification.
      type: object
      properties:
        fullText:
          type: string
          description: the full text search
        filters:
          type: Array<String>
          description: Array of filter
        lang:
          type: string
          description: requested language
    PageSpec:
      description: pagination specification
      type: object
      properties:
        offset:
          type: integer
        limit:
          type: integer
    SortSpec:
      description: type is a specification of the sorting to be applied on the server side.
      type: object
      properties:
        order:
          type: string
        lang:
          type: string
    SortSpecArray:
      description: type is a specification of the sorting to be applied on the server side.
      type: Array
      items:
        $ref: '#/components/schemas/SortSpec'
    TestRunDocumentResultWithId:
      allOf:
        - $ref: '#/components/schemas/DocumentResult'
        - type: object
        - properties:
            document:
              allOf:
                - $ref: '#/components/schemas/TestRunDocument'
                - type: object
                  properties:
                    id:
                      type: string
                      description: this is dummy value, and can be ignored
  parameters:
    ProjectIdHeader:
      name: Project-Id
      in: header
      required: true
      schema:
        type: string
      description: Project Id or the project document reference
    SubProjectIdHeader:
      name: Subproject-Id
      in: header
      required: false
      schema:
        type: string
      description: >-
        Sub Project Id or the project document reference. It might be required
        if you want to access the sub project's resource
