Skip to main content
PUT
/
projects
/
:id
Update Project
curl --request PUT \
  --url https://api.example.com/projects/:id \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "nombre": "<string>",
  "descripcion": "<string>",
  "estado": "<string>",
  "responsableId": 123,
  "presupuesto": 123,
  "fuenteFinanciacion": "<string>",
  "startDate": "<string>",
  "endDate": "<string>",
  "notas": "<string>",
  "subproyectos": [
    {}
  ],
  "activityIds": [
    {}
  ],
  "pdf": [
    null
  ]
}
'
{
  "idProyecto": 123,
  "pdfPath": [
    {}
  ],
  "responsable": {},
  "detallesActividades": [
    {}
  ]
}
Updates an existing project. All fields are optional. Supports uploading additional PDF files.

Authentication

Authorization
string
required
Bearer token for authentication
Required Roles: monitor or admin

Content Type

Important: This endpoint accepts multipart/form-data to support file uploads.

Path Parameters

id
number
required
The project ID (idProyecto) to update

Request Body

All fields are optional. Only include fields you want to update.
nombre
string
Project name (max 255 characters)
descripcion
string
Detailed project description
estado
string
Current project status (max 50 characters). Examples: “Planificado”, “En Progreso”, “Completado”
responsableId
number
User ID of the project manager/responsible person
presupuesto
number
Project budget (decimal value)
fuenteFinanciacion
string
Funding source (max 150 characters)
startDate
string
Project start date in ISO 8601 format (YYYY-MM-DD)
endDate
string
Project end date in ISO 8601 format (YYYY-MM-DD)
notas
string
Additional notes or comments about the project
subproyectos
array
Array of subproject identifiers
activityIds
array
Array of activity IDs to associate with the project. Each element should be a number.
pdf
file[]
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:
idProyecto
number
Unique identifier for the project
pdfPath
array
Array of all PDF file paths (existing + newly uploaded)
responsable
object
Full user object of the responsible person
detallesActividades
array
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.

Build docs developers (and LLMs) love