Base URL: http://localhost/api
Toutes les routes (sauf /auth/register et /auth/login) nécessitent :
Authorization: Bearer <token>
{ "email": "user@example.com", "password": "min6chars", "first_name": "John", "last_name": "Doe", "role": "Manager" }200: { user, token }
{ "email": "user@example.com", "password": "password" }200: { user, token }
200: { user }
{ "email": "new@example.com", "first_name": "Jane", "last_name": "Smith" }200: { user }
200: [{ id, name, description, manager_id, members }]
200: { id, name, description, manager, members }
{ "name": "Team Alpha", "description": "Description" }201: { team }
{ "name": "Updated Name", "description": "Updated Desc" }200: { team }
204: No content
{ "user_id": 5 }200: { team }
200: { team }
200: [{ id, email, first_name, last_name, role, team_id }]
200: { id, email, first_name, last_name, role, team_id }
{ "email": "new@example.com", "role": "Manager", "team_id": 2 }200: { user }
204: No content
Query: ?start_date=<ISO>&end_date=<ISO>
200: { user, clocks, working_hours, total_hours }
{ "status": "check-in", "clock_time": "2025-10-10T08:00:00Z" }201: { message, clock }
Query: ?start_date=<ISO>&end_date=<ISO>
200: { user, clocks, working_hours, total_hours }
200: { is_clocked_in, last_clock }
Query: ?type=team&start_date=<ISO>&end_date=<ISO>&team_id=<id>
200: { team_id, team_name, period_start, period_end, total_employees, total_hours, average_hours_per_employee, daily_reports, weekly_reports }
Query: ?start_date=<ISO>&end_date=<ISO>
200: { employee, period, summary, daily_reports, weekly_reports }
- 200: OK
- 201: Created
- 204: No Content
- 400: Bad Request
- 401: Unauthorized
- 403: Forbidden
- 404: Not Found
- 500: Internal Server Error
# Login
curl -X POST http://localhost/api/auth/login \
-H "Content-Type: application/json" \
-d '{"email":"manager1@timeflow.com","password":"password123"}'
# Get teams
curl http://localhost/api/teams \
-H "Authorization: Bearer <token>"