openapi: 3.1.0 info: # Do not change the title, if the title changes, the import paths will be broken title: Api version: 0.1.0 description: PrepForge API specification servers: - url: /api description: Base API path tags: - name: health description: Health operations - name: openai description: OpenAI AI chat, image, and audio operations - name: interview description: Mock interview operations - name: aptitude description: Aptitude test operations - name: resume description: Resume analyzer operations paths: /healthz: get: operationId: healthCheck tags: [health] summary: Health check description: Returns server health status responses: "200": description: Healthy content: application/json: schema: $ref: "#/components/schemas/HealthStatus" /openai/conversations: get: operationId: listOpenaiConversations tags: [openai] summary: List all conversations responses: "200": description: List of conversations content: application/json: schema: type: array items: $ref: "#/components/schemas/OpenaiConversation" post: operationId: createOpenaiConversation tags: [openai] summary: Create a new conversation requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/CreateOpenaiConversationBody" responses: "201": description: Created conversation content: application/json: schema: $ref: "#/components/schemas/OpenaiConversation" /openai/conversations/{id}: get: operationId: getOpenaiConversation tags: [openai] summary: Get conversation with messages parameters: - name: id in: path required: true schema: type: integer responses: "200": description: Conversation with messages content: application/json: schema: $ref: "#/components/schemas/OpenaiConversationWithMessages" "404": description: Not found content: application/json: schema: $ref: "#/components/schemas/OpenaiError" delete: operationId: deleteOpenaiConversation tags: [openai] summary: Delete a conversation parameters: - name: id in: path required: true schema: type: integer responses: "204": description: Deleted "404": description: Not found content: application/json: schema: $ref: "#/components/schemas/OpenaiError" /openai/conversations/{id}/messages: get: operationId: listOpenaiMessages tags: [openai] summary: List messages in a conversation parameters: - name: id in: path required: true schema: type: integer responses: "200": description: List of messages content: application/json: schema: type: array items: $ref: "#/components/schemas/OpenaiMessage" post: operationId: sendOpenaiMessage tags: [openai] summary: Send a text message and receive a streaming text response parameters: - name: id in: path required: true schema: type: integer requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/SendOpenaiMessageBody" responses: "200": description: SSE stream of assistant text chunks content: text/event-stream: {} /openai/conversations/{id}/voice-messages: post: operationId: sendOpenaiVoiceMessage tags: [openai] summary: Send audio and receive a streaming voice response parameters: - name: id in: path required: true schema: type: integer requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/SendOpenaiVoiceMessageBody" responses: "200": description: SSE stream of transcript and audio chunks content: text/event-stream: {} /openai/generate-image: post: operationId: generateOpenaiImage tags: [openai] summary: Generate an image from a text prompt requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/GenerateOpenaiImageBody" responses: "200": description: Generated image data content: application/json: schema: $ref: "#/components/schemas/GenerateOpenaiImageResponse" /interview/generate: post: operationId: generateInterviewQuestions tags: [interview] summary: Generate mock interview questions requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/GenerateInterviewQuestionsBody" responses: "200": description: Generated interview questions content: application/json: schema: $ref: "#/components/schemas/InterviewQuestionsResponse" /interview/evaluate: post: operationId: evaluateInterviewAnswer tags: [interview] summary: Evaluate a single interview answer requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/EvaluateAnswerBody" responses: "200": description: Evaluation result content: application/json: schema: $ref: "#/components/schemas/EvaluateAnswerResponse" /interview/sessions: get: operationId: listInterviewSessions tags: [interview] summary: List all past interview sessions responses: "200": description: List of sessions content: application/json: schema: type: array items: $ref: "#/components/schemas/InterviewSession" post: operationId: createInterviewSession tags: [interview] summary: Save a completed interview session requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/CreateInterviewSessionBody" responses: "201": description: Created session content: application/json: schema: $ref: "#/components/schemas/InterviewSession" /interview/sessions/{id}: get: operationId: getInterviewSession tags: [interview] summary: Get a specific interview session with answers parameters: - name: id in: path required: true schema: type: integer responses: "200": description: Interview session detail content: application/json: schema: $ref: "#/components/schemas/InterviewSessionDetail" /interview/stats: get: operationId: getInterviewStats tags: [interview] summary: Get aggregated interview performance stats responses: "200": description: Interview stats content: application/json: schema: $ref: "#/components/schemas/InterviewStats" /interview/tts: post: operationId: interviewTextToSpeech tags: [interview] summary: Convert interview question text to speech audio requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/TextToSpeechBody" responses: "200": description: Audio data as base64 content: application/json: schema: $ref: "#/components/schemas/TextToSpeechResponse" /interview/stt: post: operationId: interviewSpeechToText tags: [interview] summary: Transcribe recorded answer audio to text requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/SpeechToTextBody" responses: "200": description: Transcription result content: application/json: schema: $ref: "#/components/schemas/SpeechToTextResponse" /aptitude/generate: post: operationId: generateAptitudeTest tags: [aptitude] summary: Generate aptitude MCQ test requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/GenerateAptitudeTestBody" responses: "200": description: Generated MCQ questions content: application/json: schema: $ref: "#/components/schemas/AptitudeTestResponse" /aptitude/submit: post: operationId: submitAptitudeTest tags: [aptitude] summary: Submit aptitude test answers and get score requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/SubmitAptitudeTestBody" responses: "200": description: Test result with score and explanations content: application/json: schema: $ref: "#/components/schemas/AptitudeTestResult" /aptitude/sessions: get: operationId: listAptitudeSessions tags: [aptitude] summary: List all past aptitude test sessions responses: "200": description: List of aptitude sessions content: application/json: schema: type: array items: $ref: "#/components/schemas/AptitudeSession" post: operationId: saveAptitudeSession tags: [aptitude] summary: Save a completed aptitude test session requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/SaveAptitudeSessionBody" responses: "201": description: Saved session content: application/json: schema: $ref: "#/components/schemas/AptitudeSession" /aptitude/stats: get: operationId: getAptitudeStats tags: [aptitude] summary: Get aggregated aptitude test performance stats responses: "200": description: Aptitude stats content: application/json: schema: $ref: "#/components/schemas/AptitudeStats" /resume/analyze: post: operationId: analyzeResume tags: [resume] summary: Analyze resume PDF against a target role and company requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/AnalyzeResumeBody" responses: "200": description: Resume analysis result content: application/json: schema: $ref: "#/components/schemas/ResumeAnalysisResult" /resume/sessions: get: operationId: listResumeSessions tags: [resume] summary: List all past resume analysis sessions responses: "200": description: List of resume sessions content: application/json: schema: type: array items: $ref: "#/components/schemas/ResumeSession" post: operationId: saveResumeSession tags: [resume] summary: Save a resume analysis session requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/SaveResumeSessionBody" responses: "201": description: Saved session content: application/json: schema: $ref: "#/components/schemas/ResumeSession" /resume/stats: get: operationId: getResumeStats tags: [resume] summary: Get aggregated resume analysis stats responses: "200": description: Resume stats content: application/json: schema: $ref: "#/components/schemas/ResumeStats" components: schemas: HealthStatus: type: object properties: status: type: string required: - status OpenaiConversation: type: object properties: id: type: integer title: type: string createdAt: type: string format: date-time required: - id - title - createdAt OpenaiMessage: type: object properties: id: type: integer conversationId: type: integer role: type: string content: type: string createdAt: type: string format: date-time required: - id - conversationId - role - content - createdAt CreateOpenaiConversationBody: type: object properties: title: type: string required: - title SendOpenaiMessageBody: type: object properties: content: type: string required: - content SendOpenaiVoiceMessageBody: type: object properties: audio: type: string description: Base64-encoded audio data required: - audio OpenaiConversationWithMessages: type: object properties: id: type: integer title: type: string createdAt: type: string format: date-time messages: type: array items: $ref: "#/components/schemas/OpenaiMessage" required: - id - title - createdAt - messages GenerateOpenaiImageBody: type: object properties: prompt: type: string size: type: string enum: ["1024x1024", "512x512", "256x256"] required: - prompt GenerateOpenaiImageResponse: type: object properties: b64_json: type: string required: - b64_json OpenaiError: type: object properties: error: type: string required: - error GenerateInterviewQuestionsBody: type: object properties: name: type: string role: type: string experience: type: string company: type: string required: - name - role - experience - company InterviewQuestionsResponse: type: object properties: questions: type: array items: type: string sessionContext: type: object properties: name: type: string role: type: string experience: type: string company: type: string required: - name - role - experience - company required: - questions - sessionContext EvaluateAnswerBody: type: object properties: question: type: string answer: type: string role: type: string company: type: string required: - question - answer - role - company EvaluateAnswerResponse: type: object properties: score: type: integer feedback: type: string strengths: type: array items: type: string improvements: type: array items: type: string required: - score - feedback - strengths - improvements InterviewSession: type: object properties: id: type: integer name: type: string role: type: string company: type: string experience: type: string overallScore: type: number createdAt: type: string format: date-time required: - id - name - role - company - experience - overallScore - createdAt InterviewAnswer: type: object properties: question: type: string answer: type: string score: type: integer feedback: type: string required: - question - answer - score - feedback InterviewSessionDetail: type: object properties: id: type: integer name: type: string role: type: string company: type: string experience: type: string overallScore: type: number createdAt: type: string format: date-time answers: type: array items: $ref: "#/components/schemas/InterviewAnswer" required: - id - name - role - company - experience - overallScore - createdAt - answers CreateInterviewSessionBody: type: object properties: name: type: string role: type: string company: type: string experience: type: string overallScore: type: number answers: type: array items: $ref: "#/components/schemas/InterviewAnswer" required: - name - role - company - experience - overallScore - answers InterviewStats: type: object properties: totalSessions: type: integer averageScore: type: number topRoles: type: array items: type: string topCompanies: type: array items: type: string recentImprovement: type: number required: - totalSessions - averageScore - topRoles - topCompanies - recentImprovement TextToSpeechBody: type: object properties: text: type: string voice: type: string required: - text TextToSpeechResponse: type: object properties: audio: type: string description: Base64-encoded audio format: type: string required: - audio - format SpeechToTextBody: type: object properties: audio: type: string description: Base64-encoded audio data format: type: string required: - audio SpeechToTextResponse: type: object properties: transcript: type: string required: - transcript MCQOption: type: object properties: label: type: string text: type: string required: - label - text MCQQuestion: type: object properties: id: type: integer question: type: string options: type: array items: $ref: "#/components/schemas/MCQOption" correctAnswer: type: string explanation: type: string required: - id - question - options - correctAnswer - explanation GenerateAptitudeTestBody: type: object properties: company: type: string category: type: string count: type: integer required: - company - category AptitudeTestResponse: type: object properties: questions: type: array items: $ref: "#/components/schemas/MCQQuestion" company: type: string category: type: string required: - questions - company - category UserAnswer: type: object properties: questionId: type: integer selectedAnswer: type: string required: - questionId - selectedAnswer SubmitAptitudeTestBody: type: object properties: questions: type: array items: $ref: "#/components/schemas/MCQQuestion" userAnswers: type: array items: $ref: "#/components/schemas/UserAnswer" company: type: string category: type: string required: - questions - userAnswers - company - category AnswerResult: type: object properties: questionId: type: integer question: type: string selectedAnswer: type: string correctAnswer: type: string isCorrect: type: boolean explanation: type: string required: - questionId - question - selectedAnswer - correctAnswer - isCorrect - explanation AptitudeTestResult: type: object properties: score: type: integer total: type: integer percentage: type: number results: type: array items: $ref: "#/components/schemas/AnswerResult" feedback: type: string required: - score - total - percentage - results - feedback AptitudeSession: type: object properties: id: type: integer company: type: string category: type: string score: type: integer total: type: integer percentage: type: number createdAt: type: string format: date-time required: - id - company - category - score - total - percentage - createdAt SaveAptitudeSessionBody: type: object properties: company: type: string category: type: string score: type: integer total: type: integer percentage: type: number required: - company - category - score - total - percentage AptitudeStats: type: object properties: totalTests: type: integer averageScore: type: number bestCategory: type: string topCompanies: type: array items: type: string recentTrend: type: number required: - totalTests - averageScore - bestCategory - topCompanies - recentTrend AnalyzeResumeBody: type: object properties: resumeText: type: string role: type: string company: type: string required: - resumeText - role - company ResumeAnalysisResult: type: object properties: score: type: integer skills: type: array items: type: string missingSkills: type: array items: type: string suggestions: type: array items: type: string strengths: type: array items: type: string summary: type: string atsCompatibility: type: integer required: - score - skills - missingSkills - suggestions - strengths - summary - atsCompatibility ResumeSession: type: object properties: id: type: integer role: type: string company: type: string score: type: integer atsCompatibility: type: integer createdAt: type: string format: date-time required: - id - role - company - score - atsCompatibility - createdAt SaveResumeSessionBody: type: object properties: role: type: string company: type: string score: type: integer atsCompatibility: type: integer skills: type: array items: type: string suggestions: type: array items: type: string required: - role - company - score - atsCompatibility - skills - suggestions ResumeStats: type: object properties: totalAnalyses: type: integer averageScore: type: number averageAtsScore: type: number topRoles: type: array items: type: string improvementTrend: type: number required: - totalAnalyses - averageScore - averageAtsScore - topRoles - improvementTrend