Resume Management API
SmartCV resume management API documentation, including resume creation, editing, deletion, export and other features
SmartCV resume management API provides complete resume CRUD operations, supporting resume creation, editing, deletion, export, sharing and other features.
📋 API Endpoint Overview
| Endpoint | Method | Description |
|---|---|---|
/api/resumes | GET | Get user resume list |
/api/resumes | POST | Create new resume |
/api/resumes/[id] | GET | Get specified resume details |
/api/resumes/[id] | PUT | Update resume information |
/api/resumes/[id] | DELETE | Delete resume |
/api/resumes/[id]/export | POST | Export resume |
/api/resumes/[id]/share | POST | Create share link |
/api/resumes/[id]/share | PUT | Update share settings |
/api/resumes/[id]/projects | GET | Get resume project experience |
/api/resumes/[id]/projects | POST | Add project experience |
🔍 Get Resume List
Endpoint: GET /api/resumes
Description: Get all resumes for the current user
Authentication: Required login
Query Parameters:
page(optional): Page number, default is 1limit(optional): Items per page, default is 10status(optional): Filter by status (DRAFT,PUBLISHED,ARCHIVED)
Response:
{
"success": true,
"data": [
{
"id": "resume_123",
"title": "Software Engineer Resume",
"status": "DRAFT",
"templateId": "template_456",
"template": {
"id": "template_456",
"name": "Modern Minimal",
"category": "MODERN"
},
"atsScore": 85,
"keywordMatchScore": 78,
"createdAt": "2024-12-30T10:00:00Z",
"updatedAt": "2024-12-30T15:00:00Z",
"shareInfo": {
"isEnabled": true,
"viewCount": 12,
"hasPassword": false,
"lastViewedAt": "2024-12-30T14:00:00Z"
}
}
],
"meta": {
"total": 5,
"page": 1,
"limit": 10,
"totalPages": 1
}
}➕ Create Resume
Endpoint: POST /api/resumes
Description: Create a new resume
Authentication: Required login
Request Body:
{
"title": "Software Engineer Resume",
"templateId": "template_456",
"contentJson": {
"personalInfo": {
"name": "Zhang San",
"email": "zhangsan@example.com",
"phone": "13800138000",
"address": "Chaoyang District, Beijing",
"summary": "5 years of software development experience..."
},
"workExperience": [
{
"company": "ABC Technology Company",
"position": "Senior Software Engineer",
"startDate": "2021-01",
"endDate": "2024-12",
"description": "Responsible for core product development..."
}
],
"education": [
{
"school": "Peking University",
"degree": "Computer Science and Technology",
"startDate": "2017-09",
"endDate": "2021-06"
}
],
"skills": ["JavaScript", "React", "Node.js", "Python"],
"projects": [
{
"name": "E-commerce Platform",
"description": "E-commerce platform developed with React and Node.js",
"technologies": ["React", "Node.js", "MongoDB"],
"url": "https://github.com/example/ecommerce"
}
]
}
}Response:
{
"success": true,
"data": {
"id": "resume_123",
"title": "Software Engineer Resume",
"status": "DRAFT",
"templateId": "template_456",
"template": {
"id": "template_456",
"name": "Modern Minimal",
"category": "MODERN"
},
"contentJson": {
/* Complete resume content */
},
"createdAt": "2024-12-30T10:00:00Z",
"updatedAt": "2024-12-30T10:00:00Z"
}
}📄 Get Resume Details
Endpoint: GET /api/resumes/[id]
Description: Get detailed information of specified resume
Authentication: Required login
Path Parameters:
id: Resume ID
Response:
{
"success": true,
"data": {
"id": "resume_123",
"title": "Software Engineer Resume",
"status": "DRAFT",
"templateId": "template_456",
"template": {
"id": "template_456",
"name": "Modern Minimal",
"category": "MODERN",
"htmlTemplate": "...",
"cssStyles": "..."
},
"contentJson": {
"personalInfo": {
/* Personal information */
},
"workExperience": [
/* Work experience */
],
"education": [
/* Education background */
],
"skills": [
/* Skills list */
],
"projects": [
/* Project experience */
]
},
"sectionsVisibility": {
"personalInfo": true,
"workExperience": true,
"education": true,
"skills": true,
"projects": true
},
"atsScore": 85,
"keywordMatchScore": 78,
"targetJobDescription": "...",
"createdAt": "2024-12-30T10:00:00Z",
"updatedAt": "2024-12-30T15:00:00Z"
}
}✏️ Update Resume
Endpoint: PUT /api/resumes/[id]
Description: Update resume information
Authentication: Required login
Path Parameters:
id: Resume ID
Request Body:
{
"title": "New Resume Title",
"templateId": "template_789",
"contentJson": {
/* Updated resume content */
},
"sectionsVisibility": {
"personalInfo": true,
"workExperience": true,
"education": false,
"skills": true,
"projects": true
},
"status": "PUBLISHED"
}Response:
{
"success": true,
"data": {
/* Updated resume information */
}
}🗑️ Delete Resume
Endpoint: DELETE /api/resumes/[id]
Description: Delete specified resume (soft delete)
Authentication: Required login
Path Parameters:
id: Resume ID
Response:
{
"success": true,
"message": "Resume deleted successfully"
}📤 Export Resume
Endpoint: POST /api/resumes/[id]/export
Description: Export resume to specified format
Authentication: Required login
Path Parameters:
id: Resume ID
Request Body:
{
"format": "pdf",
"options": {
"pageSize": "A4",
"margin": "normal",
"includePhoto": true,
"colorScheme": "default"
}
}Response:
{
"success": true,
"data": {
"downloadUrl": "https://storage.smartcv.cc/exports/resume_123.pdf",
"filename": "Zhang_San_Software_Engineer_Resume.pdf",
"format": "pdf",
"fileSize": 1024000,
"expiresAt": "2024-12-31T10:00:00Z"
}
}Supported Export Formats:
pdf: PDF documentdocx: Word documenthtml: HTML webpagetxt: Plain text
🔗 Create Share Link
Endpoint: POST /api/resumes/[id]/share
Description: Create share link for resume
Authentication: Required login
Path Parameters:
id: Resume ID
Request Body:
{
"isEnabled": true,
"password": "optional-password",
"expiresAt": "2025-01-30T10:00:00Z",
"allowDownload": true,
"allowComments": false
}Response:
{
"success": true,
"data": {
"id": "share_123",
"token": "abc123def456",
"shareUrl": "https://smartcv.cc/share/abc123def456",
"isEnabled": true,
"hasPassword": true,
"allowDownload": true,
"allowComments": false,
"viewCount": 0,
"expiresAt": "2025-01-30T10:00:00Z",
"createdAt": "2024-12-30T10:00:00Z"
}
}🔄 Update Share Settings
Endpoint: PUT /api/resumes/[id]/share
Description: Update resume share settings
Authentication: Required login
Path Parameters:
id: Resume ID
Request Body:
{
"isEnabled": false,
"password": null,
"expiresAt": null,
"allowDownload": false,
"allowComments": true
}Response:
{
"success": true,
"data": {
/* Updated share settings */
}
}📊 Get Project Experience
Endpoint: GET /api/resumes/[id]/projects
Description: Get project experience list for resume
Authentication: Required login
Path Parameters:
id: Resume ID
Response:
{
"success": true,
"data": [
{
"id": "project_123",
"name": "E-commerce Platform",
"description": "E-commerce platform developed with React and Node.js",
"technologies": ["React", "Node.js", "MongoDB"],
"url": "https://github.com/example/ecommerce",
"startDate": "2023-01",
"endDate": "2023-12",
"highlights": ["Implemented user authentication and authorization system", "Designed efficient database architecture", "Optimized frontend performance, improving loading speed by 50%"]
}
]
}➕ Add Project Experience
Endpoint: POST /api/resumes/[id]/projects
Description: Add new project experience to resume
Authentication: Required login
Path Parameters:
id: Resume ID
Request Body:
{
"name": "New Project",
"description": "Project description",
"technologies": ["Technology stack"],
"url": "https://github.com/example/project",
"startDate": "2024-01",
"endDate": "2024-12",
"highlights": ["Main achievement 1", "Main achievement 2"]
}Response:
{
"success": true,
"data": {
"id": "project_124"
/* Newly created project information */
}
}📝 Usage Examples
JavaScript Example
// Get resume list
async function getResumes() {
const response = await fetch('/api/resumes', {
credentials: 'include'
})
const data = await response.json()
return data.data
}
// Create new resume
async function createResume(resumeData) {
const response = await fetch('/api/resumes', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
credentials: 'include',
body: JSON.stringify(resumeData)
})
const data = await response.json()
if (data.success) {
console.log('Resume created successfully:', data.data)
} else {
console.error('Creation failed:', data.error)
}
}
// Update resume
async function updateResume(resumeId, updates) {
const response = await fetch(`/api/resumes/${resumeId}`, {
method: 'PUT',
headers: {
'Content-Type': 'application/json'
},
credentials: 'include',
body: JSON.stringify(updates)
})
return response.json()
}
// Export resume
async function exportResume(resumeId, format = 'pdf') {
const response = await fetch(`/api/resumes/${resumeId}/export`, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
credentials: 'include',
body: JSON.stringify({
format,
options: {
pageSize: 'A4',
margin: 'normal'
}
})
})
const data = await response.json()
if (data.success) {
// Download file
window.open(data.data.downloadUrl, '_blank')
}
}
// Create share link
async function createShareLink(resumeId, settings) {
const response = await fetch(`/api/resumes/${resumeId}/share`, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
credentials: 'include',
body: JSON.stringify(settings)
})
const data = await response.json()
if (data.success) {
return data.data.shareUrl
}
}React Hook Example
import { useState, useEffect } from 'react'
function useResumes() {
const [resumes, setResumes] = useState([])
const [loading, setLoading] = useState(true)
const [error, setError] = useState(null)
useEffect(() => {
fetchResumes()
}, [])
const fetchResumes = async () => {
try {
setLoading(true)
const response = await fetch('/api/resumes', {
credentials: 'include'
})
const data = await response.json()
if (data.success) {
setResumes(data.data)
} else {
setError(data.error)
}
} catch (err) {
setError('Failed to fetch resume list')
} finally {
setLoading(false)
}
}
const createResume = async (resumeData) => {
try {
const response = await fetch('/api/resumes', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
credentials: 'include',
body: JSON.stringify(resumeData)
})
const data = await response.json()
if (data.success) {
setResumes((prev) => [data.data, ...prev])
return data.data
} else {
throw new Error(data.error)
}
} catch (err) {
setError(err.message)
throw err
}
}
const deleteResume = async (resumeId) => {
try {
const response = await fetch(`/api/resumes/${resumeId}`, {
method: 'DELETE',
credentials: 'include'
})
const data = await response.json()
if (data.success) {
setResumes((prev) => prev.filter((r) => r.id !== resumeId))
} else {
throw new Error(data.error)
}
} catch (err) {
setError(err.message)
throw err
}
}
return {
resumes,
loading,
error,
createResume,
deleteResume,
refetch: fetchResumes
}
}❌ Error Handling
Common Error Codes
| Error Code | HTTP Status | Description |
|---|---|---|
RESUME_NOT_FOUND | 404 | Resume does not exist |
RESUME_NOT_OWNED | 403 | No permission to access this resume |
INVALID_TEMPLATE | 400 | Template does not exist or is invalid |
CONTENT_TOO_LARGE | 413 | Resume content is too large |
EXPORT_FAILED | 500 | Export failed |
SHARE_LIMIT_EXCEEDED | 429 | Share limit exceeded |
Error Response Example
{
"error": "Resume does not exist or has been deleted",
"code": "RESUME_NOT_FOUND",
"details": {
"resumeId": "resume_123"
}
}Next Steps
Learn how to use template API to manage resume templates
Learn how to use AI analysis and optimization features
Last updated: 12/30/2024 •Suggest improvements