Updates an existing project. All fields are optional. Supports uploading additional PDF files.
Authentication
Bearer token for authentication
Required Roles: monitor or admin
Content Type
Important: This endpoint accepts multipart/form-data to support file uploads.
Path Parameters
The project ID (idProyecto) to update
Request Body
All fields are optional. Only include fields you want to update.
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.
Additional 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
- Note: New PDFs are appended to existing pdfPath array, not replaced
Behavior
- PDF Files: When new PDF files are uploaded, they are added to the existing
pdfPath array rather than replacing it. This allows accumulating multiple documents over time.
- Other Fields: Updated fields replace the existing values.
- Omitted Fields: Fields not included in the request remain unchanged.
Response
Returns the updated project object with all fields:
Unique identifier for the project
Array of all PDF file paths (existing + newly uploaded)
Full user object of the responsible person
Array of activity details with id and nombre for each associated activity
Example Request
curl -X PUT https://api.sociapp.com/projects/1 \
-H "Authorization: Bearer YOUR_TOKEN" \
-F "estado=En Progreso" \
-F "presupuesto=55000.00" \
-F "notas=Budget increased due to scope expansion" \
-F "[email protected]"
Example Response
{
"idProyecto": 1,
"nombre": "Community Development Project",
"descripcion": "A project to improve community infrastructure",
"estado": "En Progreso",
"presupuesto": 55000.00,
"fuenteFinanciacion": "Municipal Budget",
"startDate": "2024-01-15",
"endDate": "2024-12-31",
"notas": "Budget increased due to scope expansion",
"subproyectos": [],
"actividades": ["1", "2"],
"pdfPath": [
"/uploads/projects/pdf-1234567890-123456789.pdf",
"/uploads/projects/pdf-1234567890-987654321.pdf",
"/uploads/projects/pdf-1709876543-456789123.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).
404 Not Found
{
"statusCode": 404,
"message": "Proyecto no encontrado"
}
Returned when the specified project ID does not exist.