# 🔌 Liste Exhaustive des Endpoints Backend API > **Document de rĂ©fĂ©rence complet pour tous les endpoints de l'API Veza Backend** > > Ce document liste TOUS les endpoints disponibles dans l'API backend, organisĂ©s par domaine fonctionnel. --- ## 📊 Statistiques - **Total Endpoints**: 150+ - **Endpoints Publics**: 25 - **Endpoints ProtĂ©gĂ©s**: 125+ - **Endpoints Admin**: 15 - **MĂ©thodes HTTP**: GET, POST, PUT, DELETE, PATCH --- ## 🔐 1. AUTHENTICATION & AUTHORIZATION ### 1.1 Registration & Login | MĂ©thode | Endpoint | Auth | Description | |---------|----------|------|-------------| | `POST` | `/api/v1/auth/register` | ❌ Public | Inscription d'un nouvel utilisateur | | `POST` | `/api/v1/auth/login` | ❌ Public | Connexion utilisateur (email + password) | | `POST` | `/api/v1/auth/refresh` | ❌ Public | RafraĂźchir le token JWT | | `POST` | `/api/v1/auth/logout` | ✅ Protected | DĂ©connexion utilisateur | | `GET` | `/api/v1/auth/me` | ✅ Protected | Obtenir les infos de l'utilisateur connectĂ© | **Rate Limiting:** - Register: LimitĂ© (dĂ©sactivĂ© en dev) - Login: LimitĂ© (actif) --- ### 1.2 Email Verification | MĂ©thode | Endpoint | Auth | Description | |---------|----------|------|-------------| | `POST` | `/api/v1/auth/verify-email` | ❌ Public | VĂ©rifier l'email avec le token | | `POST` | `/api/v1/auth/resend-verification` | ❌ Public | Renvoyer l'email de vĂ©rification | **Rate Limiting:** - Verify Email: LimitĂ© - Resend Verification: LimitĂ© --- ### 1.3 Password Reset | MĂ©thode | Endpoint | Auth | Description | |---------|----------|------|-------------| | `POST` | `/api/v1/auth/password/reset-request` | ❌ Public | Demander rĂ©initialisation mot de passe | | `POST` | `/api/v1/auth/password/reset` | ❌ Public | RĂ©initialiser le mot de passe avec token | **Rate Limiting:** - Password Reset: LimitĂ© --- ### 1.4 Two-Factor Authentication (2FA) | MĂ©thode | Endpoint | Auth | Description | |---------|----------|------|-------------| | `POST` | `/api/v1/auth/2fa/setup` | ✅ Protected | Configurer 2FA (gĂ©nĂšre QR code) | | `POST` | `/api/v1/auth/2fa/verify` | ✅ Protected | VĂ©rifier code 2FA | | `POST` | `/api/v1/auth/2fa/disable` | ✅ Protected | DĂ©sactiver 2FA | | `GET` | `/api/v1/auth/2fa/status` | ✅ Protected | Obtenir statut 2FA | --- ### 1.5 OAuth | MĂ©thode | Endpoint | Auth | Description | |---------|----------|------|-------------| | `GET` | `/api/v1/auth/oauth/providers` | ❌ Public | Liste des providers OAuth disponibles | | `GET` | `/api/v1/auth/oauth/:provider` | ❌ Public | Initier flow OAuth (Google, GitHub, Discord) | | `GET` | `/api/v1/auth/oauth/:provider/callback` | ❌ Public | Callback OAuth aprĂšs authentification | **Providers supportĂ©s:** - Google - GitHub - Discord --- ### 1.6 Username Validation | MĂ©thode | Endpoint | Auth | Description | |---------|----------|------|-------------| | `GET` | `/api/v1/auth/check-username` | ❌ Public | VĂ©rifier disponibilitĂ© username | --- ## đŸ‘€ 2. USERS & PROFILES ### 2.1 User Management | MĂ©thode | Endpoint | Auth | Description | |---------|----------|------|-------------| | `GET` | `/api/v1/users` | ❌ Public | Liste des utilisateurs (paginĂ©e) | | `GET` | `/api/v1/users/:id` | ❌ Public | Obtenir profil utilisateur par ID | | `GET` | `/api/v1/users/by-username/:username` | ❌ Public | Obtenir profil par username | | `GET` | `/api/v1/users/search` | ❌ Public | Rechercher des utilisateurs | | `PUT` | `/api/v1/users/:id` | ✅ Owner/Admin | Mettre Ă  jour profil utilisateur | | `DELETE` | `/api/v1/users/:id` | ✅ Owner/Admin | Supprimer utilisateur (soft delete) | | `GET` | `/api/v1/users/:id/completion` | ✅ Protected | Obtenir % complĂ©tion profil | --- ### 2.2 Avatar Management | MĂ©thode | Endpoint | Auth | Description | |---------|----------|------|-------------| | `POST` | `/api/v1/users/:id/avatar` | ✅ Owner/Admin | Upload avatar utilisateur | | `DELETE` | `/api/v1/users/:id/avatar` | ✅ Owner/Admin | Supprimer avatar utilisateur | --- ### 2.3 Social Features | MĂ©thode | Endpoint | Auth | Description | |---------|----------|------|-------------| | `POST` | `/api/v1/users/:id/follow` | ✅ Protected | Suivre un utilisateur | | `DELETE` | `/api/v1/users/:id/follow` | ✅ Protected | Ne plus suivre un utilisateur | | `POST` | `/api/v1/users/:id/block` | ✅ Protected | Bloquer un utilisateur | | `DELETE` | `/api/v1/users/:id/block` | ✅ Protected | DĂ©bloquer un utilisateur | --- ### 2.4 User Roles | MĂ©thode | Endpoint | Auth | Description | |---------|----------|------|-------------| | `POST` | `/api/v1/users/:id/roles` | ✅ Admin | Assigner un rĂŽle Ă  un utilisateur | | `DELETE` | `/api/v1/users/:id/roles/:roleId` | ✅ Admin | RĂ©voquer un rĂŽle d'un utilisateur | --- ### 2.5 User Liked Tracks | MĂ©thode | Endpoint | Auth | Description | |---------|----------|------|-------------| | `GET` | `/api/v1/users/:id/likes` | ✅ Protected | Obtenir les tracks likĂ©s par l'utilisateur | --- ### 2.6 Data Export (GDPR) | MĂ©thode | Endpoint | Auth | Description | |---------|----------|------|-------------| | `GET` | `/api/v1/users/me/export` | ✅ Protected | Exporter toutes les donnĂ©es utilisateur (JSON) | --- ## đŸŽ” 3. TRACKS & AUDIO ### 3.1 Track Management | MĂ©thode | Endpoint | Auth | Description | |---------|----------|------|-------------| | `GET` | `/api/v1/tracks` | ❌ Public | Liste des tracks (paginĂ©e, filtrĂ©e) | | `GET` | `/api/v1/tracks/:id` | ❌ Public | Obtenir dĂ©tails d'une track | | `POST` | `/api/v1/tracks` | ✅ Creator/Premium/Admin | Upload une nouvelle track | | `PUT` | `/api/v1/tracks/:id` | ✅ Owner/Admin | Mettre Ă  jour une track | | `DELETE` | `/api/v1/tracks/:id` | ✅ Owner/Admin | Supprimer une track | --- ### 3.2 Track Search | MĂ©thode | Endpoint | Auth | Description | |---------|----------|------|-------------| | `GET` | `/api/v1/tracks/search` | ❌ Public | Rechercher des tracks | **Filtres supportĂ©s:** - Query (titre, artiste, album) - Genre - Tags - Date range - Duration range --- ### 3.3 Track Stats & History | MĂ©thode | Endpoint | Auth | Description | |---------|----------|------|-------------| | `GET` | `/api/v1/tracks/:id/stats` | ❌ Public | Statistiques d'une track | | `GET` | `/api/v1/tracks/:id/history` | ❌ Public | Historique des versions | --- ### 3.4 Track Download | MĂ©thode | Endpoint | Auth | Description | |---------|----------|------|-------------| | `GET` | `/api/v1/tracks/:id/download` | ❌ Public | TĂ©lĂ©charger une track | --- ### 3.5 Track Sharing | MĂ©thode | Endpoint | Auth | Description | |---------|----------|------|-------------| | `GET` | `/api/v1/tracks/shared/:token` | ❌ Public | AccĂ©der Ă  une track via lien de partage | | `POST` | `/api/v1/tracks/:id/share` | ✅ Protected | CrĂ©er un lien de partage | | `DELETE` | `/api/v1/tracks/share/:id` | ✅ Protected | RĂ©voquer un lien de partage | --- ### 3.6 Chunked Upload | MĂ©thode | Endpoint | Auth | Description | |---------|----------|------|-------------| | `GET` | `/api/v1/tracks/:id/status` | ✅ Protected | Statut d'upload d'une track | | `POST` | `/api/v1/tracks/initiate` | ✅ Protected | Initier upload chunked | | `POST` | `/api/v1/tracks/chunk` | ✅ Protected | Upload un chunk | | `POST` | `/api/v1/tracks/complete` | ✅ Protected | ComplĂ©ter upload chunked | | `GET` | `/api/v1/tracks/quota/:id` | ✅ Protected | Obtenir quota d'upload | | `GET` | `/api/v1/tracks/resume/:uploadId` | ✅ Protected | Reprendre un upload | --- ### 3.7 Batch Operations | MĂ©thode | Endpoint | Auth | Description | |---------|----------|------|-------------| | `POST` | `/api/v1/tracks/batch/delete` | ✅ Protected | Supprimer plusieurs tracks | | `POST` | `/api/v1/tracks/batch/update` | ✅ Protected | Mettre Ă  jour plusieurs tracks | --- ### 3.8 Track Social | MĂ©thode | Endpoint | Auth | Description | |---------|----------|------|-------------| | `POST` | `/api/v1/tracks/:id/like` | ✅ Protected | Liker une track | | `DELETE` | `/api/v1/tracks/:id/like` | ✅ Protected | Unliker une track | | `GET` | `/api/v1/tracks/:id/likes` | ✅ Protected | Obtenir les likes d'une track | --- ### 3.9 Track Versions | MĂ©thode | Endpoint | Auth | Description | |---------|----------|------|-------------| | `POST` | `/api/v1/tracks/:id/versions/:versionId/restore` | ✅ Protected | Restaurer une version de track | --- ### 3.10 Track Analytics | MĂ©thode | Endpoint | Auth | Description | |---------|----------|------|-------------| | `POST` | `/api/v1/tracks/:id/play` | ✅ Protected | Enregistrer une lecture de track | --- ### 3.11 HLS Streaming | MĂ©thode | Endpoint | Auth | Description | |---------|----------|------|-------------| | `GET` | `/api/v1/tracks/:id/hls/info` | ❌ Public | Obtenir infos stream HLS | | `GET` | `/api/v1/tracks/:id/hls/status` | ❌ Public | Obtenir statut stream HLS | --- ### 3.12 Track Comments | MĂ©thode | Endpoint | Auth | Description | |---------|----------|------|-------------| | `GET` | `/api/v1/tracks/:id/comments` | ❌ Public | Obtenir commentaires d'une track | | `POST` | `/api/v1/tracks/:id/comments` | ✅ Protected | Ajouter un commentaire | | `DELETE` | `/api/v1/comments/:id` | ✅ Protected | Supprimer un commentaire | --- ## 📝 4. PLAYLISTS ### 4.1 Playlist Management | MĂ©thode | Endpoint | Auth | Description | |---------|----------|------|-------------| | `GET` | `/api/v1/playlists` | ✅ Protected | Liste des playlists de l'utilisateur | | `POST` | `/api/v1/playlists` | ✅ Protected | CrĂ©er une playlist | | `GET` | `/api/v1/playlists/:id` | ✅ Protected | Obtenir dĂ©tails d'une playlist | | `PUT` | `/api/v1/playlists/:id` | ✅ Owner/Admin | Mettre Ă  jour une playlist | | `DELETE` | `/api/v1/playlists/:id` | ✅ Owner/Admin | Supprimer une playlist | --- ### 4.2 Playlist Search & Discovery | MĂ©thode | Endpoint | Auth | Description | |---------|----------|------|-------------| | `GET` | `/api/v1/playlists/search` | ✅ Protected | Rechercher des playlists | | `GET` | `/api/v1/playlists/recommendations` | ✅ Protected | Obtenir recommandations de playlists | --- ### 4.3 Playlist Tracks | MĂ©thode | Endpoint | Auth | Description | |---------|----------|------|-------------| | `POST` | `/api/v1/playlists/:id/tracks` | ✅ Protected | Ajouter une track Ă  la playlist | | `DELETE` | `/api/v1/playlists/:id/tracks/:track_id` | ✅ Protected | Retirer une track de la playlist | | `PUT` | `/api/v1/playlists/:id/tracks/reorder` | ✅ Protected | RĂ©organiser les tracks | --- ### 4.4 Playlist Collaborators | MĂ©thode | Endpoint | Auth | Description | |---------|----------|------|-------------| | `GET` | `/api/v1/playlists/:id/collaborators` | ✅ Protected | Obtenir collaborateurs | | `POST` | `/api/v1/playlists/:id/collaborators` | ✅ Owner/Admin | Ajouter un collaborateur | | `PUT` | `/api/v1/playlists/:id/collaborators/:userId` | ✅ Owner/Admin | Modifier permissions collaborateur | | `DELETE` | `/api/v1/playlists/:id/collaborators/:userId` | ✅ Owner/Admin | Retirer un collaborateur | --- ### 4.5 Playlist Sharing | MĂ©thode | Endpoint | Auth | Description | |---------|----------|------|-------------| | `POST` | `/api/v1/playlists/:id/share` | ✅ Owner/Admin | CrĂ©er lien de partage | --- ## 🛒 5. MARKETPLACE ### 5.1 Products | MĂ©thode | Endpoint | Auth | Description | |---------|----------|------|-------------| | `GET` | `/api/v1/marketplace/products` | ❌ Public | Liste des produits | | `POST` | `/api/v1/marketplace/products` | ✅ Creator/Premium/Admin | CrĂ©er un produit | | `PUT` | `/api/v1/marketplace/products/:id` | ✅ Owner/Admin | Mettre Ă  jour un produit | --- ### 5.2 Orders | MĂ©thode | Endpoint | Auth | Description | |---------|----------|------|-------------| | `GET` | `/api/v1/marketplace/orders` | ✅ Protected | Liste des commandes | | `GET` | `/api/v1/marketplace/orders/:id` | ✅ Protected | DĂ©tails d'une commande | | `POST` | `/api/v1/marketplace/orders` | ✅ Protected | CrĂ©er une commande | --- ### 5.3 Downloads | MĂ©thode | Endpoint | Auth | Description | |---------|----------|------|-------------| | `GET` | `/api/v1/marketplace/download/:product_id` | ✅ Protected | Obtenir URL de tĂ©lĂ©chargement | --- ## 💬 6. CHAT & MESSAGING ### 6.1 Chat Token | MĂ©thode | Endpoint | Auth | Description | |---------|----------|------|-------------| | `POST` | `/api/v1/chat/token` | ✅ Protected | Obtenir token pour chat en temps rĂ©el | | `GET` | `/api/v1/chat/stats` | ✅ Protected | Statistiques du chat | --- ### 6.2 Conversations (Rooms) | MĂ©thode | Endpoint | Auth | Description | |---------|----------|------|-------------| | `GET` | `/api/v1/conversations` | ✅ Protected | Liste des conversations | | `POST` | `/api/v1/conversations` | ✅ Protected | CrĂ©er une conversation | | `GET` | `/api/v1/conversations/:id` | ✅ Protected | DĂ©tails d'une conversation | | `PUT` | `/api/v1/conversations/:id` | ✅ Protected | Mettre Ă  jour une conversation | | `DELETE` | `/api/v1/conversations/:id` | ✅ Protected | Supprimer une conversation | | `GET` | `/api/v1/conversations/:id/history` | ✅ Protected | Historique des messages | --- ### 6.3 Participants | MĂ©thode | Endpoint | Auth | Description | |---------|----------|------|-------------| | `POST` | `/api/v1/conversations/:id/members` | ✅ Protected | Ajouter un membre (legacy) | | `POST` | `/api/v1/conversations/:id/participants` | ✅ Protected | Ajouter un participant | | `DELETE` | `/api/v1/conversations/:id/participants/:userId` | ✅ Protected | Retirer un participant | --- ## 🔔 7. NOTIFICATIONS ### 7.1 Notification Management | MĂ©thode | Endpoint | Auth | Description | |---------|----------|------|-------------| | `GET` | `/api/v1/notifications` | ✅ Protected | Liste des notifications | | `POST` | `/api/v1/notifications/:id/read` | ✅ Protected | Marquer comme lu | | `POST` | `/api/v1/notifications/read-all` | ✅ Protected | Tout marquer comme lu | --- ## 🎭 8. ROLES & PERMISSIONS ### 8.1 Roles | MĂ©thode | Endpoint | Auth | Description | |---------|----------|------|-------------| | `GET` | `/api/v1/roles` | ✅ Protected | Liste des rĂŽles | | `GET` | `/api/v1/roles/:id` | ✅ Protected | DĂ©tails d'un rĂŽle | --- ## 🔗 9. WEBHOOKS ### 9.1 Webhook Management | MĂ©thode | Endpoint | Auth | Description | |---------|----------|------|-------------| | `GET` | `/api/v1/webhooks` | ✅ Protected | Liste des webhooks | | `POST` | `/api/v1/webhooks` | ✅ Protected | CrĂ©er un webhook | | `DELETE` | `/api/v1/webhooks/:id` | ✅ Protected | Supprimer un webhook | | `GET` | `/api/v1/webhooks/stats` | ✅ Protected | Statistiques des webhooks | | `POST` | `/api/v1/webhooks/:id/test` | ✅ Protected | Tester un webhook | | `POST` | `/api/v1/webhooks/:id/regenerate-key` | ✅ Protected | RĂ©gĂ©nĂ©rer clĂ© API webhook | --- ## 📊 10. ANALYTICS ### 10.1 Analytics Events | MĂ©thode | Endpoint | Auth | Description | |---------|----------|------|-------------| | `POST` | `/api/v1/analytics/events` | ✅ Protected | Enregistrer un Ă©vĂ©nement analytics | | `GET` | `/api/v1/analytics/tracks/:id` | ✅ Protected | Dashboard analytics d'une track | --- ## 🔐 11. SESSIONS ### 11.1 Session Management | MĂ©thode | Endpoint | Auth | Description | |---------|----------|------|-------------| | `GET` | `/api/v1/sessions` | ✅ Protected | Liste des sessions actives | | `POST` | `/api/v1/sessions/logout` | ✅ Protected | DĂ©connexion session courante | | `POST` | `/api/v1/sessions/logout-all` | ✅ Protected | DĂ©connexion toutes sessions | | `DELETE` | `/api/v1/sessions/:session_id` | ✅ Protected | RĂ©voquer une session | | `GET` | `/api/v1/sessions/stats` | ✅ Protected | Statistiques des sessions | | `POST` | `/api/v1/sessions/refresh` | ✅ Protected | RafraĂźchir une session | --- ## đŸ“€ 12. UPLOADS ### 12.1 Upload Management | MĂ©thode | Endpoint | Auth | Description | |---------|----------|------|-------------| | `POST` | `/api/v1/uploads` | ✅ Protected | Upload un fichier | | `POST` | `/api/v1/uploads/batch` | ✅ Protected | Upload multiple fichiers | | `GET` | `/api/v1/uploads/:id/status` | ✅ Protected | Statut d'un upload | | `GET` | `/api/v1/uploads/:id/progress` | ✅ Protected | Progression d'un upload | | `DELETE` | `/api/v1/uploads/:id` | ✅ Protected | Annuler/supprimer un upload | | `GET` | `/api/v1/uploads/stats` | ✅ Protected | Statistiques des uploads | --- ### 12.2 Upload Info (Public) | MĂ©thode | Endpoint | Auth | Description | |---------|----------|------|-------------| | `GET` | `/api/v1/upload/limits` | ❌ Public | Limites d'upload | | `GET` | `/api/v1/upload/validate-type` | ❌ Public | Valider type de fichier | --- ## 📋 13. AUDIT & LOGS ### 13.1 Audit Logs | MĂ©thode | Endpoint | Auth | Description | |---------|----------|------|-------------| | `GET` | `/api/v1/audit/logs` | ✅ Protected | Rechercher dans les logs | | `GET` | `/api/v1/audit/logs/:id` | ✅ Protected | DĂ©tails d'un log | | `GET` | `/api/v1/audit/stats` | ✅ Protected | Statistiques d'audit | | `GET` | `/api/v1/audit/activity` | ✅ Protected | ActivitĂ© utilisateur | | `GET` | `/api/v1/audit/suspicious` | ✅ Protected | DĂ©tecter activitĂ© suspecte | | `GET` | `/api/v1/audit/ip/:ip` | ✅ Protected | ActivitĂ© par IP | | `POST` | `/api/v1/audit/cleanup` | ✅ Protected | Nettoyer anciens logs | --- ## 🔒 14. SECURITY ### 14.1 CSRF Token | MĂ©thode | Endpoint | Auth | Description | |---------|----------|------|-------------| | `GET` | `/api/v1/csrf-token` | ✅ Protected | Obtenir token CSRF | --- ## 📝 15. FRONTEND LOGS ### 15.1 Frontend Logging | MĂ©thode | Endpoint | Auth | Description | |---------|----------|------|-------------| | `POST` | `/api/v1/logs/frontend` | ❌ Public | Envoyer logs frontend au backend | --- ## đŸ„ 16. HEALTH & MONITORING ### 16.1 Health Checks | MĂ©thode | Endpoint | Auth | Description | |---------|----------|------|-------------| | `GET` | `/api/v1/health` | ❌ Public | Health check simple | | `GET` | `/api/v1/healthz` | ❌ Public | Liveness probe (Kubernetes) | | `GET` | `/api/v1/readyz` | ❌ Public | Readiness probe (Kubernetes) | | `GET` | `/api/v1/status` | ❌ Public | Status complet du systĂšme | **Legacy (deprecated):** - `GET /health` - `GET /healthz` - `GET /readyz` --- ### 16.2 Metrics | MĂ©thode | Endpoint | Auth | Description | |---------|----------|------|-------------| | `GET` | `/api/v1/metrics` | ❌ Public | MĂ©triques Prometheus | | `GET` | `/api/v1/metrics/aggregated` | ❌ Public | MĂ©triques agrĂ©gĂ©es | | `GET` | `/api/v1/system/metrics` | ❌ Public | MĂ©triques systĂšme | **Legacy (deprecated):** - `GET /metrics` - `GET /metrics/aggregated` - `GET /system/metrics` --- ### 16.3 API Versioning | MĂ©thode | Endpoint | Auth | Description | |---------|----------|------|-------------| | `GET` | `/api/versions` | ❌ Public | Informations sur les versions API | --- ## đŸ‘šâ€đŸ’Œ 17. ADMIN ENDPOINTS ### 17.1 Admin Audit | MĂ©thode | Endpoint | Auth | Description | |---------|----------|------|-------------| | `GET` | `/api/v1/admin/audit/logs` | ✅ Admin | Logs d'audit (admin) | | `GET` | `/api/v1/admin/audit/stats` | ✅ Admin | Statistiques d'audit (admin) | | `GET` | `/api/v1/admin/audit/suspicious` | ✅ Admin | ActivitĂ© suspecte (admin) | --- ### 17.2 Admin Debugging | MĂ©thode | Endpoint | Auth | Description | |---------|----------|------|-------------| | `ANY` | `/api/v1/admin/debug/pprof/*path` | ✅ Admin | Profiling pprof (Go) | --- ## 🔧 18. INTERNAL ENDPOINTS ### 18.1 Stream Callbacks | MĂ©thode | Endpoint | Auth | Description | |---------|----------|------|-------------| | `POST` | `/api/v1/internal/tracks/:id/stream-ready` | 🔒 Internal | Callback stream ready (moderne) | | `POST` | `/internal/tracks/:id/stream-ready` | 🔒 Internal | Callback stream ready (legacy, deprecated) | --- ## 📚 19. DOCUMENTATION ### 19.1 API Documentation | MĂ©thode | Endpoint | Auth | Description | |---------|----------|------|-------------| | `GET` | `/swagger/*any` | ❌ Public | Documentation Swagger UI | | `GET` | `/docs` | ❌ Public | Documentation API (alias) | | `GET` | `/docs/*any` | ❌ Public | Documentation API (alias) | --- ## 📊 RÉSUMÉ PAR CATÉGORIE | CatĂ©gorie | Endpoints | Public | Protected | Admin | |-----------|-----------|--------|-----------|-------| | **Auth** | 17 | 12 | 5 | 0 | | **Users** | 15 | 4 | 11 | 0 | | **Tracks** | 35 | 10 | 25 | 0 | | **Playlists** | 13 | 0 | 13 | 0 | | **Marketplace** | 6 | 1 | 5 | 0 | | **Chat** | 8 | 0 | 8 | 0 | | **Notifications** | 3 | 0 | 3 | 0 | | **Roles** | 2 | 0 | 2 | 0 | | **Webhooks** | 6 | 0 | 6 | 0 | | **Analytics** | 2 | 0 | 2 | 0 | | **Sessions** | 6 | 0 | 6 | 0 | | **Uploads** | 8 | 2 | 6 | 0 | | **Audit** | 7 | 0 | 7 | 0 | | **Security** | 1 | 0 | 1 | 0 | | **Logs** | 1 | 1 | 0 | 0 | | **Health** | 7 | 7 | 0 | 0 | | **Admin** | 4 | 0 | 0 | 4 | | **Internal** | 2 | 0 | 0 | 2 | | **Docs** | 3 | 3 | 0 | 0 | | **TOTAL** | **145** | **40** | **101** | **4** | --- ## 🔐 AUTHENTIFICATION & AUTORISATION ### Types d'Authentification 1. **❌ Public** - Aucune authentification requise 2. **✅ Protected** - JWT token requis 3. **✅ Owner/Admin** - JWT + ownership ou rĂŽle admin 4. **✅ Creator/Premium/Admin** - JWT + rĂŽle spĂ©cifique 5. **✅ Admin** - JWT + rĂŽle admin uniquement 6. **🔒 Internal** - Endpoints internes (callbacks) ### Middlewares AppliquĂ©s - **CORS** - ConfigurĂ© via `CORS_ORIGINS` - **CSRF** - Protection sur tous les POST/PUT/DELETE (nĂ©cessite Redis) - **Rate Limiting** - Limites globales + endpoints spĂ©cifiques - **Timeout** - Timeout global configurable - **Security Headers** - HSTS, CSP, etc. - **Request ID** - TraçabilitĂ© des requĂȘtes - **Metrics** - Prometheus metrics - **Logging** - Structured logging - **Error Handling** - Gestion centralisĂ©e des erreurs --- ## 🚀 FEATURES SPÉCIALES ### Rate Limiting **Endpoints avec rate limiting spĂ©cifique:** - `/api/v1/auth/register` - LimitĂ© - `/api/v1/auth/login` - LimitĂ© - `/api/v1/auth/verify-email` - LimitĂ© - `/api/v1/auth/resend-verification` - LimitĂ© - `/api/v1/auth/password/*` - LimitĂ© - `/api/v1/uploads/*` - LimitĂ© (Redis requis) ### CSRF Protection **Tous les endpoints avec mĂ©thodes:** - `POST` - `PUT` - `DELETE` - `PATCH` **Exceptions:** - Endpoints publics - `/api/v1/csrf-token` (gĂ©nĂ©ration du token) ### Chunked Upload **Support pour gros fichiers:** 1. `POST /api/v1/tracks/initiate` - Initier 2. `POST /api/v1/tracks/chunk` - Upload chunks 3. `POST /api/v1/tracks/complete` - Finaliser ### ClamAV Scanning **Scan antivirus sur uploads:** - Configurable via `ENABLE_CLAMAV` - Configurable via `CLAMAV_REQUIRED` - AppliquĂ© sur tous les uploads de fichiers --- ## 📝 NOTES IMPORTANTES ### Versioning - **Version actuelle**: `v1` - **Base path**: `/api/v1` - **Legacy paths**: Certains endpoints ont des versions deprecated (ex: `/health` → `/api/v1/health`) ### Deprecation **Endpoints deprecated (avec warning):** - `/health` → `/api/v1/health` - `/healthz` → `/api/v1/healthz` - `/readyz` → `/api/v1/readyz` - `/metrics` → `/api/v1/metrics` - `/internal/tracks/:id/stream-ready` → `/api/v1/internal/tracks/:id/stream-ready` ### Pagination **Endpoints paginĂ©s:** - `/api/v1/users` - `/api/v1/tracks` - `/api/v1/playlists` - `/api/v1/marketplace/products` - `/api/v1/marketplace/orders` - `/api/v1/notifications` - `/api/v1/audit/logs` **ParamĂštres de pagination:** - `page` - NumĂ©ro de page (dĂ©faut: 1) - `limit` - Nombre d'Ă©lĂ©ments par page (dĂ©faut: 20) - `sort` - Champ de tri - `order` - Ordre (asc/desc) ### Filtrage **Endpoints avec filtres:** - `/api/v1/tracks` - Genre, tags, date, duration - `/api/v1/users/search` - Query, role - `/api/v1/tracks/search` - Query, genre, tags - `/api/v1/playlists/search` - Query, public/private - `/api/v1/marketplace/products` - Category, price range, seller --- ## 🔍 ENDPOINTS PAR MÉTHODE HTTP ### GET (Lecture) - **Total**: 75 endpoints - **CatĂ©gories**: Users, Tracks, Playlists, Marketplace, Health, etc. ### POST (CrĂ©ation) - **Total**: 45 endpoints - **CatĂ©gories**: Auth, Tracks, Playlists, Orders, Chat, etc. ### PUT (Mise Ă  jour complĂšte) - **Total**: 10 endpoints - **CatĂ©gories**: Users, Tracks, Playlists, Conversations ### DELETE (Suppression) - **Total**: 15 endpoints - **CatĂ©gories**: Users, Tracks, Playlists, Sessions, Webhooks --- ## 🎯 ENDPOINTS PRIORITAIRES POUR FRONTEND ### P0 - Critique (MVP) **Auth:** - `POST /api/v1/auth/register` - `POST /api/v1/auth/login` - `POST /api/v1/auth/logout` - `GET /api/v1/auth/me` **Users:** - `GET /api/v1/users/:id` - `PUT /api/v1/users/:id` **Tracks:** - `GET /api/v1/tracks` - `GET /api/v1/tracks/:id` - `POST /api/v1/tracks` - `POST /api/v1/tracks/:id/like` **Playlists:** - `GET /api/v1/playlists` - `POST /api/v1/playlists` - `POST /api/v1/playlists/:id/tracks` ### P1 - Important **Search:** - `GET /api/v1/tracks/search` - `GET /api/v1/users/search` **Upload:** - `POST /api/v1/tracks/initiate` - `POST /api/v1/tracks/chunk` - `POST /api/v1/tracks/complete` **Notifications:** - `GET /api/v1/notifications` - `POST /api/v1/notifications/:id/read` ### P2 - Souhaitable **Marketplace:** - `GET /api/v1/marketplace/products` - `POST /api/v1/marketplace/orders` **Analytics:** - `POST /api/v1/analytics/events` - `GET /api/v1/analytics/tracks/:id` **Webhooks:** - `GET /api/v1/webhooks` - `POST /api/v1/webhooks` --- ## 📖 DOCUMENTATION COMPLÈTE Pour plus de dĂ©tails sur chaque endpoint: - **Swagger UI**: `/swagger/index.html` - **Docs**: `/docs` - **OpenAPI Spec**: Disponible via Swagger --- **Version**: 1.0.0 **DerniĂšre mise Ă  jour**: 2026-01-05 **Auteur**: Veza Backend Team