API Endpoints
Relevant source files
The following files were used as context for generating this wiki page:
The backend of the Resume Matcher application is built using FastAPI, providing a RESTful API for all frontend operations. The API is organized into modular routers, each handling a specific domain such as resumes, jobs, configuration, and enrichment. It leverages Pydantic models for robust data validation and serialization, ensuring a clear contract between the frontend and backend.
All endpoints are prefixed with /api/v1, which is configured in the main application entry point. The documentation below describes the endpoints relative to their router prefixes.
API Routers Overview
The following diagram shows the primary API routers and their responsibilities.
Resume Management (/resumes)
This is the core router for managing all aspects of resumes, from creation and parsing to tailoring and exporting.
Sources: apps/backend/app/routers/resumes.py
Endpoints
| Method | Path | Description |
|---|---|---|
POST | /upload | Uploads a resume file (PDF/DOCX), parses it to Markdown, and optionally to structured JSON. |
GET | / | Fetches a single resume by its ID, including raw and processed data. |
GET | /list | Lists all resumes, with an option to include the master resume. |
POST | /improve | Tailors a resume for a specific job description using an LLM. |
PATCH | /{resume_id} | Updates a resume's structured data. |
GET | /{resume_id}/pdf | Generates and downloads a resume as a PDF with customizable template settings. |
DELETE | /{resume_id} | Deletes a resume from the database. |
PATCH | /{resume_id}/cover-letter | Updates the cover letter text for a resume. |
PATCH | /{resume_id}/outreach-message | Updates the outreach message text for a resume. |
POST | /{resume_id}/generate-cover-letter | On-demand generation of a cover letter for a tailored resume. |
POST | /{resume_id}/generate-outreach | On-demand generation of an outreach message for a tailored resume. |
GET | /{resume_id}/job-description | Retrieves the job description associated with a tailored resume. |
GET | /{resume_id}/cover-letter/pdf | Generates and downloads a cover letter as a PDF. |
Resume Upload Flow
The resume upload process involves validation, parsing, and optional LLM-based structuring.
This diagram illustrates the steps taken when a user uploads a resume file.
Sources: apps/backend/app/routers/resumes.py:80-143
Resume Tailoring (Improve) Flow
The resume tailoring process is an asynchronous workflow that involves multiple services to generate an optimized resume, suggestions, and related content.
This sequence shows how the API coordinates database access and LLM services to tailor a resume.
Sources: apps/backend/app/routers/resumes.py:241-359
PDF Generation
The GET /{resume_id}/pdf endpoint generates a PDF by rendering a frontend page using a headless browser (Playwright). It accepts numerous query parameters to customize the final output.
| Parameter | Type | Description | Default |
|---|---|---|---|
template | string | swiss-single or swiss-two-column | swiss-single |
pageSize | string | A4 or LETTER | A4 |
marginTop | int | Top margin in mm (5-25) | 10 |
marginBottom | int | Bottom margin in mm (5-25) | 10 |
marginLeft | int | Left margin in mm (5-25) | 10 |
marginRight | int | Right margin in mm (5-25) | 10 |
headerFont | string | serif, sans-serif, or mono | serif |
bodyFont | string | serif, sans-serif, or mono | sans-serif |
compactMode | bool | Enables tighter spacing | false |
Sources: apps/backend/app/routers/resumes.py:417-464, AGENTS.md
Job Management (/jobs)
This router handles the ingestion of job descriptions.
Sources: apps/backend/app/routers/jobs.py
Endpoints
| Method | Path | Description |
|---|---|---|
POST | /upload | Uploads one or more job descriptions and stores them in the database. |
Resume Enrichment (/enrichment)
This feature provides an AI-powered workflow to help users enhance their master resume by answering targeted questions.
Sources: apps/backend/app/routers/enrichment.py, apps/backend/app/prompts/enrichment.py
Endpoints
| Method | Path | Description |
|---|---|---|
POST | /analyze/{resume_id} | Analyzes a resume to find weak points and generates up to 6 questions. |
POST | /enhance | Generates new, improved bullet points based on user's answers to the questions. |
POST | /apply/{resume_id} | Applies the generated enhancements by adding the new bullet points to the resume. |
Enrichment Workflow
The enrichment feature is a three-step process orchestrated between the client and the backend.
This diagram shows the interactive flow for the resume enrichment feature.
Sources: apps/backend/app/routers/enrichment.py, apps/frontend/lib/api/enrichment.ts, apps/backend/app/prompts/enrichment.py
Configuration Management (/config)
This router allows the frontend to manage application-wide settings, which are stored in a JSON file on the server.
Sources: apps/backend/app/routers/config.py
Endpoints
| Method | Path | Description |
|---|---|---|
GET | /llm | Retrieves the current LLM provider configuration. |
PUT | /llm | Updates the LLM provider, model, and API base URL. |
GET | /features | Retrieves the status of feature flags. |
PUT | /features | Enables or disables features like cover letter generation. |
GET | /language | Retrieves the current UI and content language settings. |
PUT | /language | Updates the UI and content language settings. |
GET | /api-keys | Gets the configuration status of API keys for various providers (keys are masked). |
PUT | /api-keys | Updates the API keys for providers like OpenAI, Anthropic, etc. |
Health & Status
These endpoints provide monitoring and diagnostic information about the application's state.
Sources: apps/backend/app/routers/health.py
Endpoints
| Method | Path | Description |
|---|---|---|
GET | /health | A simple health check that verifies API responsiveness and LLM connectivity. Used for Docker health checks. |
GET | /status | Provides a detailed status report including LLM configuration, database statistics, and whether a master resume exists. |
Data Models
The API relies heavily on Pydantic models defined in apps/backend/app/schemas/models.py to structure requests and responses.
ResumeData Model
The ResumeData model is central to the application, representing a complete, structured resume. It supports both default sections and dynamic custom sections.
# A simplified representation of the Pydantic model
class ResumeData(BaseModel):
# Default sections
personalInfo: PersonalInfo
summary: str
workExperience: list[Experience]
education: list[Education]
personalProjects: list[Project]
additional: AdditionalInfo
# Dynamic section management
sectionMeta: list[SectionMeta]
customSections: dict[str, CustomSection]
Sources: apps/backend/app/schemas/models.py:186-198
A helper function, normalize_resume_data, is used to lazily migrate older resume data formats by adding the sectionMeta and customSections fields if they are missing, ensuring backward compatibility.
Sources: apps/backend/app/schemas/models.py:165-183