{
  "x-generator": "NSwag v14.4.0.0 (NJsonSchema v11.3.2.0 (Newtonsoft.Json v13.0.0.0))",
  "openapi": "3.0.0",
  "info": {
    "title": "AIVA Cloud API",
    "description": "This API allows you to execute tests and retrieve their current status. Use it to integrate automated testing into your workflows and monitor test results.",
    "version": "v1"
  },
  "paths": {
    "/v1/test-runs": {
      "post": {
        "tags": [
          "Test Runs"
        ],
        "summary": "Run test",
        "description": "This endpoint allows you to enqueue a test for execution by specifying either the test name or test ID, along with optional variables and gateway name. <br/><br/>It returns a unique identifier for the test run. You can use this identifier to track the status and results of the test run. <br/><br/>When both test name and test ID are provided, the test ID takes precedence.",
        "operationId": "TestRuns_RunTest",
        "requestBody": {
          "x-name": "RunTestRequest",
          "description": "",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RunTestRequest"
              },
              "examples": {
                "Run test by ID": {
                  "summary": "Run test by ID",
                  "value": {
                    "testName": null,
                    "testId": "123e4567-e89b-12d3-a456-426614174000",
                    "gatewayName": null,
                    "variables": {
                      "username": "testuser",
                      "password": "testpass"
                    }
                  }
                },
                "Run test by name": {
                  "summary": "Run test by name",
                  "value": {
                    "testName": "Login test",
                    "testId": null,
                    "gatewayName": null,
                    "variables": {
                      "username": "testuser",
                      "password": "testpass"
                    }
                  }
                },
                "Run test with gateway": {
                  "summary": "Run test with gateway",
                  "value": {
                    "testName": "Reset infrastructure",
                    "testId": null,
                    "gatewayName": "My internal network",
                    "variables": {}
                  }
                }
              }
            }
          },
          "required": true,
          "x-position": 1
        },
        "responses": {
          "202": {
            "description": "Test run enqueued",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunTestResponse"
                },
                "example": {
                  "testRunId": "123e4567-e89b-12d3-a456-426614174000"
                }
              }
            }
          },
          "507": {
            "description": "Queue size limit reached. Cannot enqueue more tests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "400": {
            "description": "Test not found or invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      },
      "get": {
        "tags": [
          "Test Runs"
        ],
        "summary": "Get status of test runs",
        "description": "The endpoint for retrieving the status of test runs. Returns the status in the CTRF format (see https://ctrf.io/docs/specification/overview).",
        "operationId": "TestRuns_GetTestRunsStatuses",
        "parameters": [
          {
            "name": "TestRunIds",
            "in": "query",
            "style": "form",
            "explode": true,
            "required": true,
            "description": "IDs of test runs returned by the run test endpoint.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "example": [
              "0c9b10ce-f39b-4c85-9c13-d1713b842df2"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Test runs status in CTRF format",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CtrfTestResults"
                },
                "example": {
                  "reportFormat": "CTRF",
                  "specVersion": "0.0.0",
                  "results": {
                    "tool": {
                      "name": "AIVA"
                    },
                    "summary": {
                      "tests": 6,
                      "passed": 5,
                      "failed": 1,
                      "pending": 0,
                      "skipped": 0,
                      "other": 0,
                      "start": 1751520863502,
                      "stop": 1751520865650,
                      "extra": null
                    },
                    "tests": [
                      {
                        "name": "Login test",
                        "status": "passed",
                        "rawStatus": "Pass",
                        "duration": 1000,
                        "start": 1751520863502,
                        "stop": 1751520864502,
                        "message": null,
                        "parameters": {
                          "username": "testuser",
                          "password": "testpass"
                        },
                        "extra": {
                          "testResultLink": null,
                          "testRunId": "0c9b10ce-f39b-4c85-9c13-d1713b842df2"
                        }
                      },
                      {
                        "name": "Add product test",
                        "status": "failed",
                        "rawStatus": "Fail",
                        "duration": 2000,
                        "start": 1751520863650,
                        "stop": 1751520865650,
                        "message": "Text assertion failed. Text found: keyboard",
                        "parameters": {
                          "product name": "brush",
                          "quantity": "1"
                        },
                        "extra": {
                          "testResultLink": null,
                          "testRunId": "0c9b10ce-f39b-4c85-9c13-d1713b842e03"
                        }
                      }
                    ]
                  }
                }
              }
            }
          },
          "404": {
            "description": "Test runs with given IDs not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/v1/test-runs/{testRunId}/cancel": {
      "put": {
        "tags": [
          "Test Runs"
        ],
        "summary": "Cancel test run",
        "description": "Endpoint for cancellation of a test run.",
        "operationId": "TestRuns_CancelTestRun",
        "parameters": [
          {
            "name": "testRunId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "guid"
            },
            "example": "123e4567-e89b-12d3-a456-426614174000"
          },
          {
            "name": "Force",
            "in": "query",
            "description": "If force is set to false and the test is only enqueued, the test will never run; however, if the test is already running, it will be allowed to finish. The default value is true (i.e. a running test will be stopped).",
            "schema": {
              "type": "boolean",
              "nullable": true
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Test run cancelled"
          },
          "404": {
            "description": "Test run not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "example": {
                  "type": null,
                  "title": "Test run not found",
                  "status": 404,
                  "detail": "Test run with given ID not found",
                  "instance": null
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/v1/gateways/{Name}/ready": {
      "get": {
        "tags": [
          "Gateways"
        ],
        "summary": "Check gateway readiness",
        "description": "The endpoint for checking gateway readiness before test runs.",
        "operationId": "Gateways_IsGatewayReady",
        "parameters": [
          {
            "name": "Name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "My Gateway"
          }
        ],
        "responses": {
          "200": {
            "description": "Gateway status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IsGatewayReadyResponse"
                },
                "example": {
                  "isReady": true
                }
              }
            }
          },
          "404": {
            "description": "Gateway with given name not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/v1/batches": {
      "post": {
        "tags": [
          "Batches"
        ],
        "summary": "Run test batch",
        "description": "Endpoint for running a batch of tests.",
        "operationId": "Batches_RunBatch",
        "requestBody": {
          "x-name": "RunBatchRequest",
          "description": "",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RunBatchRequest"
              }
            }
          },
          "required": true,
          "x-position": 1
        },
        "responses": {
          "202": {
            "description": "Test batch started",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunBatchResponse"
                },
                "example": {
                  "testBatchId": "123e4567-e89b-12d3-a456-426614174000"
                }
              }
            }
          },
          "400": {
            "description": "The request is not valid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                },
                "example": {
                  "errors": {
                    "Labels": [
                      "Labels cannot be empty"
                    ],
                    "GatewayName": [
                      "Gateway with name 'InvalidGateway' not found."
                    ]
                  },
                  "type": null,
                  "title": "One or more validation errors occurred.",
                  "status": 400,
                  "detail": null,
                  "instance": null
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "User does not have permission to access batches"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      },
      "get": {
        "tags": [
          "Batches"
        ],
        "summary": "Get test batches statuses",
        "description": "The endpoint for retrieving the statuses of test batches. Returns an array of statuses in CTRF format (see https://ctrf.io/docs/specification/overview).",
        "operationId": "Batches_GetBatches",
        "parameters": [
          {
            "name": "Ids",
            "in": "query",
            "style": "form",
            "explode": true,
            "description": "IDs of test batches returned by the run batch endpoint.",
            "schema": {
              "type": "array",
              "nullable": true,
              "items": {
                "type": "string",
                "format": "guid"
              }
            },
            "example": [
              "0c9b10ce-f39b-4c85-9c13-d1713b842df2"
            ]
          },
          {
            "name": "Labels",
            "in": "query",
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "nullable": true,
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "Status",
            "in": "query",
            "description": "Status of the test batches. Possible values are: Enqueued, Running, Completed and Cancelled",
            "schema": {
              "nullable": true,
              "allOf": [
                {
                  "$ref": "#/components/schemas/TestBatchStatus"
                }
              ]
            }
          },
          {
            "name": "Limit",
            "in": "query",
            "description": "Maximum number of test batch statuses to return. The endpoint will return first N batches that satisfy the filtering given by other parameters. Default value is 100.",
            "schema": {
              "type": "integer",
              "format": "int32",
              "nullable": true
            },
            "example": 100
          }
        ],
        "responses": {
          "200": {
            "description": "Array of test batches status in CTRF format",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CtrfTestResults"
                },
                "example": {
                  "reportFormat": "CTRF",
                  "specVersion": "0.0.0",
                  "results": {
                    "tool": {
                      "name": "AIVA"
                    },
                    "summary": {
                      "tests": 6,
                      "passed": 5,
                      "failed": 1,
                      "pending": 0,
                      "skipped": 0,
                      "other": 0,
                      "start": 1751520863502,
                      "stop": 1751520865650,
                      "extra": null
                    },
                    "tests": [
                      {
                        "name": "Login test",
                        "status": "passed",
                        "rawStatus": "Pass",
                        "duration": 1000,
                        "start": 1751520863502,
                        "stop": 1751520864502,
                        "message": null,
                        "parameters": {
                          "username": "testuser",
                          "password": "testpass"
                        },
                        "extra": {
                          "testResultLink": null,
                          "testRunId": "0c9b10ce-f39b-4c85-9c13-d1713b842df2"
                        }
                      },
                      {
                        "name": "Add product test",
                        "status": "failed",
                        "rawStatus": "Fail",
                        "duration": 2000,
                        "start": 1751520863650,
                        "stop": 1751520865650,
                        "message": "Text assertion failed. Text found: keyboard",
                        "parameters": {
                          "product name": "brush",
                          "quantity": "1"
                        },
                        "extra": {
                          "testResultLink": null,
                          "testRunId": "0c9b10ce-f39b-4c85-9c13-d1713b842e03"
                        }
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "User does not have permission to access batches"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/v1/batches/{batchId}": {
      "get": {
        "tags": [
          "Batches"
        ],
        "summary": "Get test batch status",
        "description": "The endpoint for retrieving the status of a single test batch. Returns the status in the CTRF format (see https://ctrf.io/docs/specification/overview).",
        "operationId": "Batches_GetBatch",
        "parameters": [
          {
            "name": "batchId",
            "in": "path",
            "required": true,
            "description": "ID of test batch returned by the run batch endpoint.",
            "schema": {
              "type": "string",
              "format": "guid"
            },
            "example": "0c9b10ce-f39b-4c85-9c13-d1713b842df2"
          }
        ],
        "responses": {
          "200": {
            "description": "Test batch status in CTRF format",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CtrfTestResults"
                },
                "example": {
                  "reportFormat": "CTRF",
                  "specVersion": "0.0.0",
                  "results": {
                    "tool": {
                      "name": "AIVA"
                    },
                    "summary": {
                      "tests": 6,
                      "passed": 5,
                      "failed": 1,
                      "pending": 0,
                      "skipped": 0,
                      "other": 0,
                      "start": 1751520863502,
                      "stop": 1751520865650,
                      "extra": null
                    },
                    "tests": [
                      {
                        "name": "Login test",
                        "status": "passed",
                        "rawStatus": "Pass",
                        "duration": 1000,
                        "start": 1751520863502,
                        "stop": 1751520864502,
                        "message": null,
                        "parameters": {
                          "username": "testuser",
                          "password": "testpass"
                        },
                        "extra": {
                          "testResultLink": null,
                          "testRunId": "0c9b10ce-f39b-4c85-9c13-d1713b842df2"
                        }
                      },
                      {
                        "name": "Add product test",
                        "status": "failed",
                        "rawStatus": "Fail",
                        "duration": 2000,
                        "start": 1751520863650,
                        "stop": 1751520865650,
                        "message": "Text assertion failed. Text found: keyboard",
                        "parameters": {
                          "product name": "brush",
                          "quantity": "1"
                        },
                        "extra": {
                          "testResultLink": null,
                          "testRunId": "0c9b10ce-f39b-4c85-9c13-d1713b842e03"
                        }
                      }
                    ]
                  }
                }
              }
            }
          },
          "404": {
            "description": "Test batch with given ID not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "example": {
                  "type": null,
                  "title": "Test batch with given ID not found",
                  "status": 404,
                  "detail": "Batch with given ID not found",
                  "instance": null
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "User does not have permission to access batches"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/v1/batches/{batchId}/cancel": {
      "put": {
        "tags": [
          "Batches"
        ],
        "summary": "Cancel test batch run",
        "description": "Endpoint for cancellation of a running test batch.",
        "operationId": "Batches_CancelBatch",
        "parameters": [
          {
            "name": "batchId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "guid"
            },
            "example": "123e4567-e89b-12d3-a456-426614174000"
          },
          {
            "name": "Force",
            "in": "query",
            "description": "If force is set to true, any currently running tests in the specified batch will be immediately canceled. Otherwise, the currently running tests will be allowed to finish, but no other tests from the batch will be started. The default value is true.",
            "schema": {
              "type": "boolean",
              "nullable": true
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Test batch cancelled"
          },
          "404": {
            "description": "Test batch not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "example": {
                  "type": null,
                  "title": "Test batch not found",
                  "status": 404,
                  "detail": "Test batch with given ID not found",
                  "instance": null
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "User does not have permission to access batches"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "RunTestResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "testRunId": {
            "type": "string",
            "description": "GUID of the test run; use this to query the result of the test",
            "format": "guid"
          }
        }
      },
      "ProblemDetails": {
        "type": "object",
        "additionalProperties": {
          "nullable": true
        },
        "properties": {
          "type": {
            "type": "string",
            "nullable": true
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "detail": {
            "type": "string",
            "nullable": true
          },
          "instance": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "ValidationProblemDetails": {
        "allOf": [
          {
            "$ref": "#/components/schemas/HttpValidationProblemDetails"
          },
          {
            "type": "object",
            "additionalProperties": {
              "nullable": true
            },
            "properties": {
              "errors": {
                "type": "object",
                "additionalProperties": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          }
        ]
      },
      "HttpValidationProblemDetails": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ProblemDetails"
          },
          {
            "type": "object",
            "additionalProperties": {
              "nullable": true
            },
            "properties": {
              "errors": {
                "type": "object",
                "additionalProperties": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          }
        ]
      },
      "RunTestRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "testName": {
            "type": "string",
            "description": "The name of the test to run. When Test Id is provided, this field is ignored.",
            "nullable": true
          },
          "testId": {
            "type": "string",
            "description": "Id of the test to run. When provided, this field has precedence over Test Name.",
            "format": "guid",
            "nullable": true,
            "example": "123e4567-e89b-12d3-a456-426614174000"
          },
          "gatewayName": {
            "type": "string",
            "description": "The name of the gateway to run the test on. Leave empty to run the test on the default gateway of the test.",
            "nullable": true
          },
          "variables": {
            "type": "object",
            "description": "The values of the variables for this test run.",
            "example": {
              "username": "testuser",
              "password": "testpass"
            },
            "additionalProperties": {
              "type": "string"
            }
          }
        }
      },
      "CtrfTestResults": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "reportFormat",
          "specVersion",
          "results"
        ],
        "properties": {
          "reportFormat": {
            "type": "string",
            "minLength": 1
          },
          "specVersion": {
            "type": "string",
            "minLength": 1
          },
          "results": {
            "$ref": "#/components/schemas/Results"
          }
        }
      },
      "Results": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "tool",
          "summary",
          "tests"
        ],
        "properties": {
          "tool": {
            "$ref": "#/components/schemas/Tool"
          },
          "summary": {
            "$ref": "#/components/schemas/Summary"
          },
          "tests": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Test"
            }
          }
        }
      },
      "Tool": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          }
        }
      },
      "Summary": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "tests",
          "passed",
          "failed",
          "pending",
          "skipped",
          "other"
        ],
        "properties": {
          "tests": {
            "type": "integer",
            "format": "int32"
          },
          "passed": {
            "type": "integer",
            "format": "int32"
          },
          "failed": {
            "type": "integer",
            "format": "int32"
          },
          "pending": {
            "type": "integer",
            "format": "int32"
          },
          "skipped": {
            "type": "integer",
            "format": "int32"
          },
          "other": {
            "type": "integer",
            "format": "int32"
          },
          "start": {
            "type": "integer",
            "description": "Start time of the first test in milliseconds since the Unix epoch",
            "format": "int64",
            "nullable": true
          },
          "stop": {
            "type": "integer",
            "description": "Stop time of the last test in milliseconds since the Unix epoch",
            "format": "int64",
            "nullable": true
          },
          "extra": {
            "nullable": true,
            "oneOf": [
              {
                "$ref": "#/components/schemas/SummaryExtra"
              }
            ]
          }
        }
      },
      "SummaryExtra": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "userEmail": {
            "type": "string",
            "description": "Email of user which ran the test batch",
            "nullable": true
          },
          "batchId": {
            "type": "string",
            "description": "ID of the test batch",
            "format": "guid",
            "nullable": true
          },
          "testBatchLink": {
            "type": "string",
            "description": "URL of the test batch in AIVA",
            "nullable": true
          }
        }
      },
      "Test": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "status",
          "extra"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "Test name",
            "minLength": 1
          },
          "status": {
            "type": "string",
            "description": "Test run status as per the CTRF specification -- one of the following: passed, failed, skipped, pending, other (see https://ctrf.io/docs/specification/status)",
            "minLength": 1
          },
          "rawStatus": {
            "type": "string",
            "description": "Test run status used in AIVA"
          },
          "duration": {
            "type": "integer",
            "description": "Duration of the test run in milliseconds",
            "format": "int64",
            "nullable": true
          },
          "start": {
            "type": "integer",
            "description": "Start time of the test in milliseconds since the Unix epoch",
            "format": "int64",
            "nullable": true
          },
          "stop": {
            "type": "integer",
            "description": "Stop time of the test in milliseconds since the Unix epoch",
            "format": "int64",
            "nullable": true
          },
          "message": {
            "type": "string",
            "description": "Error message in case of a failed test",
            "nullable": true
          },
          "parameters": {
            "type": "object",
            "description": "Variables the test was run with",
            "nullable": true,
            "additionalProperties": {
              "type": "string"
            }
          },
          "extra": {
            "$ref": "#/components/schemas/Extra"
          }
        }
      },
      "Extra": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "testRunId"
        ],
        "properties": {
          "testResultLink": {
            "type": "string",
            "description": "URL of the test result in AIVA GUI",
            "nullable": true
          },
          "testRunId": {
            "type": "string",
            "description": "GUID of the test run this result corresponds to",
            "minLength": 1
          }
        }
      },
      "TestRunStatusRequest": {
        "type": "object",
        "additionalProperties": false
      },
      "CancelTestRunRequest": {
        "type": "object",
        "additionalProperties": false
      },
      "IsGatewayReadyResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "isReady": {
            "type": "boolean"
          }
        }
      },
      "IsGatewayReadyRequest": {
        "type": "object",
        "additionalProperties": false
      },
      "RunBatchResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "testBatchId": {
            "type": "string",
            "description": "ID of the test batch returned by the run batch endpoint.",
            "format": "guid"
          }
        }
      },
      "RunBatchRequest": {
        "type": "object",
        "example": {
          "name": null,
          "labels": [
            "smoke",
            "regression"
          ],
          "maxNumberOfAgents": 3,
          "globalVariablesOverrides": {
            "username": "testuser",
            "password": "testpass"
          },
          "variablesOverridesPerTest": {
            "123e4567-e89b-12d3-a456-426614174000": {
              "expectedText": "Success",
              "username": "otheruser"
            }
          },
          "gatewayName": "PrimaryGateway"
        },
        "additionalProperties": false,
        "required": [
          "labels"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the batch",
            "nullable": true
          },
          "labels": {
            "type": "array",
            "description": "Set of labels determining which tests will run in the batch. Only tests having all the specified labels will be run.",
            "minLength": 1,
            "nullable": false,
            "example": [
              "smoke",
              "regression"
            ],
            "items": {
              "type": "string"
            }
          },
          "parallel": {
            "type": "boolean",
            "description": "Whether the tests can be run in parallel or not. The tests run sequentially by default.",
            "deprecated": true,
            "x-deprecatedMessage": "Use MaxNumberOfAgents instead",
            "nullable": true
          },
          "maxNumberOfAgents": {
            "type": "integer",
            "description": "The maximum number of agents this batch can use to run its tests in parallel.",
            "format": "int32",
            "nullable": true,
            "example": 3
          },
          "globalVariablesOverrides": {
            "type": "object",
            "description": "Overrides of variables that will be applied to all the tests of the batch.",
            "nullable": true,
            "example": {
              "username": "testuser",
              "password": "testpass"
            },
            "additionalProperties": {
              "type": "string"
            }
          },
          "variablesOverridesPerTest": {
            "type": "object",
            "description": "Overrides of variables for individual tests of the batch. These values will override the global variable overrides. Use test ID as a key.",
            "nullable": true,
            "example": {
              "123e4567-e89b-12d3-a456-426614174000": {
                "expectedText": "Success",
                "username": "otheruser"
              }
            },
            "additionalProperties": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              }
            }
          },
          "gatewayName": {
            "type": "string",
            "description": "The name of the gateway to run all the tests on. Leave empty to run on the default gateway of each test.",
            "nullable": true,
            "example": "PrimaryGateway"
          }
        }
      },
      "GetBatchesRequest": {
        "type": "object",
        "additionalProperties": false
      },
      "TestBatchStatus": {
        "type": "string",
        "description": "",
        "x-enumNames": [
          "Enqueued",
          "Running",
          "Completed",
          "Cancelled"
        ],
        "enum": [
          "Enqueued",
          "Running",
          "Completed",
          "Cancelled"
        ]
      },
      "GetBatchRequest": {
        "type": "object",
        "additionalProperties": false
      },
      "CancelBatchRequest": {
        "type": "object",
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "ApiKey": {
        "type": "apiKey",
        "description": "API key to access the AIVA Cloud API",
        "name": "X-API-KEY",
        "in": "header"
      }
    }
  }
}