HR
Employees, structure, contracts, leave, time tracking with the RD 8/2019 time record, payroll and documents of the human resources module.
The HR module manages the workforce: employees and their structure, contracts, schedules, leave, time entries, payroll and documents. It requires the module in the plan (otherwise 403 module_not_available).
Scopes: hr:read / hr:write. All routes live under /hr/. An API key acts as the organization owner, limited by its scopes: it can do what an HR manager can do.
Personal data
Employees include sensitive personal data (ID number, Social Security number, IBAN, photo). Grant hr:* only to integrations that need it and store the key as a secret. Employee webhooks never include those fields.
Employees
/api/v1/hr/employees/hr:write{
"first_name": "Marta",
"last_name": "Gil Romero",
"dni_nie": "12345678Z",
"personal_email": "marta.gil@example.com",
"employee_code": "E-014",
"hire_date": "2026-11-02",
"department": 3,
"position": 7,
"work_center": 1,
"work_schedule": 2,
"status": "active"
}status: active, on_leave, terminated. The list accepts search, department, work_center, status and the incremental sync filters. Giving an employee access to the app (invitations, linking a user) can only be done in Billora.
| Resource | Route |
|---|---|
| Departments, positions and work centers | /hr/departments/ · /hr/positions/ · /hr/work-centers/ |
Contracts (contract_type, salary, payments, working hours) | /hr/contracts/ |
| Work schedules | /hr/work-schedules/ |
Employee documents (multipart/form-data: employee, doc_type, title, file) | /hr/documents/ |
| Module settings and indicators | GET/PATCH /hr/settings/ · GET /hr/dashboard/ |
Leave
/api/v1/hr/leave-requests/hr:write{ "employee": 14, "leave_type": 1, "start_date": "2026-12-22", "end_date": "2026-12-31", "notes": "Christmas holidays" }The response computes business_days (excluding weekends and the holidays in /hr/holidays/) and the request starts as pending (or directly approved if the leave type does not require approval). Dates overlapping another pending or approved leave are rejected.
| Operation | Endpoint |
|---|---|
| Approve | POST /hr/leave-requests/{id}/approve/ |
| Reject | POST /hr/leave-requests/{id}/reject/ with {"reason": "…"} |
| Cancel (restores the balance) | POST /hr/leave-requests/{id}/cancel/ |
| Leave types and balances | /hr/leave-types/ · /hr/leave-balances/ |
Time entries and time record
/api/v1/hr/time-entries/hr:write{ "employee": 14, "clock_in": "2026-11-03T08:58:00+01:00", "clock_out": "2026-11-03T17:05:00+01:00", "source": "manual", "notes": "Corrected entry" }source: web, geo, qr, manual; entry_type: regular or overtime. Each entry returns duration_hours. Clock-in QR codes live in /hr/qr-codes/ (POST …/{id}/regenerate/ invalidates the previous one).
/api/v1/hr/time-report/{employee_id}/?month=11&year=2026hr:readReturns the employee's monthly time record as a PDF, compliant with Spanish RD 8/2019, ready to keep or hand over to the Labour Inspectorate.
Payroll
/hr/payroll/ stores payslips per period (employee, period_month, period_year, gross_salary, ss_employee, irpf, other_deductions, ss_employer). Billora computes net_salary and total_cost. status: draft, confirmed, paid.
Events
employee.created, .updated, .terminated, .deleted and leave_request.created, .approved, .rejected, .cancelled. See webhooks.
