Skip to main content
PUT
/
api
/
comunicados
/
admin
/
:id
/
desactivar
curl -X PUT "https://api.example.com/api/comunicados/admin/3/desactivar" \
  -H "Authorization: Bearer ADMIN_TOKEN"
{
  "message": "Comunicado desactivado exitosamente."
}

Overview

This endpoint allows administrators to deactivate (hide) an announcement from regular users. Deactivated announcements will not appear in the active announcements list and cannot be accessed by non-admin users.
This endpoint requires admin authentication. Only users with admin privileges can deactivate announcements.
This is a soft delete operation. The announcement remains in the database but is hidden from users. Administrators can reactivate it later using the update endpoint.

Path Parameters

id
integer
required
The unique identifier of the announcement to deactivate

Response

message
string
Success message confirming the announcement deactivation
curl -X PUT "https://api.example.com/api/comunicados/admin/3/desactivar" \
  -H "Authorization: Bearer ADMIN_TOKEN"
{
  "message": "Comunicado desactivado exitosamente."
}

Behavior

When an announcement is deactivated:
  1. The activo field is set to false in the database
  2. The announcement will no longer appear in the GET /api/comunicados endpoint (active announcements list)
  3. Attempts to access it via GET /api/comunicados/:id will return a 403 Forbidden error
  4. Admin users can still view and manage the announcement through admin endpoints

Reactivating an Announcement

To reactivate a deactivated announcement, use the Update Announcement endpoint and set activo: true in the request body:
curl -X PUT "https://api.example.com/api/comunicados/admin/3" \
  -H "Authorization: Bearer ADMIN_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"activo": true}'

Update Announcement

Update an announcement or reactivate it

Create Announcement

Create a new announcement

Get Active Announcements

View all currently active announcements

Build docs developers (and LLMs) love