curl --request POST \
--url https://api.example.com/api/interview/ \
--header 'Content-Type: application/json' \
--data '
{
"jobDescription": "<string>",
"title": "<string>",
"jobTitle": "<string>",
"selfDescription": "<string>"
}
'{
"message": "<string>",
"interviewReport": {
"_id": "<string>",
"user": "<string>",
"title": "<string>",
"jobDescription": "<string>",
"resume": "<string>",
"selfDescription": "<string>",
"matchScore": 123,
"technicalQuestions": [
{
"question": "<string>",
"intention": "<string>",
"answer": "<string>"
}
],
"behavioralQuestions": [
{
"question": "<string>",
"intention": "<string>",
"answer": "<string>"
}
],
"skillGaps": [
{
"skill": "<string>",
"severity": "<string>"
}
],
"preparationPlan": [
{
"day": 123,
"focus": "<string>",
"tasks": [
{}
]
}
],
"createdAt": "<string>",
"updatedAt": "<string>"
}
}curl --request POST \
--url https://api.example.com/api/interview/ \
--header 'Content-Type: application/json' \
--data '
{
"jobDescription": "<string>",
"title": "<string>",
"jobTitle": "<string>",
"selfDescription": "<string>"
}
'{
"message": "<string>",
"interviewReport": {
"_id": "<string>",
"user": "<string>",
"title": "<string>",
"jobDescription": "<string>",
"resume": "<string>",
"selfDescription": "<string>",
"matchScore": 123,
"technicalQuestions": [
{
"question": "<string>",
"intention": "<string>",
"answer": "<string>"
}
],
"behavioralQuestions": [
{
"question": "<string>",
"intention": "<string>",
"answer": "<string>"
}
],
"skillGaps": [
{
"skill": "<string>",
"severity": "<string>"
}
],
"preparationPlan": [
{
"day": 123,
"focus": "<string>",
"tasks": [
{}
]
}
],
"createdAt": "<string>",
"updatedAt": "<string>"
}
}token. This is automatically handled by the browser after successful login.
multipart/form-data with the following fields:
title is not provided.resume file must be provided.selfDescription must be provided.Supported formats:.pdf) - Detected via magic bytes: %PDF (0x25 0x50 0x44 0x46).docx) - Detected via magic bytes: PK.. (0x50 0x4b 0x03 0x04)pdf-parsemammothcurl -X POST https://api.example.com/api/interview/ \
-b "token=YOUR_JWT_TOKEN" \
-F "jobDescription=We are looking for a Senior Software Engineer with 5+ years of experience in React and Node.js..." \
-F "title=Senior Software Engineer" \
-F "selfDescription=I am a full-stack developer with 6 years of experience..." \
-F "resume=@/path/to/resume.pdf"
const formData = new FormData();
formData.append('jobDescription', 'We are looking for a Senior Software Engineer...');
formData.append('title', 'Senior Software Engineer');
formData.append('selfDescription', 'I am a full-stack developer...');
formData.append('resume', fileInput.files[0]);
fetch('https://api.example.com/api/interview/', {
method: 'POST',
credentials: 'include', // Important: Include cookies
body: formData
});
Show interviewReport
Show preparationPlan[]
{
"message": "Interview report generated successfully.",
"interviewReport": {
"_id": "507f1f77bcf86cd799439011",
"user": "507f191e810c19729de860ea",
"title": "Senior Software Engineer",
"jobDescription": "We are looking for a Senior Software Engineer...",
"resume": "John Doe\nSoftware Engineer\n...",
"selfDescription": "I am a full-stack developer...",
"matchScore": 85,
"technicalQuestions": [
{
"question": "Can you explain the virtual DOM in React and how it improves performance?",
"intention": "To assess understanding of React's core concepts and performance optimization",
"answer": "The virtual DOM is a lightweight copy of the actual DOM. React uses it to minimize direct DOM manipulations by..."
}
],
"behavioralQuestions": [
{
"question": "Tell me about a time when you had to work with a difficult team member.",
"intention": "To evaluate interpersonal skills and conflict resolution abilities",
"answer": "Use the STAR method: Situation, Task, Action, Result. Focus on how you..."
}
],
"skillGaps": [
{
"skill": "Kubernetes",
"severity": "medium"
},
{
"skill": "GraphQL",
"severity": "low"
}
],
"preparationPlan": [
{
"day": 1,
"focus": "React fundamentals and advanced concepts",
"tasks": [
"Review React hooks and their use cases",
"Practice implementing custom hooks",
"Study React performance optimization techniques"
]
},
{
"day": 2,
"focus": "Node.js and backend architecture",
"tasks": [
"Review REST API design principles",
"Study microservices architecture patterns",
"Practice writing Express middleware"
]
}
],
"createdAt": "2026-03-03T10:30:00.000Z",
"updatedAt": "2026-03-03T10:30:00.000Z"
}
}
{
"message": "Job description is required (send as 'jobDescription')."
}
{
"message": "Either a resume file (field 'resume') or 'selfDescription' is required."
}
{
"message": "Unsupported resume file type. Please upload a PDF or DOCX."
}
{
"message": "Unable to read the uploaded resume. Please upload a valid PDF/DOCX or provide 'selfDescription'."
}
{
"message": "Could not extract text from the resume file. Please upload a text-based PDF/DOCX or provide 'selfDescription'."
}
{
"message": "Validation error message from MongoDB schema"
}
{
"message": "AI service failed to generate interview report. Please try again."
}
ai.service.js ensures structured and validated output from the AI model