Référence API
Documentation des endpoints REST trakcar-api, authentification et WebSocket.
Sur cette pageAfficherMasquer
Authentification
Base URL : http://localhost:3291 (dev) ou https://www.fleetyapp.com (prod via nginx proxy /api).
- Clé API : header X-API-Key: {key} — accès admin complet
- JWT : POST /api/auth/login → Authorization: Bearer {token}
- Les deux peuvent coexister ; JWT prioritaire si session active
| Méthode | Chemin | Description |
|---|---|---|
| GET | /api/health | Status, DB, Traccar, auth modes |
| POST | /api/auth/login | Connexion e-mail/mot de passe |
| GET | /api/auth/me | Profil + chauffeur lié |
| PUT | /api/auth/password | Changer son mot de passe |
| GET | /api/users | Liste utilisateurs (admin) |
| POST | /api/users | Créer utilisateur (admin) |
Flotte & interventions
| Méthode | Chemin | Description |
|---|---|---|
| GET | /api/vehicles | Liste véhicules + positions |
| POST | /api/vehicles/{id}/commands | Commande à distance (admin) |
| GET | /api/interventions | Liste (filtrée opérateur) |
| POST | /api/interventions | Créer intervention |
| PUT | /api/interventions/{id} | Modifier |
| POST | /api/interventions/{id}/advance | Avancer statut |
| POST | /api/interventions/{id}/notify-eta | Envoyer ETA client |
| GET | /api/public/jobs/{id} | Suivi public (sans auth) |
| GET | /api/alerts | Alertes ouvertes |
| POST | /api/alerts/{id}/resolve | Résoudre alerte |
| GET | /api/routes/today | Feuille de route |
| POST | /api/routes/today/optimize | Optimiser (admin) |
Chauffeurs, rapports & récurrents
| Méthode | Chemin | Description |
|---|---|---|
| GET | /api/drivers | Liste chauffeurs |
| GET | /api/drivers/me | Chauffeur lié au JWT |
| GET | /api/drivers/planning | Planning jour |
| GET/PUT | /api/drivers/{id}/availability | Créneaux dispo |
| GET | /api/reports/summary | Synthèse métriques |
| GET | /api/reports/summary/export | Export PDF |
| GET/POST | /api/reports/livre-de-bord/signature | Signature livre de bord |
| GET/POST | /api/recurring-templates | Modèles récurrents |
| GET | /api/trips | Historique trajets |
| GET | /api/trips/{id}/replay | Points rejeu |
WebSocket & interne
WS /api/ws/positions — flux positions GPS temps réel (proxy Traccar).
POST /internal/events — ingestion événements Traccar (header X-API-Key: INTERNAL_API_KEY).
Profil dev : /api/dev/* pour tests notifications, rapports et récurrents.