{
  "openapi": "3.0.0",
  "paths": {
    "/v2/candidates/documents/{id}/company/{companyId}/vacancy/{vacancyId}/candidate/{candidateId}/documents/{documentId}/download": {
      "get": {
        "description": "Downloads the document associated with the specified document ID for a candidate within a feature.",
        "operationId": "CandidateDocumentsController_downloadDocument_v2",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "companyId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "vacancyId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "candidateId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "documentId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Binary file stream.",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "example": {
                  "code": 401,
                  "message": "Unauthorized"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "bearer": []
          },
          {
            "x-auth-api-key": []
          }
        ],
        "summary": "Download a specific document within a feature",
        "tags": [
          "Candidate Documents"
        ],
        "x-internal": false
      }
    },
    "/v2/candidates/documents/{id}/company/{companyId}/vacancy/{vacancyId}": {
      "get": {
        "description": "Retrieve a feature by its unique identifier.",
        "operationId": "FeatureController_getById",
        "parameters": [
          {
            "name": "companyId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "vacancyId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CandidateDocumentsResponseDTO"
                }
              }
            }
          }
        },
        "security": [
          {
            "x-auth-api-key": []
          },
          {
            "bearer": []
          }
        ],
        "summary": "Get Feature by ID",
        "tags": [
          "Candidate Documents"
        ],
        "x-internal": false
      }
    },
    "/v2/candidates/documents/{id}/company/{companyId}/vacancy/{vacancyId}/orchestrate": {
      "post": {
        "description": "Closes a single feature module and requests orchestration to the next or specified feature module. This operation is typically used to transition a candidate from one stage of the recruitment process to another.",
        "operationId": "FeatureController_orchestrate",
        "parameters": [
          {
            "name": "companyId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "vacancyId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrchestrateFeatureRequestDTO"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "x-auth-api-key": []
          },
          {
            "bearer": []
          }
        ],
        "summary": "Close and orchestrate a feature",
        "tags": [
          "Candidate Documents"
        ],
        "x-internal": false
      }
    }
  },
  "info": {
    "title": "Candidate Documents API",
    "description": "The Candidate Documents API provides endpoints for managing and downloading candidate documents.",
    "version": "2.0",
    "contact": {
      "name": "Enzo García",
      "url": "https://hunty.com",
      "email": "enzo.garcia@hunty.com"
    }
  },
  "tags": [],
  "servers": [
    {
      "url": "https://k8s-exp-api-dev.hunty.cloud",
      "description": "Development server"
    },
    {
      "url": "https://k8s-exp-api-stg.hunty.cloud",
      "description": "Production server"
    }
  ],
  "components": {
    "securitySchemes": {
      "bearer": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "type": "http"
      },
      "x-auth-api-key": {
        "type": "apiKey",
        "in": "header",
        "name": "x-auth-api-key"
      }
    },
    "schemas": {
      "ReviewDocumentBodyDto": {
        "type": "object",
        "properties": {
          "action": {
            "type": "string",
            "enum": [
              "approve",
              "reject"
            ]
          }
        },
        "required": [
          "action"
        ]
      },
      "NotificableStatusDTO": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ]
      },
      "TemplateVariableDTO": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "example": {
            "type": "string"
          },
          "canBeUsedInHSM": {
            "type": "boolean"
          },
          "canBeUsedInStatic": {
            "type": "boolean"
          },
          "canBeUsedInTemplateIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "id",
          "name",
          "description",
          "example",
          "canBeUsedInHSM",
          "canBeUsedInStatic"
        ]
      },
      "ConversationActionButtonDTO": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "isRequired": {
            "type": "boolean"
          },
          "isEditable": {
            "type": "boolean"
          },
          "type": {
            "type": "string",
            "enum": [
              "QUICK_REPLY"
            ]
          }
        },
        "required": [
          "id",
          "text",
          "isRequired",
          "isEditable",
          "type"
        ]
      },
      "ConversationActionDTO": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "buttons": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConversationActionButtonDTO"
            }
          },
          "isBeingUsed": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "name",
          "description",
          "isBeingUsed"
        ]
      },
      "InitFeaturesCandidateRequestDTO": {
        "type": "object",
        "properties": {
          "candidateId": {
            "type": "string"
          },
          "relationId": {
            "type": "string"
          }
        },
        "required": [
          "candidateId",
          "relationId"
        ]
      },
      "InitFeaturesRequestDTO": {
        "type": "object",
        "properties": {
          "companyId": {
            "type": "string"
          },
          "vacancyId": {
            "type": "string"
          },
          "featureId": {
            "type": "string"
          },
          "sourceId": {
            "type": "string",
            "nullable": true
          },
          "origin": {
            "type": "string",
            "nullable": true
          },
          "candidates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InitFeaturesCandidateRequestDTO"
            }
          }
        },
        "required": [
          "companyId",
          "vacancyId",
          "featureId",
          "sourceId",
          "origin",
          "candidates"
        ]
      },
      "BaseFeatureStatusResponseDTO": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "descriptionCode": {
            "type": "string",
            "nullable": true
          },
          "date": {
            "type": "string"
          },
          "notificationDelay": {
            "type": "number",
            "nullable": true
          }
        },
        "required": [
          "code",
          "descriptionCode",
          "date",
          "notificationDelay"
        ]
      },
      "DocumentResponseDTO": {
        "type": "object",
        "properties": {
          "documentId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "content": {
            "type": "string"
          },
          "isRequired": {
            "type": "boolean"
          },
          "link": {
            "type": "string",
            "nullable": true
          },
          "answeredAt": {
            "type": "string",
            "nullable": true
          },
          "validated": {
            "type": "boolean",
            "nullable": true
          },
          "needsReview": {
            "type": "boolean"
          },
          "reviewReason": {
            "type": "string",
            "nullable": true
          },
          "extractionSummary": {
            "type": "object",
            "nullable": true
          },
          "documentTypeMatch": {
            "type": "boolean",
            "nullable": true
          },
          "instructionsComply": {
            "type": "boolean",
            "nullable": true
          },
          "nameMatch": {
            "type": "boolean",
            "nullable": true
          }
        },
        "required": [
          "documentId",
          "name",
          "content",
          "isRequired",
          "link",
          "answeredAt",
          "validated",
          "needsReview",
          "reviewReason",
          "extractionSummary",
          "documentTypeMatch",
          "instructionsComply",
          "nameMatch"
        ]
      },
      "CandidateDocumentsResponseDTO": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "featureId": {
            "type": "string"
          },
          "relationId": {
            "type": "string"
          },
          "candidateId": {
            "type": "string"
          },
          "vacancyId": {
            "type": "string"
          },
          "companyId": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/BaseFeatureStatusResponseDTO"
          },
          "statusHistory": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BaseFeatureStatusResponseDTO"
            }
          },
          "isClosed": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "nullable": true
          },
          "updatedAt": {
            "type": "string",
            "nullable": true
          },
          "documents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DocumentResponseDTO"
            }
          }
        },
        "required": [
          "id",
          "featureId",
          "relationId",
          "candidateId",
          "vacancyId",
          "companyId",
          "status",
          "statusHistory",
          "isClosed",
          "createdAt",
          "updatedAt",
          "documents"
        ]
      },
      "DiscardFeatureMassivelyRequestDTO": {
        "type": "object",
        "properties": {
          "resourceIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "recruiterUserId": {
            "type": "string"
          },
          "rejectedReasonId": {
            "type": "string"
          },
          "banCandidate": {
            "type": "boolean"
          },
          "fromKernel": {
            "type": "boolean"
          }
        },
        "required": [
          "resourceIds"
        ]
      },
      "ForwardFeatureMassivelyRequestDTO": {
        "type": "object",
        "properties": {
          "resourceIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "resourceIds"
        ]
      },
      "CancelFeatureMassivelyRequestDTO": {
        "type": "object",
        "properties": {
          "resourceIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "resourceIds"
        ]
      },
      "OrchestrateFeatureRequestDTO": {
        "type": "object",
        "properties": {
          "resourceId": {
            "type": "string"
          },
          "destFeatureId": {
            "type": "string"
          },
          "destPhaseId": {
            "type": "string"
          }
        },
        "required": [
          "resourceId"
        ]
      }
    }
  }
}