Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/CKoldo/Vacaciones-front/llms.txt

Use this file to discover all available pages before exploring further.

The Vacaciones API is a JSON REST API that powers the Módulo de Registro de Vacaciones front end. All communication happens over HTTP and every request (except login) must include a valid JWT bearer token.

Base URL

The base URL is configured via the VITE_API_URL environment variable in the front end. If the variable is not set, the default is used:
http://localhost:5175
All paths in this reference are relative to that base URL (e.g. POST /api/auth/loginhttp://localhost:5175/api/auth/login).

Authentication

Every endpoint except POST /api/auth/login requires an Authorization header carrying a JWT obtained from the login endpoint.
Authorization: Bearer <token>
See Authentication for details on obtaining and using tokens.

Request format

All request bodies must be JSON. Set the Content-Type header accordingly:
Content-Type: application/json

Error responses

Errors are returned as plain HTTP status codes with a text body. There is no structured JSON error envelope.
StatusMeaning
400Bad request — malformed body or missing required fields
401Unauthorized — missing or invalid token
404Not found — the requested resource does not exist
500Internal server error

Available endpoints

Authentication

Obtain a JWT token via username and password login.

Personal

Create, list, and delete employee records.

Schedules

Manage vacation schedules (cronogramas) per employee and year.

Ranges

Create, list, and delete vacation date ranges within a schedule.

Authentication

MethodPathDescription
POST/api/auth/loginExchange credentials for a JWT

Personal

MethodPathDescription
GET/api/personalList all employees
POST/api/personalCreate an employee
DELETE/api/personal/:idDelete an employee

Schedules

MethodPathDescription
GET/api/schedulesList all vacation schedules
GET/api/schedules/:personalIdList schedules for a specific employee
POST/api/schedulesCreate a vacation schedule
PUT/api/schedules/:idUpdate a vacation schedule

Ranges

MethodPathDescription
GET/api/ranges/:scheduleIdList ranges for a schedule
POST/api/rangesCreate a vacation range
DELETE/api/ranges/:idDelete a vacation range

Quick example

# 1. Obtain a token
TOKEN=$(curl -s -X POST http://localhost:5175/api/auth/login \
  -H "Content-Type: application/json" \
  -d '{"username":"admin","password":"secret"}' \
  | jq -r '.token')

# 2. List all employees
curl http://localhost:5175/api/personal \
  -H "Authorization: Bearer $TOKEN"

Build docs developers (and LLMs) love