Creates a new project with optional PDF file uploads.
Authentication
Bearer token for authentication
Required Roles: monitor or admin
Content Type
Important: This endpoint accepts multipart/form-data to support file uploads.
Request Body
Project name (max 255 characters)
Detailed project description
Current project status (max 50 characters). Examples: “Planificado”, “En Progreso”, “Completado”
User ID of the project manager/responsible person
Project budget (decimal value)
Funding source (max 150 characters)
Project start date in ISO 8601 format (YYYY-MM-DD)
Project end date in ISO 8601 format (YYYY-MM-DD)
Additional notes or comments about the project
Array of subproject identifiers
Array of activity IDs to associate with the project. Each element should be a number.
PDF files to upload (max 10 files, 10MB each)File Upload Restrictions:
- Field name:
pdf
- Maximum files: 10
- Allowed format: PDF only
- Maximum file size: 10MB per file
- Files are stored in
/uploads/projects/ directory
Response
Returns the created project object with all fields populated, including:
Auto-generated unique identifier for the project
Array of uploaded PDF file paths in the format /uploads/projects/{filename}
Full user object of the responsible person
Array of activity details with id and nombre for each associated activity
Example Request
curl -X POST https://api.sociapp.com/projects \
-H "Authorization: Bearer YOUR_TOKEN" \
-F "nombre=Community Development Project" \
-F "descripcion=A project to improve community infrastructure" \
-F "estado=Planificado" \
-F "responsableId=5" \
-F "presupuesto=50000.00" \
-F "fuenteFinanciacion=Municipal Budget" \
-F "startDate=2024-01-15" \
-F "endDate=2024-12-31" \
-F "activityIds[0]=1" \
-F "activityIds[1]=2" \
-F "[email protected]" \
-F "[email protected]"
Example Response
{
"idProyecto": 1,
"nombre": "Community Development Project",
"descripcion": "A project to improve community infrastructure",
"estado": "Planificado",
"presupuesto": 50000.00,
"fuenteFinanciacion": "Municipal Budget",
"startDate": "2024-01-15",
"endDate": "2024-12-31",
"notas": null,
"subproyectos": [],
"actividades": ["1", "2"],
"pdfPath": [
"/uploads/projects/pdf-1234567890-123456789.pdf",
"/uploads/projects/pdf-1234567890-987654321.pdf"
],
"responsable": {
"IdUsuario": 5,
"Nombre": "John",
"Apellido": "Doe"
},
"responsableId": 5,
"detallesActividades": [
{ "id": 1, "nombre": "Planning" },
{ "id": 2, "nombre": "Execution" }
]
}
Error Responses
400 Bad Request
{
"statusCode": 400,
"message": "Solo se permiten archivos PDF"
}
Returned when attempting to upload non-PDF files.
401 Unauthorized
Returned when the authentication token is missing or invalid.
403 Forbidden
Returned when the user does not have the required role (monitor or admin).