API Routes

This section contains the routing and API endpoint details for the Server module. These robust APIs operate as the bridge between standard interfaces and the integrated Gemini evaluation orchestration.

Job Management

POST /api/jobs

Creates a new job listing securely validating fields against Mongoose + Zod schema. Required Payload Type: JSON { title, description, requirements: string[], skills: string[] }

GET /api/jobs

Fetches all active jobs (both open and closed statues). Defaults sort to newest first.

GET /api/jobs/:id

Fetches all details for a single job description. Returns 404 natively if unmapped.

PUT /api/jobs/:id

Updates an existing job listing. Accepts partial updates to title, description, requirements, skills, or status.

DELETE /api/jobs/:id

Permanently removes a job listing and its metadata from the database.


Applicant Ingestion Pipelines

POST /api/applicants/structured

Handles Scenario 1. Strictly ingests JSON candidates conforming exactly to the structured Talent Profile Schema from Umurava. Payload: JSON Array of candidates OR single JSON object. Requires injected jobId.

POST /api/applicants/upload

Handles Scenario 2 Advanced parsing. Consumes unstructured PDF resumes. Triggers multer + pdf-parse pipe and intelligently transforms blobbed text via gemini-1.5-flash natively back down to strict structural Schema! Payload Type:multipart/form-data with fields jobId & resume (PDF Blob).

GET /api/applicants/job/:jobId

Retrieves all structurally standardized candidates bound to a given job vacancy.


AI Screening & Results Integration

POST /api/screening/trigger/:jobId

The core Orchestration route. Synchronizes the contextual Job data against all linked Applicants, strips their excess bloat to save Context Window overhead, and invokes the bespoke AI Service. Automatically performs bulkInsert database syncing upon conclusion!

GET /api/screening/results/:jobId

Leaderboard Retrieval Route! Aggregates screening scores (rank, matchScore, strengths, gapsRisks) while utilizing .populate() to natively append base Applicant stats directly in the request. Served entirely pre-sorted.