{
  "openapi": "3.1.0",
  "info": {
    "title": "APIs DGTLMS",
    "version": "2.0",
    "summary": "APIs d'intégration de la plateforme de formation DGTLMS",
    "description": "Référence des API de la plateforme de formation **DGTLMS**, éditée par DGT CONCEPT.\n\nToutes les adresses sont relatives à **votre propre plateforme** (par exemple `https://votre-plateforme.dgtlms.fr`). Les clés d'API sont fournies par DGT Concept à la mise en service, ou créées par l'administrateur de la plateforme (clés WordPress et xAPI). Servez toujours vos appels en HTTPS.\n\n## Authentification\n| API | Mécanisme |\n|---|---|\n| REST v1, Wrapper Dispatcher, Yparéo | `X-API-Key` (REST v1 : aussi HTTP Basic avec les identifiants web services) |\n| Mobile | JWT Bearer |\n| xAPI | clé xAPI en `X-API-Key` ou Basic |\n| OData / Power BI | clé BI en lecture seule (`X-API-Key` ou `?apikey=`) |\n| WordPress / WooCommerce | clé du site WordPress (`Authorization: Bearer dgtwp_…`) |\n| Dendreo | signature HMAC (webhooks), `X-API-Key` + `X-Tenant` (lecture) |\n\n## Connecteurs sans route entrante\nCes connecteurs ne demandent aucun développement de votre côté : c'est la plateforme qui appelle votre outil.\n- **Lucca (SIRH)** — synchronisation quotidienne des collaborateurs ; les départements deviennent des groupes. À fournir : URL de l'instance Lucca et clé d'API.\n- **Salesforce (CRM)** — synchronisation horaire : les Contacts marqués (`DGTLMS_Sync__c` par défaut) deviennent des apprenants, inscrits à la session indiquée par `DGTLMS_Session_Ref__c`. À fournir : application connectée (OAuth2) et compte d'intégration.\n- **CEGID HR** — comptes et inscriptions entrants, complétions sortantes (OAuth2 côté Cegid).\n\n## Notifications sortantes (webhooks)\n- **Complétion d'un contenu diffusé (Wrapper Dispatcher)** — `POST` JSON vers l'URL du partenaire (`event: wrapper.completion`, identifiant anonyme, statut, score, temps), signé par `X-DGT-Signature: sha256=<HMAC-SHA256 du corps>`. Envoi au mieux, délai 5 s, sans nouvelle tentative.\n- **Règles d'automatisation** — action « appel d'un système externe » : `POST` JSON (`event`, `user_id`, `parcours_id`, `site_id`, `score`, `timestamp`) avec l'en-tête `X-DGTLMS-Event: automation`. Cet appel n'est pas signé : utilisez une URL difficile à deviner et/ou un filtrage par adresse IP.\n\n## Web services SOAP\nL'interface historique (environ 120 opérations : utilisateurs, groupes, sessions, parcours, inscriptions, résultats) reste disponible. Description WSDL : [`/ws.php?wsdl`](/ws.php?wsdl). Authentification : `X-API-Key`, ou HTTP Basic avec les identifiants web services depuis une adresse IP autorisée.\n\n## Erreurs\nChaque API a son format d'erreur, décrit dans la présentation de son groupe et dans chaque réponse.",
    "contact": {
      "name": "DGT CONCEPT",
      "url": "https://www.dgtconcept.net"
    },
    "license": {
      "name": "Usage réservé aux clients DGTLMS",
      "url": "https://www.dgtconcept.net"
    }
  },
  "servers": [
    {
      "url": "https://{instance}",
      "description": "Votre plateforme DGTLMS",
      "variables": {
        "instance": {
          "default": "votre-plateforme.dgtlms.fr",
          "description": "Adresse de votre propre plateforme (sans https://)"
        }
      }
    }
  ],
  "tags": [
    {
      "name": "REST v1",
      "description": "**Base :** `/api/v1/`  \n**Authentification :** X-API-Key, ou HTTP Basic avec les identifiants web services\n\nPilotage de la plateforme depuis votre SIRH, ERP ou portail : utilisateurs, sessions, parcours, inscriptions et résultats. Les routes d'écriture agissent directement sur les données de production. Erreurs : `{ \"error\": \"message\" }` ; une erreur métier renvoyée par la plateforme donne 400."
    },
    {
      "name": "Wrapper Dispatcher",
      "description": "**Base :** `/api/v1/wrapper-dispatcher/`  \n**Authentification :** identique à l'API REST v1\n\nDiffusion de vos formations dans le LMS de vos partenaires (tiers) sous forme de paquets SCORM : wrappers, tiers, catégories, dépôt SFTP et statistiques. Nécessite le module Wrapper Dispatcher."
    },
    {
      "name": "Mobile",
      "description": "**Base :** `/api/mobile/`  \n**Authentification :** JWT Bearer (POST /auth/login)\n\nAPI de l'application mobile apprenant (iOS, Android, FlutterFlow) : profil, catalogue, parcours, badges, habilitations, paquets hors-ligne et synchronisation différée. À activer par DGT Concept (sinon 503). Erreurs : `{ \"ok\": false, \"reason\", \"message\" }`."
    },
    {
      "name": "xAPI LRS",
      "description": "**Base :** `/api/xapi/`  \n**Authentification :** clé xAPI en X-API-Key, ou Basic base64(\"<clé>:\")\n\nLearning Record Store xAPI 1.0.3 : Statements (avec pièces jointes), State, Activity Profile, Agent Profile, Activities, Agents. En-tête `X-Experience-API-Version: 1.0.3` obligatoire hors /health et /about. Certification ADL en cours. Erreurs : `{ \"error\", \"message\" }`."
    },
    {
      "name": "OData / Power BI",
      "description": "**Base :** `/api/bi/odata/`  \n**Authentification :** clé BI en lecture seule (X-API-Key ou ?apikey=)\n\nFlux OData v4 en lecture seule pour Power BI, Excel ou Tableau : modèle en étoile (résultats, temps passé, connexions, dimensions). Dans Power BI : Obtenir les données > Flux OData, URL `…/api/bi/odata/?apikey=<clé>`, authentification Anonyme. Erreurs au format OData."
    },
    {
      "name": "WordPress / WooCommerce",
      "description": "**Base :** `/api/wordpress/`  \n**Authentification :** clé du site WordPress (Bearer dgtwp_… ou X-API-Key)\n\nRoutes appelées par l'extension DGTLMS Connect : connexion unique, suivi des formations, vente WooCommerce (parcours, sessions, places entreprise). Documentées pour les intégrations sur mesure. Nécessite le module Intégrations & Connecteurs. Erreurs : `{ \"error\": \"message\" }`."
    },
    {
      "name": "Dendreo",
      "description": "**Base :** `/api/dendreo/`  \n**Authentification :** webhooks : signature HMAC ; lecture : X-API-Key (ou X-Auth-API-Key) + X-Tenant\n\nConnecteur du TMS Dendreo : catalogue, webhooks apprenants / sessions / inscriptions, remontée de progression et connexion en un clic. Erreurs : `{ \"error\", \"message\" }`, ou tableau `[{ \"error.field\", \"error.reason\" }]` pour la validation métier."
    },
    {
      "name": "Ypareo",
      "description": "**Base :** `/api/ypareo/`  \n**Authentification :** X-API-Key\n\nConnecteur Ymag Yparéo (CFA, organismes de formation) : apprenants, inscriptions, catalogue et connexion unique. La plateforme interroge aussi Yparéo toutes les 15 minutes."
    },
    {
      "name": "CEGID HR",
      "description": "**Base :** `/api/cegid/`  \n**Authentification :** aucune (diagnostic public)\n\nLe connecteur CEGID HR est à l'initiative de la plateforme : elle récupère comptes et inscriptions (OAuth2, toutes les 15 minutes) et renvoie les complétions. Seul le diagnostic est exposé."
    }
  ],
  "paths": {
    "/api/v1/health": {
      "get": {
        "tags": [
          "REST v1"
        ],
        "operationId": "v1Health",
        "summary": "Diagnostic de l'API",
        "description": "Public, sans clé. Renvoie le statut de l'API et la liste des routes.",
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Health"
                },
                "example": {
                  "api": "DGTLMS REST API",
                  "version": "v1",
                  "status": "ok",
                  "endpoints": {
                    "GET  /users": "Liste utilisateurs"
                  }
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/v1/users": {
      "get": {
        "tags": [
          "REST v1"
        ],
        "operationId": "v1ListUsers",
        "summary": "Lister les utilisateurs",
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/User"
                      }
                    },
                    "count": {
                      "type": "integer",
                      "description": "Nombre d'éléments renvoyés"
                    }
                  },
                  "required": [
                    "data",
                    "count"
                  ]
                },
                "example": {
                  "data": [
                    {
                      "id": 4287,
                      "login": "jean.dupont",
                      "firstname": "Jean",
                      "lastname": "Dupont",
                      "email": "jean.dupont@client.fr",
                      "level_id": 4,
                      "active": true,
                      "service": "Direction commerciale",
                      "start_date": "01/01/2026",
                      "end_date": "31/12/2026",
                      "lang": "fr",
                      "custom_fields": {
                        "field1": "Lyon"
                      }
                    }
                  ],
                  "count": 1
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1401"
          }
        },
        "security": [
          {
            "ApiKey": []
          },
          {
            "WebserviceBasic": []
          }
        ]
      },
      "post": {
        "tags": [
          "REST v1"
        ],
        "operationId": "v1SaveUser",
        "summary": "Créer ou mettre à jour un utilisateur",
        "description": "Sans `id` (ou `id` ≤ 0), crée l'utilisateur et répond 201. Avec un `id` existant, met à jour l'utilisateur et répond 200.\n\nLes dates sont des **horodatages Unix** (ou vides).\n\n**Attention : en mise à jour, tous les champs sont réécrits.** Un champ non envoyé est vidé — mot de passe compris. Relisez d'abord l'utilisateur (GET /api/v1/users/{id}) et renvoyez l'ensemble de ses valeurs.\n\n**Attention :** cette route modifie les données de production de la plateforme.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserInput"
              },
              "example": {
                "login": "jean.dupont",
                "password": "MotDePasse2026!",
                "firstname": "Jean",
                "lastname": "Dupont",
                "email": "jean.dupont@client.fr",
                "start_date": "1767225600",
                "end_date": "1798675200",
                "level_id": 4,
                "service": "Direction commerciale",
                "active": "true",
                "lang": "fr",
                "sendmail": 1
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Ressource créée",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer"
                    },
                    "created": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "id": 4287,
                  "created": true
                }
              }
            }
          },
          "200": {
            "description": "Utilisateur mis à jour",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer"
                    },
                    "created": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "id": 4287,
                  "created": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1401"
          },
          "400": {
            "$ref": "#/components/responses/V1400"
          }
        },
        "security": [
          {
            "ApiKey": []
          },
          {
            "WebserviceBasic": []
          }
        ]
      }
    },
    "/api/v1/users/login/{login}": {
      "get": {
        "tags": [
          "REST v1"
        ],
        "operationId": "v1GetUserByLogin",
        "summary": "Lire un utilisateur par identifiant de connexion",
        "parameters": [
          {
            "name": "login",
            "in": "path",
            "required": true,
            "description": "Identifiant de connexion (encodé URL)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/User"
                },
                "example": {
                  "id": 4287,
                  "login": "jean.dupont",
                  "firstname": "Jean",
                  "lastname": "Dupont",
                  "email": "jean.dupont@client.fr",
                  "level_id": 4,
                  "active": true,
                  "service": "Direction commerciale",
                  "start_date": "01/01/2026",
                  "end_date": "31/12/2026",
                  "lang": "fr",
                  "custom_fields": {
                    "field1": "Lyon"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1401"
          },
          "400": {
            "$ref": "#/components/responses/V1400"
          },
          "404": {
            "$ref": "#/components/responses/V1404"
          }
        },
        "security": [
          {
            "ApiKey": []
          },
          {
            "WebserviceBasic": []
          }
        ]
      }
    },
    "/api/v1/users/{id}": {
      "get": {
        "tags": [
          "REST v1"
        ],
        "operationId": "v1GetUser",
        "summary": "Lire un utilisateur",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Identifiant de l'utilisateur",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/User"
                },
                "example": {
                  "id": 4287,
                  "login": "jean.dupont",
                  "firstname": "Jean",
                  "lastname": "Dupont",
                  "email": "jean.dupont@client.fr",
                  "level_id": 4,
                  "active": true,
                  "service": "Direction commerciale",
                  "start_date": "01/01/2026",
                  "end_date": "31/12/2026",
                  "lang": "fr",
                  "custom_fields": {
                    "field1": "Lyon"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1401"
          },
          "400": {
            "$ref": "#/components/responses/V1400"
          },
          "404": {
            "$ref": "#/components/responses/V1404"
          }
        },
        "security": [
          {
            "ApiKey": []
          },
          {
            "WebserviceBasic": []
          }
        ]
      }
    },
    "/api/v1/users/{id}/active": {
      "put": {
        "tags": [
          "REST v1"
        ],
        "operationId": "v1SetUserActive",
        "summary": "Activer ou désactiver un utilisateur",
        "description": "\n\n**Attention :** cette route modifie les données de production de la plateforme.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Identifiant de l'utilisateur",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "active": {
                    "type": "boolean",
                    "default": true
                  }
                }
              },
              "example": {
                "active": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer"
                    },
                    "active": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "id": 4287,
                  "active": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1401"
          },
          "400": {
            "$ref": "#/components/responses/V1400"
          }
        },
        "security": [
          {
            "ApiKey": []
          },
          {
            "WebserviceBasic": []
          }
        ]
      }
    },
    "/api/v1/users/{id}/end-date": {
      "put": {
        "tags": [
          "REST v1"
        ],
        "operationId": "v1SetUserEndDate",
        "summary": "Modifier la date de fin d'accès",
        "description": "\n\n**Attention :** cette route modifie les données de production de la plateforme.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Identifiant de l'utilisateur",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "end_date": {
                    "type": "string",
                    "description": "Horodatage Unix (secondes)",
                    "pattern": "^[0-9]+$"
                  }
                },
                "required": [
                  "end_date"
                ]
              },
              "example": {
                "end_date": "1798675200"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer"
                    },
                    "end_date": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "id": 4287,
                  "end_date": 1798675200
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1401"
          },
          "400": {
            "$ref": "#/components/responses/V1400"
          },
          "404": {
            "$ref": "#/components/responses/V1404"
          }
        },
        "security": [
          {
            "ApiKey": []
          },
          {
            "WebserviceBasic": []
          }
        ]
      }
    },
    "/api/v1/users/{id}/sessions": {
      "get": {
        "tags": [
          "REST v1"
        ],
        "operationId": "v1GetUserSessions",
        "summary": "Sessions d'un utilisateur",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Identifiant de l'utilisateur",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "user_id": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Session"
                      }
                    },
                    "count": {
                      "type": "integer",
                      "description": "Nombre d'éléments renvoyés"
                    }
                  },
                  "required": [
                    "data",
                    "count"
                  ]
                },
                "example": {
                  "user_id": 4287,
                  "data": [
                    {
                      "id": 87,
                      "name": "Onboarding commerciaux — octobre 2026",
                      "start_date": "05/10/2026",
                      "end_date": "30/11/2026",
                      "active": true,
                      "locked": false,
                      "blocked": false,
                      "is_default": false
                    }
                  ],
                  "count": 1
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1401"
          }
        },
        "security": [
          {
            "ApiKey": []
          },
          {
            "WebserviceBasic": []
          }
        ]
      }
    },
    "/api/v1/users/{id}/trainings": {
      "get": {
        "tags": [
          "REST v1"
        ],
        "operationId": "v1GetUserTrainings",
        "summary": "Parcours accessibles à un utilisateur",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Identifiant de l'utilisateur",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "user_id": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Training"
                      }
                    },
                    "count": {
                      "type": "integer",
                      "description": "Nombre d'éléments renvoyés"
                    }
                  },
                  "required": [
                    "data",
                    "count"
                  ]
                },
                "example": {
                  "user_id": 4287,
                  "data": [
                    {
                      "id": 42,
                      "title": "Sécurité informatique",
                      "description": "Les bons réflexes au quotidien",
                      "nb_sco": 6,
                      "valid": "true",
                      "locked": false,
                      "themes": [
                        {
                          "id": 3,
                          "name": "Cybersécurité",
                          "color": "#5869fd"
                        }
                      ],
                      "duration": "PT2H"
                    }
                  ],
                  "count": 1
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1401"
          }
        },
        "security": [
          {
            "ApiKey": []
          },
          {
            "WebserviceBasic": []
          }
        ]
      }
    },
    "/api/v1/users/{id}/results": {
      "get": {
        "tags": [
          "REST v1"
        ],
        "operationId": "v1GetUserResults",
        "summary": "Résultats d'un utilisateur, par activité",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Identifiant de l'utilisateur",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "user_id": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ScoResult"
                      }
                    },
                    "count": {
                      "type": "integer",
                      "description": "Nombre d'éléments renvoyés"
                    }
                  },
                  "required": [
                    "data",
                    "count"
                  ]
                },
                "example": {
                  "user_id": 4287,
                  "data": [
                    {
                      "user_id": 4287,
                      "trainingpath_id": 42,
                      "sco_id": 187,
                      "nb": 2,
                      "date": "12/10/2026 09:14",
                      "date_last_update": "14/10/2026 17:02",
                      "lesson_status": "passed",
                      "spent_time": 1240,
                      "score": 85,
                      "progression": 100
                    }
                  ],
                  "count": 1
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1401"
          }
        },
        "security": [
          {
            "ApiKey": []
          },
          {
            "WebserviceBasic": []
          }
        ]
      }
    },
    "/api/v1/users/{id}/results/sessions": {
      "get": {
        "tags": [
          "REST v1"
        ],
        "operationId": "v1GetUserSessionResults",
        "summary": "Résultats d'un utilisateur, par session",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Identifiant de l'utilisateur",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "session_id",
            "in": "query",
            "required": false,
            "description": "Session (0 ou absent = toutes ses sessions)",
            "schema": {
              "type": "integer",
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "user_id": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    },
                    "count": {
                      "type": "integer",
                      "description": "Nombre d'éléments renvoyés"
                    }
                  },
                  "required": [
                    "data",
                    "count"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1401"
          },
          "400": {
            "$ref": "#/components/responses/V1400"
          }
        },
        "security": [
          {
            "ApiKey": []
          },
          {
            "WebserviceBasic": []
          }
        ]
      }
    },
    "/api/v1/users/{id}/results/courses": {
      "get": {
        "tags": [
          "REST v1"
        ],
        "operationId": "v1GetUserCourseResults",
        "summary": "Résultats d'un utilisateur, par parcours",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Identifiant de l'utilisateur",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "course_id",
            "in": "query",
            "required": false,
            "description": "Parcours (0 ou absent = tous)",
            "schema": {
              "type": "integer",
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "user_id": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CourseResult"
                      }
                    },
                    "count": {
                      "type": "integer",
                      "description": "Nombre d'éléments renvoyés"
                    }
                  },
                  "required": [
                    "data",
                    "count"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1401"
          },
          "400": {
            "$ref": "#/components/responses/V1400"
          }
        },
        "security": [
          {
            "ApiKey": []
          },
          {
            "WebserviceBasic": []
          }
        ]
      }
    },
    "/api/v1/sessions": {
      "get": {
        "tags": [
          "REST v1"
        ],
        "operationId": "v1ListSessions",
        "summary": "Lister les sessions",
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Session"
                      }
                    },
                    "count": {
                      "type": "integer",
                      "description": "Nombre d'éléments renvoyés"
                    }
                  },
                  "required": [
                    "data",
                    "count"
                  ]
                },
                "example": {
                  "data": [
                    {
                      "id": 87,
                      "name": "Onboarding commerciaux — octobre 2026",
                      "start_date": "05/10/2026",
                      "end_date": "30/11/2026",
                      "active": true,
                      "locked": false,
                      "blocked": false,
                      "is_default": false
                    }
                  ],
                  "count": 1
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1401"
          }
        },
        "security": [
          {
            "ApiKey": []
          },
          {
            "WebserviceBasic": []
          }
        ]
      },
      "post": {
        "tags": [
          "REST v1"
        ],
        "operationId": "v1CreateSession",
        "summary": "Créer une session",
        "description": "Dates en horodatages Unix (ou vides).\n\n**Attention :** cette route modifie les données de production de la plateforme.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/SessionInput"
                  },
                  {
                    "required": [
                      "name"
                    ]
                  }
                ]
              },
              "example": {
                "name": "Onboarding commerciaux — octobre 2026",
                "start_date": "1791158400",
                "end_date": "1795996800",
                "active": "true"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Ressource créée",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "id": 87
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1401"
          },
          "400": {
            "$ref": "#/components/responses/V1400"
          }
        },
        "security": [
          {
            "ApiKey": []
          },
          {
            "WebserviceBasic": []
          }
        ]
      }
    },
    "/api/v1/sessions/{id}": {
      "get": {
        "tags": [
          "REST v1"
        ],
        "operationId": "v1GetSession",
        "summary": "Lire une session",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Identifiant de la session",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Session"
                },
                "example": {
                  "id": 87,
                  "name": "Onboarding commerciaux — octobre 2026",
                  "start_date": "05/10/2026",
                  "end_date": "30/11/2026",
                  "active": true,
                  "locked": false,
                  "blocked": false,
                  "is_default": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1401"
          },
          "404": {
            "$ref": "#/components/responses/V1404"
          }
        },
        "security": [
          {
            "ApiKey": []
          },
          {
            "WebserviceBasic": []
          }
        ]
      },
      "put": {
        "tags": [
          "REST v1"
        ],
        "operationId": "v1UpdateSession",
        "summary": "Mettre à jour une session",
        "description": "Seuls les champs envoyés sont modifiés : une session mise à jour sans dates conserve ses dates.\n\n**Attention :** cette route modifie les données de production de la plateforme.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Identifiant de la session",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SessionInput"
              },
              "example": {
                "name": "Onboarding commerciaux — novembre 2026",
                "active": "true"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer"
                    },
                    "updated": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "id": 87,
                  "updated": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1401"
          },
          "400": {
            "$ref": "#/components/responses/V1400"
          },
          "404": {
            "$ref": "#/components/responses/V1404"
          }
        },
        "security": [
          {
            "ApiKey": []
          },
          {
            "WebserviceBasic": []
          }
        ]
      },
      "delete": {
        "tags": [
          "REST v1"
        ],
        "operationId": "v1DeleteSession",
        "summary": "Supprimer une session",
        "description": "\n\n**Attention :** cette route modifie les données de production de la plateforme.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Identifiant de la session",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer"
                    },
                    "deleted": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "id": 87,
                  "deleted": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1401"
          },
          "400": {
            "$ref": "#/components/responses/V1400"
          },
          "404": {
            "$ref": "#/components/responses/V1404"
          }
        },
        "security": [
          {
            "ApiKey": []
          },
          {
            "WebserviceBasic": []
          }
        ]
      }
    },
    "/api/v1/sessions/{id}/users": {
      "get": {
        "tags": [
          "REST v1"
        ],
        "operationId": "v1GetSessionUsers",
        "summary": "Inscrits d'une session",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Identifiant de la session",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "session_id": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/User"
                      }
                    },
                    "count": {
                      "type": "integer",
                      "description": "Nombre d'éléments renvoyés"
                    }
                  },
                  "required": [
                    "data",
                    "count"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1401"
          }
        },
        "security": [
          {
            "ApiKey": []
          },
          {
            "WebserviceBasic": []
          }
        ]
      },
      "post": {
        "tags": [
          "REST v1"
        ],
        "operationId": "v1EnrolSessionUser",
        "summary": "Inscrire un utilisateur à une session",
        "description": "\n\n**Attention :** cette route modifie les données de production de la plateforme.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Identifiant de la session",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user_id": {
                    "type": "integer"
                  }
                },
                "required": [
                  "user_id"
                ]
              },
              "example": {
                "user_id": 4287
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "session_id": {
                      "type": "integer"
                    },
                    "user_id": {
                      "type": "integer"
                    },
                    "enrolled": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "session_id": 87,
                  "user_id": 4287,
                  "enrolled": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1401"
          },
          "400": {
            "$ref": "#/components/responses/V1400"
          },
          "422": {
            "$ref": "#/components/responses/V1422"
          }
        },
        "security": [
          {
            "ApiKey": []
          },
          {
            "WebserviceBasic": []
          }
        ]
      }
    },
    "/api/v1/sessions/{id}/users/{uid}": {
      "delete": {
        "tags": [
          "REST v1"
        ],
        "operationId": "v1UnenrolSessionUser",
        "summary": "Désinscrire un utilisateur d'une session",
        "description": "\n\n**Attention :** cette route modifie les données de production de la plateforme.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Identifiant de la session",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "uid",
            "in": "path",
            "required": true,
            "description": "Identifiant de l'utilisateur",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "session_id": {
                      "type": "integer"
                    },
                    "user_id": {
                      "type": "integer"
                    },
                    "unenrolled": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "session_id": 87,
                  "user_id": 4287,
                  "unenrolled": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1401"
          },
          "422": {
            "$ref": "#/components/responses/V1422"
          }
        },
        "security": [
          {
            "ApiKey": []
          },
          {
            "WebserviceBasic": []
          }
        ]
      }
    },
    "/api/v1/trainings": {
      "get": {
        "tags": [
          "REST v1"
        ],
        "operationId": "v1ListTrainings",
        "summary": "Lister les parcours",
        "parameters": [
          {
            "name": "theme",
            "in": "query",
            "required": false,
            "description": "Filtrer sur un thème (identifiant)",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Training"
                      }
                    },
                    "count": {
                      "type": "integer",
                      "description": "Nombre d'éléments renvoyés"
                    }
                  },
                  "required": [
                    "data",
                    "count"
                  ]
                },
                "example": {
                  "data": [
                    {
                      "id": 42,
                      "title": "Sécurité informatique",
                      "description": "Les bons réflexes au quotidien",
                      "nb_sco": 6,
                      "valid": "true",
                      "locked": false,
                      "themes": [
                        {
                          "id": 3,
                          "name": "Cybersécurité",
                          "color": "#5869fd"
                        }
                      ],
                      "duration": "PT2H"
                    }
                  ],
                  "count": 1
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1401"
          }
        },
        "security": [
          {
            "ApiKey": []
          },
          {
            "WebserviceBasic": []
          }
        ]
      }
    },
    "/api/v1/trainings/{id}": {
      "get": {
        "tags": [
          "REST v1"
        ],
        "operationId": "v1GetTraining",
        "summary": "Lire un parcours",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Identifiant du parcours",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Training"
                },
                "example": {
                  "id": 42,
                  "title": "Sécurité informatique",
                  "description": "Les bons réflexes au quotidien",
                  "nb_sco": 6,
                  "valid": "true",
                  "locked": false,
                  "themes": [
                    {
                      "id": 3,
                      "name": "Cybersécurité",
                      "color": "#5869fd"
                    }
                  ],
                  "duration": "PT2H"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1401"
          },
          "404": {
            "$ref": "#/components/responses/V1404"
          }
        },
        "security": [
          {
            "ApiKey": []
          },
          {
            "WebserviceBasic": []
          }
        ]
      }
    },
    "/api/v1/trainings/{id}/users": {
      "get": {
        "tags": [
          "REST v1"
        ],
        "operationId": "v1GetTrainingUsers",
        "summary": "Inscrits d'un parcours",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Identifiant du parcours",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "training_id": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/User"
                      }
                    },
                    "count": {
                      "type": "integer",
                      "description": "Nombre d'éléments renvoyés"
                    }
                  },
                  "required": [
                    "data",
                    "count"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1401"
          }
        },
        "security": [
          {
            "ApiKey": []
          },
          {
            "WebserviceBasic": []
          }
        ]
      },
      "post": {
        "tags": [
          "REST v1"
        ],
        "operationId": "v1EnrolTrainingUser",
        "summary": "Inscrire un utilisateur à un parcours",
        "description": "\n\n**Attention :** cette route modifie les données de production de la plateforme.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Identifiant du parcours",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user_id": {
                    "type": "integer"
                  }
                },
                "required": [
                  "user_id"
                ]
              },
              "example": {
                "user_id": 4287
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "training_id": {
                      "type": "integer"
                    },
                    "user_id": {
                      "type": "integer"
                    },
                    "enrolled": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "training_id": 42,
                  "user_id": 4287,
                  "enrolled": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1401"
          },
          "400": {
            "$ref": "#/components/responses/V1400"
          },
          "422": {
            "$ref": "#/components/responses/V1422"
          }
        },
        "security": [
          {
            "ApiKey": []
          },
          {
            "WebserviceBasic": []
          }
        ]
      }
    },
    "/api/v1/trainings/{id}/users/{uid}": {
      "delete": {
        "tags": [
          "REST v1"
        ],
        "operationId": "v1UnenrolTrainingUser",
        "summary": "Désinscrire un utilisateur d'un parcours",
        "description": "\n\n**Attention :** cette route modifie les données de production de la plateforme.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Identifiant du parcours",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "uid",
            "in": "path",
            "required": true,
            "description": "Identifiant de l'utilisateur",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "training_id": {
                      "type": "integer"
                    },
                    "user_id": {
                      "type": "integer"
                    },
                    "unenrolled": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "training_id": 42,
                  "user_id": 4287,
                  "unenrolled": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1401"
          },
          "422": {
            "$ref": "#/components/responses/V1422"
          }
        },
        "security": [
          {
            "ApiKey": []
          },
          {
            "WebserviceBasic": []
          }
        ]
      }
    },
    "/api/v1/results": {
      "post": {
        "tags": [
          "REST v1"
        ],
        "operationId": "v1InsertResult",
        "summary": "Enregistrer un résultat",
        "description": "Insère un résultat de suivi pour une activité (statut, score, temps passé facultatif).\n\n**Attention :** cette route modifie les données de production de la plateforme.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResultInput"
              },
              "example": {
                "training_id": 42,
                "sco_id": 187,
                "user_id": 4287,
                "score": 85,
                "lesson_status": "passed",
                "time_spent": 1240
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Ressource créée",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "inserted": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "inserted": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1401"
          },
          "400": {
            "$ref": "#/components/responses/V1400"
          },
          "422": {
            "$ref": "#/components/responses/V1422"
          }
        },
        "security": [
          {
            "ApiKey": []
          },
          {
            "WebserviceBasic": []
          }
        ]
      }
    },
    "/api/v1/wrapper-dispatcher/wrappers": {
      "get": {
        "tags": [
          "Wrapper Dispatcher"
        ],
        "operationId": "wdListWrappers",
        "summary": "Lister les wrappers",
        "parameters": [
          {
            "name": "category_id",
            "in": "query",
            "required": false,
            "description": "Filtrer par catégorie",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "active",
            "in": "query",
            "required": false,
            "description": "true = wrappers actifs seulement",
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Wrapper"
                      }
                    },
                    "count": {
                      "type": "integer",
                      "description": "Nombre d'éléments renvoyés"
                    }
                  },
                  "required": [
                    "data",
                    "count"
                  ]
                },
                "example": {
                  "data": [
                    {
                      "wrapper_id": 35,
                      "title": "Cybersécurité : les bons réflexes",
                      "description": null,
                      "id_parcours": 13,
                      "parcours_titre": "Cybersécurité, les bons réflexes",
                      "access_token": "63a9…",
                      "is_active": true,
                      "nb_tiers": 4,
                      "created_at": "2026-09-12 10:24:00"
                    }
                  ],
                  "count": 1
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1401"
          }
        },
        "security": [
          {
            "ApiKey": []
          },
          {
            "WebserviceBasic": []
          }
        ]
      },
      "post": {
        "tags": [
          "Wrapper Dispatcher"
        ],
        "operationId": "wdSaveWrapper",
        "summary": "Créer ou mettre à jour un wrapper",
        "description": "\n\n**Attention :** cette route modifie les données de production de la plateforme.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WrapperInput"
              },
              "example": {
                "title": "Cybersécurité : les bons réflexes",
                "id_parcours": 13,
                "is_active": true,
                "category_ids": [
                  2
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Ressource créée",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "wrapper_id": {
                      "type": "integer"
                    },
                    "created": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "wrapper_id": 35,
                  "created": true
                }
              }
            }
          },
          "200": {
            "description": "Wrapper mis à jour",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "wrapper_id": {
                      "type": "integer"
                    },
                    "created": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "wrapper_id": 35,
                  "created": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1401"
          },
          "400": {
            "$ref": "#/components/responses/V1400"
          }
        },
        "security": [
          {
            "ApiKey": []
          },
          {
            "WebserviceBasic": []
          }
        ]
      }
    },
    "/api/v1/wrapper-dispatcher/wrappers/{id}": {
      "get": {
        "tags": [
          "Wrapper Dispatcher"
        ],
        "operationId": "wdGetWrapper",
        "summary": "Lire un wrapper (avec ses tiers et catégories)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Identifiant du wrapper",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WrapperDetail"
                },
                "example": {
                  "wrapper_id": 35,
                  "title": "Cybersécurité : les bons réflexes",
                  "description": null,
                  "id_parcours": 13,
                  "parcours_titre": "Cybersécurité, les bons réflexes",
                  "access_token": "63a9…",
                  "is_active": true,
                  "nb_tiers": 4,
                  "created_at": "2026-09-12 10:24:00",
                  "tiers": [
                    {
                      "tier_id": 12,
                      "tier_name": "Groupe Exemple",
                      "origins": [
                        {
                          "url": "https://lms.exemple.fr",
                          "date_start": null,
                          "date_end": "2027-06-30"
                        }
                      ],
                      "max_users": 500,
                      "seat_inactivity_days": null,
                      "is_active": true,
                      "current_users": 214,
                      "nb_wrappers": 6
                    }
                  ],
                  "categories": [
                    {
                      "category_id": 2,
                      "category_name": "Sécurité",
                      "category_order": 1,
                      "nb_wrappers": 8
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1401"
          },
          "404": {
            "$ref": "#/components/responses/V1404"
          }
        },
        "security": [
          {
            "ApiKey": []
          },
          {
            "WebserviceBasic": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Wrapper Dispatcher"
        ],
        "operationId": "wdDeleteWrapper",
        "summary": "Supprimer un wrapper",
        "description": "\n\n**Attention :** cette route modifie les données de production de la plateforme.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Identifiant du wrapper",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "wrapper_id": {
                      "type": "integer"
                    },
                    "deleted": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "wrapper_id": 35,
                  "deleted": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1401"
          },
          "404": {
            "$ref": "#/components/responses/V1404"
          }
        },
        "security": [
          {
            "ApiKey": []
          },
          {
            "WebserviceBasic": []
          }
        ]
      }
    },
    "/api/v1/wrapper-dispatcher/wrappers/{id}/regen-token": {
      "post": {
        "tags": [
          "Wrapper Dispatcher"
        ],
        "operationId": "wdRegenWrapperToken",
        "summary": "Régénérer le jeton d'accès",
        "description": "L'ancien jeton cesse de fonctionner : les paquets déjà distribués doivent être remplacés.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Identifiant du wrapper",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "wrapper_id": {
                      "type": "integer"
                    },
                    "access_token": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1401"
          },
          "404": {
            "$ref": "#/components/responses/V1404"
          }
        },
        "security": [
          {
            "ApiKey": []
          },
          {
            "WebserviceBasic": []
          }
        ]
      }
    },
    "/api/v1/wrapper-dispatcher/wrappers/{id}/scorm": {
      "get": {
        "tags": [
          "Wrapper Dispatcher"
        ],
        "operationId": "wdDownloadWrapperScorm",
        "summary": "Télécharger le paquet SCORM global",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Identifiant du wrapper",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "description": "Format du paquet : scorm12 (défaut), scorm2004 (4th Edition) ou cmi5. Valeur inconnue = scorm12.",
            "schema": {
              "type": "string",
              "enum": [
                "scorm12",
                "scorm2004",
                "cmi5"
              ],
              "default": "scorm12"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paquet SCORM (.zip)",
            "content": {
              "application/zip": {
                "schema": {
                  "type": "string",
                  "contentMediaType": "application/zip"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1401"
          },
          "404": {
            "$ref": "#/components/responses/V1404"
          },
          "500": {
            "$ref": "#/components/responses/V1500"
          }
        },
        "security": [
          {
            "ApiKey": []
          },
          {
            "WebserviceBasic": []
          }
        ]
      }
    },
    "/api/v1/wrapper-dispatcher/tiers": {
      "get": {
        "tags": [
          "Wrapper Dispatcher"
        ],
        "operationId": "wdListTiers",
        "summary": "Lister les tiers",
        "parameters": [
          {
            "name": "active",
            "in": "query",
            "required": false,
            "description": "true = tiers actifs seulement",
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Tier"
                      }
                    },
                    "count": {
                      "type": "integer",
                      "description": "Nombre d'éléments renvoyés"
                    }
                  },
                  "required": [
                    "data",
                    "count"
                  ]
                },
                "example": {
                  "data": [
                    {
                      "tier_id": 12,
                      "tier_name": "Groupe Exemple",
                      "origins": [
                        {
                          "url": "https://lms.exemple.fr",
                          "date_start": null,
                          "date_end": "2027-06-30"
                        }
                      ],
                      "max_users": 500,
                      "seat_inactivity_days": null,
                      "is_active": true,
                      "current_users": 214,
                      "nb_wrappers": 6
                    }
                  ],
                  "count": 1
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1401"
          }
        },
        "security": [
          {
            "ApiKey": []
          },
          {
            "WebserviceBasic": []
          }
        ]
      },
      "post": {
        "tags": [
          "Wrapper Dispatcher"
        ],
        "operationId": "wdSaveTier",
        "summary": "Créer ou mettre à jour un tiers",
        "description": "\n\n**Attention :** cette route modifie les données de production de la plateforme.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TierInput"
              },
              "example": {
                "tier_name": "Groupe Exemple",
                "origins": [
                  "https://lms.exemple.fr"
                ],
                "max_users": 500
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Ressource créée",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tier_id": {
                      "type": "integer"
                    },
                    "created": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "tier_id": 12,
                  "created": true
                }
              }
            }
          },
          "200": {
            "description": "Tiers mis à jour",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tier_id": {
                      "type": "integer"
                    },
                    "created": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "tier_id": 12,
                  "created": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1401"
          },
          "400": {
            "$ref": "#/components/responses/V1400"
          }
        },
        "security": [
          {
            "ApiKey": []
          },
          {
            "WebserviceBasic": []
          }
        ]
      }
    },
    "/api/v1/wrapper-dispatcher/tiers/{id}": {
      "get": {
        "tags": [
          "Wrapper Dispatcher"
        ],
        "operationId": "wdGetTier",
        "summary": "Lire un tiers",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Identifiant du tiers",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Tier"
                },
                "example": {
                  "tier_id": 12,
                  "tier_name": "Groupe Exemple",
                  "origins": [
                    {
                      "url": "https://lms.exemple.fr",
                      "date_start": null,
                      "date_end": "2027-06-30"
                    }
                  ],
                  "max_users": 500,
                  "seat_inactivity_days": null,
                  "is_active": true,
                  "current_users": 214,
                  "nb_wrappers": 6
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1401"
          },
          "404": {
            "$ref": "#/components/responses/V1404"
          }
        },
        "security": [
          {
            "ApiKey": []
          },
          {
            "WebserviceBasic": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Wrapper Dispatcher"
        ],
        "operationId": "wdDeleteTier",
        "summary": "Supprimer un tiers",
        "description": "\n\n**Attention :** cette route modifie les données de production de la plateforme.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Identifiant du tiers",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tier_id": {
                      "type": "integer"
                    },
                    "deleted": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "tier_id": 12,
                  "deleted": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1401"
          },
          "404": {
            "$ref": "#/components/responses/V1404"
          }
        },
        "security": [
          {
            "ApiKey": []
          },
          {
            "WebserviceBasic": []
          }
        ]
      }
    },
    "/api/v1/wrapper-dispatcher/tiers/{id}/wrappers": {
      "get": {
        "tags": [
          "Wrapper Dispatcher"
        ],
        "operationId": "wdListTierWrappers",
        "summary": "Wrappers associés à un tiers",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Identifiant du tiers",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/TierWrapper"
                      }
                    },
                    "count": {
                      "type": "integer",
                      "description": "Nombre d'éléments renvoyés"
                    }
                  },
                  "required": [
                    "data",
                    "count"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1401"
          },
          "404": {
            "$ref": "#/components/responses/V1404"
          }
        },
        "security": [
          {
            "ApiKey": []
          },
          {
            "WebserviceBasic": []
          }
        ]
      },
      "post": {
        "tags": [
          "Wrapper Dispatcher"
        ],
        "operationId": "wdLinkTierWrapper",
        "summary": "Associer un wrapper à un tiers",
        "description": "\n\n**Attention :** cette route modifie les données de production de la plateforme.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Identifiant du tiers",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "wrapper_id": {
                    "type": "integer"
                  }
                },
                "required": [
                  "wrapper_id"
                ]
              },
              "example": {
                "wrapper_id": 35
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Ressource créée",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tier_id": {
                      "type": "integer"
                    },
                    "wrapper_id": {
                      "type": "integer"
                    },
                    "associated": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "tier_id": 12,
                  "wrapper_id": 35,
                  "associated": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1401"
          },
          "400": {
            "$ref": "#/components/responses/V1400"
          },
          "404": {
            "$ref": "#/components/responses/V1404"
          }
        },
        "security": [
          {
            "ApiKey": []
          },
          {
            "WebserviceBasic": []
          }
        ]
      }
    },
    "/api/v1/wrapper-dispatcher/tiers/{tid}/wrappers/{wid}": {
      "delete": {
        "tags": [
          "Wrapper Dispatcher"
        ],
        "operationId": "wdUnlinkTierWrapper",
        "summary": "Dissocier un wrapper d'un tiers",
        "description": "\n\n**Attention :** cette route modifie les données de production de la plateforme.",
        "parameters": [
          {
            "name": "tid",
            "in": "path",
            "required": true,
            "description": "Identifiant du tiers",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "wid",
            "in": "path",
            "required": true,
            "description": "Identifiant du wrapper",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tier_id": {
                      "type": "integer"
                    },
                    "wrapper_id": {
                      "type": "integer"
                    },
                    "unassociated": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1401"
          }
        },
        "security": [
          {
            "ApiKey": []
          },
          {
            "WebserviceBasic": []
          }
        ]
      }
    },
    "/api/v1/wrapper-dispatcher/tiers/{tid}/wrappers/{wid}/dedicated-token": {
      "post": {
        "tags": [
          "Wrapper Dispatcher"
        ],
        "operationId": "wdCreateDedicatedToken",
        "summary": "Générer un jeton dédié tiers / wrapper",
        "description": "Pour les LMS mutualisés, où l'identification par domaine ne suffit pas.",
        "parameters": [
          {
            "name": "tid",
            "in": "path",
            "required": true,
            "description": "Identifiant du tiers",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "wid",
            "in": "path",
            "required": true,
            "description": "Identifiant du wrapper",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tier_id": {
                      "type": "integer"
                    },
                    "wrapper_id": {
                      "type": "integer"
                    },
                    "access_token": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1401"
          }
        },
        "security": [
          {
            "ApiKey": []
          },
          {
            "WebserviceBasic": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Wrapper Dispatcher"
        ],
        "operationId": "wdDeleteDedicatedToken",
        "summary": "Supprimer le jeton dédié",
        "parameters": [
          {
            "name": "tid",
            "in": "path",
            "required": true,
            "description": "Identifiant du tiers",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "wid",
            "in": "path",
            "required": true,
            "description": "Identifiant du wrapper",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tier_id": {
                      "type": "integer"
                    },
                    "wrapper_id": {
                      "type": "integer"
                    },
                    "dedicated_token_removed": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1401"
          }
        },
        "security": [
          {
            "ApiKey": []
          },
          {
            "WebserviceBasic": []
          }
        ]
      }
    },
    "/api/v1/wrapper-dispatcher/tiers/{tid}/wrappers/{wid}/scorm": {
      "get": {
        "tags": [
          "Wrapper Dispatcher"
        ],
        "operationId": "wdDownloadTierScorm",
        "summary": "Télécharger le paquet SCORM dédié au tiers",
        "parameters": [
          {
            "name": "tid",
            "in": "path",
            "required": true,
            "description": "Identifiant du tiers",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "wid",
            "in": "path",
            "required": true,
            "description": "Identifiant du wrapper",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "description": "Format du paquet : scorm12 (défaut), scorm2004 (4th Edition) ou cmi5. Valeur inconnue = scorm12.",
            "schema": {
              "type": "string",
              "enum": [
                "scorm12",
                "scorm2004",
                "cmi5"
              ],
              "default": "scorm12"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paquet SCORM (.zip)",
            "content": {
              "application/zip": {
                "schema": {
                  "type": "string",
                  "contentMediaType": "application/zip"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1401"
          },
          "404": {
            "$ref": "#/components/responses/V1404"
          },
          "500": {
            "$ref": "#/components/responses/V1500"
          }
        },
        "security": [
          {
            "ApiKey": []
          },
          {
            "WebserviceBasic": []
          }
        ]
      }
    },
    "/api/v1/wrapper-dispatcher/categories": {
      "get": {
        "tags": [
          "Wrapper Dispatcher"
        ],
        "operationId": "wdListCategories",
        "summary": "Lister les catégories",
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/WrapperCategory"
                      }
                    },
                    "count": {
                      "type": "integer",
                      "description": "Nombre d'éléments renvoyés"
                    }
                  },
                  "required": [
                    "data",
                    "count"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1401"
          }
        },
        "security": [
          {
            "ApiKey": []
          },
          {
            "WebserviceBasic": []
          }
        ]
      },
      "post": {
        "tags": [
          "Wrapper Dispatcher"
        ],
        "operationId": "wdSaveCategory",
        "summary": "Créer ou mettre à jour une catégorie",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "category_id": {
                    "type": "integer",
                    "description": "Absent = création"
                  },
                  "category_name": {
                    "type": "string"
                  },
                  "category_order": {
                    "type": "integer",
                    "default": 0
                  }
                },
                "required": [
                  "category_name"
                ]
              },
              "example": {
                "category_name": "Sécurité",
                "category_order": 1
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Ressource créée",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "saved": {
                      "type": "boolean"
                    },
                    "created": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "saved": true,
                  "created": true
                }
              }
            }
          },
          "200": {
            "description": "Catégorie mise à jour",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "saved": {
                      "type": "boolean"
                    },
                    "created": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1401"
          },
          "400": {
            "$ref": "#/components/responses/V1400"
          }
        },
        "security": [
          {
            "ApiKey": []
          },
          {
            "WebserviceBasic": []
          }
        ]
      }
    },
    "/api/v1/wrapper-dispatcher/categories/{id}": {
      "delete": {
        "tags": [
          "Wrapper Dispatcher"
        ],
        "operationId": "wdDeleteCategory",
        "summary": "Supprimer une catégorie",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Identifiant de la catégorie",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "category_id": {
                      "type": "integer"
                    },
                    "deleted": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1401"
          }
        },
        "security": [
          {
            "ApiKey": []
          },
          {
            "WebserviceBasic": []
          }
        ]
      }
    },
    "/api/v1/wrapper-dispatcher/inbox": {
      "get": {
        "tags": [
          "Wrapper Dispatcher"
        ],
        "operationId": "wdListInbox",
        "summary": "Lister les paquets déposés en SFTP",
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "import_dir": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    },
                    "count": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1401"
          }
        },
        "security": [
          {
            "ApiKey": []
          },
          {
            "WebserviceBasic": []
          }
        ]
      }
    },
    "/api/v1/wrapper-dispatcher/inbox/absorb": {
      "post": {
        "tags": [
          "Wrapper Dispatcher"
        ],
        "operationId": "wdAbsorbInbox",
        "summary": "Absorber un paquet déposé",
        "description": "En une opération : création (ou remplacement) du parcours, du wrapper, des catégories et des associations aux tiers. Répond 201 à la création, 200 au remplacement.\n\n**Attention :** cette route modifie les données de production de la plateforme.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "filename": {
                    "type": "string",
                    "description": "Nom du .zip dans le dossier de dépôt"
                  },
                  "title": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "replace_wrapper_id": {
                    "type": "integer"
                  },
                  "category_ids": {
                    "type": "array",
                    "items": {
                      "type": "integer"
                    }
                  },
                  "tier_ids": {
                    "type": "array",
                    "items": {
                      "type": "integer"
                    }
                  }
                },
                "required": [
                  "filename"
                ]
              },
              "example": {
                "filename": "cyber-reflexes-v3.zip",
                "replace_wrapper_id": 35,
                "tier_ids": [
                  12,
                  14
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Ressource créée",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "200": {
            "description": "Wrapper existant remplacé",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1401"
          },
          "400": {
            "$ref": "#/components/responses/V1400"
          },
          "422": {
            "$ref": "#/components/responses/V1422"
          }
        },
        "security": [
          {
            "ApiKey": []
          },
          {
            "WebserviceBasic": []
          }
        ]
      }
    },
    "/api/v1/wrapper-dispatcher/stats/global": {
      "get": {
        "tags": [
          "Wrapper Dispatcher"
        ],
        "operationId": "wdGlobalStats",
        "summary": "Indicateurs globaux",
        "parameters": [
          {
            "name": "disk_breakdown",
            "in": "query",
            "required": false,
            "description": "true = détail de l'espace disque par parcours",
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "wrappers": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "integer"
                        },
                        "active": {
                          "type": "integer"
                        }
                      }
                    },
                    "tiers": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "integer"
                        },
                        "active": {
                          "type": "integer"
                        },
                        "total_quota": {
                          "type": "integer"
                        },
                        "unlimited": {
                          "type": "integer"
                        }
                      }
                    },
                    "associations": {
                      "type": "integer"
                    },
                    "users": {
                      "type": "object",
                      "properties": {
                        "unique_total": {
                          "type": "integer"
                        },
                        "seats_used": {
                          "type": "integer"
                        }
                      }
                    },
                    "completion": {
                      "$ref": "#/components/schemas/CompletionCounts"
                    },
                    "avg_score": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "total_time_seconds": {
                      "type": "integer"
                    },
                    "first_access": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "last_access": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "global_inactivity_days": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "disk_usage": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                },
                "example": {
                  "wrappers": {
                    "total": 25,
                    "active": 25
                  },
                  "tiers": {
                    "total": 11,
                    "active": 11,
                    "total_quota": 0,
                    "unlimited": 11
                  },
                  "associations": 65,
                  "users": {
                    "unique_total": 1078,
                    "seats_used": 1078
                  },
                  "completion": {
                    "completed": 612,
                    "in_progress": 301,
                    "failed": 22,
                    "not_started": 143
                  },
                  "avg_score": 78.4,
                  "total_time_seconds": 2310400
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1401"
          }
        },
        "security": [
          {
            "ApiKey": []
          },
          {
            "WebserviceBasic": []
          }
        ]
      }
    },
    "/api/v1/wrapper-dispatcher/stats/tiers/{id}": {
      "get": {
        "tags": [
          "Wrapper Dispatcher"
        ],
        "operationId": "wdTierStats",
        "summary": "Indicateurs d'un tiers, par wrapper",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Identifiant du tiers",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tier_id": {
                      "type": "integer"
                    },
                    "tier_name": {
                      "type": "string"
                    },
                    "max_users": {
                      "type": "integer"
                    },
                    "current_users": {
                      "type": "integer"
                    },
                    "total_users_ever": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "effective_inactivity_days": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "completion": {
                      "$ref": "#/components/schemas/CompletionCounts"
                    },
                    "avg_score": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "total_time_seconds": {
                      "type": "integer"
                    },
                    "by_wrapper": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "wrapper_id": {
                            "type": "integer"
                          },
                          "wrapper_title": {
                            "type": "string"
                          },
                          "parcours_titre": {
                            "type": "string"
                          },
                          "total_users": {
                            "type": "integer"
                          },
                          "completed": {
                            "type": "integer"
                          },
                          "in_progress": {
                            "type": "integer"
                          },
                          "failed": {
                            "type": "integer"
                          },
                          "avg_score": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "total_time_seconds": {
                            "type": "integer"
                          },
                          "last_access": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1401"
          },
          "404": {
            "$ref": "#/components/responses/V1404"
          }
        },
        "security": [
          {
            "ApiKey": []
          },
          {
            "WebserviceBasic": []
          }
        ]
      }
    },
    "/api/mobile/health": {
      "get": {
        "tags": [
          "Mobile"
        ],
        "operationId": "mobileHealth",
        "summary": "Diagnostic",
        "description": "Public.",
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Health"
                },
                "example": {
                  "ok": true,
                  "service": "dgtlms-mobile-api",
                  "version": "1.0",
                  "time": "2026-10-21T14:32:05+02:00"
                }
              }
            }
          },
          "503": {
            "$ref": "#/components/responses/Mobile503"
          }
        },
        "security": []
      }
    },
    "/api/mobile/auth/login": {
      "post": {
        "tags": [
          "Mobile"
        ],
        "operationId": "mobileLogin",
        "summary": "Se connecter",
        "description": "Échange identifiant et mot de passe contre un jeton d'accès (1 h) et un jeton de renouvellement (30 jours). Le bloc `device` est facultatif (notifications push).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "login": {
                    "type": "string"
                  },
                  "password": {
                    "type": "string",
                    "format": "password"
                  },
                  "device": {
                    "type": "object",
                    "properties": {
                      "label": {
                        "type": "string"
                      },
                      "platform": {
                        "type": "string",
                        "enum": [
                          "ios",
                          "android",
                          "web"
                        ]
                      },
                      "push_token": {
                        "type": "string"
                      }
                    }
                  }
                },
                "required": [
                  "login",
                  "password"
                ]
              },
              "example": {
                "login": "jean.dupont",
                "password": "MotDePasse2026!",
                "device": {
                  "label": "iPhone 15 Pro",
                  "platform": "ios",
                  "push_token": "<fcm/apns token>"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MobileTokens"
                },
                "example": {
                  "ok": true,
                  "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9…",
                  "refresh_token": "Qm9…",
                  "token_type": "Bearer",
                  "expires_in": 3600,
                  "user": {
                    "id": 4287,
                    "login": "jean.dupont",
                    "firstname": "Jean",
                    "lastname": "Dupont",
                    "fullname": "Jean Dupont",
                    "email": "jean.dupont@client.fr",
                    "level": 4,
                    "language": "fr"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Mobile400"
          },
          "401": {
            "$ref": "#/components/responses/Mobile401"
          },
          "503": {
            "$ref": "#/components/responses/Mobile503"
          }
        },
        "security": []
      }
    },
    "/api/mobile/auth/refresh": {
      "post": {
        "tags": [
          "Mobile"
        ],
        "operationId": "mobileRefresh",
        "summary": "Renouveler le jeton d'accès",
        "description": "Le jeton de renouvellement utilisé est révoqué et remplacé par un nouveau (rotation).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "refresh_token": {
                    "type": "string"
                  }
                },
                "required": [
                  "refresh_token"
                ]
              },
              "example": {
                "refresh_token": "Qm9…"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MobileTokens"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Mobile400"
          },
          "401": {
            "$ref": "#/components/responses/Mobile401"
          },
          "503": {
            "$ref": "#/components/responses/Mobile503"
          }
        },
        "security": []
      }
    },
    "/api/mobile/auth/logout": {
      "post": {
        "tags": [
          "Mobile"
        ],
        "operationId": "mobileLogout",
        "summary": "Se déconnecter",
        "description": "Révoque le jeton de renouvellement.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "refresh_token": {
                    "type": "string"
                  }
                },
                "required": [
                  "refresh_token"
                ]
              },
              "example": {
                "refresh_token": "Qm9…"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "logged_out": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "ok": true,
                  "logged_out": true
                }
              }
            }
          },
          "503": {
            "$ref": "#/components/responses/Mobile503"
          }
        },
        "security": []
      }
    },
    "/api/mobile/me": {
      "get": {
        "tags": [
          "Mobile"
        ],
        "operationId": "mobileMe",
        "summary": "Profil de l'apprenant connecté",
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "user": {
                      "$ref": "#/components/schemas/MobileUser"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Mobile401"
          },
          "503": {
            "$ref": "#/components/responses/Mobile503"
          }
        },
        "security": [
          {
            "MobileJWT": []
          }
        ]
      }
    },
    "/api/mobile/me/courses": {
      "get": {
        "tags": [
          "Mobile"
        ],
        "operationId": "mobileMyCourses",
        "summary": "Mes parcours et leur progression",
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "courses": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/MobileCourse"
                      }
                    },
                    "count": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Mobile401"
          },
          "503": {
            "$ref": "#/components/responses/Mobile503"
          }
        },
        "security": [
          {
            "MobileJWT": []
          }
        ]
      }
    },
    "/api/mobile/me/sessions": {
      "get": {
        "tags": [
          "Mobile"
        ],
        "operationId": "mobileMySessions",
        "summary": "Mes sessions à venir",
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "count": {
                      "type": "integer"
                    },
                    "sessions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer"
                          },
                          "title": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "starts_at": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "date-time"
                          },
                          "ends_at": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "date-time"
                          }
                        },
                        "additionalProperties": true
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Mobile401"
          },
          "503": {
            "$ref": "#/components/responses/Mobile503"
          }
        },
        "security": [
          {
            "MobileJWT": []
          }
        ]
      }
    },
    "/api/mobile/me/badges": {
      "get": {
        "tags": [
          "Mobile"
        ],
        "operationId": "mobileMyBadges",
        "summary": "Mes badges",
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "count": {
                      "type": "integer"
                    },
                    "badges": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer"
                          },
                          "title": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "image": {
                            "type": "string"
                          },
                          "badge_uid": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "obtained_at": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Mobile401"
          },
          "503": {
            "$ref": "#/components/responses/Mobile503"
          }
        },
        "security": [
          {
            "MobileJWT": []
          }
        ]
      }
    },
    "/api/mobile/me/certifications": {
      "get": {
        "tags": [
          "Mobile"
        ],
        "operationId": "mobileMyCertifications",
        "summary": "Mes habilitations",
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "count": {
                      "type": "integer"
                    },
                    "certifications": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer"
                          },
                          "catalog_id": {
                            "type": "integer"
                          },
                          "title": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "level": {
                            "type": [
                              "integer",
                              "null"
                            ]
                          },
                          "status": {
                            "type": "string"
                          },
                          "obtained_date": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "expiry_date": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "days_to_expiry": {
                            "type": [
                              "integer",
                              "null"
                            ]
                          },
                          "reference": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Mobile401"
          },
          "503": {
            "$ref": "#/components/responses/Mobile503"
          }
        },
        "security": [
          {
            "MobileJWT": []
          }
        ]
      }
    },
    "/api/mobile/catalog": {
      "get": {
        "tags": [
          "Mobile"
        ],
        "operationId": "mobileCatalog",
        "summary": "Catalogue des parcours accessibles",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Recherche plein texte",
            "schema": {
              "type": "string"
            },
            "example": "sécurité"
          }
        ],
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "courses": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/MobileCourse"
                      }
                    },
                    "count": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Mobile401"
          },
          "503": {
            "$ref": "#/components/responses/Mobile503"
          }
        },
        "security": [
          {
            "MobileJWT": []
          }
        ]
      }
    },
    "/api/mobile/courses/{id}": {
      "get": {
        "tags": [
          "Mobile"
        ],
        "operationId": "mobileCourse",
        "summary": "Détail d'un parcours",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Identifiant du parcours",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "course": {
                      "$ref": "#/components/schemas/MobileCourse"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Mobile401"
          },
          "503": {
            "$ref": "#/components/responses/Mobile503"
          },
          "400": {
            "$ref": "#/components/responses/Mobile400"
          },
          "403": {
            "$ref": "#/components/responses/Mobile403"
          },
          "404": {
            "$ref": "#/components/responses/Mobile404"
          }
        },
        "security": [
          {
            "MobileJWT": []
          }
        ]
      }
    },
    "/api/mobile/courses/{id}/curriculum": {
      "get": {
        "tags": [
          "Mobile"
        ],
        "operationId": "mobileCurriculum",
        "summary": "Arbre des activités d'un parcours",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Identifiant du parcours",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "curriculum": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/MobileSco"
                      }
                    },
                    "count": {
                      "type": "integer"
                    },
                    "course_id": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Mobile401"
          },
          "503": {
            "$ref": "#/components/responses/Mobile503"
          },
          "400": {
            "$ref": "#/components/responses/Mobile400"
          },
          "403": {
            "$ref": "#/components/responses/Mobile403"
          },
          "404": {
            "$ref": "#/components/responses/Mobile404"
          }
        },
        "security": [
          {
            "MobileJWT": []
          }
        ]
      }
    },
    "/api/mobile/courses/{id}/package": {
      "get": {
        "tags": [
          "Mobile"
        ],
        "operationId": "mobilePackage",
        "summary": "Paquet hors-ligne d'un parcours",
        "description": "ZIP autonome : arborescence du parcours (SCORM 1.2/2004, DGT Studio, médias) et, à la racine, `dgtlms_manifest.json` (activités, URL de lancement, identifiant de suivi pré-créé, expiration à 30 jours).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Identifiant du parcours",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paquet ZIP",
            "content": {
              "application/zip": {
                "schema": {
                  "type": "string",
                  "contentMediaType": "application/zip"
                }
              }
            },
            "headers": {
              "X-DGTLMS-Content-Hash": {
                "description": "Empreinte SHA-256 du contenu : à comparer pour invalider le cache local",
                "schema": {
                  "type": "string"
                }
              },
              "X-DGTLMS-Scorm-Version": {
                "description": "1.2, 2004, mixed ou unknown",
                "schema": {
                  "type": "string"
                }
              },
              "X-DGTLMS-Cache-Hit": {
                "description": "1 si le paquet était déjà en cache",
                "schema": {
                  "type": "string",
                  "enum": [
                    "0",
                    "1"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Mobile401"
          },
          "503": {
            "$ref": "#/components/responses/Mobile503"
          },
          "400": {
            "$ref": "#/components/responses/Mobile400"
          },
          "403": {
            "$ref": "#/components/responses/Mobile403"
          },
          "405": {
            "$ref": "#/components/responses/Mobile405"
          },
          "500": {
            "$ref": "#/components/responses/Mobile500"
          }
        },
        "security": [
          {
            "MobileJWT": []
          }
        ]
      }
    },
    "/api/mobile/tracking/sync": {
      "post": {
        "tags": [
          "Mobile"
        ],
        "operationId": "mobileTrackingSync",
        "summary": "Synchroniser le suivi hors-ligne",
        "description": "Rejoue les écritures SCORM, enregistre les statements xAPI et clôture les tentatives réalisées hors-ligne. Idempotent par `client_uuid` : un renvoi restitue la réponse initiale ; un contenu différent pour le même `client_uuid` donne 409.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MobileSyncInput"
              },
              "example": {
                "client_uuid": "f5b6c1e2-8d4a-4c1b-9b7e-2a3f4c5d6e7f",
                "scorm_writes": [
                  {
                    "id_tracking": 12847,
                    "champ": "cmi.core.score.raw",
                    "valeur": "75",
                    "client_seq": 1
                  },
                  {
                    "id_tracking": 12847,
                    "champ": "cmi.core.lesson_status",
                    "valeur": "passed",
                    "client_seq": 2
                  }
                ],
                "xapi_statements": [],
                "finalize": [
                  {
                    "id_tracking": 12847
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "scorm": {
                      "$ref": "#/components/schemas/Counter"
                    },
                    "xapi": {
                      "$ref": "#/components/schemas/Counter"
                    },
                    "finalize": {
                      "$ref": "#/components/schemas/Counter"
                    },
                    "received_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                },
                "example": {
                  "ok": true,
                  "scorm": {
                    "ok": 2,
                    "rejected": 0
                  },
                  "xapi": {
                    "ok": 0,
                    "rejected": 0
                  },
                  "finalize": {
                    "ok": 1,
                    "rejected": 0
                  },
                  "received_at": "2026-10-21T14:32:05+02:00"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Mobile401"
          },
          "503": {
            "$ref": "#/components/responses/Mobile503"
          },
          "400": {
            "$ref": "#/components/responses/Mobile400"
          },
          "405": {
            "$ref": "#/components/responses/Mobile405"
          },
          "409": {
            "$ref": "#/components/responses/Mobile409"
          },
          "413": {
            "$ref": "#/components/responses/Mobile413"
          }
        },
        "security": [
          {
            "MobileJWT": []
          }
        ]
      }
    },
    "/api/xapi/health": {
      "get": {
        "tags": [
          "xAPI LRS"
        ],
        "operationId": "xapiHealth",
        "summary": "Diagnostic",
        "description": "Public.",
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Health"
                },
                "example": {
                  "api": "DGTLMS xAPI LRS",
                  "xapi_version": "1.0.3",
                  "status": "ok",
                  "database": "connected"
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/xapi/about": {
      "get": {
        "tags": [
          "xAPI LRS"
        ],
        "operationId": "xapiAbout",
        "summary": "Versions xAPI prises en charge",
        "description": "Public (ressource About de la spécification).",
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "version": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "extensions": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                },
                "example": {
                  "version": [
                    "1.0.3"
                  ],
                  "extensions": {
                    "http://dgtlms.fr/xapi/extensions/parcours_id": "ID parcours DGTLMS"
                  }
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/xapi/statements": {
      "post": {
        "tags": [
          "xAPI LRS"
        ],
        "operationId": "xapiPostStatements",
        "summary": "Enregistrer un ou plusieurs statements",
        "description": "Corps JSON (un statement ou un tableau) ou `multipart/mixed` avec pièces jointes. Clé en écriture requise. Répond avec la liste des identifiants.",
        "parameters": [
          {
            "name": "X-Experience-API-Version",
            "in": "header",
            "required": true,
            "description": "Version xAPI, obligatoire : 1.0.3",
            "schema": {
              "type": "string"
            },
            "example": "1.0.3"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/XapiStatement"
                  },
                  {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/XapiStatement"
                    }
                  }
                ]
              },
              "example": {
                "actor": {
                  "mbox": "mailto:jean.dupont@client.fr",
                  "name": "Jean Dupont"
                },
                "verb": {
                  "id": "http://adlnet.gov/expapi/verbs/completed",
                  "display": {
                    "fr-FR": "a terminé",
                    "en-GB": "completed"
                  }
                },
                "object": {
                  "id": "https://votre-plateforme.dgtlms.fr/parcours/42",
                  "definition": {
                    "name": {
                      "fr-FR": "Sécurité informatique"
                    }
                  }
                },
                "result": {
                  "score": {
                    "scaled": 0.85
                  },
                  "success": true,
                  "completion": true
                }
              }
            },
            "multipart/mixed": {
              "schema": {
                "type": "string"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "example": [
                  "b8a4f5c2-3e1d-4f6a-9c7b-1d2e3f4a5b6c"
                ]
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Std400"
          },
          "401": {
            "$ref": "#/components/responses/Std401"
          },
          "403": {
            "$ref": "#/components/responses/Std403"
          },
          "409": {
            "$ref": "#/components/responses/Std409"
          }
        },
        "security": [
          {
            "XapiKey": []
          },
          {
            "XapiBasic": []
          }
        ]
      },
      "put": {
        "tags": [
          "xAPI LRS"
        ],
        "operationId": "xapiPutStatement",
        "summary": "Enregistrer un statement d'identifiant imposé",
        "description": "Un statement est immuable : si l'identifiant existe déjà, la réponse est 409.",
        "parameters": [
          {
            "name": "X-Experience-API-Version",
            "in": "header",
            "required": true,
            "description": "Version xAPI, obligatoire : 1.0.3",
            "schema": {
              "type": "string"
            },
            "example": "1.0.3"
          },
          {
            "name": "statementId",
            "in": "query",
            "required": true,
            "description": "UUID du statement",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/XapiStatement"
              }
            },
            "multipart/mixed": {
              "schema": {
                "type": "string"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Enregistré"
          },
          "400": {
            "$ref": "#/components/responses/Std400"
          },
          "401": {
            "$ref": "#/components/responses/Std401"
          },
          "403": {
            "$ref": "#/components/responses/Std403"
          },
          "409": {
            "$ref": "#/components/responses/Std409"
          }
        },
        "security": [
          {
            "XapiKey": []
          },
          {
            "XapiBasic": []
          }
        ]
      },
      "get": {
        "tags": [
          "xAPI LRS"
        ],
        "operationId": "xapiGetStatements",
        "summary": "Lire ou rechercher des statements",
        "description": "Avec `statementId` ou `voidedStatementId` : renvoie ce statement seul (aucun autre filtre accepté, hors `format` et `attachments`). Sinon : recherche paginée ; suivre l'URL `more` pour la page suivante.",
        "parameters": [
          {
            "name": "X-Experience-API-Version",
            "in": "header",
            "required": true,
            "description": "Version xAPI, obligatoire : 1.0.3",
            "schema": {
              "type": "string"
            },
            "example": "1.0.3"
          },
          {
            "name": "statementId",
            "in": "query",
            "required": false,
            "description": "UUID d'un statement",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "voidedStatementId",
            "in": "query",
            "required": false,
            "description": "UUID d'un statement annulé",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "agent",
            "in": "query",
            "required": false,
            "description": "Agent encodé en JSON (mbox, account…)",
            "schema": {
              "type": "string"
            },
            "example": "{\"mbox\":\"mailto:jean.dupont@client.fr\"}"
          },
          {
            "name": "verb",
            "in": "query",
            "required": false,
            "description": "IRI du verbe",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "activity",
            "in": "query",
            "required": false,
            "description": "IRI de l'activité",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "registration",
            "in": "query",
            "required": false,
            "description": "UUID d'inscription",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "related_activities",
            "in": "query",
            "required": false,
            "description": "Étendre la recherche d'activité au contexte et aux sous-statements",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "related_agents",
            "in": "query",
            "required": false,
            "description": "Étendre la recherche d'agent",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "description": "Date ISO 8601 (exclue)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "until",
            "in": "query",
            "required": false,
            "description": "Date ISO 8601 (incluse)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Nombre maximum de résultats (défaut 100, maximum 1000)",
            "schema": {
              "type": "integer",
              "default": 100,
              "maximum": 1000
            }
          },
          {
            "name": "ascending",
            "in": "query",
            "required": false,
            "description": "Ordre chronologique",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "description": "ids, exact ou canonical (libellés réduits selon Accept-Language)",
            "schema": {
              "type": "string",
              "enum": [
                "ids",
                "exact",
                "canonical"
              ],
              "default": "exact"
            }
          },
          {
            "name": "attachments",
            "in": "query",
            "required": false,
            "description": "true = réponse multipart/mixed avec les pièces jointes",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "id_parcours",
            "in": "query",
            "required": false,
            "description": "Extension DGTLMS : filtrer par parcours",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "id_session",
            "in": "query",
            "required": false,
            "description": "Extension DGTLMS : filtrer par session",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "id_membre",
            "in": "query",
            "required": false,
            "description": "Extension DGTLMS : filtrer par utilisateur",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/XapiStatementResult"
                    },
                    {
                      "$ref": "#/components/schemas/XapiStatement"
                    }
                  ]
                },
                "example": {
                  "statements": [],
                  "more": ""
                }
              }
            },
            "headers": {
              "X-Experience-API-Consistent-Through": {
                "description": "Horodatage jusqu'auquel le LRS est cohérent",
                "schema": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Std400"
          },
          "401": {
            "$ref": "#/components/responses/Std401"
          },
          "403": {
            "$ref": "#/components/responses/Std403"
          },
          "404": {
            "$ref": "#/components/responses/Std404"
          }
        },
        "security": [
          {
            "XapiKey": []
          },
          {
            "XapiBasic": []
          }
        ]
      }
    },
    "/api/xapi/activities/state": {
      "put": {
        "tags": [
          "xAPI LRS"
        ],
        "operationId": "xapiPutState",
        "summary": "État : écrire",
        "description": "Contexte : activityId + agent [+ registration] + stateId.",
        "parameters": [
          {
            "name": "X-Experience-API-Version",
            "in": "header",
            "required": true,
            "description": "Version xAPI, obligatoire : 1.0.3",
            "schema": {
              "type": "string"
            },
            "example": "1.0.3"
          },
          {
            "name": "activityId",
            "in": "query",
            "required": true,
            "description": "IRI de l'activité",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "agent",
            "in": "query",
            "required": true,
            "description": "Agent encodé en JSON",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "registration",
            "in": "query",
            "required": false,
            "description": "UUID d'inscription",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "stateId",
            "in": "query",
            "required": true,
            "description": "Identifiant du document",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": false,
            "description": "ETag attendu (écriture concurrente)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "If-None-Match",
            "in": "header",
            "required": false,
            "description": "* = n'écrire que si le document n'existe pas",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "bookmark": "page-4"
              }
            },
            "application/octet-stream": {
              "schema": {
                "type": "string"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Enregistré"
          },
          "400": {
            "$ref": "#/components/responses/Std400"
          },
          "401": {
            "$ref": "#/components/responses/Std401"
          },
          "409": {
            "$ref": "#/components/responses/Std409"
          },
          "412": {
            "$ref": "#/components/responses/Std412"
          }
        },
        "security": [
          {
            "XapiKey": []
          },
          {
            "XapiBasic": []
          }
        ]
      },
      "post": {
        "tags": [
          "xAPI LRS"
        ],
        "operationId": "xapiMergeState",
        "summary": "État : fusionner (JSON)",
        "description": "Contexte : activityId + agent [+ registration] + stateId.",
        "parameters": [
          {
            "name": "X-Experience-API-Version",
            "in": "header",
            "required": true,
            "description": "Version xAPI, obligatoire : 1.0.3",
            "schema": {
              "type": "string"
            },
            "example": "1.0.3"
          },
          {
            "name": "activityId",
            "in": "query",
            "required": true,
            "description": "IRI de l'activité",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "agent",
            "in": "query",
            "required": true,
            "description": "Agent encodé en JSON",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "registration",
            "in": "query",
            "required": false,
            "description": "UUID d'inscription",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "stateId",
            "in": "query",
            "required": true,
            "description": "Identifiant du document",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": false,
            "description": "ETag attendu (écriture concurrente)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "If-None-Match",
            "in": "header",
            "required": false,
            "description": "* = n'écrire que si le document n'existe pas",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "bookmark": "page-4"
              }
            },
            "application/octet-stream": {
              "schema": {
                "type": "string"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Fusionné"
          },
          "400": {
            "$ref": "#/components/responses/Std400"
          },
          "401": {
            "$ref": "#/components/responses/Std401"
          },
          "409": {
            "$ref": "#/components/responses/Std409"
          },
          "412": {
            "$ref": "#/components/responses/Std412"
          }
        },
        "security": [
          {
            "XapiKey": []
          },
          {
            "XapiBasic": []
          }
        ]
      },
      "get": {
        "tags": [
          "xAPI LRS"
        ],
        "operationId": "xapiGetState",
        "summary": "État : lire",
        "description": "Contexte : activityId + agent [+ registration] + stateId. Sans identifiant : liste des identifiants de documents (filtrable par since).",
        "parameters": [
          {
            "name": "X-Experience-API-Version",
            "in": "header",
            "required": true,
            "description": "Version xAPI, obligatoire : 1.0.3",
            "schema": {
              "type": "string"
            },
            "example": "1.0.3"
          },
          {
            "name": "activityId",
            "in": "query",
            "required": true,
            "description": "IRI de l'activité",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "agent",
            "in": "query",
            "required": true,
            "description": "Agent encodé en JSON",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "registration",
            "in": "query",
            "required": false,
            "description": "UUID d'inscription",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "stateId",
            "in": "query",
            "required": false,
            "description": "Identifiant du document",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "description": "Date ISO 8601 (liste)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Document, ou tableau d'identifiants",
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Std400"
          },
          "401": {
            "$ref": "#/components/responses/Std401"
          },
          "404": {
            "$ref": "#/components/responses/Std404"
          }
        },
        "security": [
          {
            "XapiKey": []
          },
          {
            "XapiBasic": []
          }
        ]
      },
      "delete": {
        "tags": [
          "xAPI LRS"
        ],
        "operationId": "xapiDeleteState",
        "summary": "État : supprimer",
        "description": "Contexte : activityId + agent [+ registration] + stateId. Sans stateId : supprime tous les états du contexte.",
        "parameters": [
          {
            "name": "X-Experience-API-Version",
            "in": "header",
            "required": true,
            "description": "Version xAPI, obligatoire : 1.0.3",
            "schema": {
              "type": "string"
            },
            "example": "1.0.3"
          },
          {
            "name": "activityId",
            "in": "query",
            "required": true,
            "description": "IRI de l'activité",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "agent",
            "in": "query",
            "required": true,
            "description": "Agent encodé en JSON",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "registration",
            "in": "query",
            "required": false,
            "description": "UUID d'inscription",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "stateId",
            "in": "query",
            "required": false,
            "description": "Identifiant du document",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": false,
            "description": "ETag attendu (écriture concurrente)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Supprimé"
          },
          "400": {
            "$ref": "#/components/responses/Std400"
          },
          "401": {
            "$ref": "#/components/responses/Std401"
          },
          "412": {
            "$ref": "#/components/responses/Std412"
          }
        },
        "security": [
          {
            "XapiKey": []
          },
          {
            "XapiBasic": []
          }
        ]
      }
    },
    "/api/xapi/activities/profile": {
      "put": {
        "tags": [
          "xAPI LRS"
        ],
        "operationId": "xapiPutActivityProfile",
        "summary": "Profil d'activité : écrire",
        "description": "Contexte : activityId + profileId.",
        "parameters": [
          {
            "name": "X-Experience-API-Version",
            "in": "header",
            "required": true,
            "description": "Version xAPI, obligatoire : 1.0.3",
            "schema": {
              "type": "string"
            },
            "example": "1.0.3"
          },
          {
            "name": "activityId",
            "in": "query",
            "required": true,
            "description": "IRI de l'activité",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profileId",
            "in": "query",
            "required": true,
            "description": "Identifiant du document",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": false,
            "description": "ETag attendu (écriture concurrente)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "If-None-Match",
            "in": "header",
            "required": false,
            "description": "* = n'écrire que si le document n'existe pas",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "bookmark": "page-4"
              }
            },
            "application/octet-stream": {
              "schema": {
                "type": "string"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Enregistré"
          },
          "400": {
            "$ref": "#/components/responses/Std400"
          },
          "401": {
            "$ref": "#/components/responses/Std401"
          },
          "409": {
            "$ref": "#/components/responses/Std409"
          },
          "412": {
            "$ref": "#/components/responses/Std412"
          }
        },
        "security": [
          {
            "XapiKey": []
          },
          {
            "XapiBasic": []
          }
        ]
      },
      "post": {
        "tags": [
          "xAPI LRS"
        ],
        "operationId": "xapiMergeActivityProfile",
        "summary": "Profil d'activité : fusionner (JSON)",
        "description": "Contexte : activityId + profileId.",
        "parameters": [
          {
            "name": "X-Experience-API-Version",
            "in": "header",
            "required": true,
            "description": "Version xAPI, obligatoire : 1.0.3",
            "schema": {
              "type": "string"
            },
            "example": "1.0.3"
          },
          {
            "name": "activityId",
            "in": "query",
            "required": true,
            "description": "IRI de l'activité",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profileId",
            "in": "query",
            "required": true,
            "description": "Identifiant du document",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": false,
            "description": "ETag attendu (écriture concurrente)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "If-None-Match",
            "in": "header",
            "required": false,
            "description": "* = n'écrire que si le document n'existe pas",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "bookmark": "page-4"
              }
            },
            "application/octet-stream": {
              "schema": {
                "type": "string"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Fusionné"
          },
          "400": {
            "$ref": "#/components/responses/Std400"
          },
          "401": {
            "$ref": "#/components/responses/Std401"
          },
          "409": {
            "$ref": "#/components/responses/Std409"
          },
          "412": {
            "$ref": "#/components/responses/Std412"
          }
        },
        "security": [
          {
            "XapiKey": []
          },
          {
            "XapiBasic": []
          }
        ]
      },
      "get": {
        "tags": [
          "xAPI LRS"
        ],
        "operationId": "xapiGetActivityProfile",
        "summary": "Profil d'activité : lire",
        "description": "Contexte : activityId + profileId. Sans identifiant : liste des identifiants de documents (filtrable par since).",
        "parameters": [
          {
            "name": "X-Experience-API-Version",
            "in": "header",
            "required": true,
            "description": "Version xAPI, obligatoire : 1.0.3",
            "schema": {
              "type": "string"
            },
            "example": "1.0.3"
          },
          {
            "name": "activityId",
            "in": "query",
            "required": true,
            "description": "IRI de l'activité",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profileId",
            "in": "query",
            "required": false,
            "description": "Identifiant du document",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "description": "Date ISO 8601 (liste)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Document, ou tableau d'identifiants",
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Std400"
          },
          "401": {
            "$ref": "#/components/responses/Std401"
          },
          "404": {
            "$ref": "#/components/responses/Std404"
          }
        },
        "security": [
          {
            "XapiKey": []
          },
          {
            "XapiBasic": []
          }
        ]
      },
      "delete": {
        "tags": [
          "xAPI LRS"
        ],
        "operationId": "xapiDeleteActivityProfile",
        "summary": "Profil d'activité : supprimer",
        "description": "Contexte : activityId + profileId.",
        "parameters": [
          {
            "name": "X-Experience-API-Version",
            "in": "header",
            "required": true,
            "description": "Version xAPI, obligatoire : 1.0.3",
            "schema": {
              "type": "string"
            },
            "example": "1.0.3"
          },
          {
            "name": "activityId",
            "in": "query",
            "required": true,
            "description": "IRI de l'activité",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profileId",
            "in": "query",
            "required": false,
            "description": "Identifiant du document",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": false,
            "description": "ETag attendu (écriture concurrente)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Supprimé"
          },
          "400": {
            "$ref": "#/components/responses/Std400"
          },
          "401": {
            "$ref": "#/components/responses/Std401"
          },
          "412": {
            "$ref": "#/components/responses/Std412"
          }
        },
        "security": [
          {
            "XapiKey": []
          },
          {
            "XapiBasic": []
          }
        ]
      }
    },
    "/api/xapi/agents/profile": {
      "put": {
        "tags": [
          "xAPI LRS"
        ],
        "operationId": "xapiPutAgentProfile",
        "summary": "Profil d'apprenant : écrire",
        "description": "Contexte : agent + profileId.",
        "parameters": [
          {
            "name": "X-Experience-API-Version",
            "in": "header",
            "required": true,
            "description": "Version xAPI, obligatoire : 1.0.3",
            "schema": {
              "type": "string"
            },
            "example": "1.0.3"
          },
          {
            "name": "agent",
            "in": "query",
            "required": true,
            "description": "Agent encodé en JSON",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profileId",
            "in": "query",
            "required": true,
            "description": "Identifiant du document",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": false,
            "description": "ETag attendu (écriture concurrente)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "If-None-Match",
            "in": "header",
            "required": false,
            "description": "* = n'écrire que si le document n'existe pas",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "bookmark": "page-4"
              }
            },
            "application/octet-stream": {
              "schema": {
                "type": "string"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Enregistré"
          },
          "400": {
            "$ref": "#/components/responses/Std400"
          },
          "401": {
            "$ref": "#/components/responses/Std401"
          },
          "409": {
            "$ref": "#/components/responses/Std409"
          },
          "412": {
            "$ref": "#/components/responses/Std412"
          }
        },
        "security": [
          {
            "XapiKey": []
          },
          {
            "XapiBasic": []
          }
        ]
      },
      "post": {
        "tags": [
          "xAPI LRS"
        ],
        "operationId": "xapiMergeAgentProfile",
        "summary": "Profil d'apprenant : fusionner (JSON)",
        "description": "Contexte : agent + profileId.",
        "parameters": [
          {
            "name": "X-Experience-API-Version",
            "in": "header",
            "required": true,
            "description": "Version xAPI, obligatoire : 1.0.3",
            "schema": {
              "type": "string"
            },
            "example": "1.0.3"
          },
          {
            "name": "agent",
            "in": "query",
            "required": true,
            "description": "Agent encodé en JSON",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profileId",
            "in": "query",
            "required": true,
            "description": "Identifiant du document",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": false,
            "description": "ETag attendu (écriture concurrente)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "If-None-Match",
            "in": "header",
            "required": false,
            "description": "* = n'écrire que si le document n'existe pas",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "bookmark": "page-4"
              }
            },
            "application/octet-stream": {
              "schema": {
                "type": "string"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Fusionné"
          },
          "400": {
            "$ref": "#/components/responses/Std400"
          },
          "401": {
            "$ref": "#/components/responses/Std401"
          },
          "409": {
            "$ref": "#/components/responses/Std409"
          },
          "412": {
            "$ref": "#/components/responses/Std412"
          }
        },
        "security": [
          {
            "XapiKey": []
          },
          {
            "XapiBasic": []
          }
        ]
      },
      "get": {
        "tags": [
          "xAPI LRS"
        ],
        "operationId": "xapiGetAgentProfile",
        "summary": "Profil d'apprenant : lire",
        "description": "Contexte : agent + profileId. Sans identifiant : liste des identifiants de documents (filtrable par since).",
        "parameters": [
          {
            "name": "X-Experience-API-Version",
            "in": "header",
            "required": true,
            "description": "Version xAPI, obligatoire : 1.0.3",
            "schema": {
              "type": "string"
            },
            "example": "1.0.3"
          },
          {
            "name": "agent",
            "in": "query",
            "required": true,
            "description": "Agent encodé en JSON",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profileId",
            "in": "query",
            "required": false,
            "description": "Identifiant du document",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "description": "Date ISO 8601 (liste)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Document, ou tableau d'identifiants",
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Std400"
          },
          "401": {
            "$ref": "#/components/responses/Std401"
          },
          "404": {
            "$ref": "#/components/responses/Std404"
          }
        },
        "security": [
          {
            "XapiKey": []
          },
          {
            "XapiBasic": []
          }
        ]
      },
      "delete": {
        "tags": [
          "xAPI LRS"
        ],
        "operationId": "xapiDeleteAgentProfile",
        "summary": "Profil d'apprenant : supprimer",
        "description": "Contexte : agent + profileId.",
        "parameters": [
          {
            "name": "X-Experience-API-Version",
            "in": "header",
            "required": true,
            "description": "Version xAPI, obligatoire : 1.0.3",
            "schema": {
              "type": "string"
            },
            "example": "1.0.3"
          },
          {
            "name": "agent",
            "in": "query",
            "required": true,
            "description": "Agent encodé en JSON",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profileId",
            "in": "query",
            "required": false,
            "description": "Identifiant du document",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": false,
            "description": "ETag attendu (écriture concurrente)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Supprimé"
          },
          "400": {
            "$ref": "#/components/responses/Std400"
          },
          "401": {
            "$ref": "#/components/responses/Std401"
          },
          "412": {
            "$ref": "#/components/responses/Std412"
          }
        },
        "security": [
          {
            "XapiKey": []
          },
          {
            "XapiBasic": []
          }
        ]
      }
    },
    "/api/xapi/activities": {
      "get": {
        "tags": [
          "xAPI LRS"
        ],
        "operationId": "xapiGetActivity",
        "summary": "Objet Activity canonique",
        "parameters": [
          {
            "name": "X-Experience-API-Version",
            "in": "header",
            "required": true,
            "description": "Version xAPI, obligatoire : 1.0.3",
            "schema": {
              "type": "string"
            },
            "example": "1.0.3"
          },
          {
            "name": "activityId",
            "in": "query",
            "required": true,
            "description": "IRI de l'activité",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "objectType": "Activity",
                  "id": "https://votre-plateforme.dgtlms.fr/parcours/42"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Std400"
          },
          "401": {
            "$ref": "#/components/responses/Std401"
          }
        },
        "security": [
          {
            "XapiKey": []
          },
          {
            "XapiBasic": []
          }
        ]
      }
    },
    "/api/xapi/agents": {
      "get": {
        "tags": [
          "xAPI LRS"
        ],
        "operationId": "xapiGetAgent",
        "summary": "Objet Person d'un agent",
        "parameters": [
          {
            "name": "X-Experience-API-Version",
            "in": "header",
            "required": true,
            "description": "Version xAPI, obligatoire : 1.0.3",
            "schema": {
              "type": "string"
            },
            "example": "1.0.3"
          },
          {
            "name": "agent",
            "in": "query",
            "required": true,
            "description": "Agent encodé en JSON (avec un identifiant : mbox, account…)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "objectType": "Person",
                  "name": [
                    "Jean Dupont"
                  ],
                  "mbox": [
                    "mailto:jean.dupont@client.fr"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Std400"
          },
          "401": {
            "$ref": "#/components/responses/Std401"
          }
        },
        "security": [
          {
            "XapiKey": []
          },
          {
            "XapiBasic": []
          }
        ]
      }
    },
    "/api/bi/odata/": {
      "get": {
        "tags": [
          "OData / Power BI"
        ],
        "operationId": "odataServiceDocument",
        "summary": "Document de service",
        "description": "Liste des tables (EntitySets) disponibles.",
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "@odata.context": {
                      "type": "string"
                    },
                    "value": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "@odata.context": "https://votre-plateforme.dgtlms.fr/api/bi/odata/$metadata",
                  "value": [
                    {
                      "name": "fact_results",
                      "kind": "EntitySet",
                      "url": "fact_results"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/OData401"
          },
          "503": {
            "$ref": "#/components/responses/OData503"
          }
        },
        "security": [
          {
            "BiKeyHeader": []
          },
          {
            "BiKeyQuery": []
          }
        ]
      }
    },
    "/api/bi/odata/$metadata": {
      "get": {
        "tags": [
          "OData / Power BI"
        ],
        "operationId": "odataMetadata",
        "summary": "Schéma EDMX",
        "description": "Types des colonnes : c'est lui qui stabilise le schéma dans Power BI.",
        "responses": {
          "200": {
            "description": "Document EDMX (XML)",
            "content": {
              "application/xml": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/OData401"
          },
          "503": {
            "$ref": "#/components/responses/OData503"
          }
        },
        "security": [
          {
            "BiKeyHeader": []
          },
          {
            "BiKeyQuery": []
          }
        ]
      }
    },
    "/api/bi/odata/{entitySet}": {
      "get": {
        "tags": [
          "OData / Power BI"
        ],
        "operationId": "odataEntitySet",
        "summary": "Données d'une table",
        "description": "Pagination pilotée par le serveur (5000 lignes par page au maximum, suite dans `@odata.nextLink`). `$filter` accepte `colonne op valeur [and …]` avec op parmi eq, ne, gt, ge, lt, le ; `or`, les fonctions et les colonnes inconnues renvoient 400. Les dates sont en Edm.DateTimeOffset, ce qui permet le rafraîchissement incrémental. Le flux n'est pas cloisonné par site : il expose l'ensemble des données de la plateforme.",
        "parameters": [
          {
            "name": "entitySet",
            "in": "path",
            "required": true,
            "description": "Nom de la table",
            "schema": {
              "type": "string",
              "enum": [
                "fact_results",
                "fact_connexions_jour",
                "bridge_sessions_resultats",
                "dim_apprenants",
                "dim_formations",
                "dim_activites",
                "dim_sessions"
              ]
            }
          },
          {
            "name": "$top",
            "in": "query",
            "required": false,
            "description": "Nombre de lignes (5000 au maximum)",
            "schema": {
              "type": "integer",
              "maximum": 5000
            }
          },
          {
            "name": "$skip",
            "in": "query",
            "required": false,
            "description": "Lignes à sauter",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "$count",
            "in": "query",
            "required": false,
            "description": "true = ajouter @odata.count",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "$select",
            "in": "query",
            "required": false,
            "description": "Colonnes, séparées par des virgules",
            "schema": {
              "type": "string"
            },
            "example": "id_membre,id_parcours,score_raw"
          },
          {
            "name": "$orderby",
            "in": "query",
            "required": false,
            "description": "Tri : colonne [asc|desc]",
            "schema": {
              "type": "string"
            },
            "example": "date_evenement desc"
          },
          {
            "name": "$filter",
            "in": "query",
            "required": false,
            "description": "Filtre (sous-ensemble sûr)",
            "schema": {
              "type": "string"
            },
            "example": "date_evenement ge 2026-01-01T00:00:00Z and date_evenement lt 2026-02-01T00:00:00Z"
          }
        ],
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ODataCollection"
                },
                "example": {
                  "@odata.context": "https://votre-plateforme.dgtlms.fr/api/bi/odata/$metadata#fact_results",
                  "value": [
                    {
                      "id": 9812,
                      "id_membre": 4287,
                      "id_parcours": 42,
                      "id_sco": 187,
                      "cle_inscription": "4287-42",
                      "date_evenement": "2026-10-12T09:14:00Z",
                      "lesson_status": "passed",
                      "score_raw": 85,
                      "temps_passe_sec": 1240
                    }
                  ],
                  "@odata.nextLink": "https://votre-plateforme.dgtlms.fr/api/bi/odata/fact_results?%24skip=5000"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/OData401"
          },
          "503": {
            "$ref": "#/components/responses/OData503"
          },
          "400": {
            "$ref": "#/components/responses/OData400"
          },
          "404": {
            "$ref": "#/components/responses/OData404"
          }
        },
        "security": [
          {
            "BiKeyHeader": []
          },
          {
            "BiKeyQuery": []
          }
        ]
      }
    },
    "/api/wordpress/ping": {
      "get": {
        "tags": [
          "WordPress / WooCommerce"
        ],
        "operationId": "wpPing",
        "summary": "Tester la connexion",
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "site": {
                      "type": "string"
                    },
                    "platform": {
                      "type": "string"
                    },
                    "version": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                },
                "example": {
                  "status": "ok",
                  "site": "Boutique formation",
                  "platform": "https://votre-plateforme.dgtlms.fr",
                  "version": "26.10.21"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/WP401"
          },
          "403": {
            "$ref": "#/components/responses/WP403"
          },
          "503": {
            "$ref": "#/components/responses/WP503"
          }
        },
        "security": [
          {
            "WordPressKey": []
          },
          {
            "WordPressKeyHeader": []
          }
        ]
      }
    },
    "/api/wordpress/trainings": {
      "get": {
        "tags": [
          "WordPress / WooCommerce"
        ],
        "operationId": "wpListTrainings",
        "summary": "Parcours proposables à la vente",
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "trainings": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/WpTraining"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/WP401"
          },
          "403": {
            "$ref": "#/components/responses/WP403"
          },
          "503": {
            "$ref": "#/components/responses/WP503"
          }
        },
        "security": [
          {
            "WordPressKey": []
          },
          {
            "WordPressKeyHeader": []
          }
        ]
      }
    },
    "/api/wordpress/trainings/{id}/sessions": {
      "get": {
        "tags": [
          "WordPress / WooCommerce"
        ],
        "operationId": "wpListTrainingSessions",
        "summary": "Sessions actives contenant un parcours",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Identifiant du parcours",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "sessions": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/WpSession"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/WP401"
          },
          "403": {
            "$ref": "#/components/responses/WP403"
          },
          "503": {
            "$ref": "#/components/responses/WP503"
          },
          "404": {
            "$ref": "#/components/responses/WP404"
          }
        },
        "security": [
          {
            "WordPressKey": []
          },
          {
            "WordPressKeyHeader": []
          }
        ]
      }
    },
    "/api/wordpress/sessions": {
      "post": {
        "tags": [
          "WordPress / WooCommerce"
        ],
        "operationId": "wpSaveSession",
        "summary": "Créer ou mettre à jour une session déclarée dans WordPress",
        "description": "Une même référence désigne toujours la même session. Seul le site qui l'a créée peut la modifier ; le parcours est figé dès le premier inscrit.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reference": {
                    "type": "string"
                  },
                  "training_id": {
                    "type": "integer"
                  },
                  "name": {
                    "type": "string"
                  },
                  "start_date": {
                    "type": "string",
                    "format": "date"
                  },
                  "end_date": {
                    "type": "string",
                    "format": "date"
                  }
                },
                "required": [
                  "reference",
                  "training_id",
                  "name",
                  "start_date"
                ]
              },
              "example": {
                "reference": "wc-product-318",
                "training_id": 42,
                "name": "Sécurité informatique — 12 novembre",
                "start_date": "2026-11-12",
                "end_date": "2026-11-12"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Ressource créée",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/WpSession"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "created": {
                          "type": "boolean"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "200": {
            "description": "Session mise à jour",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/WpSession"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "created": {
                          "type": "boolean"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/WP401"
          },
          "403": {
            "$ref": "#/components/responses/WP403"
          },
          "503": {
            "$ref": "#/components/responses/WP503"
          },
          "400": {
            "$ref": "#/components/responses/WP400"
          },
          "404": {
            "$ref": "#/components/responses/WP404"
          },
          "409": {
            "$ref": "#/components/responses/WP409"
          }
        },
        "security": [
          {
            "WordPressKey": []
          },
          {
            "WordPressKeyHeader": []
          }
        ]
      }
    },
    "/api/wordpress/learners": {
      "post": {
        "tags": [
          "WordPress / WooCommerce"
        ],
        "operationId": "wpEnsureLearner",
        "summary": "Retrouver ou créer un apprenant",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "firstname": {
                    "type": "string"
                  },
                  "lastname": {
                    "type": "string"
                  },
                  "lang": {
                    "type": "string"
                  }
                },
                "required": [
                  "email"
                ]
              },
              "example": {
                "email": "jean.dupont@client.fr",
                "firstname": "Jean",
                "lastname": "Dupont",
                "lang": "fr"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Ressource créée",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer"
                    },
                    "email": {
                      "type": "string"
                    },
                    "firstname": {
                      "type": "string"
                    },
                    "lastname": {
                      "type": "string"
                    },
                    "active": {
                      "type": "boolean"
                    },
                    "created": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "id": 4287,
                  "email": "jean.dupont@client.fr",
                  "firstname": "Jean",
                  "lastname": "Dupont",
                  "active": true,
                  "created": true
                }
              }
            }
          },
          "200": {
            "description": "Apprenant existant"
          },
          "401": {
            "$ref": "#/components/responses/WP401"
          },
          "403": {
            "$ref": "#/components/responses/WP403"
          },
          "503": {
            "$ref": "#/components/responses/WP503"
          },
          "400": {
            "$ref": "#/components/responses/WP400"
          }
        },
        "security": [
          {
            "WordPressKey": []
          },
          {
            "WordPressKeyHeader": []
          }
        ]
      }
    },
    "/api/wordpress/enrolments": {
      "post": {
        "tags": [
          "WordPress / WooCommerce"
        ],
        "operationId": "wpEnrol",
        "summary": "Inscrire un apprenant",
        "description": "Indiquer `session_id` OU `training_id`. Idempotent par `reference` (ex. wc-<commande>-<ligne>) : rejouer l'appel renvoie 200 sans doublon. L'apprenant est créé s'il n'existe pas.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reference": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "firstname": {
                    "type": "string"
                  },
                  "lastname": {
                    "type": "string"
                  },
                  "lang": {
                    "type": "string"
                  },
                  "session_id": {
                    "type": "integer"
                  },
                  "training_id": {
                    "type": "integer"
                  }
                },
                "required": [
                  "reference",
                  "email"
                ]
              },
              "example": {
                "reference": "wc-1542-1",
                "email": "jean.dupont@client.fr",
                "firstname": "Jean",
                "lastname": "Dupont",
                "session_id": 87
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Ressource créée",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WpEnrolment"
                },
                "example": {
                  "reference": "wc-1542-1",
                  "status": "active",
                  "already_enrolled": false,
                  "replayed": false,
                  "learner_id": 4287,
                  "learner_created": true
                }
              }
            }
          },
          "200": {
            "description": "Appel déjà traité (rejoué)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WpEnrolment"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/WP401"
          },
          "403": {
            "$ref": "#/components/responses/WP403"
          },
          "503": {
            "$ref": "#/components/responses/WP503"
          },
          "400": {
            "$ref": "#/components/responses/WP400"
          },
          "404": {
            "$ref": "#/components/responses/WP404"
          },
          "409": {
            "$ref": "#/components/responses/WP409"
          },
          "422": {
            "$ref": "#/components/responses/WP422"
          }
        },
        "security": [
          {
            "WordPressKey": []
          },
          {
            "WordPressKeyHeader": []
          }
        ]
      }
    },
    "/api/wordpress/enrolments/{reference}": {
      "delete": {
        "tags": [
          "WordPress / WooCommerce"
        ],
        "operationId": "wpCancelEnrolment",
        "summary": "Annuler une inscription",
        "description": "Annulation ou remboursement de la commande. L'apprenant n'est retiré que si l'inscription venait de cet achat.",
        "parameters": [
          {
            "name": "reference",
            "in": "path",
            "required": true,
            "description": "Référence de l'inscription (encodée URL)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "reference": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "removed": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "reference": "wc-1542-1",
                  "status": "cancelled",
                  "removed": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/WP401"
          },
          "403": {
            "$ref": "#/components/responses/WP403"
          },
          "503": {
            "$ref": "#/components/responses/WP503"
          },
          "404": {
            "$ref": "#/components/responses/WP404"
          }
        },
        "security": [
          {
            "WordPressKey": []
          },
          {
            "WordPressKeyHeader": []
          }
        ]
      }
    },
    "/api/wordpress/progress": {
      "post": {
        "tags": [
          "WordPress / WooCommerce"
        ],
        "operationId": "wpProgress",
        "summary": "Suivi de plusieurs apprenants",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "emails": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "email"
                    },
                    "description": "200 adresses au maximum"
                  }
                },
                "required": [
                  "emails"
                ]
              },
              "example": {
                "emails": [
                  "jean.dupont@client.fr"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "learners": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "email": {
                            "type": "string"
                          },
                          "found": {
                            "type": "boolean"
                          },
                          "active": {
                            "type": "boolean"
                          },
                          "last_login": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "sessions": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "additionalProperties": true
                            }
                          },
                          "trainings": {
                            "type": "array",
                            "items": {
                              "$ref": "#/components/schemas/WpFollowUp"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/WP401"
          },
          "403": {
            "$ref": "#/components/responses/WP403"
          },
          "503": {
            "$ref": "#/components/responses/WP503"
          },
          "400": {
            "$ref": "#/components/responses/WP400"
          }
        },
        "security": [
          {
            "WordPressKey": []
          },
          {
            "WordPressKeyHeader": []
          }
        ]
      }
    },
    "/api/wordpress/sso": {
      "post": {
        "tags": [
          "WordPress / WooCommerce"
        ],
        "operationId": "wpSso",
        "summary": "Obtenir une adresse de connexion unique",
        "description": "Adresse valable 5 minutes, réservée aux comptes apprenants. Cibles : home, courses, session, training et attestation (ces trois dernières exigent `id`).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "target": {
                    "type": "string",
                    "enum": [
                      "home",
                      "courses",
                      "session",
                      "training",
                      "attestation"
                    ],
                    "default": "home"
                  },
                  "id": {
                    "type": "integer"
                  }
                },
                "required": [
                  "email"
                ]
              },
              "example": {
                "email": "jean.dupont@client.fr",
                "target": "training",
                "id": 42
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string",
                      "format": "uri"
                    },
                    "expires_in": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "url": "https://votre-plateforme.dgtlms.fr/jwt.php?skey=…",
                  "expires_in": 300
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/WP401"
          },
          "403": {
            "$ref": "#/components/responses/WP403"
          },
          "503": {
            "$ref": "#/components/responses/WP503"
          },
          "400": {
            "$ref": "#/components/responses/WP400"
          },
          "404": {
            "$ref": "#/components/responses/WP404"
          }
        },
        "security": [
          {
            "WordPressKey": []
          },
          {
            "WordPressKeyHeader": []
          }
        ]
      }
    },
    "/api/dendreo/health": {
      "get": {
        "tags": [
          "Dendreo"
        ],
        "operationId": "dendreoHealth",
        "summary": "Diagnostic",
        "description": "Public.",
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Health"
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/dendreo/trainings": {
      "get": {
        "tags": [
          "Dendreo"
        ],
        "operationId": "dendreoTrainings",
        "summary": "Catalogue des parcours et sessions",
        "description": "Consommé par Dendreo. Seules les formations publiées sont proposées.",
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TmsTraining"
                  }
                },
                "example": [
                  {
                    "training_id": "parcours_42",
                    "training_title": "Sécurité informatique",
                    "training_description": ""
                  }
                ]
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Std401"
          }
        },
        "security": [
          {
            "ApiKey": [],
            "DendreoTenant": []
          },
          {
            "DendreoAuthKey": [],
            "DendreoTenant": []
          },
          {
            "DendreoSignature": []
          }
        ]
      }
    },
    "/api/dendreo/users": {
      "post": {
        "tags": [
          "Dendreo"
        ],
        "operationId": "dendreoUserCreated",
        "summary": "Webhook user.created",
        "description": "Crée l'apprenant (ou renvoie l'existant). Enveloppe Dendreo ou objet direct.\n\nWebhook signé : en-tête `Signature` = HMAC-SHA256 hexadécimal du corps brut.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DendreoEnvelope"
              },
              "example": {
                "event": "user.created",
                "timestamp": 1792500000,
                "tenant_id": "client_xyz",
                "data": {
                  "firstname": "Jean",
                  "lastname": "Dupont",
                  "email": "jean.dupont@client.fr",
                  "password": "MotDePasse2026!",
                  "send_credentials": true,
                  "external_id": "DDR-USR-1201"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "user_id": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "user_id": "4287"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Std401"
          },
          "400": {
            "$ref": "#/components/responses/Std400"
          },
          "500": {
            "$ref": "#/components/responses/Std500"
          }
        },
        "security": [
          {
            "DendreoSignature": []
          }
        ]
      }
    },
    "/api/dendreo/sessions": {
      "post": {
        "tags": [
          "Dendreo"
        ],
        "operationId": "dendreoSessionEvent",
        "summary": "Webhook session.created / .updated / .deleted",
        "description": "Création : training_id, name, start_date, end_date et external_id requis. Mise à jour et suppression : session_id requis.\n\nWebhook signé : en-tête `Signature` = HMAC-SHA256 hexadécimal du corps brut.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DendreoEnvelope"
              },
              "example": {
                "event": "session.created",
                "timestamp": 1792500000,
                "tenant_id": "client_xyz",
                "data": {
                  "training_id": "parcours_42",
                  "name": "Sécurité — Lyon",
                  "start_date": "2026-11-12",
                  "end_date": "2026-11-30",
                  "external_id": "DDR-SES-77"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "session_id": {
                      "type": "string"
                    },
                    "deleted": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "session_id": "87"
                }
              }
            }
          },
          "404": {
            "description": "Ressource ou route introuvable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FieldErrors"
                },
                "example": [
                  {
                    "error.field": "training_id",
                    "error.reason": "Training inconnu"
                  }
                ]
              }
            }
          },
          "409": {
            "description": "Conflit avec l'état existant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FieldErrors"
                },
                "example": [
                  {
                    "error.field": "training_id",
                    "error.reason": "Training non publie (brouillon ou a revalider)"
                  }
                ]
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Std401"
          },
          "400": {
            "$ref": "#/components/responses/Std400"
          },
          "500": {
            "$ref": "#/components/responses/Std500"
          }
        },
        "security": [
          {
            "DendreoSignature": []
          }
        ]
      }
    },
    "/api/dendreo/enrolments": {
      "post": {
        "tags": [
          "Dendreo"
        ],
        "operationId": "dendreoEnrolmentEvent",
        "summary": "Webhook enrolment.created / .updated / .deleted",
        "description": "training_id : parcours_<id> (inscription directe) ou session_<id> (via une session). Une formation non publiée est refusée (409).\n\nWebhook signé : en-tête `Signature` = HMAC-SHA256 hexadécimal du corps brut.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DendreoEnvelope"
              },
              "example": {
                "event": "enrolment.created",
                "timestamp": 1792500000,
                "tenant_id": "client_xyz",
                "data": {
                  "user_id": "4287",
                  "training_id": "parcours_42",
                  "session_id": null,
                  "start_date": "2026-01-15",
                  "end_date": "2026-02-15",
                  "send_notification": true,
                  "external_id": "DDR-7842"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "enrolment_id": {
                      "type": "string"
                    },
                    "deleted": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "enrolment_id": "5120"
                }
              }
            }
          },
          "404": {
            "description": "Ressource ou route introuvable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FieldErrors"
                },
                "example": [
                  {
                    "error.field": "training_id",
                    "error.reason": "Training inconnu"
                  }
                ]
              }
            }
          },
          "409": {
            "description": "Conflit avec l'état existant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FieldErrors"
                },
                "example": [
                  {
                    "error.field": "training_id",
                    "error.reason": "Training non publie (brouillon ou a revalider)"
                  }
                ]
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Std401"
          },
          "400": {
            "$ref": "#/components/responses/Std400"
          },
          "500": {
            "$ref": "#/components/responses/Std500"
          }
        },
        "security": [
          {
            "DendreoSignature": []
          }
        ]
      }
    },
    "/api/dendreo/users/{id}/enrolments": {
      "get": {
        "tags": [
          "Dendreo"
        ],
        "operationId": "dendreoUserEnrolments",
        "summary": "Inscriptions d'un apprenant",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Identifiant DGTLMS de l'apprenant",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "user_id": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/TmsEnrolment"
                      }
                    },
                    "count": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Std401"
          },
          "500": {
            "$ref": "#/components/responses/Std500"
          }
        },
        "security": [
          {
            "ApiKey": [],
            "DendreoTenant": []
          },
          {
            "DendreoAuthKey": [],
            "DendreoTenant": []
          },
          {
            "DendreoSignature": []
          }
        ]
      }
    },
    "/api/dendreo/webhook/progress": {
      "post": {
        "tags": [
          "Dendreo"
        ],
        "operationId": "dendreoPushProgress",
        "summary": "Pousser une progression vers Dendreo",
        "description": "Met à jour la progression locale puis l'envoie à Dendreo. En temps normal, la plateforme le fait d'elle-même à chaque avancée, avec rattrapage automatique si Dendreo est injoignable.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "enrolment_id": {
                    "type": "integer"
                  },
                  "progression": {
                    "type": "number",
                    "description": "Progression (%)"
                  },
                  "score": {
                    "type": "integer"
                  },
                  "started_at": {
                    "type": "string"
                  },
                  "completed_at": {
                    "type": "string"
                  },
                  "last_access_at": {
                    "type": "string"
                  },
                  "time_spent": {
                    "type": "integer",
                    "description": "Secondes"
                  }
                },
                "required": [
                  "enrolment_id",
                  "progression"
                ]
              },
              "example": {
                "enrolment_id": 5120,
                "progression": 100,
                "score": 85,
                "time_spent": 1240
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "enrolment_id": {
                      "type": "string"
                    },
                    "progression": {
                      "type": "number"
                    },
                    "webhook_sent": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "enrolment_id": "5120",
                  "progression": 100,
                  "webhook_sent": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Std401"
          },
          "400": {
            "$ref": "#/components/responses/Std400"
          },
          "404": {
            "$ref": "#/components/responses/Std404"
          },
          "500": {
            "$ref": "#/components/responses/Std500"
          }
        },
        "security": [
          {
            "ApiKey": [],
            "DendreoTenant": []
          },
          {
            "DendreoAuthKey": [],
            "DendreoTenant": []
          },
          {
            "DendreoSignature": []
          }
        ]
      }
    },
    "/api/dendreo/auth/jwt": {
      "get": {
        "tags": [
          "Dendreo"
        ],
        "operationId": "dendreoSso",
        "summary": "Connexion en un clic depuis l'extranet Dendreo",
        "description": "Jeton JWT signé par Dendreo (5 minutes maximum). Un navigateur est redirigé (302) vers la plateforme ; un client API reçoit l'URL de redirection.",
        "parameters": [
          {
            "name": "jwt",
            "in": "query",
            "required": true,
            "description": "Jeton JWT (alias : token)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "return_to",
            "in": "query",
            "required": false,
            "description": "Page de retour sur la plateforme",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "dendreo_return_to",
            "in": "query",
            "required": false,
            "description": "Page de retour côté Dendreo",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "user_id": {
                      "type": "integer"
                    },
                    "redirect_url": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "302": {
            "description": "Redirection vers la plateforme (navigateur)"
          },
          "400": {
            "$ref": "#/components/responses/Std400"
          },
          "401": {
            "$ref": "#/components/responses/Std401"
          },
          "500": {
            "$ref": "#/components/responses/Std500"
          }
        },
        "security": []
      }
    },
    "/api/ypareo/health": {
      "get": {
        "tags": [
          "Ypareo"
        ],
        "operationId": "ypareoHealth",
        "summary": "Diagnostic",
        "description": "Public.",
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Health"
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/ypareo/trainings": {
      "get": {
        "tags": [
          "Ypareo"
        ],
        "operationId": "ypareoTrainings",
        "summary": "Catalogue des parcours et sessions",
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TmsTraining"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Std401"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/api/ypareo/users": {
      "post": {
        "tags": [
          "Ypareo"
        ],
        "operationId": "ypareoSaveUser",
        "summary": "Créer ou mettre à jour un apprenant",
        "description": "nom et prénom requis, ainsi que email ou login. Accepte un objet direct ou enveloppé dans `data`. Répond 201 à la création, 200 si l'apprenant existait.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "nom": {
                    "type": "string"
                  },
                  "prenom": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "login": {
                    "type": "string"
                  },
                  "password": {
                    "type": "string",
                    "format": "password"
                  },
                  "codeApprenant": {
                    "type": "integer",
                    "description": "Code apprenant Yparéo"
                  },
                  "uuidNetUtilisateur": {
                    "type": "string"
                  }
                },
                "required": [
                  "nom",
                  "prenom"
                ]
              },
              "example": {
                "nom": "Dupont",
                "prenom": "Jean",
                "email": "jean.dupont@cfa.fr",
                "codeApprenant": 1234,
                "uuidNetUtilisateur": "abc-…"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Ressource créée",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "user_id": {
                      "type": "string"
                    },
                    "created": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "user_id": "4287",
                  "created": true
                }
              }
            }
          },
          "200": {
            "description": "Apprenant existant mis à jour",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "user_id": {
                      "type": "string"
                    },
                    "created": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Std401"
          },
          "400": {
            "$ref": "#/components/responses/Std400"
          },
          "500": {
            "$ref": "#/components/responses/Std500"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/api/ypareo/enrolments": {
      "post": {
        "tags": [
          "Ypareo"
        ],
        "operationId": "ypareoEnrolmentEvent",
        "summary": "Inscrire ou désinscrire",
        "description": "Événements enrolment.created / .updated (user_id, training_id, start_date, end_date requis) et enrolment.deleted (enrolment_id requis).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "event": {
                    "type": "string",
                    "enum": [
                      "enrolment.created",
                      "enrolment.updated",
                      "enrolment.deleted"
                    ]
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": true
                  }
                },
                "required": [
                  "event",
                  "data"
                ]
              },
              "example": {
                "event": "enrolment.created",
                "data": {
                  "user_id": "4287",
                  "training_id": "session_87",
                  "start_date": "2026-09-01",
                  "end_date": "2027-06-30",
                  "external_id": "YP-993"
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Ressource créée",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "enrolment_id": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "enrolment_id": "6021"
                }
              }
            }
          },
          "200": {
            "description": "Inscription mise à jour ou supprimée",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "enrolment_id": {
                      "type": "string"
                    },
                    "deleted": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Ressource ou route introuvable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FieldErrors"
                },
                "example": [
                  {
                    "error.field": "training_id",
                    "error.reason": "Training inconnu"
                  }
                ]
              }
            }
          },
          "409": {
            "description": "Conflit avec l'état existant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FieldErrors"
                },
                "example": [
                  {
                    "error.field": "training_id",
                    "error.reason": "Training non publie (brouillon ou a revalider)"
                  }
                ]
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Std401"
          },
          "400": {
            "$ref": "#/components/responses/Std400"
          },
          "500": {
            "$ref": "#/components/responses/Std500"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/api/ypareo/users/{id}/enrolments": {
      "get": {
        "tags": [
          "Ypareo"
        ],
        "operationId": "ypareoUserEnrolments",
        "summary": "Inscriptions d'un apprenant",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Identifiant DGTLMS de l'apprenant",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "user_id": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/TmsEnrolment"
                      }
                    },
                    "count": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Std401"
          },
          "500": {
            "$ref": "#/components/responses/Std500"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/ypareo_auth.php": {
      "get": {
        "tags": [
          "Ypareo"
        ],
        "operationId": "ypareoSso",
        "summary": "Connexion unique depuis Yparéo",
        "description": "À la racine de la plateforme (hors /api/ypareo/). Le jeton est vérifié auprès de l'API Yparéo, puis le navigateur est redirigé ; en cas d'échec, retour à la page de connexion.",
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "description": "Jeton SSO Yparéo",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "302": {
            "description": "Redirection (connexion réussie ou page de connexion)"
          }
        },
        "security": []
      }
    },
    "/api/cegid/health": {
      "get": {
        "tags": [
          "CEGID HR"
        ],
        "operationId": "cegidHealth",
        "summary": "Diagnostic du connecteur",
        "description": "Public. État de la base, du jeton OAuth2 Cegid, dernière synchronisation et compteurs.",
        "responses": {
          "200": {
            "description": "Succès",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Health"
                },
                "example": {
                  "api": "DGTLMS × CEGID HR",
                  "status": "ok",
                  "database": "connected",
                  "last_sync": {
                    "status": "success",
                    "users_fetched": 120,
                    "enrolments_applied": 85
                  }
                }
              }
            }
          }
        },
        "security": []
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "Clé d'API de la plateforme, fournie par DGT Concept à la mise en service. Utilisée par l'API REST v1, le Wrapper Dispatcher, Yparéo et les routes de lecture Dendreo."
      },
      "WebserviceBasic": {
        "type": "http",
        "scheme": "basic",
        "description": "Alternative à X-API-Key pour l'API REST v1 : identifiant et mot de passe d'accès aux web services (paramètres de la plateforme), en HTTP Basic."
      },
      "MobileJWT": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Jeton d'accès JWT obtenu par POST /api/mobile/auth/login (durée de vie 1 heure)."
      },
      "XapiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "Clé xAPI (lecture, écriture ou les deux), cloisonnée par site."
      },
      "XapiBasic": {
        "type": "http",
        "scheme": "basic",
        "description": "Authentification xAPI standard : Basic base64(\"<clé>:\") — la clé xAPI en identifiant, mot de passe vide."
      },
      "BiKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "Clé BI en lecture seule, distincte de la clé d'API d'écriture."
      },
      "BiKeyQuery": {
        "type": "apiKey",
        "in": "query",
        "name": "apikey",
        "description": "Clé BI passée dans l'URL : nécessaire pour le connecteur « Flux OData » de Power BI en mode Anonyme. HTTPS obligatoire."
      },
      "WordPressKey": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "dgtwp_…",
        "description": "Clé du site WordPress (préfixe dgtwp_), créée dans Administration > Connecteurs ; une clé par site, révocable."
      },
      "WordPressKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "Même clé WordPress, transmise dans X-API-Key."
      },
      "DendreoAuthKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Auth-API-Key",
        "description": "Variante d'en-tête acceptée pour la clé d'API (nom utilisé par Dendreo)."
      },
      "DendreoTenant": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Tenant",
        "description": "Identifiant de tenant Dendreo, à envoyer avec la clé d'API."
      },
      "DendreoSignature": {
        "type": "apiKey",
        "in": "header",
        "name": "Signature",
        "description": "Signature HMAC-SHA256 (hexadécimal) du corps brut, avec le secret de webhook partagé. Obligatoire sur les webhooks entrants."
      }
    },
    "schemas": {
      "ErrorV1": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": "Message d'erreur"
          }
        },
        "required": [
          "error"
        ],
        "description": "Erreur de l'API REST v1, du Wrapper Dispatcher et du connecteur WordPress"
      },
      "ErrorStandard": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": "Libellé du statut HTTP"
          },
          "message": {
            "type": "string",
            "description": "Détail"
          }
        },
        "required": [
          "error",
          "message"
        ],
        "description": "Erreur des API xAPI, Dendreo, Yparéo et Cegid"
      },
      "ErrorMobile": {
        "type": "object",
        "properties": {
          "ok": {
            "const": false,
            "type": "boolean"
          },
          "reason": {
            "type": "string",
            "description": "Code machine (no_token, invalid_token, invalid_credentials, bad_input, forbidden, not_found…)"
          },
          "message": {
            "type": "string",
            "description": "Message lisible"
          }
        },
        "required": [
          "ok",
          "reason",
          "message"
        ]
      },
      "ErrorOData": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "message"
            ]
          }
        },
        "required": [
          "error"
        ],
        "description": "Erreur au format OData"
      },
      "FieldErrors": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "error.field": {
              "type": "string",
              "description": "Champ en cause"
            },
            "error.reason": {
              "type": "string",
              "description": "Motif"
            }
          }
        },
        "description": "Erreur de validation métier Dendreo / Yparéo (tableau)"
      },
      "Health": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "example": "ok"
          }
        },
        "description": "Diagnostic (champs variables selon l'API)",
        "additionalProperties": true
      },
      "User": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Identifiant"
          },
          "login": {
            "type": "string"
          },
          "firstname": {
            "type": "string"
          },
          "lastname": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "level_id": {
            "type": "integer",
            "description": "Niveau (1 super-administrateur, 2 administrateur, 3 formateur, 4 apprenant, ou niveau personnalisé)"
          },
          "custom_level_id": {
            "type": "integer",
            "description": "Niveau personnalisé éventuel"
          },
          "active": {
            "type": "boolean"
          },
          "service": {
            "type": "string",
            "description": "Service / département"
          },
          "start_date": {
            "type": "string",
            "description": "Date au format jj/mm/aaaa"
          },
          "end_date": {
            "type": "string",
            "description": "Date au format jj/mm/aaaa"
          },
          "lang": {
            "type": "string",
            "description": "Code langue (fr, uk…)"
          },
          "auth_method": {
            "type": "string",
            "description": "Méthode d'authentification"
          },
          "custom_fields": {
            "type": "object",
            "properties": {},
            "description": "Champs personnalisés field1 à field20 (seuls les champs renseignés)",
            "additionalProperties": {
              "type": "string"
            }
          }
        },
        "description": "Utilisateur. Les champs vides sont omis."
      },
      "UserInput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "0 ou absent = création ; identifiant existant = mise à jour",
            "default": 0
          },
          "login": {
            "type": "string"
          },
          "password": {
            "type": "string",
            "description": "Mot de passe (alias : pass)",
            "format": "password"
          },
          "firstname": {
            "type": "string"
          },
          "lastname": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "start_date": {
            "type": "string",
            "description": "Début d'accès : horodatage Unix ou vide",
            "pattern": "^[0-9]*$"
          },
          "end_date": {
            "type": "string",
            "description": "Fin d'accès : horodatage Unix ou vide",
            "pattern": "^[0-9]*$"
          },
          "level_id": {
            "type": "integer",
            "description": "Niveau de l'utilisateur"
          },
          "service": {
            "type": "string"
          },
          "active": {
            "type": "string",
            "enum": [
              "true",
              "false"
            ],
            "default": "true"
          },
          "style": {
            "type": "string",
            "description": "Habillage"
          },
          "lang": {
            "type": "string"
          },
          "sendmail": {
            "type": "integer",
            "description": "1 = envoyer les identifiants par courriel",
            "enum": [
              0,
              1
            ],
            "default": 0
          },
          "mailsender": {
            "type": "string",
            "description": "Expéditeur du courriel"
          },
          "auth_method": {
            "type": "string"
          },
          "field1": {
            "type": "string",
            "description": "Champs personnalisés field1 à field20 (alias f1 à f20)"
          }
        },
        "required": [
          "login",
          "level_id"
        ]
      },
      "Session": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "start_date": {
            "type": "string",
            "description": "Date au format jj/mm/aaaa"
          },
          "end_date": {
            "type": "string",
            "description": "Date au format jj/mm/aaaa"
          },
          "active": {
            "type": "boolean"
          },
          "locked": {
            "type": "boolean"
          },
          "blocked": {
            "type": "boolean",
            "description": "Dates bloquantes"
          },
          "is_default": {
            "type": "boolean",
            "description": "Session par défaut"
          },
          "default_page": {
            "type": "string",
            "description": "Onglet d'arrivée"
          }
        },
        "description": "Session. Les champs vides sont omis."
      },
      "SessionInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "start_date": {
            "type": "string",
            "description": "Horodatage Unix ou vide",
            "pattern": "^[0-9]*$"
          },
          "end_date": {
            "type": "string",
            "description": "Horodatage Unix ou vide",
            "pattern": "^[0-9]*$"
          },
          "active": {
            "type": "string",
            "enum": [
              "true",
              "false"
            ],
            "default": "true"
          },
          "locked": {
            "type": "string",
            "enum": [
              "true",
              "false"
            ],
            "default": "false"
          },
          "flash": {
            "type": "string",
            "enum": [
              "true",
              "false"
            ],
            "default": "false"
          },
          "locking_dates": {
            "type": "string",
            "description": "Dates bloquantes",
            "enum": [
              "true",
              "false"
            ],
            "default": "false"
          },
          "reception_text": {
            "type": "string",
            "description": "Texte d'accueil"
          },
          "default_page": {
            "type": "string",
            "description": "Onglet d'arrivée"
          },
          "field1": {
            "type": "string",
            "description": "Champs personnalisés field1 à field10"
          }
        }
      },
      "Theme": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "color": {
            "type": "string",
            "example": "#5869fd"
          }
        }
      },
      "Training": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "nb_sco": {
            "type": "integer",
            "description": "Nombre d'activités"
          },
          "valid": {
            "type": "string"
          },
          "locked": {
            "type": "boolean"
          },
          "keywords": {
            "type": "string"
          },
          "themes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Theme"
            }
          },
          "duration": {
            "type": "string",
            "description": "Durée indicative"
          },
          "thumbnail": {
            "type": "string",
            "description": "URL de la vignette"
          }
        },
        "description": "Parcours (formation). Les champs vides sont omis."
      },
      "ScoResult": {
        "type": "object",
        "properties": {
          "user_id": {
            "type": "integer"
          },
          "trainingpath_id": {
            "type": "integer"
          },
          "sco_id": {
            "type": "integer"
          },
          "nb": {
            "type": "integer",
            "description": "Nombre de tentatives"
          },
          "date": {
            "type": "string",
            "description": "Première tentative (jj/mm/aaaa hh:mm)"
          },
          "date_last_update": {
            "type": "string",
            "description": "Dernier passage (jj/mm/aaaa hh:mm)"
          },
          "lesson_status": {
            "type": "string"
          },
          "spent_time": {
            "type": "integer",
            "description": "Temps passé (secondes)"
          },
          "score": {
            "type": "number"
          },
          "progression": {
            "type": "number"
          },
          "unique_sco_id": {
            "type": "string"
          }
        },
        "description": "Résultat d'un utilisateur sur une activité"
      },
      "CourseResult": {
        "type": "object",
        "properties": {
          "id_membre": {
            "type": "integer"
          },
          "id_parcours": {
            "type": "integer"
          },
          "nb": {
            "type": "integer"
          },
          "date": {
            "type": "integer",
            "description": "Horodatage Unix (secondes)"
          },
          "date_dernier_passage": {
            "type": "integer",
            "description": "Horodatage Unix (secondes)"
          },
          "lesson_status": {
            "type": "string"
          },
          "termine": {
            "type": "integer",
            "description": "1 = parcours terminé"
          },
          "nb_valid_ua": {
            "type": "integer",
            "description": "Activités validées"
          },
          "temps_passe": {
            "type": "integer",
            "description": "Temps passé (secondes)"
          },
          "score": {
            "type": "number"
          },
          "progression": {
            "type": "integer",
            "description": "Progression (%)"
          }
        },
        "description": "Meilleur résultat d'un utilisateur sur un parcours",
        "additionalProperties": true
      },
      "ResultInput": {
        "type": "object",
        "properties": {
          "training_id": {
            "type": "integer",
            "description": "Parcours"
          },
          "sco_id": {
            "type": "integer",
            "description": "Activité (SCO)"
          },
          "user_id": {
            "type": "integer"
          },
          "score": {
            "type": "integer",
            "default": 0
          },
          "lesson_status": {
            "type": "string",
            "enum": [
              "passed",
              "failed",
              "incomplete",
              "not_attempted",
              "not attempted"
            ]
          },
          "time_spent": {
            "type": "integer",
            "description": "Temps passé en secondes (facultatif)"
          }
        },
        "required": [
          "training_id",
          "sco_id",
          "user_id",
          "lesson_status"
        ]
      },
      "Wrapper": {
        "type": "object",
        "properties": {
          "wrapper_id": {
            "type": "integer"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "id_parcours": {
            "type": "integer",
            "description": "Parcours diffusé"
          },
          "parcours_titre": {
            "type": "string"
          },
          "access_token": {
            "type": "string",
            "description": "Jeton d'accès global du wrapper"
          },
          "is_active": {
            "type": "boolean"
          },
          "category_names": {
            "type": [
              "string",
              "null"
            ]
          },
          "nb_tiers": {
            "type": "integer"
          },
          "created_at": {
            "type": "string"
          }
        }
      },
      "WrapperDetail": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Wrapper"
          },
          {
            "type": "object",
            "properties": {
              "tiers": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Tier"
                }
              },
              "categories": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/WrapperCategory"
                }
              }
            }
          }
        ]
      },
      "WrapperInput": {
        "type": "object",
        "properties": {
          "wrapper_id": {
            "type": "integer",
            "description": "Absent = création ; présent = mise à jour"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "id_parcours": {
            "type": "integer"
          },
          "is_active": {
            "type": "boolean",
            "default": true
          },
          "category_ids": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          }
        },
        "required": [
          "title",
          "id_parcours"
        ]
      },
      "TierOrigin": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "Domaine autorisé (LMS du partenaire)"
          },
          "date_start": {
            "type": [
              "string",
              "null"
            ]
          },
          "date_end": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "url"
        ]
      },
      "Tier": {
        "type": "object",
        "properties": {
          "tier_id": {
            "type": "integer"
          },
          "tier_name": {
            "type": "string"
          },
          "origins": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TierOrigin"
            }
          },
          "max_users": {
            "type": "integer",
            "description": "Quota de places (0 = illimité)"
          },
          "seat_inactivity_days": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Recyclage des places inactives (jours) ; null = valeur globale, 0 = jamais"
          },
          "is_active": {
            "type": "boolean"
          },
          "current_users": {
            "type": "integer"
          },
          "total_users_ever": {
            "type": "integer"
          },
          "nb_wrappers": {
            "type": "integer"
          },
          "created_at": {
            "type": "string"
          }
        },
        "description": "Tiers : partenaire ou client destinataire des contenus"
      },
      "TierInput": {
        "type": "object",
        "properties": {
          "tier_id": {
            "type": "integer",
            "description": "Absent = création"
          },
          "tier_name": {
            "type": "string"
          },
          "origins": {
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "type": "string"
                },
                {
                  "$ref": "#/components/schemas/TierOrigin"
                }
              ]
            },
            "description": "Domaines autorisés : URL simple ou objet daté"
          },
          "max_users": {
            "type": "integer",
            "default": 0
          },
          "is_active": {
            "type": "boolean",
            "default": true
          },
          "seat_inactivity_days": {
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "required": [
          "tier_name"
        ]
      },
      "TierWrapper": {
        "type": "object",
        "properties": {
          "wrapper_id": {
            "type": "integer"
          },
          "title": {
            "type": "string"
          },
          "id_parcours": {
            "type": "integer"
          },
          "parcours_titre": {
            "type": "string"
          },
          "is_active": {
            "type": "boolean"
          },
          "has_dedicated_token": {
            "type": "boolean"
          },
          "access_token": {
            "type": [
              "string",
              "null"
            ]
          },
          "current_users": {
            "type": "integer"
          }
        }
      },
      "WrapperCategory": {
        "type": "object",
        "properties": {
          "category_id": {
            "type": "integer"
          },
          "category_name": {
            "type": "string"
          },
          "category_order": {
            "type": "integer"
          },
          "nb_wrappers": {
            "type": [
              "integer",
              "null"
            ]
          }
        }
      },
      "CompletionCounts": {
        "type": "object",
        "properties": {
          "completed": {
            "type": "integer"
          },
          "in_progress": {
            "type": "integer"
          },
          "failed": {
            "type": "integer"
          },
          "not_started": {
            "type": "integer"
          }
        }
      },
      "MobileUser": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "login": {
            "type": "string"
          },
          "firstname": {
            "type": "string"
          },
          "lastname": {
            "type": "string"
          },
          "fullname": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "level": {
            "type": "integer"
          },
          "language": {
            "type": "string"
          }
        },
        "additionalProperties": true
      },
      "MobileTokens": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "access_token": {
            "type": "string"
          },
          "refresh_token": {
            "type": "string"
          },
          "token_type": {
            "type": "string",
            "example": "Bearer"
          },
          "expires_in": {
            "type": "integer",
            "description": "Durée de validité (secondes)",
            "example": 3600
          },
          "user": {
            "$ref": "#/components/schemas/MobileUser"
          }
        },
        "required": [
          "ok",
          "access_token",
          "refresh_token",
          "expires_in"
        ]
      },
      "MobileCourse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "keywords": {
            "type": "string"
          },
          "themes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Theme"
            }
          },
          "nature": {
            "type": "string"
          },
          "duration": {
            "type": [
              "integer",
              "null"
            ]
          },
          "progress_pct": {
            "type": "integer"
          },
          "lesson_status": {
            "type": "string"
          },
          "score": {
            "type": [
              "integer",
              "null"
            ]
          },
          "time_spent": {
            "type": "integer"
          },
          "last_seen_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "completed": {
            "type": "boolean"
          }
        },
        "additionalProperties": true
      },
      "MobileSco": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "parent_id": {
            "type": "integer"
          },
          "type": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "mastery_score": {
            "type": [
              "integer",
              "null"
            ]
          },
          "position": {
            "type": "integer"
          },
          "lesson_status": {
            "type": "string"
          },
          "score": {
            "type": [
              "integer",
              "null"
            ]
          },
          "time_spent": {
            "type": "integer"
          },
          "last_seen_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "completed": {
            "type": "boolean"
          },
          "offline_supported": {
            "type": "boolean"
          }
        }
      },
      "MobileSyncInput": {
        "type": "object",
        "properties": {
          "client_uuid": {
            "type": "string",
            "description": "UUID v4 généré par l'application : rend l'appel idempotent",
            "format": "uuid"
          },
          "scorm_writes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id_tracking": {
                  "type": "integer"
                },
                "champ": {
                  "type": "string",
                  "description": "Élément CMI"
                },
                "valeur": {
                  "type": "string"
                },
                "client_seq": {
                  "type": "integer"
                }
              }
            },
            "description": "5000 au maximum"
          },
          "xapi_statements": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "1000 au maximum ; l'acteur est remplacé par l'apprenant authentifié"
          },
          "finalize": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id_tracking": {
                  "type": "integer"
                }
              }
            },
            "description": "200 au maximum"
          }
        },
        "required": [
          "client_uuid"
        ]
      },
      "Counter": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "integer"
          },
          "rejected": {
            "type": "integer"
          }
        }
      },
      "XapiStatement": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "actor": {
            "type": "object"
          },
          "verb": {
            "type": "object"
          },
          "object": {
            "type": "object"
          },
          "result": {
            "type": "object"
          },
          "context": {
            "type": "object"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "attachments": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        },
        "required": [
          "actor",
          "verb",
          "object"
        ],
        "description": "Statement xAPI 1.0.3 (voir la spécification ADL)",
        "additionalProperties": true
      },
      "XapiStatementResult": {
        "type": "object",
        "properties": {
          "statements": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/XapiStatement"
            }
          },
          "more": {
            "type": "string",
            "description": "URL de la page suivante (vide en fin de liste)"
          }
        },
        "required": [
          "statements",
          "more"
        ]
      },
      "ODataCollection": {
        "type": "object",
        "properties": {
          "@odata.context": {
            "type": "string"
          },
          "@odata.count": {
            "type": "integer",
            "description": "Présent avec $count=true"
          },
          "value": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "@odata.nextLink": {
            "type": "string",
            "description": "Page suivante (5000 lignes par page au maximum)"
          }
        },
        "required": [
          "value"
        ]
      },
      "WpSession": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "start_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "end_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "active": {
            "type": "boolean"
          },
          "enrolled": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Nombre d'inscrits"
          }
        },
        "additionalProperties": true
      },
      "WpTraining": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "objectives": {
            "type": "string"
          },
          "duration": {
            "type": "string"
          },
          "keywords": {
            "type": "string"
          },
          "thumbnail": {
            "type": "string"
          },
          "color": {
            "type": "string"
          }
        },
        "additionalProperties": true
      },
      "WpEnrolment": {
        "type": "object",
        "properties": {
          "reference": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "cancelled"
            ]
          },
          "already_enrolled": {
            "type": "boolean",
            "description": "L'apprenant était déjà inscrit avant cet achat"
          },
          "replayed": {
            "type": "boolean",
            "description": "Appel déjà reçu pour cette référence"
          },
          "learner_id": {
            "type": "integer"
          },
          "learner_created": {
            "type": "boolean"
          }
        }
      },
      "WpFollowUp": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "title": {
            "type": "string"
          },
          "progress": {
            "type": "integer",
            "description": "Progression (%)"
          },
          "status": {
            "type": "string",
            "enum": [
              "not_started",
              "in_progress",
              "completed"
            ]
          },
          "lesson_status": {
            "type": "string"
          },
          "score": {
            "type": [
              "number",
              "null"
            ]
          },
          "time_spent": {
            "type": "integer"
          },
          "last_activity": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "additionalProperties": true
      },
      "TmsTraining": {
        "type": "object",
        "properties": {
          "training_id": {
            "type": "string",
            "description": "parcours_<id> (inscription directe au parcours) ou session_<id> (inscription via une session)",
            "example": "parcours_42"
          },
          "training_title": {
            "type": "string"
          },
          "training_description": {
            "type": "string"
          }
        }
      },
      "TmsEnrolment": {
        "type": "object",
        "properties": {
          "enrolment_id": {
            "type": "string"
          },
          "training_id": {
            "type": "string"
          },
          "training_title": {
            "type": "string"
          },
          "session_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "session_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "start_date": {
            "type": "string"
          },
          "end_date": {
            "type": "string"
          },
          "progression": {
            "type": "number"
          }
        },
        "additionalProperties": true
      },
      "DendreoEnvelope": {
        "type": "object",
        "properties": {
          "event": {
            "type": "string"
          },
          "timestamp": {
            "type": "integer",
            "description": "Horodatage Unix (secondes)"
          },
          "tenant_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "additionalProperties": true
          }
        },
        "required": [
          "event",
          "data"
        ],
        "description": "Enveloppe standard des webhooks Dendreo"
      }
    },
    "responses": {
      "V1401": {
        "description": "Authentification absente ou refusée",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorV1"
            },
            "example": {
              "error": "Unauthorized — X-API-Key absente ou invalide, et identifiants webservices (options 42/43) non reconnus"
            }
          }
        }
      },
      "V1400": {
        "description": "Requête invalide (champ manquant, JSON ou paramètre incorrect)",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorV1"
            },
            "example": {
              "error": "Champ requis manquant : login"
            }
          }
        }
      },
      "V1404": {
        "description": "Ressource ou route introuvable",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorV1"
            },
            "example": {
              "error": "Utilisateur #4287 introuvable"
            }
          }
        }
      },
      "V1422": {
        "description": "Données valides mais opération impossible (règle métier)",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorV1"
            },
            "example": {
              "error": "Inscription impossible"
            }
          }
        }
      },
      "V1500": {
        "description": "Erreur interne du serveur",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorV1"
            },
            "example": {
              "error": "Génération SCORM échouée"
            }
          }
        }
      },
      "Mobile503": {
        "description": "Service désactivé sur cette plateforme",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorMobile"
            },
            "example": {
              "ok": false,
              "reason": "jwt_misconfigured",
              "message": "API mobile désactivée : MOBILE_JWT_SECRET manquant ou < 16 caractères dans .env."
            }
          }
        }
      },
      "Mobile400": {
        "description": "Requête invalide (champ manquant, JSON ou paramètre incorrect)",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorMobile"
            },
            "example": {
              "ok": false,
              "reason": "bad_input",
              "message": "client_uuid manquant ou invalide (UUID v4 attendu)."
            }
          }
        }
      },
      "Mobile401": {
        "description": "Authentification absente ou refusée",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorMobile"
            },
            "example": {
              "ok": false,
              "reason": "invalid_token",
              "message": "Token invalide ou expiré."
            }
          }
        }
      },
      "Mobile403": {
        "description": "Accès interdit",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorMobile"
            },
            "example": {
              "ok": false,
              "reason": "forbidden",
              "message": "Vous n'êtes pas inscrit à ce parcours."
            }
          }
        }
      },
      "Mobile404": {
        "description": "Ressource ou route introuvable",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorMobile"
            },
            "example": {
              "ok": false,
              "reason": "not_found",
              "message": "Parcours introuvable."
            }
          }
        }
      },
      "Mobile405": {
        "description": "Méthode non prise en charge",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorMobile"
            },
            "example": {
              "ok": false,
              "reason": "method",
              "message": "Méthode non supportée."
            }
          }
        }
      },
      "Mobile500": {
        "description": "Erreur interne du serveur",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorMobile"
            },
            "example": {
              "ok": false,
              "reason": "package_error",
              "message": "Generation du package impossible."
            }
          }
        }
      },
      "Mobile409": {
        "description": "Conflit avec l'état existant",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorMobile"
            },
            "example": {
              "ok": false,
              "reason": "idempotency_conflict",
              "message": "Payload divergent pour le meme client_uuid."
            }
          }
        }
      },
      "Mobile413": {
        "description": "Corps de requête trop volumineux",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorMobile"
            },
            "example": {
              "ok": false,
              "reason": "batch_too_large",
              "message": "Batch trop volumineux (max 5000 scorm_writes / 1000 xapi / 200 finalize)."
            }
          }
        }
      },
      "Std400": {
        "description": "Requête invalide (champ manquant, JSON ou paramètre incorrect)",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorStandard"
            },
            "example": {
              "error": "Bad Request",
              "message": "Missing field: training_id"
            }
          }
        }
      },
      "Std401": {
        "description": "Authentification absente ou refusée",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorStandard"
            },
            "example": {
              "error": "Unauthorized",
              "message": "Invalid or missing API key"
            }
          }
        }
      },
      "Std403": {
        "description": "Accès interdit",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorStandard"
            },
            "example": {
              "error": "Forbidden",
              "message": "Statement appartient à un autre tenant"
            }
          }
        }
      },
      "Std409": {
        "description": "Conflit avec l'état existant",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorStandard"
            },
            "example": {
              "error": "Conflict",
              "message": "Un statement avec cet id existe déjà"
            }
          }
        }
      },
      "Std404": {
        "description": "Ressource ou route introuvable",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorStandard"
            },
            "example": {
              "error": "Not Found",
              "message": "Endpoint not found"
            }
          }
        }
      },
      "Std412": {
        "description": "Précondition non remplie (ETag)",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorStandard"
            },
            "example": {
              "error": "Precondition Failed",
              "message": "ETag ne correspondant pas"
            }
          }
        }
      },
      "OData401": {
        "description": "Authentification absente ou refusée",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorOData"
            },
            "example": {
              "error": {
                "code": "unauthorized",
                "message": "Clé API invalide ou absente (header X-API-Key ou ?apikey=)."
              }
            }
          }
        }
      },
      "OData503": {
        "description": "Service désactivé sur cette plateforme",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorOData"
            },
            "example": {
              "error": {
                "code": "bi_disabled",
                "message": "Le flux BI est désactivé."
              }
            }
          }
        }
      },
      "OData400": {
        "description": "Requête invalide (champ manquant, JSON ou paramètre incorrect)",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorOData"
            },
            "example": {
              "error": {
                "code": "filter_parse",
                "message": "Clause $filter non interprétable : titre contains 'x'"
              }
            }
          }
        }
      },
      "OData404": {
        "description": "Ressource ou route introuvable",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorOData"
            },
            "example": {
              "error": {
                "code": "not_found",
                "message": "EntitySet inconnu"
              }
            }
          }
        }
      },
      "WP401": {
        "description": "Authentification absente ou refusée",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorV1"
            },
            "example": {
              "error": "Clé absente, inconnue ou révoquée."
            }
          }
        }
      },
      "WP403": {
        "description": "Accès interdit",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorV1"
            },
            "example": {
              "error": "Module Intégrations & Connecteurs non souscrit."
            }
          }
        }
      },
      "WP503": {
        "description": "Service désactivé sur cette plateforme",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorV1"
            },
            "example": {
              "error": "Connecteur WordPress désactivé."
            }
          }
        }
      },
      "WP404": {
        "description": "Ressource ou route introuvable",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorV1"
            },
            "example": {
              "error": "Parcours inconnu ou non proposable."
            }
          }
        }
      },
      "WP400": {
        "description": "Requête invalide (champ manquant, JSON ou paramètre incorrect)",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorV1"
            },
            "example": {
              "error": "Indiquer session_id OU training_id."
            }
          }
        }
      },
      "WP409": {
        "description": "Conflit avec l'état existant",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorV1"
            },
            "example": {
              "error": "Conflit"
            }
          }
        }
      },
      "WP422": {
        "description": "Données valides mais opération impossible (règle métier)",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorV1"
            },
            "example": {
              "error": "Inscription impossible"
            }
          }
        }
      },
      "Std500": {
        "description": "Erreur interne du serveur",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorStandard"
            },
            "example": {
              "error": "Server Error",
              "message": "Server Error"
            }
          }
        }
      }
    }
  }
}
