Deletes a beneficiario from the system.
Endpoint
DELETE /beneficiarios/:id
Authentication
This endpoint requires a valid JWT token.
Authorization: Bearer YOUR_JWT_TOKEN
Path Parameters
The unique identifier of the beneficiario to delete
Response
Returns a success message or the deleted beneficiario object.
Example Request
curl -X DELETE http://localhost:3000/beneficiarios/1 \
-H "Authorization: Bearer YOUR_JWT_TOKEN"
Example Response
{
"message": "Beneficiario deleted successfully"
}
Error Responses
Not Found
{
"statusCode": 404,
"message": "Beneficiario not found"
}
Invalid ID
{
"statusCode": 400,
"message": "Validation failed (numeric string is expected)",
"error": "Bad Request"
}
This operation cannot be undone. Make sure you want to permanently delete this beneficiario before proceeding.
If the beneficiario has associated health records, the deletion may be restricted depending on the database constraints.