{
  "openapi": "3.0.4",
  "info": {
    "title": "VIS Rest API",
    "version": "v1"
  },
  "paths": {
    "/api/export/{exportId}": {
      "get": {
        "tags": [
          "Export"
        ],
        "parameters": [
          {
            "name": "exportId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/json": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "text/json": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "202": {
            "description": "Accepted",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PollResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PollResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PollResult"
                }
              }
            }
          }
        }
      }
    },
    "/api/persons": {
      "post": {
        "tags": [
          "Persons"
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/PersonCreateRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PersonCreateRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PersonCreateRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PersonCreateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PersonCreateRequest"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PersonCreateRequest"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PersonCreateRequest"
                }
              }
            }
          }
        }
      }
    },
    "/api/persons/{externalId}": {
      "get": {
        "tags": [
          "Persons"
        ],
        "parameters": [
          {
            "name": "externalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PersonCreateRequest"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PersonCreateRequest"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PersonCreateRequest"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Persons"
        ],
        "parameters": [
          {
            "name": "externalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/PersonCreateRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PersonCreateRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PersonCreateRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PersonCreateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PersonCreateRequest"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PersonCreateRequest"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PersonCreateRequest"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Persons"
        ],
        "parameters": [
          {
            "name": "externalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "application/json": {
                "schema": {
                  "type": "string"
                }
              },
              "text/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/persons/{externalId}/test-sequences": {
      "get": {
        "tags": [
          "Persons"
        ],
        "parameters": [
          {
            "name": "externalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CandidateTestSequencesResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CandidateTestSequencesResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CandidateTestSequencesResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/persons/invite": {
      "post": {
        "tags": [
          "Persons"
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/PersonInviteRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PersonInviteRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PersonInviteRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PersonInviteRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PersonInviteResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PersonInviteResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PersonInviteResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/results/export/pdf": {
      "post": {
        "tags": [
          "Results"
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/PdfExportExportRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PdfExportExportRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PdfExportExportRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PdfExportExportRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PdfExportResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PdfExportResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PdfExportResult"
                }
              }
            }
          }
        }
      }
    },
    "/api/results/export/csv": {
      "post": {
        "tags": [
          "Results"
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/CsvExportExportRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CsvExportExportRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CsvExportExportRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CsvExportExportRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CsvExportResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CsvExportResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CsvExportResult"
                }
              }
            }
          }
        }
      }
    },
    "/api/results/export/word-report": {
      "post": {
        "tags": [
          "Results"
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/ExportWordReportByResultRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExportWordReportByResultRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ExportWordReportByResultRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ExportWordReportByResultRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ExportWordReportByResultResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExportWordReportByResultResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExportWordReportByResultResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/results/{resultId}": {
      "delete": {
        "tags": [
          "Results"
        ],
        "parameters": [
          {
            "name": "resultId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "boolean"
                }
              },
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              },
              "text/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          }
        }
      }
    },
    "/api/test-sequences/export/pdf": {
      "post": {
        "tags": [
          "TestSequences"
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/ExportTestSequenceRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExportTestSequenceRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ExportTestSequenceRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ExportTestSequenceRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ExportTestSequenceResult"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExportTestSequenceResult"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExportTestSequenceResult"
                }
              }
            }
          }
        }
      }
    },
    "/api/test-sequences/export/word-report": {
      "post": {
        "tags": [
          "TestSequences"
        ],
        "requestBody": {
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/ExportWordReportByTestSequenceRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExportWordReportByTestSequenceRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ExportWordReportByTestSequenceRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ExportWordReportByTestSequenceRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ExportWordReportByTestSequenceResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExportWordReportByTestSequenceResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExportWordReportByTestSequenceResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/test-sequences/{testSequenceId}": {
      "delete": {
        "tags": [
          "TestSequences"
        ],
        "parameters": [
          {
            "name": "testSequenceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "boolean"
                }
              },
              "application/json": {
                "schema": {
                  "type": "boolean"
                }
              },
              "text/json": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "CandidateTestSequence": {
        "type": "object",
        "properties": {
          "testSequenceId": {
            "type": "string",
            "format": "uuid"
          },
          "dateOfTestAdministration": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "testLabel": {
            "type": "string",
            "nullable": true
          },
          "tests": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExecutedTestSequenceItemInfo"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CandidateTestSequencesResponse": {
        "type": "object",
        "properties": {
          "testSequences": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CandidateTestSequence"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CsvExportExportRequest": {
        "type": "object",
        "properties": {
          "resultId": {
            "type": "string",
            "format": "uuid"
          },
          "exportProfileName": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CsvExportResult": {
        "type": "object",
        "properties": {
          "resultId": {
            "type": "string",
            "format": "uuid"
          },
          "exportId": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "EducationLevel": {
        "enum": [
          "0 = Unknown",
          "1 = CompulsoryNotCompleted",
          "2 = CompulsoryCompleted",
          "3 = VocationalCompleted",
          "4 = Highschool",
          "5 = University"
        ],
        "type": "integer",
        "format": "int32",
        "example": 0
      },
      "ExecutedTestSequenceItemInfo": {
        "type": "object",
        "properties": {
          "resultId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "dateOfTestAdministration": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "testLabel": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ExportTestSequenceRequest": {
        "type": "object",
        "properties": {
          "testSequenceId": {
            "type": "string",
            "format": "uuid"
          },
          "scoringMethod": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ExportTestSequenceResult": {
        "type": "object",
        "properties": {
          "testSequenceId": {
            "type": "string",
            "format": "uuid"
          },
          "scoringMethod": {
            "type": "string",
            "nullable": true
          },
          "exportId": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ExportWordReportByResultRequest": {
        "type": "object",
        "properties": {
          "wordReport": {
            "type": "string",
            "nullable": true
          },
          "scoringMethod": {
            "type": "string",
            "nullable": true
          },
          "resultId": {
            "type": "string",
            "format": "uuid"
          }
        },
        "additionalProperties": false
      },
      "ExportWordReportByResultResponse": {
        "type": "object",
        "properties": {
          "wordReport": {
            "type": "string",
            "nullable": true
          },
          "scoringMethod": {
            "type": "string",
            "nullable": true
          },
          "exportId": {
            "type": "string",
            "nullable": true
          },
          "resultId": {
            "type": "string",
            "format": "uuid"
          }
        },
        "additionalProperties": false
      },
      "ExportWordReportByTestSequenceRequest": {
        "type": "object",
        "properties": {
          "wordReport": {
            "type": "string",
            "nullable": true
          },
          "scoringMethod": {
            "type": "string",
            "nullable": true
          },
          "testSequenceId": {
            "type": "string",
            "format": "uuid"
          }
        },
        "additionalProperties": false
      },
      "ExportWordReportByTestSequenceResponse": {
        "type": "object",
        "properties": {
          "wordReport": {
            "type": "string",
            "nullable": true
          },
          "scoringMethod": {
            "type": "string",
            "nullable": true
          },
          "exportId": {
            "type": "string",
            "nullable": true
          },
          "testSequenceId": {
            "type": "string",
            "format": "uuid"
          }
        },
        "additionalProperties": false
      },
      "Gender": {
        "enum": [
          "0 = Male",
          "1 = Female",
          "2 = Diverse",
          "3 = NotSpecified"
        ],
        "type": "integer",
        "format": "int32",
        "example": 0
      },
      "PdfExportExportRequest": {
        "type": "object",
        "properties": {
          "resultId": {
            "type": "string",
            "format": "uuid"
          }
        },
        "additionalProperties": false
      },
      "PdfExportResult": {
        "type": "object",
        "properties": {
          "resultId": {
            "type": "string",
            "format": "uuid"
          },
          "exportId": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PersonCreateRequest": {
        "type": "object",
        "properties": {
          "firstName": {
            "type": "string",
            "nullable": true
          },
          "lastName": {
            "type": "string",
            "nullable": true
          },
          "gender": {
            "$ref": "#/components/schemas/Gender"
          },
          "dayOfBirth": {
            "type": "string",
            "nullable": true
          },
          "registrationDate": {
            "type": "string",
            "nullable": true
          },
          "educationLevel": {
            "$ref": "#/components/schemas/EducationLevel"
          },
          "language": {
            "type": "string",
            "nullable": true
          },
          "email": {
            "type": "string",
            "nullable": true
          },
          "department": {
            "type": "string",
            "nullable": true
          },
          "scoringCode": {
            "type": "string",
            "nullable": true
          },
          "testBatteryForDirectTesting": {
            "type": "string",
            "nullable": true
          },
          "personalId": {
            "type": "string",
            "nullable": true
          },
          "externalId": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PersonInviteRequest": {
        "required": [
          "externalId",
          "testBattery"
        ],
        "type": "object",
        "properties": {
          "externalId": {
            "type": "string",
            "nullable": true
          },
          "testBattery": {
            "type": "string",
            "nullable": true
          },
          "sendEmail": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "PersonInviteResponse": {
        "required": [
          "externalId",
          "invitationLink"
        ],
        "type": "object",
        "properties": {
          "externalId": {
            "type": "string",
            "nullable": true
          },
          "invitationLink": {
            "type": "string",
            "nullable": true
          },
          "sentEmailTimestamp": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "email": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PollResult": {
        "type": "object",
        "properties": {
          "isFinished": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "ApiKey": {
        "type": "apiKey",
        "description": "Authorization by X-Api-Key inside request's header",
        "name": "X-Api-Key",
        "in": "header"
      }
    }
  },
  "security": [
    {
      "X-Api-Key": [ ]
    }
  ]
}