{"openapi":"3.1.0","info":{"title":"Pysae Datahub v4","version":"3.1.0"},"paths":{"/api/v4/groups/{group_id}/export/vehicles":{"get":{"tags":["vehicles","stats"],"summary":"Returns a csv file with all vehicles filtered by status","description":"**This endpoint allows to export a csv file with all vehicles filtered by status.**\n\n# Export des Véhicules\n\nCe rapport permet d’exporter une liste des véhicules\n\n| **Champ**         | **Champ requis** | **Identifiant Pysae** | **Description** |\n|-------------------|------------------|-----------------------|----------------------------------|\n| `id`             | Oui              | Oui                   | Identifiant unique du véhicule |\n| `fleet_number`   | Oui              | Non                   | Numéro de flotte du véhicule |\n| `license_plate`  | Oui              | Non                   | Plaque d’immatriculation du véhicule |\n| `teams`          | Non              | Oui                   | Liste des équipes associées au véhicule |\n| `comment`        | Non              | Non                   | Commentaire libre sur l’état ou l’utilisation du véhicule |\n| `archived`       | Oui              | Non                   | Indique si le véhicule est archivé |\n| `capacity`       | Non              | Non                   | Capacité maximale de passagers |\n\n\n<h2>Example : </h2>\n\n| **id** | **fleet_number** | **license_plate** | **teams** | **comment** | **status** | **capacity** |\n|:--|:--|:--|:--|:--|:--|:--|\n| 67ac7168782c60a04ba486d4 | 839 | XY-999-YX | — | Good condition | active | — |\n\nRole needed: admin, reader, external_reader, driver, operator, limited_reader","operationId":"getExportVehicles","security":[{"SessionCookie":[]},{"SessionBearerToken":[]},{"OpenIDConnect":[]},{"ApiKey":[]}],"parameters":[{"name":"group_id","in":"path","required":true,"schema":{"type":"string","description":"The id of the group you want to retrieve datas from.","examples":["global-transport-100","blue_bus_moov","serviceMobility"],"title":"Group Id"},"description":"The id of the group you want to retrieve datas from."},{"name":"statuses","in":"query","required":false,"schema":{"anyOf":[{"type":"array","uniqueItems":true,"items":{"$ref":"#/components/schemas/VehicleStatus"}},{"type":"null"}],"title":"Statuses"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"text/csv":{"schema":{"type":"string"},"example":"id;fleet_number;license_plate;teams;comment;status;capacity\n67ac7168782c60a04ba486d4;839;XY-999-YX;;Good condition;active;"}}},"403":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/pysae__common__http__base__RoleDependency__1"},{"$ref":"#/components/schemas/NoRole"}],"title":"Response 403 Getexportvehicles"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroupNotFound"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-datahub":true,"x-api-version":4,"x-path-prefix":"/api","x-deployment":"stats","x-public":true}},"/api/v4/groups/{group_id}/export/punctuality":{"get":{"tags":["punctuality","stats"],"summary":"Get punctuality report in csv file.","description":"**This endpoint allows you to get punctuality report in csv file.**\n\n# Rapport de Ponctualité\n\nCe rapport analyse la ponctualité des trajets en comparant les horaires théoriques et enregistrés à chaque arrêt. Chaque ligne du rapport correspond à un arrêt et un événement (arrivée, départ, etc.). Il inclut les informations sur les trajets, les conducteurs, les véhicules, ainsi que les écarts de temps.\n\n| **Champ**                | **Champ requis** | **Champ du GTFS** | **Identifiant Pysae** | **Description** |\n|--------------------------|------------------|-------------------|-----------------------|----------------------------------|\n| `id`                     | Oui              | Non               | Oui                   |       |\n| `gtfs_id`                | Oui              | Non               | Oui                   | Identifiant du fichier GTFS.      |\n| `trip_id`                | Oui              | Oui               | Non                   | Identifiant du trajet.       |\n| `trip_formatted_name`    | Oui              | Non               | Non                   | Nom du trajet selon le format configuré par l'utilisateur. |\n| `route_id`               | Oui              | Oui               | Non                   | Identifiant de la ligne.       |\n| `route_long_name`        | Non              | Oui               | Non                   | Nom de la ligne.                   |\n| `block_id`               | Non              | Oui               | Non                   | Identifiant du bloc.                   |\n| `driver_id`              | Non              | Non               | Oui                   | Identifiant du conducteur. |\n| `driver`                 | Non              | Non               | Non                   | Nom du conducteur suivi de son matricule entre parenthèses. |\n| `vehicle_id`             | Non              | Non               | Oui                   | Identifiant du véhicule. |\n| `vehicle`                | Non              | Non               | Non                   | Plaque d'immatriculation suivie du numéro de parc entre parenthèses. |\n| `start_date`             | Oui              | Non               | Non                   | Date de début du trajet (format `20220101`). |\n| `stop_id`                | Oui              | Oui               | Non                   | Identifiant de l'arrêt. |\n| `stop_name`              | Oui              | Oui               | Non                   | Nom de l'arrêt. |\n| `stop_sequence`          | Oui              | Oui               | Non                   | Ordre de passage de l'arrêt. |\n| `event`                  | Oui              | Oui               | Non                   | Type d'événement. |\n| `distance`               | Oui              | Non               | Non                   | Distance en mètres entre les arrêts. |\n| `device_id`              | Oui              | Non               | Oui                   | Identifiant d'appareil.        |\n| `device_name`            | Non              | Non               | Non                   | Nom d'appareil. |\n| `delay`                  | Oui              | Non               | Non                   | Retard en secondes.            |\n| `recorded_departure`     | Oui              | Non               | Non                   | Heure de départ enregistrée (format `31/12/2021 23:58:07`). |\n| `theoretical_departure`  | Oui              | Non               | Non                   | Heure de départ théorique prévue (format `31/12/2021 23:58:07`). |\n| `teams`                  | Non              | Oui               | Non                   | Équipes associées à la course dans le GTFS. |\n\n\n<h2>Example : </h2>\n\n| **id** | **gtfs_id** | **trip_id** | **trip_formatted_name** | **route_id** | **route_long_name** | **block_id** | **driver_id** | **driver** | **vehicle_id** | **vehicle** | **start_date** | **stop_id** | **stop_name** | **stop_sequence** | **event** | **distance** | **device_id** | **device_name** | **delay** | **recorded_departure** | **theoretical_departure** | **teams** |\n|:--|:--|:--|:--|:--|:--|:--|:--|:--|:--|:--|:--|:--|:--|:--|:--|:--|:--|:--|:--|:--|:--|:--|\n| 67aa9421f9128fdab39e8c52 | 67923fa10e4810940efd5a9f | Trip-id-1 | 10:10 Start – End | Route-id-1 | The route 1 | Block-id-1 | 67ab7232160716991f4df61f | Jean Dupont | 67ab7258160716991f4df620 | Vehicle 1 | 20250211 | Stop-id-1 | Stop 1 | 1 | arrival | 0.0 | af318f5918ac2e40 | Device 1 | -315 | 11/02/25 10:10 | 11/02/25 10:10 | Team 1 |\n\nRole needed: limited_reader, operator, reader","operationId":"getExportPunctuality","security":[{"SessionCookie":[]},{"SessionBearerToken":[]},{"OpenIDConnect":[]},{"ApiKey":[]}],"parameters":[{"name":"group_id","in":"path","required":true,"schema":{"type":"string","description":"The id of the group you want to retrieve datas from.","examples":["global-transport-100","blue_bus_moov","serviceMobility"],"title":"Group Id"},"description":"The id of the group you want to retrieve datas from."},{"name":"start_date","in":"query","required":true,"schema":{"type":"string","format":"date","description":"The start date","title":"Start Date"},"description":"The start date"},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"The end date","title":"End Date"},"description":"The end date"},{"name":"event","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The event type","title":"Event"},"description":"The event type"},{"name":"stop_id","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"The stop id","title":"Stop Id"},"description":"The stop id"},{"name":"gtfs_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The gtfs id","title":"Gtfs Id"},"description":"The gtfs id"},{"name":"driver_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The driver id","title":"Driver Id"},"description":"The driver id"},{"name":"route_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The route id","title":"Route Id"},"description":"The route id"},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"text/csv":{"schema":{"type":"string"},"example":"id;gtfs_id;trip_id;trip_formatted_name;route_id;route_long_name;block_id;driver_id;driver;vehicle_id;vehicle;start_date;stop_id;stop_name;stop_sequence;event;distance;device_id;device_name;delay;recorded_departure;theoretical_departure;teams\n67aa9421f9128fdab39e8c52;67923fa10e4810940efd5a9f;Trip-id-1;10:10 Start – End;Route-id-1;The route 1;Block-id-1;67ab7232160716991f4df61f;Jean Dupont;67ab7258160716991f4df620;Vehicle 1;20250211;Stop-id-1;Stop 1;1;arrival;0.0;af318f5918ac2e40;Device 1;-315;11/02/25 10:10;11/02/25 10:10;Team 1"}}},"403":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/pysae__common__http__base__RoleDependency__2"},{"$ref":"#/components/schemas/NoRole"}],"title":"Response 403 Getexportpunctuality"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroupNotFound"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-datahub":true,"x-api-version":4,"x-path-prefix":"/api","x-deployment":"stats","x-public":true}},"/api/v4/groups/{group_id}/export/trips":{"get":{"tags":["trips","stats"],"summary":"Exports recorded trips for a date as a csv","description":"**Exports recorded trips for a date as a csv**\n\nRole needed: admin, operator, reader","operationId":"getExportTrips","security":[{"SessionCookie":[]},{"SessionBearerToken":[]},{"OpenIDConnect":[]},{"ApiKey":[]}],"parameters":[{"name":"group_id","in":"path","required":true,"schema":{"type":"string","description":"The id of the group you want to retrieve datas from.","examples":["global-transport-100","blue_bus_moov","serviceMobility"],"title":"Group Id"},"description":"The id of the group you want to retrieve datas from."},{"name":"date","in":"query","required":true,"schema":{"type":"string","pattern":"\\d{8}$","description":"The date you want to get the trips for","title":"Date"},"description":"The date you want to get the trips for"},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"403":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/pysae__common__http__base__RoleDependency__3"},{"$ref":"#/components/schemas/NoRole"}],"title":"Response 403 Getexporttrips"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroupNotFound"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-datahub":true,"x-api-version":4,"x-path-prefix":"/api","x-deployment":"stats","x-public":true}},"/api/v4/groups/{group_id}/export/trip-tracking":{"get":{"tags":["trip-tracking","stats"],"summary":"Return a csv file with tracking status of all scheduled trips.","description":"**This endpoint returns a csv file with tracking status of all scheduled trips.**\n\nPour chaque course planifiée sur le GTFS, une ligne dans le fichier CSV.\n\n# Description des champs\n\n| nom                 | requis | issu du GTFS | identifiant Pysae | commentaires                                                                  |\n| ------------------- | ------ | ------------ | ----------------- | ----------------------------------------------------------------------------- |\n| gtfs_id             | oui    | non          | oui               |                                                                               |\n| gtfs_name           | oui    | non          | non               | nom donné par l'utilisateur                                                   |\n| departure_time      | oui    | oui          | non               | heure de départ planifiée au format ISO                                       |\n| trip_id             | oui    | oui          | non               |                                                                               |\n| trip_formatted_name | oui    | non          | non               | nom du trajet selon le format configuré par l'utilisateur                     |\n| route_id            | oui    | oui          | non               |                                                                               |\n| route_long_name     | non    | oui          | non               | requis si `route_short_name` absent                                           |\n| route_short_name    | non    | oui          | non               | requis si `route_long_name` absent                                            |\n| agency_id           | oui    | oui          | non               |                                                                               |\n| is_tracked          | oui    | non          | non               | est considérée suivie une course qui a été commencée par au moins un appareil |\n| trip_teams          | non    | non          | non               | équipes associées à la course dans le GTFS                                    |\n| device_team         | non    | non          | non               | équipe de l'appareil qui a pris la course                                     |\n\n\n<h2>Example : </h2>\n\n| **gtfs_id** | **gtfs_name** | **departure_time** | **trip_id** | **trip_formatted_name** | **route_id** | **route_long_name** | **route_short_name** | **agency_id** | **is_tracked** | **trip_teams** | **device_team** |\n|:--|:--|:--|:--|:--|:--|:--|:--|:--|:--|:--|:--|\n| 123456 | Ligne 42 - Matin | 2025-05-13T08:00:00 | trip_001 | Gare → Centre | route_42 | Longue Ligne 42 | — | agency_1 | True | team-a | team-a |\n| 789012 | Ligne 15 - Soir | 2025-05-13T18:30:00 | trip_002 | Université → Stade | route_15 | — | 15S | agency_1 | False | — | team-b |\n\nRole needed: external_reader, limited_reader, operator, reader","operationId":"getExportTripTracking","security":[{"SessionCookie":[]},{"SessionBearerToken":[]},{"OpenIDConnect":[]},{"ApiKey":[]}],"parameters":[{"name":"group_id","in":"path","required":true,"schema":{"type":"string","description":"The id of the group you want to retrieve datas from.","examples":["global-transport-100","blue_bus_moov","serviceMobility"],"title":"Group Id"},"description":"The id of the group you want to retrieve datas from."},{"name":"start_date","in":"query","required":true,"schema":{"type":"string","format":"date","title":"Start Date"}},{"name":"end_date","in":"query","required":true,"schema":{"type":"string","format":"date","title":"End Date"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"text/csv":{"schema":{"type":"string"},"example":"gtfs_id;gtfs_name;departure_time;trip_id;trip_formatted_name;route_id;route_long_name;route_short_name;agency_id;is_tracked;trip_teams;device_team\n123456;Ligne 42 - Matin;2025-05-13T08:00:00;trip_001;Gare → Centre;route_42;Longue Ligne 42;;agency_1;True;team-a;team-a\n789012;Ligne 15 - Soir;2025-05-13T18:30:00;trip_002;Université → Stade;route_15;;15S;agency_1;False;;team-b"}}},"403":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/pysae__common__http__base__RoleDependency__4"},{"$ref":"#/components/schemas/NoRole"}],"title":"Response 403 Getexporttriptracking"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroupNotFound"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-datahub":true,"x-api-version":4,"x-path-prefix":"/api","x-deployment":"stats","x-public":true}},"/api/v4/groups/{group_id}/export/passenger-counts":{"get":{"tags":["passenger-counts","stats"],"summary":"Returns a csv file with passenger counts for each trip in date range","description":"**This endpoint allows you to get a csv file with passenger counts for each trip in date range.**\n\n# Rapport du Comptage de Passagers\n\nCe rapport permet de suivre le nombre de passagers montés et descendus à chaque arrêt, en associant ces données aux trajets, véhicules et conducteurs.\n\n| **Champ**                | **Champ requis** | **Champ du GTFS** | **Identifiant Pysae** | **Description** |\n|--------------------------|------------------|-------------------|-----------------------|----------------------------------|\n| `agency_id`             | Non              | Oui               | Non                   | Identifiant de l'agence |\n| `alighting`             | Oui              | Non               | Non                   | Nombre de passagers descendus à l'arrêt |\n| `block_id`              | Non              | Oui               | Non                   | Identifiant du bloc |\n| `boarding`              | Oui              | Non               | Non                   | Nombre de passagers montés à l'arrêt |\n| `day_of_week`           | Oui              | Non               | Non                   | Jour de la semaine du trajet |\n| `device_id`             | Non              | Non               | Oui                   | Identifiant de l’appareil utilisé pour l’enregistrement |\n| `driver`               | Non              | Non               | Non                   | Nom du conducteur suivi de son matricule entre parenthèses |\n| `group_id`             | Oui              | Non               | Oui                   | Identifiant du groupe |\n| `gtfs_id`              | Oui              | Non               | Oui                   | Identifiant du fichier GTFS |\n| `location_type`        | Non              | Oui               | Non                   | Type d’emplacement |\n| `route_id`            | Non               | Oui               | Non                   | Identifiant de la ligne |\n| `route_long_name`      | Non               | Oui               | Non                   | Nom complet de la ligne |\n| `route_short_name`     | Non               | Oui               | Non                   | Nom court de la ligne |\n| `server_ts`           | Non               | Non               | Non                   | Horodatage serveur de l’événement |\n| `start_date`          | Oui               | Non               | Non                   | Date de début du trajet |\n| `stop_code`          | Non                | Oui               | Non                   | Code de l'arrêt |\n| `stop_id`            | Oui               | Oui               | Non                   | Identifiant de l'arrêt |\n| `stop_lat`          | Non                | Oui               | Non                   | Latitude de l'arrêt |\n| `stop_lon`          | Non                | Oui               | Non                   | Longitude de l'arrêt |\n| `stop_name`         | Non                | Oui               | Non                   | Nom de l'arrêt |\n| `stop_sequence`     | Oui               | Oui               | Non                   | Ordre de passage de l'arrêt dans l’itinéraire |\n| `teams`            | Non                | Oui               | Non                   | Équipes associées au trajet |\n| `total_boarding`   | Oui               | Non               | Non                   | Nombre total de passagers montés à l'arrêt |\n| `trip_formatted_name` | Non             | Non               | Non                   | Nom formaté du trajet selon la configuration utilisateur |\n| `trip_headsign`    | Non                | Oui               | Non                   | Destination affichée du trajet |\n| `trip_id`         | Oui                 | Oui               | Non                   | Identifiant du trajet |\n| `trip_short_name` | Non                 | Oui               | Non                   | Nom court du trajet |\n| `vehicle`        | Non                 | Non               | Non                   | Plaque d'immatriculation suivie du numéro de parc entre parenthèses |\n\n\n<h2>Example : </h2>\n\n| **group_id** | **gtfs_id** | **start_date** | **day_of_week** | **device_id** | **teams** | **trip_id** | **trip_short_name** | **trip_headsign** | **trip_formatted_name** | **block_id** | **route_id** | **route_long_name** | **route_short_name** | **agency_id** | **stop_id** | **stop_sequence** | **is_temporary_stop** | **stop_name** | **stop_code** | **stop_lat** | **stop_lon** | **driver** | **vehicle** | **location_type** | **boarding** | **alighting** | **total_boarding** |\n|:--|:--|:--|:--|:--|:--|:--|:--|:--|:--|:--|:--|:--|:--|:--|:--|:--|:--|:--|:--|:--|:--|:--|:--|:--|:--|:--|:--|\n| My group | 6787cdef78c8d88c81fdbae3 | 2025-02-03 00:00:00+00:00 | monday | 284de389eb291bce | my-team | trip-id-1 | Trip1 | Start  > End | 10:10 [Route1 / block-1] > Start > End | Block-id-1 | Route-id-1 | Trip 1 : Start > End | Route 1 | 1 | Stop-id-2 | 2 | False | The Stop 2 ! | 2222222 | 0.0 | 0.0 | Driver 1 | Vehicle 1 | 0 | 2 | 0 | 2 |\n\nRole needed: external_reader, limited_reader, operator, reader","operationId":"getExportPassengerCounts","security":[{"SessionCookie":[]},{"SessionBearerToken":[]},{"OpenIDConnect":[]},{"ApiKey":[]}],"parameters":[{"name":"group_id","in":"path","required":true,"schema":{"type":"string","description":"The id of the group you want to retrieve datas from.","examples":["global-transport-100","blue_bus_moov","serviceMobility"],"title":"Group Id"},"description":"The id of the group you want to retrieve datas from."},{"name":"start_date","in":"query","required":true,"schema":{"type":"string","title":"Start Date"}},{"name":"end_date","in":"query","required":true,"schema":{"type":"string","title":"End Date"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"text/csv":{"schema":{"type":"string"},"example":"group_id;gtfs_id;start_date;day_of_week;device_id;teams;trip_id;trip_short_name;trip_headsign;trip_formatted_name;block_id;route_id;route_long_name;route_short_name;agency_id;stop_id;stop_sequence;is_temporary_stop;stop_name;stop_code;stop_lat;stop_lon;driver;vehicle;location_type;boarding;alighting;total_boarding\nMy group;6787cdef78c8d88c81fdbae3;2025-02-03 00:00:00+00:00;monday;284de389eb291bce;my-team;trip-id-1;Trip1;Start  > End;10:10 [Route1 / block-1] > Start > End;Block-id-1;Route-id-1;Trip 1 : Start > End;Route 1;1;Stop-id-2;2;False;The Stop 2 !;2222222;0.0;0.0;Driver 1;Vehicle 1;0;2;0;2"}}},"403":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/pysae__common__http__base__RoleDependency__4"},{"$ref":"#/components/schemas/NoRole"}],"title":"Response 403 Getexportpassengercounts"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroupNotFound"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-datahub":true,"x-api-version":4,"x-path-prefix":"/api","x-deployment":"stats","x-public":true}},"/api/v4/groups/{group_id}/export/trip-km":{"get":{"tags":["trip-km","stats"],"summary":"Export Trip Km Stats","description":"**This endpoint allows to export trip km stats.**\n\n# Rapport d’Export des Kilomètres Commerciaux\n\nCe rapport permet de suivre et d’analyser les distances commerciales théoriques et réelles pour chaque trajet. Il compare les kilomètres prévus et parcourus.\n\n| **Champ**                        | **Champ requis** | **Champ du GTFS** | **Identifiant Pysae** | **Description** |\n|----------------------------------|------------------|------------------|-----------------------|-----------------|\n| `gtfs_id`                        | Oui              | Non              | Oui                   | Identifiant du fichier GTFS |\n| `block_id`                       | Non              | Oui              | Non                   | Identifiant du bloc de trajets |\n| `date`                           | Oui              | Non              | Non                   | Date de début du trajet au format GTFS (ex. `20220101`) |\n| `gtfs_name`                      | Oui              | Non              | Non                   | Nom donné par l'utilisateur |\n| `route_id`                       | Oui              | Oui              | Non                   | Identifiant de la ligne |\n| `route_long_name`                | Non              | Oui              | Non                   | Nom complet de la ligne |\n| `route_short_name`               | Non              | Oui              | Non                   | Nom court de la ligne |\n| `theoretical_departure_time`     | Oui              | Non              | Non                   | Heure théorique de départ du trajet |\n| `theoretical_commercial_km`      | Oui              | Non              | Non                   | Distance commerciale théorique prévue pour le trajet (en kilomètres) |\n| `trip_id`                        | Oui              | Oui              | Non                   | Identifiant du trajet spécifique |\n| `trip_headsign`                  | Non              | Oui              | Non                   | Destination du trajet |\n| `trip_short_name`                | Non              | Oui              | Non                   | Nom court du trajet |\n| `recorded_commercial_km`         | Oui              | Non              | Non                   | Distance commerciale réelle parcourue pendant le trajet |\n| `unreliable_km`                  | Non              | Non              | Non                   | Distance incertaine ou non fiable |\n| `reliable_km`                    | Oui              | Non              | Non                   | Distance fiable confirmée |\n| `week`                           | Oui              | Non              | Non                   | Numéro de la semaine de la date du trajet |\n\n\n<h2>Example : </h2>\n\n| **gtfs_id** | **block_id** | **date** | **gtfs_name** | **route_id** | **route_long_name** | **route_short_name** | **theoretical_departure_time** | **theoretical_commercial_km** | **trip_id** | **trip_headsign** | **trip_short_name** | **recorded_commercial_km** | **unreliable_km** | **reliable_km** | **week** |\n|:--|:--|:--|:--|:--|:--|:--|:--|:--|:--|:--|:--|:--|:--|:--|:--|\n| 123456 | block_A | 20250113 | Ligne Express A | route_100 | Centre-Ville ↔ Gare | CV-GR | 2025-01-13 07:00:00+01:00 | 15.2 | trip_a1 | Gare Centrale | A1 | 15.0 | 0.2 | 14.8 | 3 |\n| 654321 | — | 20250114 | Navette B | route_200 | — | NB | 2025-01-14 07:30:00+01:00 | 7.8 | trip_b2 | Campus Nord | B2 | 7.5 | 0.0 | 7.5 | 3 |\n\nRole needed: external_reader, limited_reader, operator, reader","operationId":"getExportTripKm","security":[{"SessionCookie":[]},{"SessionBearerToken":[]},{"OpenIDConnect":[]},{"ApiKey":[]}],"parameters":[{"name":"group_id","in":"path","required":true,"schema":{"type":"string","description":"The id of the group you want to retrieve datas from.","examples":["global-transport-100","blue_bus_moov","serviceMobility"],"title":"Group Id"},"description":"The id of the group you want to retrieve datas from."},{"name":"start_date","in":"query","required":true,"schema":{"type":"string","title":"Start Date"}},{"name":"end_date","in":"query","required":true,"schema":{"type":"string","title":"End Date"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"text/csv":{"schema":{"type":"string"},"example":"gtfs_id;block_id;date;gtfs_name;route_id;route_long_name;route_short_name;theoretical_departure_time;theoretical_commercial_km;trip_id;trip_headsign;trip_short_name;recorded_commercial_km;unreliable_km;reliable_km;week\n123456;block_A;20250113;Ligne Express A;route_100;Centre-Ville ↔ Gare;CV-GR;2025-01-13 07:00:00+01:00;15.2;trip_a1;Gare Centrale;A1;15.0;0.2;14.8;3\n654321;;20250114;Navette B;route_200;;NB;2025-01-14 07:30:00+01:00;7.8;trip_b2;Campus Nord;B2;7.5;0.0;7.5;3"}}},"403":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/pysae__common__http__base__RoleDependency__4"},{"$ref":"#/components/schemas/NoRole"}],"title":"Response 403 Getexporttripkm"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroupNotFound"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-datahub":true,"x-api-version":4,"x-path-prefix":"/api","x-deployment":"stats","x-public":true}},"/api/v4/groups/{group_id}/export/alerts":{"get":{"tags":["alerts","stats"],"summary":"Return the alerts for the given group_id.","description":"**This endpoint allows to get all alerts for the given group_id.**\n\n# Export des Alertes\n\nCe rapport permet d’exporter la liste des alertes actives ou passées.\n\n| **Champ**            | **Champ requis** | **Champ du GTFS** | **Identifiant Pysae** | **Description** |\n|----------------------|------------------|-------------------|-----------------------|----------------------------------|\n| `active`           | Oui              | Non               | Non                   | Indique si l’alerte est active |\n| `header_text`      | Oui              | Oui               | Non                   | Titre ou sujet de l’alerte |\n| `description_text` | Oui              | Non               | Non                   | Description détaillée de l’alerte |\n| `description_raw`  | Oui              | Oui               | Non                   | Description brute de l’alerte |\n| `start_date`       | Oui              | Non               | Non                   | Date et heure de début de l’alerte (format `2024-03-04T00:00:00+00:00`) |\n| `end_date`         | Oui              | Non               | Non                   | Date et heure de fin de l’alerte (format `2024-03-04T00:00:00+00:00`) |\n| `cause`           | Oui              | Oui               | Non                   | Raison de l’alerte (ex. `MAINTENANCE`) |\n| `effect`          | Oui              | Oui               | Non                   | Effet de l’alerte sur le service (ex. `OTHER_EFFECT`) |\n| `url`             | Non              | Oui               | Non                   | Lien vers une page web détaillant l’alerte. |\n| `stop_id`         | Non              | Oui               | Non                   | Identifiant de l’arrêt affecté |\n| `route_id`        | Non              | Oui               | Non                   | Identifiant de la ligne concernée |\n\n\n<h2>Example : </h2>\n\n| **active** | **header_text** | **description_text** | **description_raw** | **start_date** | **end_date** | **cause** | **effect** | **url** | **stop_id** | **route_id** |\n|:--|:--|:--|:--|:--|:--|:--|:--|:--|:--|:--|\n| True | Problem | <p>Unavoidable problem at stop</p> | Unavoidable problem at stop | 2024-03-04T00:00:00+00:00 | 2024-03-05T23:59:00+00:00 | MAINTENANCE | OTHER_EFFECT | http://www.transporter.com/unavoidable-problem-1 | the-stop-id-1 | the-route-id-1 |\n| False | Discomfort | <p>Light disconfort</p> | Light discomfort | 2024-03-04T00:00:00+00:00 | 2024-03-05T23:59:00+00:00 | MAINTENANCE | OTHER_EFFECT | http://www.transporter.com/light-lack-of-comfort | the-stop-id-3 | the-route-id-2 |","operationId":"getExportAlerts","parameters":[{"name":"group_id","in":"path","required":true,"schema":{"type":"string","description":"The id of the group you want to retrieve datas from.","examples":["global-transport-100","blue_bus_moov","serviceMobility"],"title":"Group Id"},"description":"The id of the group you want to retrieve datas from."}],"responses":{"200":{"description":"Successful Response","content":{"text/csv":{"schema":{"type":"string"},"example":"active;header_text;description_text;description_raw;start_date;end_date;cause;effect;url;stop_id;route_id\nTrue;Problem;<p>Unavoidable problem at stop</p>;Unavoidable problem at stop;2024-03-04T00:00:00+00:00;2024-03-05T23:59:00+00:00;MAINTENANCE;OTHER_EFFECT;http://www.transporter.com/unavoidable-problem-1;the-stop-id-1;the-route-id-1\nFalse;Discomfort;<p>Light disconfort</p>;Light discomfort;2024-03-04T00:00:00+00:00;2024-03-05T23:59:00+00:00;MAINTENANCE;OTHER_EFFECT;http://www.transporter.com/light-lack-of-comfort;the-stop-id-3;the-route-id-2"}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-datahub":true,"x-api-version":4,"x-path-prefix":"/api","x-deployment":"stats","x-public":true}},"/api/v4/groups/{group_id}/export/drivers":{"get":{"tags":["drivers","stats"],"summary":"Returns a csv file with all drivers","description":"**This endpoint allows you to export all drivers**\n\n# Export des Conducteurs\n\nCe rapport permet d’exporter la liste des conducteurs.\n\n| **Champ**        | **Champ requis** | **Identifiant Pysae** | **Description** |\n|------------------|------------------|-----------------------|----------------------------------|\n| `id`            | Oui              | Oui                   | Identifiant unique du conducteur |\n| `driver_name`   | Oui              | Non                   | Nom complet du conducteur |\n| `staff_number`  | Oui              | Non                   | Numéro de matricule du conducteur |\n| `teams`         | Non              | Non                   | Liste des équipes associées au conducteur |\n| `comment`       | Non              | Non                   | Commentaire sur la disponibilité ou l'affectation du conducteur |\n| `archived`      | Oui              | Non                   | Indique si le conducteur est archivé |\n| `code`          | Non              | Non                   | Code interne associé au conducteur |\n\n\n<h2>Example : </h2>\n\n| **id** | **driver_name** | **staff_number** | **teams** | **comment** | **archived** | **code** |\n|:--|:--|:--|:--|:--|:--|:--|\n| 6400b14955c2d0b2d7058a09 | John Smith | smith01 | team-1 | Monday and tuesday only | False | 7656 |\n| 6400b14955c2d0b2d83b7a1b | Jean Dupont | dupont01 | team-1 | — | True | 8321 |\n\nRole needed: external_reader, reader, driver, operator, limited_reader","operationId":"getExportDrivers","security":[{"SessionCookie":[]},{"SessionBearerToken":[]},{"OpenIDConnect":[]},{"ApiKey":[]}],"parameters":[{"name":"group_id","in":"path","required":true,"schema":{"type":"string","description":"The id of the group you want to retrieve datas from.","examples":["global-transport-100","blue_bus_moov","serviceMobility"],"title":"Group Id"},"description":"The id of the group you want to retrieve datas from."},{"name":"archived","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean","description":"Query for archived ressources"},{"type":"null"}],"title":"Archived"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"text/csv":{"schema":{"type":"string"},"example":"id;driver_name;staff_number;teams;comment;archived;code\n6400b14955c2d0b2d7058a09;John Smith;smith01;team-1;Monday and tuesday only;False;7656\n6400b14955c2d0b2d83b7a1b;Jean Dupont;dupont01;team-1;;True;8321"}}},"403":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/pysae__common__http__base__RoleDependency__1"},{"$ref":"#/components/schemas/NoRole"}],"title":"Response 403 Getexportdrivers"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroupNotFound"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-datahub":true,"x-api-version":4,"x-path-prefix":"/api","x-deployment":"stats","x-public":true}}},"components":{"schemas":{"GroupNotFound":{"properties":{"code":{"type":"string","const":"GROUP_NOT_FOUND","title":"Code"},"details":{"type":"string","const":"The group has not been found","title":"Details"},"payload":{"$ref":"#/components/schemas/GroupNotFoundPayload"}},"type":"object","required":["code","details","payload"],"title":"GroupNotFound"},"GroupNotFoundPayload":{"properties":{"group_id":{"type":"string","title":"Group Id"}},"type":"object","required":["group_id"],"title":"GroupNotFoundPayload"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"NoRole":{"properties":{"code":{"type":"string","const":"NO_ROLE","title":"Code"},"details":{"type":"string","const":"You do not have any role in the requested group","title":"Details"},"payload":{"$ref":"#/components/schemas/NoRolePayload"}},"type":"object","required":["code","details","payload"],"title":"NoRole"},"NoRolePayload":{"properties":{"group_id":{"type":"string","title":"Group Id"},"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id"}},"type":"object","required":["group_id"],"title":"NoRolePayload"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"VehicleStatus":{"type":"string","enum":["active","archived","immobilized"],"title":"VehicleStatus"},"pysae__common__http__base__RoleDependencyPayload__1":{"properties":{"role_given":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role Given"},"role_needed":{"type":"array","const":["external_reader","admin","limited_reader","driver","operator","reader"],"title":"Role Needed","default":["external_reader","admin","limited_reader","driver","operator","reader"]}},"type":"object","required":["role_given"],"title":"RoleDependencyPayload"},"pysae__common__http__base__RoleDependencyPayload__2":{"properties":{"role_given":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role Given"},"role_needed":{"type":"array","const":["admin","limited_reader","operator","reader"],"title":"Role Needed","default":["admin","limited_reader","operator","reader"]}},"type":"object","required":["role_given"],"title":"RoleDependencyPayload"},"pysae__common__http__base__RoleDependencyPayload__3":{"properties":{"role_given":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role Given"},"role_needed":{"type":"array","const":["admin","operator","reader"],"title":"Role Needed","default":["admin","operator","reader"]}},"type":"object","required":["role_given"],"title":"RoleDependencyPayload"},"pysae__common__http__base__RoleDependencyPayload__4":{"properties":{"role_given":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role Given"},"role_needed":{"type":"array","const":["external_reader","admin","limited_reader","operator","reader"],"title":"Role Needed","default":["external_reader","admin","limited_reader","operator","reader"]}},"type":"object","required":["role_given"],"title":"RoleDependencyPayload"},"pysae__common__http__base__RoleDependency__1":{"properties":{"code":{"type":"string","const":"INVALID_ROLE","title":"Code"},"details":{"type":"string","const":"The role of the calling user for this group_id is not in the list of allowed roles","title":"Details"},"payload":{"$ref":"#/components/schemas/pysae__common__http__base__RoleDependencyPayload__1"}},"type":"object","required":["code","details","payload"],"title":"RoleDependency"},"pysae__common__http__base__RoleDependency__2":{"properties":{"code":{"type":"string","const":"INVALID_ROLE","title":"Code"},"details":{"type":"string","const":"The role of the calling user for this group_id is not in the list of allowed roles","title":"Details"},"payload":{"$ref":"#/components/schemas/pysae__common__http__base__RoleDependencyPayload__2"}},"type":"object","required":["code","details","payload"],"title":"RoleDependency"},"pysae__common__http__base__RoleDependency__3":{"properties":{"code":{"type":"string","const":"INVALID_ROLE","title":"Code"},"details":{"type":"string","const":"The role of the calling user for this group_id is not in the list of allowed roles","title":"Details"},"payload":{"$ref":"#/components/schemas/pysae__common__http__base__RoleDependencyPayload__3"}},"type":"object","required":["code","details","payload"],"title":"RoleDependency"},"pysae__common__http__base__RoleDependency__4":{"properties":{"code":{"type":"string","const":"INVALID_ROLE","title":"Code"},"details":{"type":"string","const":"The role of the calling user for this group_id is not in the list of allowed roles","title":"Details"},"payload":{"$ref":"#/components/schemas/pysae__common__http__base__RoleDependencyPayload__4"}},"type":"object","required":["code","details","payload"],"title":"RoleDependency"}},"securitySchemes":{"SessionCookie":{"type":"apiKey","description":"Cookie: session_id=<session_id>","in":"cookie","name":"session_id"},"SessionBearerToken":{"type":"http","description":"Authorization: Bearer <session_id>","scheme":"bearer"},"OpenIDConnect":{"type":"openIdConnect","description":"Authorization: Bearer <jwt>","openIdConnectUrl":"https://dev-ebbcamyiet1cvkvr.eu.auth0.com/.well-known/openid-configuration"},"ApiKey":{"type":"http","description":"Authorization: Api-Key <api_key>","scheme":"bearer"}}},"servers":[{"url":"https://api.pysae.com","description":"prod"}]}