Skip to main content
POST
/
projects
Create Project
curl --request POST \
  --url https://api.example.com/projects \
  --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": [
    {}
  ]
}
Creates a new project with optional PDF file uploads.

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.

Request Body

nombre
string
required
Project name (max 255 characters)
descripcion
string
Detailed project description
estado
string
required
Current project status (max 50 characters). Examples: “Planificado”, “En Progreso”, “Completado”
responsableId
number
required
User ID of the project manager/responsible person
presupuesto
number
required
Project budget (decimal value)
fuenteFinanciacion
string
Funding source (max 150 characters)
startDate
string
required
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[]
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:
idProyecto
number
Auto-generated unique identifier for the project
pdfPath
array
Array of uploaded PDF file paths in the format /uploads/projects/{filename}
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 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).

Build docs developers (and LLMs) love