Skip to main content

Export Resume as PDF

GET /api/v1/resumes/:id/pdf

Export a resume as a PDF file. The response is the raw PDF binary, which will be downloaded directly.

This endpoint generates a fresh PDF with accurate height calculations, so the output matches what you see in the Enhancv editor. Generation typically takes 5-15 seconds.

Request

Headers

HeaderValueRequired
AuthorizationBearer YOUR_API_KEYREQUIRED

Path Parameters

ParameterTypeDescription
idstringResume ID (from List Resumes endpoint) REQUIRED

Response

Success Response

Status Code: 200 OK

Content-Type: application/pdf

The response body is the raw PDF binary. The Content-Disposition header is set to trigger a file download with the resume owner's name as the filename.

Response Headers:

HeaderValue
Content-Typeapplication/pdf
Content-Dispositionattachment; filename="John Doe.pdf"
Content-LengthFile size in bytes

Examples

Download PDF

curl -o resume.pdf \
  https://api.enhancv.com/api/v1/resumes/64f1a2b3c4d5e6f7g8h9i0j1/pdf \
  -H "Authorization: Bearer enh_live_your_api_key_here"
const fs = require('fs');

const resumeId = '64f1a2b3c4d5e6f7g8h9i0j1';

const response = await fetch(
  `https://api.enhancv.com/api/v1/resumes/${resumeId}/pdf`,
  {
    headers: {
      'Authorization': 'Bearer enh_live_your_api_key_here'
    }
  }
);

if (!response.ok) {
  throw new Error(`Export failed: ${response.status}`);
}

const buffer = Buffer.from(await response.arrayBuffer());
fs.writeFileSync('resume.pdf', buffer);
console.log('PDF saved to resume.pdf');
import requests

resume_id = '64f1a2b3c4d5e6f7g8h9i0j1'

response = requests.get(
    f'https://api.enhancv.com/api/v1/resumes/{resume_id}/pdf',
    headers={'Authorization': 'Bearer enh_live_your_api_key_here'}
)

response.raise_for_status()

with open('resume.pdf', 'wb') as f:
    f.write(response.content)

print('PDF saved to resume.pdf')

Upload, Create, and Export

const fs = require('fs');

const API_KEY = 'enh_live_your_api_key_here';
const BASE_URL = 'https://api.enhancv.com/api/v1';

// Step 1: Create a resume
const createResponse = await fetch(`${BASE_URL}/resumes`, {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${API_KEY}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    header: {
      name: 'John Doe',
      title: 'Software Engineer',
      email: 'john@example.com'
    },
    sections: {
      experiences: {
        name: 'Experience',
        column: 0,
        order: 0,
        items: [{
          workplace: 'Tech Corp',
          position: 'Senior Engineer',
          dateRange: { fromYear: 2020, fromMonth: 0 },
          bullets: ['Led team of 5 engineers']
        }]
      }
    }
  })
});

const { id } = await createResponse.json();

// Step 2: Export as PDF
const pdfResponse = await fetch(`${BASE_URL}/resumes/${id}/pdf`, {
  headers: {
    'Authorization': `Bearer ${API_KEY}`
  }
});

const pdfBuffer = Buffer.from(await pdfResponse.arrayBuffer());
fs.writeFileSync('resume.pdf', pdfBuffer);
console.log('PDF exported successfully!');

Error Responses

401 Unauthorized

Missing or invalid API key.

{
  "error": "Invalid API key",
  "status": 401
}

404 Not Found

Resume not found or doesn't belong to your account.

{
  "error": "Resume not found",
  "status": 404
}

504 Gateway Timeout

PDF generation took too long. This can happen with very complex resumes.

{
  "error": "PDF generation timed out. Please try again.",
  "status": 504
}

Notes

  • PDF generation typically takes 5-15 seconds. Set your HTTP client timeout accordingly (at least 60 seconds recommended)
  • The generated PDF includes accurate height calculations, so it matches the Enhancv editor output exactly
  • Cover letters are not supported through this endpoint
  • Each call generates a fresh PDF; results are cached based on resume content, so exporting the same unmodified resume is faster on subsequent calls
  • The PDF page size matches the resume's isLetterSize setting (US Letter or A4)