Download Resume
Download a resume as a PDF or plain text file. The API returns the binary file directly.
Request
Headers
| Header | Value | Required |
|---|---|---|
Authorization | Bearer YOUR_API_KEY | REQUIRED |
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Resume ID (from List Resumes endpoint) REQUIRED |
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
format | string | pdf | File format: pdf or txt |
Response
Success Response
Status Code: 200 OK
Content-Type:
application/pdf(for PDF format)text/plain(for TXT format)
Response Body: Binary file data
Headers:
Content-Disposition: attachment; filename="JohnDoeResume.pdf"
Examples
Download as PDF
cURL - Save to File
curl "https://api.enhancv.com/api/v1/resumes/64f1a2b3c4d5e6f7g8h9i0j1/download?format=pdf" \
-H "Authorization: Bearer enh_live_your_api_key_here" \
-o resume.pdf
JavaScript - Node.js
const fs = require('fs');
const fetch = require('node-fetch');
const resumeId = '64f1a2b3c4d5e6f7g8h9i0j1';
const apiKey = 'enh_live_your_api_key_here';
const response = await fetch(
`https://api.enhancv.com/api/v1/resumes/${resumeId}/download?format=pdf`,
{
headers: {
'Authorization': `Bearer ${apiKey}`
}
}
);
const buffer = await response.arrayBuffer();
fs.writeFileSync('resume.pdf', Buffer.from(buffer));
console.log('Resume downloaded successfully!');
Python
import requests
resume_id = '64f1a2b3c4d5e6f7g8h9i0j1'
api_key = 'enh_live_your_api_key_here'
response = requests.get(
f'https://api.enhancv.com/api/v1/resumes/{resume_id}/download?format=pdf',
headers={'Authorization': f'Bearer {api_key}'}
)
with open('resume.pdf', 'wb') as f:
f.write(response.content)
print('Resume downloaded successfully!')
Download as Plain Text
cURL
curl "https://api.enhancv.com/api/v1/resumes/64f1a2b3c4d5e6f7g8h9i0j1/download?format=txt" \
-H "Authorization: Bearer enh_live_your_api_key_here" \
-o resume.txt
JavaScript
const response = await fetch(
`https://api.enhancv.com/api/v1/resumes/${resumeId}/download?format=txt`,
{
headers: {
'Authorization': `Bearer ${apiKey}`
}
}
);
const text = await response.text();
console.log(text);
Python
response = requests.get(
f'https://api.enhancv.com/api/v1/resumes/{resume_id}/download?format=txt',
headers={'Authorization': f'Bearer {api_key}'}
)
print(response.text)
Error Responses
400 Bad Request
Invalid format parameter.
{
"error": "Invalid format. Must be 'pdf' or 'txt'",
"status": 400
}
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 (rare, usually completes in 5-10 seconds).
{
"error": "PDF generation timeout. Please try again later.",
"status": 504
}
Notes
PDF Generation
- PDF files are generated asynchronously
- The API waits for generation to complete before returning (up to 50 seconds)
- Generation typically completes in 5-10 seconds
- The PDF includes all formatting, design, and layout from the resume builder
Plain Text Export
- Text files are generated instantly
- No formatting or design elements
- Plain text representation of resume content
- Useful for ATS systems or simple parsing
File Names
The API automatically generates appropriate filenames based on the resume's name field:
- Format:
{Name}{Type}.{extension} - Example:
JohnDoeResume.pdforJaneDoeCovelLetter.txt - Special characters are removed from names
Performance Tips
- Use
txtformat for faster downloads when you don't need formatting - PDF generation may take 5-10 seconds for complex resumes
- Consider caching downloaded files on your end to reduce API calls