Skip to main content
Deactivates an activity, making it inactive in the system without permanently deleting it.

Endpoint

PATCH /actividades/:id/desactivar

Authentication

This endpoint requires a valid JWT token.
Authorization: Bearer YOUR_JWT_TOKEN

Path Parameters

id
number
required
The unique identifier of the activity to deactivate

Response

Returns the updated activity object with activo set to false.
id
number
Unique identifier for the activity
nombre
string
Name of the activity
descripcion
string
Description of the activity
objetivo
string
Objective of the activity
categoria
string
Activity category
activo
boolean
Whether the activity is active (will be false)

Example Request

curl -X PATCH http://localhost:3000/actividades/1/desactivar \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"

Example Response

{
  "id": 1,
  "nombre": "Limpieza de parques públicos",
  "descripcion": "Actividad de limpieza y mantenimiento de áreas verdes",
  "objetivo": "Contribuir al mejoramiento del entorno comunitario",
  "categoria": "TRABAJO_COMUNITARIO",
  "activo": false
}

Error Responses

Not Found

{
  "statusCode": 404,
  "message": "Actividad not found"
}
Deactivated activities will not appear in the /actividades endpoint (which only returns active activities), but can be retrieved using /actividades/todas.
To reactivate an activity, use the /actividades/:id/reactivar endpoint.

Build docs developers (and LLMs) love