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 Publications API manages content posted to a residential community’s notice board. Currently the system supports the NOTICIA type — general announcements and news items published by community administrators and visible to all residents. Each publication is automatically tied to the posting admin’s community and user account via the JWT token.
The comunidad and usuario fields on a publication are always auto-populated from the JWT token. Do not include either field in your request body when creating or updating a publication.

Data model

id
Long
Auto-generated primary key for the publication.
tipo
TipoPublicacion enum
The category of the publication. Possible values:
ValueMeaning
NOTICIAA community news item or announcement
INCIDENCIAA reported incident or maintenance issue
titulo
String
The headline or title of the publication.
descripcion
String
The body text or content of the publication.
imagen
String
Optional path or URL to an associated image.
usuario
Usuario object
The admin who authored the publication. Set automatically from the JWT on creation.
comunidad
Comunidad object
The community this publication belongs to. Set automatically from the JWT on creation.
documento
Documento object | null
An optional linked document (PDF) that accompanies the publication.
fechaCreacion
String (ISO-8601 datetime)
Timestamp set by the database when the record is first inserted. Read-only.
fechaFin
String (ISO-8601 datetime) | null
Optional expiry or completion date for the publication.
estado
Boolean
Whether the publication is active. Defaults to true.
moderado
Boolean
Whether the publication has been reviewed by a moderator. Defaults to false.

Endpoints

GET api/publicaciones/noticias

Returns all active news publications for the authenticated user’s community.
Required role: USER or ADMIN
The community is resolved automatically from the bearer token. Only records with tipo = NOTICIA are returned. Response
body
List<Publicacion>
An array of publication objects of type NOTICIA scoped to the caller’s community.
curl -X GET http://localhost:8081/api/publicaciones/noticias \
  -H 'Authorization: Bearer <token>'

POST api/publicaciones/noticias

Creates a new news publication for the authenticated admin’s community.
Required role: ADMIN
The comunidad and usuario fields are resolved from the JWT and set automatically — do not include them in the request body. The tipo field is also set automatically to NOTICIA by the service layer. Request bodyapplication/json
titulo
String
required
The headline of the news item.
descripcion
String
required
The body content of the announcement.
imagen
String
Optional path or URL to an image to display alongside the post.
documento
Object
Optional. An object containing id (Long) to link an existing community document to this publication.
fechaFin
String
Optional expiry date-time for the publication in ISO-8601 format.
Response codes
CodeMeaning
200 OKPublication created successfully
400 Bad RequestValidation failed (e.g. missing required fields)
body
Publicacion
The full persisted publication object.
curl -X POST http://localhost:8081/api/publicaciones/noticias \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{
    "titulo": "Junta de propietarios - Febrero 2025",
    "descripcion": "Se convoca junta ordinaria para el 15 de febrero a las 19:00h en la sala comunitaria."
  }'

PUT api/publicaciones/noticias/{id}

Replaces the content of an existing news publication with new data.
Required role: ADMIN
This is a full replacement operation — send the complete set of fields you want persisted. As with creation, comunidad and usuario are managed server-side and should not be sent in the body. Path parameters
id
Long
required
The ID of the publication to update.
Request bodyapplication/json
titulo
String
Updated headline for the publication.
descripcion
String
Updated body content.
imagen
String
Updated image path or URL.
estado
Boolean
Set to false to deactivate the publication without deleting it.
fechaFin
String
Updated expiry date-time in ISO-8601 format.
Response codes
CodeMeaning
200 OKPublication updated and returned
404 Not FoundNo publication found with the given ID
body
Publicacion
The updated publication object after the PUT has been applied.
curl -X PUT http://localhost:8081/api/publicaciones/noticias/7 \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  -d '{
    "titulo": "Junta de propietarios - Febrero 2025 (ACTUALIZADO)",
    "descripcion": "La junta se traslada al 20 de febrero a las 19:00h. Misma sala comunitaria.",
    "estado": true
  }'

DELETE api/publicaciones/{id}

Permanently deletes a publication by its ID.
Required role: ADMIN
Deletion is permanent and irreversible. If you only want to hide a publication from residents, consider updating its estado field to false via the PUT endpoint instead.
Path parameters
id
Long
required
The ID of the publication to delete.
Response codes
CodeMeaning
200 OKPublication deleted successfully
404 Not FoundNo publication found with the given ID
curl -X DELETE http://localhost:8081/api/publicaciones/7 \
  -H 'Authorization: Bearer <token>'

Build docs developers (and LLMs) love