{
  "openapi": "3.0.0",
  "paths": {
    "/v2/candidates/psychometrics/{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/CandidatePsychometricResponseDTO"
                }
              }
            }
          }
        },
        "security": [
          {
            "x-auth-api-key": []
          },
          {
            "bearer": []
          }
        ],
        "summary": "Get Feature by ID",
        "tags": [
          "Candidate Psychometric"
        ],
        "x-internal": false
      }
    },
    "/v2/candidates/psychometrics/{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 Psychometric"
        ],
        "x-internal": false
      }
    }
  },
  "info": {
    "title": "Candidate Psychometric API",
    "description": "The Candidate Psychometric API provides endpoints for managing candidate psychometric test processes.",
    "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": {
      "WebhookTriggerEventV2DTO": {
        "type": "object",
        "properties": {
          "webhookId": {
            "type": "string"
          },
          "idempotencyId": {
            "type": "string"
          },
          "domain": {
            "type": "string"
          },
          "event": {
            "type": "string"
          },
          "version": {
            "type": "number"
          },
          "timestamp": {
            "type": "number"
          },
          "payload": {
            "type": "object"
          }
        },
        "required": [
          "webhookId",
          "idempotencyId",
          "domain",
          "event",
          "version",
          "timestamp",
          "payload"
        ]
      },
      "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"
        ]
      },
      "ReportLinkDTO": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Report identifier/label (e.g. \"candidate\")."
          },
          "url": {
            "type": "string",
            "description": "Downloadable URL for this report."
          }
        },
        "required": [
          "name",
          "url"
        ]
      },
      "CandidatePsychometricResponseDTO": {
        "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
          },
          "submissionId": {
            "type": "string",
            "nullable": true,
            "description": "Company-side submission id. Null until the submission is created."
          },
          "link": {
            "type": "string",
            "nullable": true,
            "description": "Test link sent to the candidate. Null until accepted."
          },
          "evaluationId": {
            "type": "number",
            "nullable": true,
            "description": "Provider evaluation id. Null until assigned."
          },
          "evaluationName": {
            "type": "string",
            "nullable": true,
            "description": "Provider evaluation name. Null until assigned."
          },
          "reports": {
            "description": "Report links available once the test is finished.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReportLinkDTO"
            }
          }
        },
        "required": [
          "id",
          "featureId",
          "relationId",
          "candidateId",
          "vacancyId",
          "companyId",
          "status",
          "statusHistory",
          "isClosed",
          "createdAt",
          "updatedAt",
          "reports"
        ]
      },
      "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"
        ]
      }
    }
  }
}