Starts real estate project data enrichment using Google Gemini AI with comprehensive data enhancement. This endpoint validates the request and starts background processing that typically takes 2-3 minutes. Projects are processed in batches of 5 and updated with enhanced information.
Endpoint: /enrichment/projects
Method: POST
{
"project_ids": [123, 124, 125], // Optional: Specific project IDs to enrich (can be single integer or list)
"filter_status": "researching", // Optional: Filter projects by status (default: "researching")
"source_urls": { // Optional: Additional source URLs for enhanced research context
"123": ["<https://example.com/project1>"],
"124": ["<https://example.com/project2>", "<https://another.com/info>"]
},
"superagent_service_token": "sa_token_abc123", // Required: Service token for Superagent API authentication
"superagent_environment": "staging" // Optional: Superagent environment (default: based on app environment)
}
Status 202 (Accepted - Processing in Background):
{
"success": true,
"message": "Enrichment request accepted and will be processed in background",
"request_id": "enrich_20240110_142301",
"total_projects": 8,
"estimated_completion_minutes": 3
}
Status 202 (Accepted - No Projects Found):
{
"success": true,
"message": "No projects found to enrich",
"request_id": "enrich_20240110_142301",
"total_projects": 0,
"estimated_completion_minutes": 0
}
Status 400 (Bad Request - No Valid Projects):
{
"success": false,
"error": "No valid projects found with the provided IDs",
"error_code": "NO_VALID_PROJECTS"
}
Status 422 (Validation Error):
{
"success": false,
"error": "Request validation failed",
"error_code": "VALIDATION_ERROR",
"details": {
"project_ids": "Invalid project ID format"
}
}
Status 500 (Internal Server Error):
{
"success": false,
"error": "Request validation failed: Database connection failed",
"error_code": "VALIDATION_ERROR"
}
Reverts project enrichment changes using cached backup data. This endpoint restores projects to their state before enrichment by retrieving backup data from Redis cache and updating projects with original data.
Endpoint: /enrichment/projects/revert
Method: POST