Create Vacation Request
Requests
Create Vacation Request
Create a vacation request with automatic balance validation
POST
Create Vacation Request
Endpoint
Request Body
Vacation start date in ISO format or YYYY-MM-DDExample:
"2026-05-01" or "2026-05-01T00:00:00"Vacation end date in ISO format or YYYY-MM-DDMust be equal to or after
fecha_inicioOptional description for the vacation requestExample:
"Summer vacation"Optional URL to supporting document
Response
Success message: “Solicitud de vacaciones creada exitosamente”
Validation Rules
Date Validation
- Start date must be before or equal to end date
- Dates cannot be in the past
- Date format must be valid
Balance Validation
- System checks employee’s available vacation days
- Request is rejected if insufficient days available
- Balance is only deducted after approval
Code Examples
Response Example
201 Created
Error Responses
Business Logic Flow
Retrieve Employee Balance
System loads the authenticated employee’s vacation balance from the database
Calculate Days
Computes the number of vacation days using
calcularDiasSolicitados() (excludes weekends)Related Operations
Cancel Vacation
PUT
/api/solicitudes/:id/cancelarEmployees can cancel their own pending vacation requestsApprove Vacation
PUT
/api/solicitudes/:id/aprobarAdmins approve vacation requests, which triggers balance deduction