{
  "openapi": "3.1.0",
  "info": {
    "title": "DGTLMS APIs",
    "version": "2.0",
    "summary": "Integration APIs of the DGTLMS learning platform",
    "description": "Reference for the APIs of the **DGTLMS** learning platform, published by DGT CONCEPT.\n\nEvery address is relative to **your own platform** (for example `https://your-platform.dgtlms.fr`). API keys are supplied by DGT Concept when the platform is set up, or created by the platform administrator (WordPress and xAPI keys). Always call the APIs over HTTPS.\n\n## Authentication\n| API | Mechanism |\n|---|---|\n| REST v1, Wrapper Dispatcher, Ypareo | `X-API-Key` (REST v1: also HTTP Basic with the web services credentials) |\n| Mobile | JWT Bearer |\n| xAPI | xAPI key in `X-API-Key`, or Basic |\n| OData / Power BI | read-only BI key (`X-API-Key` or `?apikey=`) |\n| WordPress / WooCommerce | WordPress site key (`Authorization: Bearer dgtwp_…`) |\n| Dendreo | HMAC signature (webhooks), `X-API-Key` + `X-Tenant` (reads) |\n\n## Connectors with no incoming route\nThese connectors need no development on your side: the platform calls your tool.\n- **Lucca (HRIS)** — daily sync of employees; departments become groups. You provide: the Lucca instance URL and an API key.\n- **Salesforce (CRM)** — hourly sync: flagged Contacts (`DGTLMS_Sync__c` by default) become learners, enrolled in the session given by `DGTLMS_Session_Ref__c`. You provide: a connected app (OAuth2) and an integration account.\n- **CEGID HR** — incoming accounts and enrolments, outgoing completions (OAuth2 on the Cegid side).\n\n## Outgoing notifications (webhooks)\n- **Completion of distributed content (Wrapper Dispatcher)** — JSON `POST` to the partner's URL (`event: wrapper.completion`, anonymous identifier, status, score, time), signed with `X-DGT-Signature: sha256=<HMAC-SHA256 of the body>`. Best effort, 5-second timeout, no retry.\n- **Automation rules** — \"call an external system\" action: JSON `POST` (`event`, `user_id`, `parcours_id`, `site_id`, `score`, `timestamp`) with the `X-DGTLMS-Event: automation` header. This call is not signed: use a hard-to-guess URL and/or IP filtering.\n\n## SOAP web services\nThe legacy interface (about 120 operations: users, groups, sessions, courses, enrolments, results) is still available. WSDL description: [`/ws.php?wsdl`](/ws.php?wsdl). Authentication: `X-API-Key`, or HTTP Basic with the web services credentials from an allowed IP address.\n\n## Errors\nEach API has its own error format, described in its group introduction and in each response.",
    "contact": {
      "name": "DGT CONCEPT",
      "url": "https://www.dgtconcept.net"
    },
    "license": {
      "name": "For use by DGTLMS customers only",
      "url": "https://www.dgtconcept.net"
    }
  },
  "servers": [
    {
      "url": "https://{instance}",
      "description": "Your DGTLMS platform",
      "variables": {
        "instance": {
          "default": "your-platform.dgtlms.fr",
          "description": "Address of your own platform (without https://)"
        }
      }
    }
  ],
  "tags": [
    {
      "name": "REST v1",
      "description": "**Base path:** `/api/v1/`  \n**Authentication:** X-API-Key, or HTTP Basic with the web services credentials\n\nDrive the platform from your HRIS, ERP or portal: users, sessions, courses, enrolments and results. Write routes act directly on live data. Errors: `{ \"error\": \"message\" }`; a business error returned by the platform gives 400."
    },
    {
      "name": "Wrapper Dispatcher",
      "description": "**Base path:** `/api/v1/wrapper-dispatcher/`  \n**Authentication:** same as REST API v1\n\nDistribute your courses into your partners' (tiers') LMSs as SCORM packages: wrappers, tiers, categories, SFTP drop and statistics. Requires the Wrapper Dispatcher module."
    },
    {
      "name": "Mobile",
      "description": "**Base path:** `/api/mobile/`  \n**Authentication:** JWT Bearer (POST /auth/login)\n\nAPI for the learner mobile app (iOS, Android, FlutterFlow): profile, catalogue, courses, badges, certifications, offline packages and deferred sync. Must be enabled by DGT Concept (otherwise 503). Errors: `{ \"ok\": false, \"reason\", \"message\" }`."
    },
    {
      "name": "xAPI LRS",
      "description": "**Base path:** `/api/xapi/`  \n**Authentication:** xAPI key in X-API-Key, or Basic base64(\"<key>:\")\n\nxAPI 1.0.3 Learning Record Store: Statements (with attachments), State, Activity Profile, Agent Profile, Activities, Agents. `X-Experience-API-Version: 1.0.3` header required except on /health and /about. ADL certification in progress. Errors: `{ \"error\", \"message\" }`."
    },
    {
      "name": "OData / Power BI",
      "description": "**Base path:** `/api/bi/odata/`  \n**Authentication:** read-only BI key (X-API-Key or ?apikey=)\n\nRead-only OData v4 feed for Power BI, Excel or Tableau: star schema (results, time spent, logins, dimensions). In Power BI: Get data > OData feed, URL `…/api/bi/odata/?apikey=<key>`, Anonymous authentication. Errors in OData format."
    },
    {
      "name": "WordPress / WooCommerce",
      "description": "**Base path:** `/api/wordpress/`  \n**Authentication:** WordPress site key (Bearer dgtwp_… or X-API-Key)\n\nRoutes called by the DGTLMS Connect plugin: single sign-on, course follow-up, WooCommerce sales (courses, sessions, company seats). Documented for custom integrations. Requires the Integrations & Connectors module. Errors: `{ \"error\": \"message\" }`."
    },
    {
      "name": "Dendreo",
      "description": "**Base path:** `/api/dendreo/`  \n**Authentication:** webhooks: HMAC signature; reads: X-API-Key (or X-Auth-API-Key) + X-Tenant\n\nDendreo TMS connector: catalogue, learner / session / enrolment webhooks, progress reporting and one-click sign-in. Errors: `{ \"error\", \"message\" }`, or an array `[{ \"error.field\", \"error.reason\" }]` for business validation."
    },
    {
      "name": "Ypareo",
      "description": "**Base path:** `/api/ypareo/`  \n**Authentication:** X-API-Key\n\nYmag Ypareo connector (apprenticeship centres, training providers): learners, enrolments, catalogue and single sign-on. The platform also polls Ypareo every 15 minutes."
    },
    {
      "name": "CEGID HR",
      "description": "**Base path:** `/api/cegid/`  \n**Authentication:** none (public health check)\n\nThe CEGID HR connector is driven by the platform: it fetches accounts and enrolments (OAuth2, every 15 minutes) and sends back completions. Only the health check is exposed."
    }
  ],
  "paths": {
    "/api/v1/health": {
      "get": {
        "tags": [
          "REST v1"
        ],
        "operationId": "v1Health",
        "summary": "API health check",
        "description": "Public, no key required. Returns the API status and the list of routes.",
        "responses": {
          "200": {
            "description": "Success",
            "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": "List users",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/User"
                      }
                    },
                    "count": {
                      "type": "integer",
                      "description": "Number of items returned"
                    }
                  },
                  "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": "Create or update a user",
        "description": "Without `id` (or with `id` ≤ 0), creates the user and returns 201. With an existing `id`, updates the user and returns 200.\n\nDates are **Unix timestamps** (or empty).\n\n**Warning: an update rewrites every field.** Any field you do not send is cleared — including the password. Read the user first (GET /api/v1/users/{id}) and send back all of its values.\n\n**Warning:** this route changes live data on the platform.",
        "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": "Resource created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer"
                    },
                    "created": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "id": 4287,
                  "created": true
                }
              }
            }
          },
          "200": {
            "description": "User updated",
            "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": "Get a user by login",
        "parameters": [
          {
            "name": "login",
            "in": "path",
            "required": true,
            "description": "Login (URL-encoded)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "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": "Get a user",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "User identifier",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "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": "Activate or deactivate a user",
        "description": "\n\n**Warning:** this route changes live data on the platform.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "User identifier",
            "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": "Success",
            "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": "Change the access end date",
        "description": "\n\n**Warning:** this route changes live data on the platform.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "User identifier",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "end_date": {
                    "type": "string",
                    "description": "Unix timestamp (seconds)",
                    "pattern": "^[0-9]+$"
                  }
                },
                "required": [
                  "end_date"
                ]
              },
              "example": {
                "end_date": "1798675200"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "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": "A user's sessions",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "User identifier",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "user_id": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Session"
                      }
                    },
                    "count": {
                      "type": "integer",
                      "description": "Number of items returned"
                    }
                  },
                  "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": "Courses available to a user",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "User identifier",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "user_id": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Training"
                      }
                    },
                    "count": {
                      "type": "integer",
                      "description": "Number of items returned"
                    }
                  },
                  "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": "A user's results, by activity",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "User identifier",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "user_id": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ScoResult"
                      }
                    },
                    "count": {
                      "type": "integer",
                      "description": "Number of items returned"
                    }
                  },
                  "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": "A user's results, by session",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "User identifier",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "session_id",
            "in": "query",
            "required": false,
            "description": "Session (0 or omitted = all of the user's sessions)",
            "schema": {
              "type": "integer",
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "user_id": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    },
                    "count": {
                      "type": "integer",
                      "description": "Number of items returned"
                    }
                  },
                  "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": "A user's results, by course",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "User identifier",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "course_id",
            "in": "query",
            "required": false,
            "description": "Course (0 or omitted = all)",
            "schema": {
              "type": "integer",
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "user_id": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CourseResult"
                      }
                    },
                    "count": {
                      "type": "integer",
                      "description": "Number of items returned"
                    }
                  },
                  "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": "List sessions",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Session"
                      }
                    },
                    "count": {
                      "type": "integer",
                      "description": "Number of items returned"
                    }
                  },
                  "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": "Create a session",
        "description": "Dates are Unix timestamps (or empty).\n\n**Warning:** this route changes live data on the platform.",
        "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": "Resource created",
            "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": "Get a session",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Session identifier",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "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": "Update a session",
        "description": "Only the fields you send are changed: a session updated without dates keeps its dates.\n\n**Warning:** this route changes live data on the platform.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Session identifier",
            "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": "Success",
            "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": "Delete a session",
        "description": "\n\n**Warning:** this route changes live data on the platform.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Session identifier",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "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": "Users enrolled in a session",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Session identifier",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "session_id": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/User"
                      }
                    },
                    "count": {
                      "type": "integer",
                      "description": "Number of items returned"
                    }
                  },
                  "required": [
                    "data",
                    "count"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1401"
          }
        },
        "security": [
          {
            "ApiKey": []
          },
          {
            "WebserviceBasic": []
          }
        ]
      },
      "post": {
        "tags": [
          "REST v1"
        ],
        "operationId": "v1EnrolSessionUser",
        "summary": "Enrol a user in a session",
        "description": "\n\n**Warning:** this route changes live data on the platform.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Session identifier",
            "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": "Success",
            "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": "Remove a user from a session",
        "description": "\n\n**Warning:** this route changes live data on the platform.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Session identifier",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "uid",
            "in": "path",
            "required": true,
            "description": "User identifier",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "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": "List courses",
        "parameters": [
          {
            "name": "theme",
            "in": "query",
            "required": false,
            "description": "Filter by theme (identifier)",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Training"
                      }
                    },
                    "count": {
                      "type": "integer",
                      "description": "Number of items returned"
                    }
                  },
                  "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": "Get a course",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Course identifier",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "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": "Users enrolled in a course",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Course identifier",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "training_id": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/User"
                      }
                    },
                    "count": {
                      "type": "integer",
                      "description": "Number of items returned"
                    }
                  },
                  "required": [
                    "data",
                    "count"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1401"
          }
        },
        "security": [
          {
            "ApiKey": []
          },
          {
            "WebserviceBasic": []
          }
        ]
      },
      "post": {
        "tags": [
          "REST v1"
        ],
        "operationId": "v1EnrolTrainingUser",
        "summary": "Enrol a user in a course",
        "description": "\n\n**Warning:** this route changes live data on the platform.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Course identifier",
            "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": "Success",
            "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": "Remove a user from a course",
        "description": "\n\n**Warning:** this route changes live data on the platform.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Course identifier",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "uid",
            "in": "path",
            "required": true,
            "description": "User identifier",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "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": "Record a result",
        "description": "Inserts a tracking result for an activity (status, score, optional time spent).\n\n**Warning:** this route changes live data on the platform.",
        "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": "Resource created",
            "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": "List wrappers",
        "parameters": [
          {
            "name": "category_id",
            "in": "query",
            "required": false,
            "description": "Filter by category",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "active",
            "in": "query",
            "required": false,
            "description": "true = active wrappers only",
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Wrapper"
                      }
                    },
                    "count": {
                      "type": "integer",
                      "description": "Number of items returned"
                    }
                  },
                  "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": "Create or update a wrapper",
        "description": "\n\n**Warning:** this route changes live data on the platform.",
        "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": "Resource created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "wrapper_id": {
                      "type": "integer"
                    },
                    "created": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "wrapper_id": 35,
                  "created": true
                }
              }
            }
          },
          "200": {
            "description": "Wrapper updated",
            "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": "Get a wrapper (with its tiers and categories)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Wrapper identifier",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "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": "Delete a wrapper",
        "description": "\n\n**Warning:** this route changes live data on the platform.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Wrapper identifier",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "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": "Regenerate the access token",
        "description": "The previous token stops working: packages already distributed must be replaced.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Wrapper identifier",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "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": "Download the global SCORM package",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Wrapper identifier",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "description": "Package format: scorm12 (default), scorm2004 (4th Edition) or cmi5. Unknown value = scorm12.",
            "schema": {
              "type": "string",
              "enum": [
                "scorm12",
                "scorm2004",
                "cmi5"
              ],
              "default": "scorm12"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "SCORM package (.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": "List tiers",
        "parameters": [
          {
            "name": "active",
            "in": "query",
            "required": false,
            "description": "true = active tiers only",
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Tier"
                      }
                    },
                    "count": {
                      "type": "integer",
                      "description": "Number of items returned"
                    }
                  },
                  "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": "Create or update a tier",
        "description": "\n\n**Warning:** this route changes live data on the platform.",
        "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": "Resource created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tier_id": {
                      "type": "integer"
                    },
                    "created": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "tier_id": 12,
                  "created": true
                }
              }
            }
          },
          "200": {
            "description": "Tier updated",
            "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": "Get a tier",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Tier identifier",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "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": "Delete a tier",
        "description": "\n\n**Warning:** this route changes live data on the platform.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Tier identifier",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "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 linked to a tier",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Tier identifier",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/TierWrapper"
                      }
                    },
                    "count": {
                      "type": "integer",
                      "description": "Number of items returned"
                    }
                  },
                  "required": [
                    "data",
                    "count"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1401"
          },
          "404": {
            "$ref": "#/components/responses/V1404"
          }
        },
        "security": [
          {
            "ApiKey": []
          },
          {
            "WebserviceBasic": []
          }
        ]
      },
      "post": {
        "tags": [
          "Wrapper Dispatcher"
        ],
        "operationId": "wdLinkTierWrapper",
        "summary": "Link a wrapper to a tier",
        "description": "\n\n**Warning:** this route changes live data on the platform.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Tier identifier",
            "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": "Resource created",
            "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": "Unlink a wrapper from a tier",
        "description": "\n\n**Warning:** this route changes live data on the platform.",
        "parameters": [
          {
            "name": "tid",
            "in": "path",
            "required": true,
            "description": "Tier identifier",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "wid",
            "in": "path",
            "required": true,
            "description": "Wrapper identifier",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "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": "Generate a dedicated tier / wrapper token",
        "description": "For shared LMSs, where identification by domain is not enough.",
        "parameters": [
          {
            "name": "tid",
            "in": "path",
            "required": true,
            "description": "Tier identifier",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "wid",
            "in": "path",
            "required": true,
            "description": "Wrapper identifier",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "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": "Delete the dedicated token",
        "parameters": [
          {
            "name": "tid",
            "in": "path",
            "required": true,
            "description": "Tier identifier",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "wid",
            "in": "path",
            "required": true,
            "description": "Wrapper identifier",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "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": "Download the tier's dedicated SCORM package",
        "parameters": [
          {
            "name": "tid",
            "in": "path",
            "required": true,
            "description": "Tier identifier",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "wid",
            "in": "path",
            "required": true,
            "description": "Wrapper identifier",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "description": "Package format: scorm12 (default), scorm2004 (4th Edition) or cmi5. Unknown value = scorm12.",
            "schema": {
              "type": "string",
              "enum": [
                "scorm12",
                "scorm2004",
                "cmi5"
              ],
              "default": "scorm12"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "SCORM package (.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": "List categories",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/WrapperCategory"
                      }
                    },
                    "count": {
                      "type": "integer",
                      "description": "Number of items returned"
                    }
                  },
                  "required": [
                    "data",
                    "count"
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/V1401"
          }
        },
        "security": [
          {
            "ApiKey": []
          },
          {
            "WebserviceBasic": []
          }
        ]
      },
      "post": {
        "tags": [
          "Wrapper Dispatcher"
        ],
        "operationId": "wdSaveCategory",
        "summary": "Create or update a category",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "category_id": {
                    "type": "integer",
                    "description": "Omitted = create"
                  },
                  "category_name": {
                    "type": "string"
                  },
                  "category_order": {
                    "type": "integer",
                    "default": 0
                  }
                },
                "required": [
                  "category_name"
                ]
              },
              "example": {
                "category_name": "Sécurité",
                "category_order": 1
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Resource created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "saved": {
                      "type": "boolean"
                    },
                    "created": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "saved": true,
                  "created": true
                }
              }
            }
          },
          "200": {
            "description": "Category updated",
            "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": "Delete a category",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Category identifier",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "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": "List packages dropped via SFTP",
        "responses": {
          "200": {
            "description": "Success",
            "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": "Absorb a dropped package",
        "description": "In a single operation: creates (or replaces) the course, the wrapper, categories and tier links. Returns 201 on creation, 200 on replacement.\n\n**Warning:** this route changes live data on the platform.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "filename": {
                    "type": "string",
                    "description": "Name of the .zip in the drop folder"
                  },
                  "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": "Resource created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "200": {
            "description": "Existing wrapper replaced",
            "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": "Global indicators",
        "parameters": [
          {
            "name": "disk_breakdown",
            "in": "query",
            "required": false,
            "description": "true = disk usage broken down by course",
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "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": "A tier's indicators, by wrapper",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Tier identifier",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "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": "Health check",
        "description": "Public.",
        "responses": {
          "200": {
            "description": "Success",
            "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": "Log in",
        "description": "Exchanges a login and password for an access token (1 hour) and a refresh token (30 days). The `device` block is optional (push notifications).",
        "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": "Success",
            "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": "Refresh the access token",
        "description": "The refresh token used is revoked and replaced by a new one (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": "Success",
            "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": "Log out",
        "description": "Revokes the refresh token.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "refresh_token": {
                    "type": "string"
                  }
                },
                "required": [
                  "refresh_token"
                ]
              },
              "example": {
                "refresh_token": "Qm9…"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "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": "Signed-in learner's profile",
        "responses": {
          "200": {
            "description": "Success",
            "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": "My courses and progress",
        "responses": {
          "200": {
            "description": "Success",
            "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": "My upcoming sessions",
        "responses": {
          "200": {
            "description": "Success",
            "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": "My badges",
        "responses": {
          "200": {
            "description": "Success",
            "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": "My certifications",
        "responses": {
          "200": {
            "description": "Success",
            "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 of available courses",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Full-text search",
            "schema": {
              "type": "string"
            },
            "example": "sécurité"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "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": "Course details",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Course identifier",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "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": "Activity tree of a course",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Course identifier",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "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": "Offline package of a course",
        "description": "Self-contained ZIP: the course tree (SCORM 1.2/2004, DGT Studio, media) and, at the root, `dgtlms_manifest.json` (activities, launch URLs, pre-created tracking identifier, 30-day expiry).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Course identifier",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "ZIP package",
            "content": {
              "application/zip": {
                "schema": {
                  "type": "string",
                  "contentMediaType": "application/zip"
                }
              }
            },
            "headers": {
              "X-DGTLMS-Content-Hash": {
                "description": "SHA-256 hash of the content: compare it to invalidate the local cache",
                "schema": {
                  "type": "string"
                }
              },
              "X-DGTLMS-Scorm-Version": {
                "description": "1.2, 2004, mixed or unknown",
                "schema": {
                  "type": "string"
                }
              },
              "X-DGTLMS-Cache-Hit": {
                "description": "1 if the package was already cached",
                "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": "Sync offline tracking",
        "description": "Replays SCORM writes, stores xAPI statements and closes attempts made offline. Idempotent per `client_uuid`: a resend returns the original response; different content for the same `client_uuid` returns 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": "Success",
            "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": "Health check",
        "description": "Public.",
        "responses": {
          "200": {
            "description": "Success",
            "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": "Supported xAPI versions",
        "description": "Public (About resource of the specification).",
        "responses": {
          "200": {
            "description": "Success",
            "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": "Store one or more statements",
        "description": "JSON body (one statement or an array) or `multipart/mixed` with attachments. Requires a write key. Returns the list of identifiers.",
        "parameters": [
          {
            "name": "X-Experience-API-Version",
            "in": "header",
            "required": true,
            "description": "xAPI version, required: 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": "Success",
            "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": "Store a statement with a given identifier",
        "description": "Statements are immutable: if the identifier already exists, the response is 409.",
        "parameters": [
          {
            "name": "X-Experience-API-Version",
            "in": "header",
            "required": true,
            "description": "xAPI version, required: 1.0.3",
            "schema": {
              "type": "string"
            },
            "example": "1.0.3"
          },
          {
            "name": "statementId",
            "in": "query",
            "required": true,
            "description": "Statement UUID",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/XapiStatement"
              }
            },
            "multipart/mixed": {
              "schema": {
                "type": "string"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Stored"
          },
          "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": "Get or search statements",
        "description": "With `statementId` or `voidedStatementId`: returns that statement only (no other filter allowed, except `format` and `attachments`). Otherwise: paged search; follow the `more` URL for the next page.",
        "parameters": [
          {
            "name": "X-Experience-API-Version",
            "in": "header",
            "required": true,
            "description": "xAPI version, required: 1.0.3",
            "schema": {
              "type": "string"
            },
            "example": "1.0.3"
          },
          {
            "name": "statementId",
            "in": "query",
            "required": false,
            "description": "Statement UUID",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "voidedStatementId",
            "in": "query",
            "required": false,
            "description": "UUID of a voided statement",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "agent",
            "in": "query",
            "required": false,
            "description": "JSON-encoded agent (mbox, account…)",
            "schema": {
              "type": "string"
            },
            "example": "{\"mbox\":\"mailto:jean.dupont@client.fr\"}"
          },
          {
            "name": "verb",
            "in": "query",
            "required": false,
            "description": "Verb IRI",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "activity",
            "in": "query",
            "required": false,
            "description": "Activity IRI",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "registration",
            "in": "query",
            "required": false,
            "description": "Registration UUID",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "related_activities",
            "in": "query",
            "required": false,
            "description": "Extend the activity search to context and sub-statements",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "related_agents",
            "in": "query",
            "required": false,
            "description": "Extend the agent search",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "description": "ISO 8601 date (exclusive)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "until",
            "in": "query",
            "required": false,
            "description": "ISO 8601 date (inclusive)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of results (default 100, maximum 1,000)",
            "schema": {
              "type": "integer",
              "default": 100,
              "maximum": 1000
            }
          },
          {
            "name": "ascending",
            "in": "query",
            "required": false,
            "description": "Chronological order",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "description": "ids, exact or canonical (labels reduced according to Accept-Language)",
            "schema": {
              "type": "string",
              "enum": [
                "ids",
                "exact",
                "canonical"
              ],
              "default": "exact"
            }
          },
          {
            "name": "attachments",
            "in": "query",
            "required": false,
            "description": "true = multipart/mixed response including attachments",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "id_parcours",
            "in": "query",
            "required": false,
            "description": "DGTLMS extension: filter by course",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "id_session",
            "in": "query",
            "required": false,
            "description": "DGTLMS extension: filter by session",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "id_membre",
            "in": "query",
            "required": false,
            "description": "DGTLMS extension: filter by user",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/XapiStatementResult"
                    },
                    {
                      "$ref": "#/components/schemas/XapiStatement"
                    }
                  ]
                },
                "example": {
                  "statements": [],
                  "more": ""
                }
              }
            },
            "headers": {
              "X-Experience-API-Consistent-Through": {
                "description": "Timestamp up to which the LRS is consistent",
                "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": "State: write",
        "description": "Context: activityId + agent [+ registration] + stateId.",
        "parameters": [
          {
            "name": "X-Experience-API-Version",
            "in": "header",
            "required": true,
            "description": "xAPI version, required: 1.0.3",
            "schema": {
              "type": "string"
            },
            "example": "1.0.3"
          },
          {
            "name": "activityId",
            "in": "query",
            "required": true,
            "description": "Activity IRI",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "agent",
            "in": "query",
            "required": true,
            "description": "JSON-encoded agent",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "registration",
            "in": "query",
            "required": false,
            "description": "Registration UUID",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "stateId",
            "in": "query",
            "required": true,
            "description": "Document identifier",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": false,
            "description": "Expected ETag (concurrent write)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "If-None-Match",
            "in": "header",
            "required": false,
            "description": "* = write only if the document does not exist",
            "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": "Stored"
          },
          "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": "State: merge (JSON)",
        "description": "Context: activityId + agent [+ registration] + stateId.",
        "parameters": [
          {
            "name": "X-Experience-API-Version",
            "in": "header",
            "required": true,
            "description": "xAPI version, required: 1.0.3",
            "schema": {
              "type": "string"
            },
            "example": "1.0.3"
          },
          {
            "name": "activityId",
            "in": "query",
            "required": true,
            "description": "Activity IRI",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "agent",
            "in": "query",
            "required": true,
            "description": "JSON-encoded agent",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "registration",
            "in": "query",
            "required": false,
            "description": "Registration UUID",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "stateId",
            "in": "query",
            "required": true,
            "description": "Document identifier",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": false,
            "description": "Expected ETag (concurrent write)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "If-None-Match",
            "in": "header",
            "required": false,
            "description": "* = write only if the document does not exist",
            "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": "Merged"
          },
          "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": "State: read",
        "description": "Context: activityId + agent [+ registration] + stateId. Without an identifier: list of document identifiers (can be filtered by since).",
        "parameters": [
          {
            "name": "X-Experience-API-Version",
            "in": "header",
            "required": true,
            "description": "xAPI version, required: 1.0.3",
            "schema": {
              "type": "string"
            },
            "example": "1.0.3"
          },
          {
            "name": "activityId",
            "in": "query",
            "required": true,
            "description": "Activity IRI",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "agent",
            "in": "query",
            "required": true,
            "description": "JSON-encoded agent",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "registration",
            "in": "query",
            "required": false,
            "description": "Registration UUID",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "stateId",
            "in": "query",
            "required": false,
            "description": "Document identifier",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "description": "ISO 8601 date (list)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Document, or array of identifiers",
            "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": "State: delete",
        "description": "Context: activityId + agent [+ registration] + stateId. Without stateId: deletes every state in the context.",
        "parameters": [
          {
            "name": "X-Experience-API-Version",
            "in": "header",
            "required": true,
            "description": "xAPI version, required: 1.0.3",
            "schema": {
              "type": "string"
            },
            "example": "1.0.3"
          },
          {
            "name": "activityId",
            "in": "query",
            "required": true,
            "description": "Activity IRI",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "agent",
            "in": "query",
            "required": true,
            "description": "JSON-encoded agent",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "registration",
            "in": "query",
            "required": false,
            "description": "Registration UUID",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "stateId",
            "in": "query",
            "required": false,
            "description": "Document identifier",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": false,
            "description": "Expected ETag (concurrent write)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "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": "Activity profile: write",
        "description": "Context: activityId + profileId.",
        "parameters": [
          {
            "name": "X-Experience-API-Version",
            "in": "header",
            "required": true,
            "description": "xAPI version, required: 1.0.3",
            "schema": {
              "type": "string"
            },
            "example": "1.0.3"
          },
          {
            "name": "activityId",
            "in": "query",
            "required": true,
            "description": "Activity IRI",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profileId",
            "in": "query",
            "required": true,
            "description": "Document identifier",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": false,
            "description": "Expected ETag (concurrent write)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "If-None-Match",
            "in": "header",
            "required": false,
            "description": "* = write only if the document does not exist",
            "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": "Stored"
          },
          "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": "Activity profile: merge (JSON)",
        "description": "Context: activityId + profileId.",
        "parameters": [
          {
            "name": "X-Experience-API-Version",
            "in": "header",
            "required": true,
            "description": "xAPI version, required: 1.0.3",
            "schema": {
              "type": "string"
            },
            "example": "1.0.3"
          },
          {
            "name": "activityId",
            "in": "query",
            "required": true,
            "description": "Activity IRI",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profileId",
            "in": "query",
            "required": true,
            "description": "Document identifier",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": false,
            "description": "Expected ETag (concurrent write)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "If-None-Match",
            "in": "header",
            "required": false,
            "description": "* = write only if the document does not exist",
            "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": "Merged"
          },
          "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": "Activity profile: read",
        "description": "Context: activityId + profileId. Without an identifier: list of document identifiers (can be filtered by since).",
        "parameters": [
          {
            "name": "X-Experience-API-Version",
            "in": "header",
            "required": true,
            "description": "xAPI version, required: 1.0.3",
            "schema": {
              "type": "string"
            },
            "example": "1.0.3"
          },
          {
            "name": "activityId",
            "in": "query",
            "required": true,
            "description": "Activity IRI",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profileId",
            "in": "query",
            "required": false,
            "description": "Document identifier",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "description": "ISO 8601 date (list)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Document, or array of identifiers",
            "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": "Activity profile: delete",
        "description": "Context: activityId + profileId.",
        "parameters": [
          {
            "name": "X-Experience-API-Version",
            "in": "header",
            "required": true,
            "description": "xAPI version, required: 1.0.3",
            "schema": {
              "type": "string"
            },
            "example": "1.0.3"
          },
          {
            "name": "activityId",
            "in": "query",
            "required": true,
            "description": "Activity IRI",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profileId",
            "in": "query",
            "required": false,
            "description": "Document identifier",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": false,
            "description": "Expected ETag (concurrent write)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "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": "Agent profile: write",
        "description": "Context: agent + profileId.",
        "parameters": [
          {
            "name": "X-Experience-API-Version",
            "in": "header",
            "required": true,
            "description": "xAPI version, required: 1.0.3",
            "schema": {
              "type": "string"
            },
            "example": "1.0.3"
          },
          {
            "name": "agent",
            "in": "query",
            "required": true,
            "description": "JSON-encoded agent",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profileId",
            "in": "query",
            "required": true,
            "description": "Document identifier",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": false,
            "description": "Expected ETag (concurrent write)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "If-None-Match",
            "in": "header",
            "required": false,
            "description": "* = write only if the document does not exist",
            "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": "Stored"
          },
          "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": "Agent profile: merge (JSON)",
        "description": "Context: agent + profileId.",
        "parameters": [
          {
            "name": "X-Experience-API-Version",
            "in": "header",
            "required": true,
            "description": "xAPI version, required: 1.0.3",
            "schema": {
              "type": "string"
            },
            "example": "1.0.3"
          },
          {
            "name": "agent",
            "in": "query",
            "required": true,
            "description": "JSON-encoded agent",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profileId",
            "in": "query",
            "required": true,
            "description": "Document identifier",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": false,
            "description": "Expected ETag (concurrent write)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "If-None-Match",
            "in": "header",
            "required": false,
            "description": "* = write only if the document does not exist",
            "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": "Merged"
          },
          "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": "Agent profile: read",
        "description": "Context: agent + profileId. Without an identifier: list of document identifiers (can be filtered by since).",
        "parameters": [
          {
            "name": "X-Experience-API-Version",
            "in": "header",
            "required": true,
            "description": "xAPI version, required: 1.0.3",
            "schema": {
              "type": "string"
            },
            "example": "1.0.3"
          },
          {
            "name": "agent",
            "in": "query",
            "required": true,
            "description": "JSON-encoded agent",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profileId",
            "in": "query",
            "required": false,
            "description": "Document identifier",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "description": "ISO 8601 date (list)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Document, or array of identifiers",
            "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": "Agent profile: delete",
        "description": "Context: agent + profileId.",
        "parameters": [
          {
            "name": "X-Experience-API-Version",
            "in": "header",
            "required": true,
            "description": "xAPI version, required: 1.0.3",
            "schema": {
              "type": "string"
            },
            "example": "1.0.3"
          },
          {
            "name": "agent",
            "in": "query",
            "required": true,
            "description": "JSON-encoded agent",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profileId",
            "in": "query",
            "required": false,
            "description": "Document identifier",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": false,
            "description": "Expected ETag (concurrent write)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "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": "Canonical Activity object",
        "parameters": [
          {
            "name": "X-Experience-API-Version",
            "in": "header",
            "required": true,
            "description": "xAPI version, required: 1.0.3",
            "schema": {
              "type": "string"
            },
            "example": "1.0.3"
          },
          {
            "name": "activityId",
            "in": "query",
            "required": true,
            "description": "Activity IRI",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "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": "Person object of an agent",
        "parameters": [
          {
            "name": "X-Experience-API-Version",
            "in": "header",
            "required": true,
            "description": "xAPI version, required: 1.0.3",
            "schema": {
              "type": "string"
            },
            "example": "1.0.3"
          },
          {
            "name": "agent",
            "in": "query",
            "required": true,
            "description": "JSON-encoded agent (with an identifier: mbox, account…)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "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": "Service document",
        "description": "Lists the available tables (EntitySets).",
        "responses": {
          "200": {
            "description": "Success",
            "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": "EDMX schema",
        "description": "Column types: this is what keeps the schema stable in Power BI.",
        "responses": {
          "200": {
            "description": "EDMX document (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": "Table data",
        "description": "Server-driven paging (5,000 rows per page at most, continued in `@odata.nextLink`). `$filter` accepts `column op value [and …]` with op among eq, ne, gt, ge, lt, le; `or`, functions and unknown columns return 400. Dates are Edm.DateTimeOffset, which enables incremental refresh. The feed is not scoped by site: it exposes all of the platform's data.",
        "parameters": [
          {
            "name": "entitySet",
            "in": "path",
            "required": true,
            "description": "Table name",
            "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": "Number of rows (5,000 at most)",
            "schema": {
              "type": "integer",
              "maximum": 5000
            }
          },
          {
            "name": "$skip",
            "in": "query",
            "required": false,
            "description": "Rows to skip",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "$count",
            "in": "query",
            "required": false,
            "description": "true = add @odata.count",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "$select",
            "in": "query",
            "required": false,
            "description": "Comma-separated columns",
            "schema": {
              "type": "string"
            },
            "example": "id_membre,id_parcours,score_raw"
          },
          {
            "name": "$orderby",
            "in": "query",
            "required": false,
            "description": "Sort: column [asc|desc]",
            "schema": {
              "type": "string"
            },
            "example": "date_evenement desc"
          },
          {
            "name": "$filter",
            "in": "query",
            "required": false,
            "description": "Filter (safe subset)",
            "schema": {
              "type": "string"
            },
            "example": "date_evenement ge 2026-01-01T00:00:00Z and date_evenement lt 2026-02-01T00:00:00Z"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "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": "Test the connection",
        "responses": {
          "200": {
            "description": "Success",
            "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": "Courses available for sale",
        "responses": {
          "200": {
            "description": "Success",
            "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": "Active sessions containing a course",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Course identifier",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "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": "Create or update a session declared in WordPress",
        "description": "The same reference always identifies the same session. Only the site that created it can change it; the course is locked once someone has enrolled.",
        "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": "Resource created",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/WpSession"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "created": {
                          "type": "boolean"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "200": {
            "description": "Session updated",
            "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": "Find or create a learner",
        "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": "Resource created",
            "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": "Existing learner"
          },
          "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": "Enrol a learner",
        "description": "Send `session_id` OR `training_id`. Idempotent per `reference` (e.g. wc-<order>-<line>): replaying the call returns 200 with no duplicate. The learner is created if they do not exist.",
        "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": "Resource created",
            "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": "Call already processed (replayed)",
            "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": "Cancel an enrolment",
        "description": "Order cancelled or refunded. The learner is only removed if the enrolment came from this purchase.",
        "parameters": [
          {
            "name": "reference",
            "in": "path",
            "required": true,
            "description": "Enrolment reference (URL-encoded)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "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": "Progress of several learners",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "emails": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "email"
                    },
                    "description": "200 addresses at most"
                  }
                },
                "required": [
                  "emails"
                ]
              },
              "example": {
                "emails": [
                  "jean.dupont@client.fr"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "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": "Get a single sign-on URL",
        "description": "URL valid for 5 minutes, for learner accounts only. Targets: home, courses, session, training and attestation (the last three require `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": "Success",
            "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": "Health check",
        "description": "Public.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Health"
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/dendreo/trainings": {
      "get": {
        "tags": [
          "Dendreo"
        ],
        "operationId": "dendreoTrainings",
        "summary": "Course and session catalogue",
        "description": "Used by Dendreo. Only published courses are listed.",
        "responses": {
          "200": {
            "description": "Success",
            "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": "user.created webhook",
        "description": "Creates the learner (or returns the existing one). Dendreo envelope or plain object.\n\nSigned webhook: `Signature` header = hex HMAC-SHA256 of the raw body.",
        "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": "Success",
            "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": "session.created / .updated / .deleted webhook",
        "description": "Create: training_id, name, start_date, end_date and external_id required. Update and delete: session_id required.\n\nSigned webhook: `Signature` header = hex HMAC-SHA256 of the raw body.",
        "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": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "session_id": {
                      "type": "string"
                    },
                    "deleted": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "session_id": "87"
                }
              }
            }
          },
          "404": {
            "description": "Resource or route not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FieldErrors"
                },
                "example": [
                  {
                    "error.field": "training_id",
                    "error.reason": "Training inconnu"
                  }
                ]
              }
            }
          },
          "409": {
            "description": "Conflict with the existing state",
            "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": "enrolment.created / .updated / .deleted webhook",
        "description": "training_id: parcours_<id> (direct enrolment) or session_<id> (through a session). An unpublished course is rejected (409).\n\nSigned webhook: `Signature` header = hex HMAC-SHA256 of the raw body.",
        "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": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "enrolment_id": {
                      "type": "string"
                    },
                    "deleted": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "enrolment_id": "5120"
                }
              }
            }
          },
          "404": {
            "description": "Resource or route not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FieldErrors"
                },
                "example": [
                  {
                    "error.field": "training_id",
                    "error.reason": "Training inconnu"
                  }
                ]
              }
            }
          },
          "409": {
            "description": "Conflict with the existing state",
            "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": "A learner's enrolments",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "DGTLMS learner identifier",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "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": "Push progress to Dendreo",
        "description": "Updates local progress, then sends it to Dendreo. Normally the platform does this by itself on every step forward, with automatic catch-up if Dendreo is unreachable.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "enrolment_id": {
                    "type": "integer"
                  },
                  "progression": {
                    "type": "number",
                    "description": "Progress (%)"
                  },
                  "score": {
                    "type": "integer"
                  },
                  "started_at": {
                    "type": "string"
                  },
                  "completed_at": {
                    "type": "string"
                  },
                  "last_access_at": {
                    "type": "string"
                  },
                  "time_spent": {
                    "type": "integer",
                    "description": "Seconds"
                  }
                },
                "required": [
                  "enrolment_id",
                  "progression"
                ]
              },
              "example": {
                "enrolment_id": 5120,
                "progression": 100,
                "score": 85,
                "time_spent": 1240
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "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": "One-click sign-in from the Dendreo extranet",
        "description": "JWT signed by Dendreo (5 minutes at most). A browser is redirected (302) to the platform; an API client receives the redirect URL.",
        "parameters": [
          {
            "name": "jwt",
            "in": "query",
            "required": true,
            "description": "JWT (alias: token)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "return_to",
            "in": "query",
            "required": false,
            "description": "Return page on the platform",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "dendreo_return_to",
            "in": "query",
            "required": false,
            "description": "Return page on Dendreo",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "user_id": {
                      "type": "integer"
                    },
                    "redirect_url": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "302": {
            "description": "Redirect to the platform (browser)"
          },
          "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": "Health check",
        "description": "Public.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Health"
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/ypareo/trainings": {
      "get": {
        "tags": [
          "Ypareo"
        ],
        "operationId": "ypareoTrainings",
        "summary": "Course and session catalogue",
        "responses": {
          "200": {
            "description": "Success",
            "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": "Create or update a learner",
        "description": "nom (surname) and prenom (first name) are required, plus email or login. Accepts a plain object or one wrapped in `data`. Returns 201 on creation, 200 if the learner already existed.",
        "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": "Ypareo learner code"
                  },
                  "uuidNetUtilisateur": {
                    "type": "string"
                  }
                },
                "required": [
                  "nom",
                  "prenom"
                ]
              },
              "example": {
                "nom": "Dupont",
                "prenom": "Jean",
                "email": "jean.dupont@cfa.fr",
                "codeApprenant": 1234,
                "uuidNetUtilisateur": "abc-…"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Resource created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "user_id": {
                      "type": "string"
                    },
                    "created": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "user_id": "4287",
                  "created": true
                }
              }
            }
          },
          "200": {
            "description": "Existing learner updated",
            "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": "Enrol or unenrol",
        "description": "Events enrolment.created / .updated (user_id, training_id, start_date, end_date required) and enrolment.deleted (enrolment_id required).",
        "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": "Resource created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "enrolment_id": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "enrolment_id": "6021"
                }
              }
            }
          },
          "200": {
            "description": "Enrolment updated or deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "enrolment_id": {
                      "type": "string"
                    },
                    "deleted": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Resource or route not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FieldErrors"
                },
                "example": [
                  {
                    "error.field": "training_id",
                    "error.reason": "Training inconnu"
                  }
                ]
              }
            }
          },
          "409": {
            "description": "Conflict with the existing state",
            "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": "A learner's enrolments",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "DGTLMS learner identifier",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "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": "Single sign-on from Ypareo",
        "description": "At the platform root (outside /api/ypareo/). The token is checked with the Ypareo API, then the browser is redirected; on failure, back to the sign-in page.",
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "description": "Ypareo SSO token",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "302": {
            "description": "Redirect (signed in, or sign-in page)"
          }
        },
        "security": []
      }
    },
    "/api/cegid/health": {
      "get": {
        "tags": [
          "CEGID HR"
        ],
        "operationId": "cegidHealth",
        "summary": "Connector health check",
        "description": "Public. Database status, Cegid OAuth2 token, last sync and counters.",
        "responses": {
          "200": {
            "description": "Success",
            "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": "Platform API key, supplied by DGT Concept when the platform is set up. Used by REST API v1, the Wrapper Dispatcher, Ypareo and the Dendreo read routes."
      },
      "WebserviceBasic": {
        "type": "http",
        "scheme": "basic",
        "description": "Alternative to X-API-Key for REST API v1: the web services username and password (platform settings), sent as HTTP Basic."
      },
      "MobileJWT": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "JWT access token obtained from POST /api/mobile/auth/login (valid for 1 hour)."
      },
      "XapiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "xAPI key (read, write or both), scoped to a site."
      },
      "XapiBasic": {
        "type": "http",
        "scheme": "basic",
        "description": "Standard xAPI authentication: Basic base64(\"<key>:\") — the xAPI key as username, empty password."
      },
      "BiKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "Read-only BI key, separate from the write API key."
      },
      "BiKeyQuery": {
        "type": "apiKey",
        "in": "query",
        "name": "apikey",
        "description": "BI key passed in the URL: required by the Power BI \"OData feed\" connector in Anonymous mode. HTTPS is mandatory."
      },
      "WordPressKey": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "dgtwp_…",
        "description": "WordPress site key (dgtwp_ prefix), created in Administration > Connectors; one key per site, revocable."
      },
      "WordPressKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "The same WordPress key, sent in X-API-Key."
      },
      "DendreoAuthKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Auth-API-Key",
        "description": "Alternative header name accepted for the API key (the name Dendreo uses)."
      },
      "DendreoTenant": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Tenant",
        "description": "Dendreo tenant identifier, sent together with the API key."
      },
      "DendreoSignature": {
        "type": "apiKey",
        "in": "header",
        "name": "Signature",
        "description": "HMAC-SHA256 signature (hex) of the raw body, using the shared webhook secret. Required on incoming webhooks."
      }
    },
    "schemas": {
      "ErrorV1": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": "Error message"
          }
        },
        "required": [
          "error"
        ],
        "description": "Error returned by REST API v1, the Wrapper Dispatcher and the WordPress connector"
      },
      "ErrorStandard": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": "HTTP status label"
          },
          "message": {
            "type": "string",
            "description": "Details"
          }
        },
        "required": [
          "error",
          "message"
        ],
        "description": "Error returned by the xAPI, Dendreo, Ypareo and Cegid APIs"
      },
      "ErrorMobile": {
        "type": "object",
        "properties": {
          "ok": {
            "const": false,
            "type": "boolean"
          },
          "reason": {
            "type": "string",
            "description": "Machine-readable code (no_token, invalid_token, invalid_credentials, bad_input, forbidden, not_found…)"
          },
          "message": {
            "type": "string",
            "description": "Human-readable message"
          }
        },
        "required": [
          "ok",
          "reason",
          "message"
        ]
      },
      "ErrorOData": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "message"
            ]
          }
        },
        "required": [
          "error"
        ],
        "description": "Error in OData format"
      },
      "FieldErrors": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "error.field": {
              "type": "string",
              "description": "Field concerned"
            },
            "error.reason": {
              "type": "string",
              "description": "Reason"
            }
          }
        },
        "description": "Dendreo / Ypareo business validation error (array)"
      },
      "Health": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "example": "ok"
          }
        },
        "description": "Health check (fields vary by API)",
        "additionalProperties": true
      },
      "User": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Identifier"
          },
          "login": {
            "type": "string"
          },
          "firstname": {
            "type": "string"
          },
          "lastname": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "level_id": {
            "type": "integer",
            "description": "Level (1 super administrator, 2 administrator, 3 trainer, 4 learner, or a custom level)"
          },
          "custom_level_id": {
            "type": "integer",
            "description": "Custom level, if any"
          },
          "active": {
            "type": "boolean"
          },
          "service": {
            "type": "string",
            "description": "Department"
          },
          "start_date": {
            "type": "string",
            "description": "Date in dd/mm/yyyy format"
          },
          "end_date": {
            "type": "string",
            "description": "Date in dd/mm/yyyy format"
          },
          "lang": {
            "type": "string",
            "description": "Language code (fr, uk…)"
          },
          "auth_method": {
            "type": "string",
            "description": "Authentication method"
          },
          "custom_fields": {
            "type": "object",
            "properties": {},
            "description": "Custom fields field1 to field20 (only fields that have a value)",
            "additionalProperties": {
              "type": "string"
            }
          }
        },
        "description": "User. Empty fields are omitted."
      },
      "UserInput": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "0 or omitted = create; existing identifier = update",
            "default": 0
          },
          "login": {
            "type": "string"
          },
          "password": {
            "type": "string",
            "description": "Password (alias: pass)",
            "format": "password"
          },
          "firstname": {
            "type": "string"
          },
          "lastname": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "start_date": {
            "type": "string",
            "description": "Access start: Unix timestamp or empty",
            "pattern": "^[0-9]*$"
          },
          "end_date": {
            "type": "string",
            "description": "Access end: Unix timestamp or empty",
            "pattern": "^[0-9]*$"
          },
          "level_id": {
            "type": "integer",
            "description": "User level"
          },
          "service": {
            "type": "string"
          },
          "active": {
            "type": "string",
            "enum": [
              "true",
              "false"
            ],
            "default": "true"
          },
          "style": {
            "type": "string",
            "description": "Theme"
          },
          "lang": {
            "type": "string"
          },
          "sendmail": {
            "type": "integer",
            "description": "1 = email the login details",
            "enum": [
              0,
              1
            ],
            "default": 0
          },
          "mailsender": {
            "type": "string",
            "description": "Email sender"
          },
          "auth_method": {
            "type": "string"
          },
          "field1": {
            "type": "string",
            "description": "Custom fields field1 to field20 (aliases f1 to f20)"
          }
        },
        "required": [
          "login",
          "level_id"
        ]
      },
      "Session": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "start_date": {
            "type": "string",
            "description": "Date in dd/mm/yyyy format"
          },
          "end_date": {
            "type": "string",
            "description": "Date in dd/mm/yyyy format"
          },
          "active": {
            "type": "boolean"
          },
          "locked": {
            "type": "boolean"
          },
          "blocked": {
            "type": "boolean",
            "description": "Dates enforced"
          },
          "is_default": {
            "type": "boolean",
            "description": "Default session"
          },
          "default_page": {
            "type": "string",
            "description": "Landing tab"
          }
        },
        "description": "Session. Empty fields are omitted."
      },
      "SessionInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "start_date": {
            "type": "string",
            "description": "Unix timestamp or empty",
            "pattern": "^[0-9]*$"
          },
          "end_date": {
            "type": "string",
            "description": "Unix timestamp or empty",
            "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": "Enforce dates",
            "enum": [
              "true",
              "false"
            ],
            "default": "false"
          },
          "reception_text": {
            "type": "string",
            "description": "Welcome text"
          },
          "default_page": {
            "type": "string",
            "description": "Landing tab"
          },
          "field1": {
            "type": "string",
            "description": "Custom fields field1 to 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": "Number of activities"
          },
          "valid": {
            "type": "string"
          },
          "locked": {
            "type": "boolean"
          },
          "keywords": {
            "type": "string"
          },
          "themes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Theme"
            }
          },
          "duration": {
            "type": "string",
            "description": "Typical learning time"
          },
          "thumbnail": {
            "type": "string",
            "description": "Thumbnail URL"
          }
        },
        "description": "Course. Empty fields are omitted."
      },
      "ScoResult": {
        "type": "object",
        "properties": {
          "user_id": {
            "type": "integer"
          },
          "trainingpath_id": {
            "type": "integer"
          },
          "sco_id": {
            "type": "integer"
          },
          "nb": {
            "type": "integer",
            "description": "Number of attempts"
          },
          "date": {
            "type": "string",
            "description": "First attempt (dd/mm/yyyy hh:mm)"
          },
          "date_last_update": {
            "type": "string",
            "description": "Last visit (dd/mm/yyyy hh:mm)"
          },
          "lesson_status": {
            "type": "string"
          },
          "spent_time": {
            "type": "integer",
            "description": "Time spent (seconds)"
          },
          "score": {
            "type": "number"
          },
          "progression": {
            "type": "number"
          },
          "unique_sco_id": {
            "type": "string"
          }
        },
        "description": "A user's result for an activity"
      },
      "CourseResult": {
        "type": "object",
        "properties": {
          "id_membre": {
            "type": "integer"
          },
          "id_parcours": {
            "type": "integer"
          },
          "nb": {
            "type": "integer"
          },
          "date": {
            "type": "integer",
            "description": "Unix timestamp (seconds)"
          },
          "date_dernier_passage": {
            "type": "integer",
            "description": "Unix timestamp (seconds)"
          },
          "lesson_status": {
            "type": "string"
          },
          "termine": {
            "type": "integer",
            "description": "1 = course completed"
          },
          "nb_valid_ua": {
            "type": "integer",
            "description": "Activities passed"
          },
          "temps_passe": {
            "type": "integer",
            "description": "Time spent (seconds)"
          },
          "score": {
            "type": "number"
          },
          "progression": {
            "type": "integer",
            "description": "Progress (%)"
          }
        },
        "description": "A user's best result for a course",
        "additionalProperties": true
      },
      "ResultInput": {
        "type": "object",
        "properties": {
          "training_id": {
            "type": "integer",
            "description": "Course"
          },
          "sco_id": {
            "type": "integer",
            "description": "Activity (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": "Time spent in seconds (optional)"
          }
        },
        "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": "Course distributed"
          },
          "parcours_titre": {
            "type": "string"
          },
          "access_token": {
            "type": "string",
            "description": "Global wrapper access token"
          },
          "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": "Omitted = create; present = update"
          },
          "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": "Allowed domain (partner LMS)"
          },
          "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": "Seat quota (0 = unlimited)"
          },
          "seat_inactivity_days": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Recycling of inactive seats (days); null = global setting, 0 = never"
          },
          "is_active": {
            "type": "boolean"
          },
          "current_users": {
            "type": "integer"
          },
          "total_users_ever": {
            "type": "integer"
          },
          "nb_wrappers": {
            "type": "integer"
          },
          "created_at": {
            "type": "string"
          }
        },
        "description": "Tier: partner or client receiving the content"
      },
      "TierInput": {
        "type": "object",
        "properties": {
          "tier_id": {
            "type": "integer",
            "description": "Omitted = create"
          },
          "tier_name": {
            "type": "string"
          },
          "origins": {
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "type": "string"
                },
                {
                  "$ref": "#/components/schemas/TierOrigin"
                }
              ]
            },
            "description": "Allowed domains: plain URL or dated object"
          },
          "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": "Validity (seconds)",
            "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 generated by the app: makes the call idempotent",
            "format": "uuid"
          },
          "scorm_writes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id_tracking": {
                  "type": "integer"
                },
                "champ": {
                  "type": "string",
                  "description": "CMI element"
                },
                "valeur": {
                  "type": "string"
                },
                "client_seq": {
                  "type": "integer"
                }
              }
            },
            "description": "5,000 at most"
          },
          "xapi_statements": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "1,000 at most; the actor is replaced by the authenticated learner"
          },
          "finalize": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id_tracking": {
                  "type": "integer"
                }
              }
            },
            "description": "200 at most"
          }
        },
        "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": "xAPI 1.0.3 statement (see the ADL specification)",
        "additionalProperties": true
      },
      "XapiStatementResult": {
        "type": "object",
        "properties": {
          "statements": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/XapiStatement"
            }
          },
          "more": {
            "type": "string",
            "description": "URL of the next page (empty at the end)"
          }
        },
        "required": [
          "statements",
          "more"
        ]
      },
      "ODataCollection": {
        "type": "object",
        "properties": {
          "@odata.context": {
            "type": "string"
          },
          "@odata.count": {
            "type": "integer",
            "description": "Present with $count=true"
          },
          "value": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "@odata.nextLink": {
            "type": "string",
            "description": "Next page (5,000 rows per page at most)"
          }
        },
        "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": "Number enrolled"
          }
        },
        "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": "The learner was already enrolled before this purchase"
          },
          "replayed": {
            "type": "boolean",
            "description": "Call already received for this reference"
          },
          "learner_id": {
            "type": "integer"
          },
          "learner_created": {
            "type": "boolean"
          }
        }
      },
      "WpFollowUp": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "title": {
            "type": "string"
          },
          "progress": {
            "type": "integer",
            "description": "Progress (%)"
          },
          "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> (direct course enrolment) or session_<id> (enrolment through a 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": "Unix timestamp (seconds)"
          },
          "tenant_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "additionalProperties": true
          }
        },
        "required": [
          "event",
          "data"
        ],
        "description": "Standard Dendreo webhook envelope"
      }
    },
    "responses": {
      "V1401": {
        "description": "Authentication missing or rejected",
        "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": "Invalid request (missing field, malformed JSON or parameter)",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorV1"
            },
            "example": {
              "error": "Champ requis manquant : login"
            }
          }
        }
      },
      "V1404": {
        "description": "Resource or route not found",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorV1"
            },
            "example": {
              "error": "Utilisateur #4287 introuvable"
            }
          }
        }
      },
      "V1422": {
        "description": "Valid data, but the operation is not possible (business rule)",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorV1"
            },
            "example": {
              "error": "Inscription impossible"
            }
          }
        }
      },
      "V1500": {
        "description": "Internal server error",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorV1"
            },
            "example": {
              "error": "Génération SCORM échouée"
            }
          }
        }
      },
      "Mobile503": {
        "description": "Service disabled on this platform",
        "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": "Invalid request (missing field, malformed JSON or parameter)",
        "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": "Authentication missing or rejected",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorMobile"
            },
            "example": {
              "ok": false,
              "reason": "invalid_token",
              "message": "Token invalide ou expiré."
            }
          }
        }
      },
      "Mobile403": {
        "description": "Access forbidden",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorMobile"
            },
            "example": {
              "ok": false,
              "reason": "forbidden",
              "message": "Vous n'êtes pas inscrit à ce parcours."
            }
          }
        }
      },
      "Mobile404": {
        "description": "Resource or route not found",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorMobile"
            },
            "example": {
              "ok": false,
              "reason": "not_found",
              "message": "Parcours introuvable."
            }
          }
        }
      },
      "Mobile405": {
        "description": "Method not supported",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorMobile"
            },
            "example": {
              "ok": false,
              "reason": "method",
              "message": "Méthode non supportée."
            }
          }
        }
      },
      "Mobile500": {
        "description": "Internal server error",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorMobile"
            },
            "example": {
              "ok": false,
              "reason": "package_error",
              "message": "Generation du package impossible."
            }
          }
        }
      },
      "Mobile409": {
        "description": "Conflict with the existing state",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorMobile"
            },
            "example": {
              "ok": false,
              "reason": "idempotency_conflict",
              "message": "Payload divergent pour le meme client_uuid."
            }
          }
        }
      },
      "Mobile413": {
        "description": "Request body too large",
        "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": "Invalid request (missing field, malformed JSON or parameter)",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorStandard"
            },
            "example": {
              "error": "Bad Request",
              "message": "Missing field: training_id"
            }
          }
        }
      },
      "Std401": {
        "description": "Authentication missing or rejected",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorStandard"
            },
            "example": {
              "error": "Unauthorized",
              "message": "Invalid or missing API key"
            }
          }
        }
      },
      "Std403": {
        "description": "Access forbidden",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorStandard"
            },
            "example": {
              "error": "Forbidden",
              "message": "Statement appartient à un autre tenant"
            }
          }
        }
      },
      "Std409": {
        "description": "Conflict with the existing state",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorStandard"
            },
            "example": {
              "error": "Conflict",
              "message": "Un statement avec cet id existe déjà"
            }
          }
        }
      },
      "Std404": {
        "description": "Resource or route not found",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorStandard"
            },
            "example": {
              "error": "Not Found",
              "message": "Endpoint not found"
            }
          }
        }
      },
      "Std412": {
        "description": "Precondition failed (ETag)",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorStandard"
            },
            "example": {
              "error": "Precondition Failed",
              "message": "ETag ne correspondant pas"
            }
          }
        }
      },
      "OData401": {
        "description": "Authentication missing or rejected",
        "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 disabled on this platform",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorOData"
            },
            "example": {
              "error": {
                "code": "bi_disabled",
                "message": "Le flux BI est désactivé."
              }
            }
          }
        }
      },
      "OData400": {
        "description": "Invalid request (missing field, malformed JSON or parameter)",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorOData"
            },
            "example": {
              "error": {
                "code": "filter_parse",
                "message": "Clause $filter non interprétable : titre contains 'x'"
              }
            }
          }
        }
      },
      "OData404": {
        "description": "Resource or route not found",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorOData"
            },
            "example": {
              "error": {
                "code": "not_found",
                "message": "EntitySet inconnu"
              }
            }
          }
        }
      },
      "WP401": {
        "description": "Authentication missing or rejected",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorV1"
            },
            "example": {
              "error": "Clé absente, inconnue ou révoquée."
            }
          }
        }
      },
      "WP403": {
        "description": "Access forbidden",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorV1"
            },
            "example": {
              "error": "Module Intégrations & Connecteurs non souscrit."
            }
          }
        }
      },
      "WP503": {
        "description": "Service disabled on this platform",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorV1"
            },
            "example": {
              "error": "Connecteur WordPress désactivé."
            }
          }
        }
      },
      "WP404": {
        "description": "Resource or route not found",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorV1"
            },
            "example": {
              "error": "Parcours inconnu ou non proposable."
            }
          }
        }
      },
      "WP400": {
        "description": "Invalid request (missing field, malformed JSON or parameter)",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorV1"
            },
            "example": {
              "error": "Indiquer session_id OU training_id."
            }
          }
        }
      },
      "WP409": {
        "description": "Conflict with the existing state",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorV1"
            },
            "example": {
              "error": "Conflit"
            }
          }
        }
      },
      "WP422": {
        "description": "Valid data, but the operation is not possible (business rule)",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorV1"
            },
            "example": {
              "error": "Inscription impossible"
            }
          }
        }
      },
      "Std500": {
        "description": "Internal server error",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorStandard"
            },
            "example": {
              "error": "Server Error",
              "message": "Server Error"
            }
          }
        }
      }
    }
  }
}
