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

Endpoint

PATCH /beneficiarios/:id

Authentication

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

Path Parameters

id
number
required
The unique identifier of the beneficiario to update

Request Body

All fields are optional. Only include fields you want to update.
nombre
string
Full name of the beneficiario (max 150 characters)
tiempoAsignado
number
Assigned time amount (must be greater than 0)
unidadTiempo
string
Time unit. Must be one of:
  • HORAS - Hours
  • MESES - Months

Response

Returns the updated beneficiario object.
id
number
Unique identifier for the beneficiario
nombre
string
Full name of the beneficiario
fechaIngreso
string
Date of entry
tiempoAsignado
number
Assigned time amount
unidadTiempo
string
Time unit (HORAS or MESES)
creadoEn
string
Timestamp when record was created

Example Request

curl -X PATCH http://localhost:3000/beneficiarios/1 \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "tiempoAsignado": 8,
    "unidadTiempo": "MESES"
  }'

Example Response

{
  "id": 1,
  "nombre": "Juan Pérez García",
  "fechaIngreso": "2026-03-01",
  "tiempoAsignado": 8,
  "unidadTiempo": "MESES",
  "creadoEn": "2026-03-01T10:00:00.000Z"
}

Error Responses

Not Found

{
  "statusCode": 404,
  "message": "Beneficiario not found"
}

Validation Error

{
  "statusCode": 400,
  "message": [
    "La unidad de tiempo debe ser HORAS o MESES"
  ],
  "error": "Bad Request"
}
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