curl --request POST \
--url https://api.example.com/api/projects \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"styleTemplateId": "<string>",
"roomType": "<string>"
}
'{
"success": true,
"data": {
"data.id": "<string>",
"data.workspaceId": "<string>",
"data.userId": "<string>",
"data.name": "<string>",
"data.styleTemplateId": "<string>",
"data.roomType": {},
"data.thumbnailUrl": {},
"data.status": "<string>",
"data.imageCount": 123,
"data.completedCount": 123,
"data.createdAt": "<string>",
"data.updatedAt": "<string>"
},
"error": "<string>"
}Create a new AI photo editing project with specified style and room type
curl --request POST \
--url https://api.example.com/api/projects \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"styleTemplateId": "<string>",
"roomType": "<string>"
}
'{
"success": true,
"data": {
"data.id": "<string>",
"data.workspaceId": "<string>",
"data.userId": "<string>",
"data.name": "<string>",
"data.styleTemplateId": "<string>",
"data.roomType": {},
"data.thumbnailUrl": {},
"data.status": "<string>",
"data.imageCount": 123,
"data.completedCount": 123,
"data.createdAt": "<string>",
"data.updatedAt": "<string>"
},
"error": "<string>"
}"123 Main Street - Living Room"/lib/style-templates.ts.living-roomkitchenbedroombathroomtoilethallwayofficelaundry-roomstorage-roomwalk-in-closetsaunagymchildrens-roompool-areadining-roomtv-roomlibraryhobby-roomutility-roompantryconservatorygarageterracegardenlandscapeexteriorother{
"name": "Sunset Villa - Master Bedroom",
"styleTemplateId": "modern-scandinavian",
"roomType": "bedroom"
}
pending.
null, automatically set to the first uploaded image."pending" for new projects.Possible values:pending - Project created, no images processed yetprocessing - At least one image is being processedcompleted - All images completed successfullyfailed - All images failed to process0.0.success is false.Common errors:"Unauthorized" - User not authenticated"Workspace not found" - User has no workspace assigned"Name and style template are required" - Missing required fields"Failed to create project" - Database error{
"success": true,
"data": {
"id": "a1b2c3d4-5678-90ab-cdef-1234567890ab",
"workspaceId": "ws_abc123",
"userId": "user_xyz789",
"name": "Sunset Villa - Master Bedroom",
"styleTemplateId": "modern-scandinavian",
"roomType": "bedroom",
"thumbnailUrl": null,
"status": "pending",
"imageCount": 0,
"completedCount": 0,
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-01-15T10:30:00.000Z"
}
}
{
"success": false,
"error": "Name and style template are required"
}
pending/dashboard pathproject table with the following structure:
{
id: string (UUID, primary key)
workspaceId: string (foreign key → workspace.id)
userId: string (foreign key → user.id)
name: string
styleTemplateId: string
roomType: string | null
thumbnailUrl: string | null
status: "pending" | "processing" | "completed" | "failed"
imageCount: number (denormalized count)
completedCount: number (denormalized count)
createdAt: timestamp
updatedAt: timestamp
}
POST /api/process-image/lib/actions/projects.ts:createProjectAction (lines 28-77)/lib/db/queries.ts:createProject (lines 374-386)/lib/db/schema.ts:project (lines 164-196)