Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/CristianParadaLopez/cv-builder/llms.txt

Use this file to discover all available pages before exploring further.

Send form data and style preferences to generate a complete CV HTML document. The endpoint validates the input, builds a style-specific prompt based on the requested template, and routes the request through the OpenRouter multi-model fallback system. The resulting HTML is a self-contained document ready to display in a browser or forward to the /api/cv/pdf endpoint.

Request

Method: POST
Path: /api/cv/generate
Content-Type: application/json
formData
object
required
A CVFormData object containing all of the candidate’s resume information. The name and email fields are required within this object; all other fields are optional. See the CVFormData reference for the full field list.
style
string
The visual template to use. Must be one of "moderno", "clasico", "minimalista", or "creativo". Invalid or missing values default to "moderno". See CV Types for a description of each style.
mode
string
The layout mode. Must be "designed" or "ats". When set to "ats", the style value is ignored and a single-column, black-and-white ATS-safe layout is generated instead. Invalid or missing values default to "designed".

Validation

The controller applies the following checks before calling the AI service:
  • formData must be present and must be a plain object.
  • formData.name and formData.email must both be non-empty strings.
  • style is validated against ["moderno", "clasico", "minimalista", "creativo"]; any value not in this list is silently replaced with "moderno".
  • mode is validated against ["ats", "designed"]; any value not in this list is silently replaced with "designed".
If formData contains a photo field with a base64 data URI (e.g. "data:image/jpeg;base64,...") it is stripped before the prompt is sent to the AI model and re-injected into the returned HTML afterward. The AI receives a literal PHOTO_PLACEHOLDER string as the src attribute value instead of the full base64 string.

Response

Status: 200 OK
html
string
A complete HTML document beginning with <!DOCTYPE html> and ending with </html>. The document embeds all CSS in a <style> block in the <head> and is constrained to a max-width of 794 px (A4 width). It includes @media print rules so it renders correctly when sent to /api/cv/pdf.

Error responses

StatusCondition
400formData is missing, not an object, or formData.name / formData.email is absent
500All configured AI models and API keys failed to return a valid response
Error bodies follow the standard envelope:
{ "error": "Nombre y email son campos requeridos" }

Example request

curl -X POST http://localhost:3001/api/cv/generate \
  -H 'Content-Type: application/json' \
  -d '{
    "formData": {
      "name": "Ana García",
      "email": "ana@example.com",
      "phone": "+503 7000-0000",
      "location": "San Salvador, El Salvador",
      "title": "Frontend Developer",
      "summary": "Desarrolladora web con 3 años de experiencia en React.",
      "experience": [
        {
          "company": "TechCorp",
          "position": "Frontend Developer",
          "startDate": "Ene 2022",
          "endDate": "Presente",
          "description": "Desarrollo de interfaces con React y TypeScript."
        }
      ],
      "education": [
        {
          "institution": "Universidad de El Salvador",
          "degree": "Ingeniería en Sistemas",
          "startDate": "Ene 2018",
          "endDate": "Dic 2022"
        }
      ],
      "skills": ["React", "TypeScript", "Tailwind CSS"],
      "tools": ["Vite", "Git", "Figma"],
      "languages": ["Español (nativo)", "Inglés (avanzado)"]
    },
    "style": "moderno",
    "mode": "designed"
  }'

Example response

{ "html": "<!DOCTYPE html><html lang='es'><head>...</head><body>...</body></html>" }
Pass the html value directly to POST /api/cv/pdf to produce a downloadable PDF without any additional editing steps.

Build docs developers (and LLMs) love