Skip to main content
Updates one or more fields of an existing activity.

Endpoint

PATCH /actividades/:id

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 update

Request Body

All fields are optional. Only include fields you want to update.
nombre
string
Name of the activity
descripcion
string
Description of the activity
objetivo
string
Objective or goal of the activity
categoria
string
Activity category. Must be one of:
  • TRABAJO_COMUNITARIO
  • LIDERAZGO_COMUNITARIO
  • ATENCION_SUSTANCIAS
  • EDUCACION_PARA_LA_VIDA
  • PROMOCION_CULTURAL_DEPORTIVA

Response

Returns the updated activity object.
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

Example Request

curl -X PATCH http://localhost:3000/actividades/1 \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "descripcion": "Actividad mejorada de limpieza y embellecimiento de áreas verdes",
    "objetivo": "Contribuir significativamente al mejoramiento del entorno comunitario"
  }'

Example Response

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

Error Responses

Not Found

{
  "statusCode": 404,
  "message": "Actividad not found"
}
You only need to include the fields you want to update. Fields not included in the request will remain unchanged.

Build docs developers (and LLMs) love