Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/GuillermoNavarro/Proyecto_comunidades/llms.txt

Use this file to discover all available pages before exploring further.

The Documents API lets community administrators publish official PDFs — such as meeting minutes, regulations, or financial reports — and make them available to all residents. Files are stored on the server filesystem at the path configured by the app.upload.dir property. Each Documento record keeps a reference to the stored file path alongside its human-readable metadata.
Only application/pdf files are accepted. Uploads of any other content type are rejected with 400 Bad Request. Maximum file size is 15 MB.

Data model

id
Long
Auto-generated primary key for the document record.
comunidad
Comunidad object
The community this document belongs to. Resolved automatically from the JWT on upload.
nombre
String
A display name for the document, e.g. "Actas Junta 2025".
descripcion
String
A short description of the document’s contents.
fecha
String (ISO-8601 datetime)
The timestamp when the document was stored. Set by the database on insert.
documento
String
The server-side filesystem path where the uploaded PDF file is stored.

ModifDocumento DTO

Used exclusively for PATCH requests. Only the fields listed below can be updated — the file itself cannot be replaced through this endpoint.
nombre
String
New display name for the document.
descripcion
String
New description for the document.

Endpoints

POST /api/documentos

Uploads a new PDF document and creates its metadata record.
Required role: ADMIN or SUPER_ADMIN
The request must be sent as multipart/form-data. The PDF binary is passed via the archivo field; document metadata (nombre, descripcion) is passed as additional form fields.
A SUPER_ADMIN may supply the optional idComunidadManual query parameter to upload a document on behalf of any community. An ADMIN always uploads to their own JWT community — the idComunidadManual parameter is ignored for this role.
Query parameters
idComunidadManual
Long
(SUPER_ADMIN only) The ID of the target community when uploading on behalf of another community. Ignored for ADMIN callers.
Form fieldsmultipart/form-data
archivo
File
required
The PDF file to upload. Content type must be application/pdf. Maximum size: 15 MB.
nombre
String
Display name that will be stored in the Documento record.
descripcion
String
Short description of the document’s contents.
Response codes
CodeMeaning
200 OKDocument uploaded and record created successfully
400 Bad RequestFile is missing, empty, or not a PDF
500 Internal Server ErrorUnexpected server-side error during file storage
body
Documento
The persisted document record, including the server filesystem path in the documento field.
curl -X POST http://localhost:8081/api/documentos \
  -H 'Authorization: Bearer <token>' \
  -F 'archivo=@/path/to/actas_2025.pdf;type=application/pdf' \
  -F 'nombre=Actas Junta 2025' \
  -F 'descripcion=Actas de la junta ordinaria de 2025'

GET /api/documentos

Returns all document records for the authenticated user’s community.
Required role: USER, ADMIN, or SUPER_ADMIN
The community is resolved from the JWT automatically. A SUPER_ADMIN may optionally pass idComunidadManual to retrieve documents for a different community. Query parameters
idComunidadManual
Long
(SUPER_ADMIN only) Override the JWT community and return documents for the specified community ID instead.
Response
body
List<Documento>
An array of document records belonging to the resolved community.
curl -X GET http://localhost:8081/api/documentos \
  -H 'Authorization: Bearer <token>'

PATCH /api/documentos/{id}

Updates the metadata (nombre and/or descripcion) of an existing document. The underlying PDF file is not replaced by this operation.
Required role: ADMIN or SUPER_ADMIN
Send a JSON body containing only the fields you want to change. Both fields are optional — omit any field you do not wish to update. Path parameters
id
Long
required
The ID of the document record to update.
Request bodyapplication/json
nombre
String
New display name for the document.
descripcion
String
New description for the document.
Response codes
CodeMeaning
200 OKMetadata updated and updated record returned
404 Not FoundNo document found with the given ID
body
Documento
The full updated document record after applying the patch.
curl -X PATCH http://localhost:8081/api/documentos/4 \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{"nombre":"Actas Junta Ordinaria 2025","descripcion":"Versión corregida de las actas"}'

DELETE /api/documentos/{id}

Deletes a document record and its associated file from the server filesystem.
Required role: ADMIN or SUPER_ADMIN
This action is irreversible. Both the database record and the stored PDF file are permanently removed.
Path parameters
id
Long
required
The ID of the document to delete.
Response codes
CodeMeaning
200 OKDocument and file deleted successfully
404 Not FoundNo document found with the given ID
curl -X DELETE http://localhost:8081/api/documentos/4 \
  -H 'Authorization: Bearer <token>'

Build docs developers (and LLMs) love