Skip to main content
Creates a new activity in the system.

Endpoint

POST /actividades

Authentication

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

Request Body

nombre
string
required
Name of the activity (must be unique)
descripcion
string
Description of the activity
objetivo
string
Objective or goal of the activity
categoria
string
Activity category. Must be one of:
  • TRABAJO_COMUNITARIO - Community work
  • LIDERAZGO_COMUNITARIO - Community leadership
  • ATENCION_SUSTANCIAS - Substance abuse treatment
  • EDUCACION_PARA_LA_VIDA - Life education
  • PROMOCION_CULTURAL_DEPORTIVA - Cultural and sports promotion

Response

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 (default: true)

Example Request

curl -X POST http://localhost:3000/actividades \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "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"
  }'

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": true
}

Validation Errors

{
  "statusCode": 400,
  "message": [
    "El nombre de la actividad es obligatorio",
    "Categoría inválida"
  ],
  "error": "Bad Request"
}
The activity name must be unique. Attempting to create an activity with a duplicate name will result in an error.

Build docs developers (and LLMs) love