{
  "openapi": "3.1.0",
  "info": {
    "title": "ModernCV Agent API",
    "version": "1.0.0",
    "description": "Draft-to-PDF resume API for AI agents: writing guides, example resumes, 44 templates, PNG previews, vector PDFs and editor handoff links. No auth; rendering is limited to 6 requests per minute per IP. Resumes are not stored. The same tools are available over MCP at https://genedai.cv/mcp."
  },
  "servers": [
    {
      "url": "https://genedai.cv"
    }
  ],
  "security": [],
  "paths": {
    "/api/agent/templates": {
      "get": {
        "operationId": "listTemplates",
        "summary": "List resume templates",
        "parameters": [
          {
            "name": "ats_only",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Templates",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/agent/guide": {
      "get": {
        "operationId": "getWritingGuide",
        "summary": "Resume writing guide for a job title",
        "parameters": [
          {
            "name": "job_title",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "Data Analyst"
          }
        ],
        "responses": {
          "200": {
            "description": "Guide",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/agent/example": {
      "get": {
        "operationId": "getExampleResume",
        "summary": "A complete example resume for a job title; its `resume` field is render-ready",
        "parameters": [
          {
            "name": "job_title",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "Registered Nurse (RN)"
          }
        ],
        "responses": {
          "200": {
            "description": "Example",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "jobTitle": {
                      "type": "string"
                    },
                    "family": {
                      "type": "string"
                    },
                    "page": {
                      "type": "string"
                    },
                    "resume": {
                      "type": "object"
                    },
                    "matchedTitle": {
                      "type": "string"
                    },
                    "exact": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/agent/link": {
      "post": {
        "operationId": "createEditorLink",
        "summary": "Editor URL with the resume preloaded (carried in the URL fragment, not stored)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "resume"
                ],
                "properties": {
                  "resume": {
                    "$ref": "https://genedai.cv/resume.schema.json",
                    "description": "ModernCV resume object, or a JSON Resume document."
                  },
                  "template": {
                    "type": "string",
                    "enum": [
                      "classic",
                      "modern",
                      "ivy",
                      "banking",
                      "vanguard",
                      "timeline",
                      "executive",
                      "compact",
                      "academic",
                      "tech",
                      "silk",
                      "lateral",
                      "opal",
                      "meridian",
                      "keystone",
                      "vital",
                      "minimalist",
                      "duo",
                      "altitude",
                      "halo",
                      "europa",
                      "tokyo",
                      "jade",
                      "portrait",
                      "prism",
                      "sidebar",
                      "creative",
                      "professional",
                      "elegant",
                      "swiss",
                      "berlin",
                      "iron",
                      "ginto",
                      "symmetry",
                      "path",
                      "wireframe",
                      "quartz",
                      "bronx",
                      "paper",
                      "moda",
                      "noir",
                      "mono",
                      "pop",
                      "cast"
                    ],
                    "default": "modern"
                  },
                  "accent": {
                    "type": "string",
                    "pattern": "^#[0-9A-Fa-f]{6}$",
                    "description": "Accent colour; omit for the template default."
                  },
                  "font": {
                    "type": "string",
                    "enum": [
                      "template",
                      "inter",
                      "source-sans",
                      "lato",
                      "roboto",
                      "source-serif",
                      "charis",
                      "garamond",
                      "tinos",
                      "plex-serif"
                    ],
                    "default": "template"
                  },
                  "scale": {
                    "type": "number",
                    "minimum": 0.85,
                    "maximum": 1.15,
                    "default": 1,
                    "description": "Text size; lower it to fit one page."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Link",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string"
                    },
                    "template": {
                      "type": "string"
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/agent/preview": {
      "post": {
        "operationId": "renderPreview",
        "summary": "Render page 1 as PNG",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "resume"
                ],
                "properties": {
                  "resume": {
                    "$ref": "https://genedai.cv/resume.schema.json",
                    "description": "ModernCV resume object, or a JSON Resume document."
                  },
                  "template": {
                    "type": "string",
                    "enum": [
                      "classic",
                      "modern",
                      "ivy",
                      "banking",
                      "vanguard",
                      "timeline",
                      "executive",
                      "compact",
                      "academic",
                      "tech",
                      "silk",
                      "lateral",
                      "opal",
                      "meridian",
                      "keystone",
                      "vital",
                      "minimalist",
                      "duo",
                      "altitude",
                      "halo",
                      "europa",
                      "tokyo",
                      "jade",
                      "portrait",
                      "prism",
                      "sidebar",
                      "creative",
                      "professional",
                      "elegant",
                      "swiss",
                      "berlin",
                      "iron",
                      "ginto",
                      "symmetry",
                      "path",
                      "wireframe",
                      "quartz",
                      "bronx",
                      "paper",
                      "moda",
                      "noir",
                      "mono",
                      "pop",
                      "cast"
                    ],
                    "default": "modern"
                  },
                  "accent": {
                    "type": "string",
                    "pattern": "^#[0-9A-Fa-f]{6}$",
                    "description": "Accent colour; omit for the template default."
                  },
                  "font": {
                    "type": "string",
                    "enum": [
                      "template",
                      "inter",
                      "source-sans",
                      "lato",
                      "roboto",
                      "source-serif",
                      "charis",
                      "garamond",
                      "tinos",
                      "plex-serif"
                    ],
                    "default": "template"
                  },
                  "scale": {
                    "type": "number",
                    "minimum": 0.85,
                    "maximum": 1.15,
                    "default": 1,
                    "description": "Text size; lower it to fit one page."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "PNG",
            "headers": {
              "x-resume-pages": {
                "description": "Height in A4 pages.",
                "schema": {
                  "type": "integer"
                }
              },
              "x-resume-warnings": {
                "description": "URL-encoded JSON array of content warnings.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "image/png": {}
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/agent/pdf": {
      "post": {
        "operationId": "renderPdf",
        "summary": "Render an A4 vector PDF",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "resume"
                ],
                "properties": {
                  "resume": {
                    "$ref": "https://genedai.cv/resume.schema.json",
                    "description": "ModernCV resume object, or a JSON Resume document."
                  },
                  "template": {
                    "type": "string",
                    "enum": [
                      "classic",
                      "modern",
                      "ivy",
                      "banking",
                      "vanguard",
                      "timeline",
                      "executive",
                      "compact",
                      "academic",
                      "tech",
                      "silk",
                      "lateral",
                      "opal",
                      "meridian",
                      "keystone",
                      "vital",
                      "minimalist",
                      "duo",
                      "altitude",
                      "halo",
                      "europa",
                      "tokyo",
                      "jade",
                      "portrait",
                      "prism",
                      "sidebar",
                      "creative",
                      "professional",
                      "elegant",
                      "swiss",
                      "berlin",
                      "iron",
                      "ginto",
                      "symmetry",
                      "path",
                      "wireframe",
                      "quartz",
                      "bronx",
                      "paper",
                      "moda",
                      "noir",
                      "mono",
                      "pop",
                      "cast"
                    ],
                    "default": "modern"
                  },
                  "accent": {
                    "type": "string",
                    "pattern": "^#[0-9A-Fa-f]{6}$",
                    "description": "Accent colour; omit for the template default."
                  },
                  "font": {
                    "type": "string",
                    "enum": [
                      "template",
                      "inter",
                      "source-sans",
                      "lato",
                      "roboto",
                      "source-serif",
                      "charis",
                      "garamond",
                      "tinos",
                      "plex-serif"
                    ],
                    "default": "template"
                  },
                  "scale": {
                    "type": "number",
                    "minimum": 0.85,
                    "maximum": 1.15,
                    "default": 1,
                    "description": "Text size; lower it to fit one page."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "PDF",
            "headers": {
              "x-resume-pages": {
                "description": "Height in A4 pages.",
                "schema": {
                  "type": "integer"
                }
              },
              "x-resume-warnings": {
                "description": "URL-encoded JSON array of content warnings.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/pdf": {}
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            }
          }
        }
      }
    }
  }
}
