{
    "openapi": "3.0.0",
    "info": {
        "title": "Ulams",
        "version": "0.0.1"
    },
    "paths": {
        "/api/contact": {
            "post": {
                "tags": [
                    "Contact"
                ],
                "summary": "Send a message to the ULAMS team",
                "operationId": "contact.create",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "name",
                                    "email",
                                    "subject",
                                    "message"
                                ],
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "maxLength": 120
                                    },
                                    "email": {
                                        "type": "string",
                                        "format": "email",
                                        "maxLength": 254
                                    },
                                    "subject": {
                                        "type": "string",
                                        "maxLength": 160
                                    },
                                    "message": {
                                        "type": "string",
                                        "maxLength": 6000
                                    },
                                    "website": {
                                        "description": "Spam honeypot; leave empty",
                                        "type": "string"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "202": {
                        "description": "Message delivered to the private contact inbox",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiJson"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Input validation failed"
                    },
                    "429": {
                        "description": "Rate limit exceeded"
                    },
                    "503": {
                        "description": "Message delivery is temporarily unavailable"
                    }
                }
            }
        },
        "/api/events": {
            "get": {
                "tags": [
                    "Events"
                ],
                "summary": "Get a listing of the Stationary events and Webinars",
                "description": "Get all Stationary Events and Webinars",
                "operationId": "events.get",
                "parameters": [
                    {
                        "name": "order_by",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "next",
                                "past"
                            ]
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Pagination Page Number",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "default": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Pagination Per Page",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "default": 15
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/admin/adapt": {
            "get": {
                "tags": [
                    "Admin Adapt"
                ],
                "summary": "List Adapt JSON sources",
                "description": "Adapt Path B (behind ADAPT_SOURCE_ENABLED; 404 when off). Permission `adapt_manage`.",
                "operationId": "adapt.list",
                "responses": {
                    "200": {
                        "description": "sources",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/AdaptSourceListResponse"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Admin Adapt"
                ],
                "summary": "Create from Adapt JSON (course, config, contentObjects, articles, blocks, components)",
                "operationId": "adapt.create",
                "responses": {
                    "201": {
                        "description": "source, version 1",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/AdaptSourceResponse"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "structural errors with paths"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/adapt/{id}": {
            "get": {
                "tags": [
                    "Admin Adapt"
                ],
                "summary": "Show a source and its build status",
                "operationId": "adapt.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "source",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/AdaptSourceResponse"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Admin Adapt"
                ],
                "summary": "Delete a source (the built SCORM package stays)",
                "operationId": "adapt.delete",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "deleted",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/adapt/{id}/source": {
            "get": {
                "tags": [
                    "Admin Adapt"
                ],
                "summary": "JSON of the current or a given version",
                "operationId": "adapt.source",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Adapt JSON",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "additionalProperties": true
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/adapt/{id}/versions": {
            "get": {
                "tags": [
                    "Admin Adapt"
                ],
                "summary": "Version history (version, change note, author, date; no source)",
                "operationId": "adapt.versions-list",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "versions, newest first",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/AdaptVersionListResponse"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Admin Adapt"
                ],
                "summary": "Add a version",
                "operationId": "adapt.versions-add",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "source",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/AdaptSourceResponse"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/adapt/{id}/build": {
            "post": {
                "tags": [
                    "Admin Adapt"
                ],
                "summary": "Build the current version into a SCORM package (queued)",
                "operationId": "adapt.build",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "202": {
                        "description": "queued",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/AdaptSourceResponse"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/user-submissions": {
            "get": {
                "tags": [
                    "Assign Without Account"
                ],
                "summary": "Lists available user submissions",
                "operationId": "user-submissions.list",
                "parameters": [
                    {
                        "name": "email",
                        "in": "query",
                        "description": "User email",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "User submission status",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "morphable_type",
                        "in": "query",
                        "description": "Morphable type",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "morphable_id",
                        "in": "query",
                        "description": "Morphable id",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "order_by",
                        "in": "query",
                        "description": "Order column",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "order",
                        "in": "query",
                        "description": "Order direction",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "List of available user submissions",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/UserSubmissionPageResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Endpoint requires authentication"
                    },
                    "403": {
                        "description": "User doesn't have required access rights"
                    },
                    "500": {
                        "description": "Server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Assign Without Account"
                ],
                "summary": "Create a new user submission identified by id",
                "operationId": "user-submissions.create",
                "requestBody": {
                    "description": "User submission attributes",
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/UserSubmission"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "User submission created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/UserSubmissionResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Endpoint requires authentication"
                    },
                    "403": {
                        "description": "User doesn't have required access rights"
                    },
                    "422": {
                        "description": "One of the parameters has invalid format"
                    },
                    "500": {
                        "description": "Server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/user-submissions/{id}": {
            "put": {
                "tags": [
                    "Assign Without Account"
                ],
                "summary": "Update an existing user submission identified by id",
                "operationId": "user-submissions.update",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Unique human-readable user submission identifier",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "description": "User submission attributes",
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/UserSubmission"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "User submission created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/UserSubmissionResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Endpoint requires authentication"
                    },
                    "403": {
                        "description": "User doesn't have required access rights"
                    },
                    "422": {
                        "description": "One of the parameters has invalid format"
                    },
                    "500": {
                        "description": "Server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Assign Without Account"
                ],
                "summary": "Delete user submission identified by a id",
                "operationId": "user-submissions.delete",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Unique human-readable access url identifier",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "User submission eleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Endpoint requires authentication"
                    },
                    "403": {
                        "description": "User doesn't have required access rights"
                    },
                    "500": {
                        "description": "Server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/tokens": {
            "get": {
                "tags": [
                    "Admin Tokens"
                ],
                "summary": "Every user's scoped API tokens",
                "operationId": "admin.tokens.get",
                "parameters": [
                    {
                        "name": "user_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "kind",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "cli",
                                "agent",
                                "ci",
                                "integration"
                            ]
                        }
                    },
                    {
                        "name": "include_revoked",
                        "in": "query",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Paginated tokens",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiTokenList"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "403": {
                        "description": "Needs token_manage"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/tokens/{id}": {
            "delete": {
                "tags": [
                    "Admin Tokens"
                ],
                "summary": "Revoke any scoped token",
                "operationId": "admin.tokens.by-id.delete",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Revoked",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "403": {
                        "description": "Needs token_manage"
                    },
                    "404": {
                        "description": "Unknown token"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "patch": {
                "tags": [
                    "Admin Tokens"
                ],
                "summary": "Change the per-minute rate limit of any scoped token",
                "operationId": "admin.tokens.by-id.patch",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "rate_limit_per_minute"
                                ],
                                "properties": {
                                    "rate_limit_per_minute": {
                                        "description": "null removes the limit",
                                        "type": "integer",
                                        "nullable": true,
                                        "maximum": 6000,
                                        "minimum": 1
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Updated token",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/ApiToken"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "403": {
                        "description": "Needs token_manage or token owner"
                    },
                    "404": {
                        "description": "Unknown token"
                    },
                    "422": {
                        "description": "Invalid limit"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/tokens/{id}/usage": {
            "get": {
                "tags": [
                    "Admin Tokens"
                ],
                "summary": "Request counts of one token per day, and its rate limit window",
                "operationId": "admin.tokens.by-id.usage.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "days",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "default": 30,
                            "maximum": 90,
                            "minimum": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Usage",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/ApiTokenUsage"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "403": {
                        "description": "Needs token_manage or token owner"
                    },
                    "404": {
                        "description": "Unknown token"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/tokens/{id}/audit": {
            "get": {
                "tags": [
                    "Admin Tokens"
                ],
                "summary": "Audit log of one token",
                "operationId": "admin.tokens.by-id.audit.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Paginated audit rows",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/AgentAuditList"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "403": {
                        "description": "Needs token_manage or token owner"
                    },
                    "404": {
                        "description": "Unknown token"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/agent-audit": {
            "get": {
                "tags": [
                    "Admin Tokens"
                ],
                "summary": "Agent audit log",
                "operationId": "admin.agent-audit.get",
                "parameters": [
                    {
                        "name": "token_id",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "from",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Paginated audit rows",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/AgentAuditList"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "403": {
                        "description": "Needs token_manage"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/user-groups/": {
            "get": {
                "tags": [
                    "Admin User Groups"
                ],
                "summary": "List groups",
                "description": "",
                "operationId": "admin.user-groups.get",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "parent_id",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "format": "int64"
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation, returns list of groups",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/components/schemas/Group"
                                    }
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Admin User Groups"
                ],
                "summary": "Create group",
                "description": "",
                "operationId": "admin.user-groups.post",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/Group"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "successful operation, Group created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Group"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/user-groups/tree/": {
            "get": {
                "tags": [
                    "Admin User Groups"
                ],
                "summary": "List groups in a tree",
                "description": "",
                "operationId": "admin.user-groups.tree.get",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "parent_id",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "format": "int64"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation, returns list of groups",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/components/schemas/Group"
                                    }
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/user-groups/users": {
            "get": {
                "tags": [
                    "Admin User Groups"
                ],
                "summary": "List of groups with users",
                "description": "",
                "operationId": "admin.user-groups.users.get",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "parent_id",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "format": "int64"
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "id[]",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation, returns list of groups",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/components/schemas/Group"
                                    }
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/user-groups/{id}": {
            "get": {
                "tags": [
                    "Admin User Groups"
                ],
                "summary": "Get group details",
                "description": "",
                "operationId": "admin.user-groups.by-id.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "format": "int64"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation, returns Group data",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Group"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Admin User Groups"
                ],
                "summary": "Update group",
                "description": "",
                "operationId": "admin.user-groups.by-id.put",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "format": "int64"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/Group"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Group"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Group not found"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Admin User Groups"
                ],
                "summary": "Delete group",
                "description": "",
                "operationId": "groups.delete",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "format": "int64"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation, Group deleted",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/user-groups/{id}/members": {
            "post": {
                "tags": [
                    "Admin User Groups"
                ],
                "summary": "Add user to group",
                "description": "",
                "operationId": "admin.user-groups.by-id.members.post",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "user_id": {
                                        "description": "Id of user to be added",
                                        "type": "integer",
                                        "format": "int64"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation, returns list of group members",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/components/schemas/User"
                                    }
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/user-groups/{id}/members/{user_id}": {
            "delete": {
                "tags": [
                    "Admin User Groups"
                ],
                "summary": "Add user to group",
                "description": "",
                "operationId": "admin.user-groups.by-id.members.by-user-id.delete",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "format": "int64"
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "format": "int64"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation, returns list of group members",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/components/schemas/User"
                                    }
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/users/{id}/interests": {
            "get": {
                "tags": [
                    "Admin User Interests"
                ],
                "summary": "Get user interests",
                "description": "",
                "operationId": "admin.users.by-id.interests.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "format": "int64"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation, returns list of user interests",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Admin User Interests"
                ],
                "summary": "Set user interests",
                "description": "Set user interests",
                "operationId": "admin.users.by-id.interests.put",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "format": "int64"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "interests": {
                                        "description": "Ids of categories to be set",
                                        "type": "array",
                                        "items": {
                                            "type": "integer",
                                            "format": "int64"
                                        }
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation, returns list of user interests",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Admin User Interests"
                ],
                "summary": "Add single user interest",
                "description": "Add single user interest",
                "operationId": "admin.users.by-id.interests.post",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "format": "int64"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "required": [
                                    "interest_id"
                                ],
                                "properties": {
                                    "interest_id": {
                                        "description": "Id of category to be added",
                                        "type": "integer",
                                        "format": "int64"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation, returns list of user interests",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/users/{id}/interests/{interest_id}": {
            "delete": {
                "tags": [
                    "Admin User Interests"
                ],
                "summary": "Add single user interest",
                "description": "",
                "operationId": "admin.users.by-id.interests.by-interest-id.delete",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "format": "int64"
                        }
                    },
                    {
                        "name": "interest_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "format": "int64"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation, returns list of user interests",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/users/{id}/settings": {
            "get": {
                "tags": [
                    "Admin User Settings"
                ],
                "summary": "Get user settings",
                "description": "",
                "operationId": "admin.users.by-id.settings.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "format": "int64"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation, returns list of user settings",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Admin User Settings"
                ],
                "summary": "Set user setting (removes settings not sent)",
                "operationId": "admin.users.by-id.settings.put",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "format": "int64"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "settings": {
                                        "type": "array",
                                        "items": {
                                            "type": "object"
                                        }
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiJson"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "patch": {
                "tags": [
                    "Admin User Settings"
                ],
                "summary": "Update user setting(s) without changing other settings",
                "operationId": "admin.users.by-id.settings.patch",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "format": "int64"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "settings": {
                                        "type": "array",
                                        "items": {
                                            "type": "object"
                                        }
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiJson"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/users": {
            "get": {
                "tags": [
                    "Admin Users"
                ],
                "summary": "Get users",
                "description": "",
                "operationId": "admin.users.get",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "description": "will search through first_name, last_name and email",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "role",
                        "in": "query",
                        "description": "user role",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "will check if user is_active",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "onboarding",
                        "in": "query",
                        "description": "will check if user completed onboarding",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "from",
                        "in": "query",
                        "description": "users created after this date",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "description": "users created before this date",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "gt_last_login_day",
                        "in": "query",
                        "description": "users last login greater equal then X days",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "lt_last_login_day",
                        "in": "query",
                        "description": "users last login less or equal then X days",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation, returns list of Users",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/components/schemas/User"
                                    }
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Admin Users"
                ],
                "summary": "Create user",
                "description": "",
                "operationId": "admin.users.post",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/User"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation, returns created User data",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/User"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/users/{id}": {
            "get": {
                "tags": [
                    "Admin Users"
                ],
                "summary": "Get user",
                "description": "",
                "operationId": "admin.users.by-id.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "format": "int64"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation, returns User data",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/User"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Admin Users"
                ],
                "summary": "Delete user",
                "description": "",
                "operationId": "users.delete",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "format": "int64"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid id"
                    },
                    "404": {
                        "description": "User not found"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/user/{id}": {
            "put": {
                "tags": [
                    "Admin Users"
                ],
                "summary": "Update/Replace user data (will overwrite unset fields with nulls)",
                "description": "",
                "operationId": "admin.user.by-id.put",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "format": "int64"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/User"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/User"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid id"
                    },
                    "404": {
                        "description": "User not found"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "patch": {
                "tags": [
                    "Admin Users"
                ],
                "summary": "Partial Update User (will only change sent fields)",
                "description": "",
                "operationId": "admin.user.by-id.patch",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "format": "int64"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/User"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/User"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid id"
                    },
                    "404": {
                        "description": "User not found"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/users/{id}/avatar": {
            "post": {
                "tags": [
                    "Admin Users"
                ],
                "description": "Upload avatar",
                "operationId": "admin.users.by-id.avatar.post",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "format": "int64"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "$ref": "#/components/schemas/UserAvatar"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Admin Users"
                ],
                "description": "Delete avatar",
                "operationId": "admin.users.by-id.avatar.delete",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer",
                            "format": "int64"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/auth/password/forgot": {
            "post": {
                "tags": [
                    "Auth"
                ],
                "summary": "Password forget call",
                "operationId": "auth.password.forgot.post",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "email": {
                                        "type": "string",
                                        "example": "user@ulams.com"
                                    },
                                    "return_url": {
                                        "type": "string",
                                        "example": "https://ulams.app/password-reset"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/auth/password/reset": {
            "post": {
                "tags": [
                    "Auth"
                ],
                "summary": "Password reset",
                "operationId": "auth.password.reset.post",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "email": {
                                        "type": "string",
                                        "example": "user@ulams.com"
                                    },
                                    "token": {
                                        "type": "string",
                                        "example": "hFD4UpgzTMNBeCGyfUrbvHtDb2yzSnuE"
                                    },
                                    "password": {
                                        "type": "string",
                                        "example": "zaq1@WSX"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/auth/refresh": {
            "get": {
                "tags": [
                    "Auth"
                ],
                "summary": "Refresh access token",
                "operationId": "auth.refresh.get",
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/auth/social/{provider}": {
            "get": {
                "tags": [
                    "Auth"
                ],
                "summary": "Redirect to social login",
                "description": "Starts a login with Google or Facebook. `return_url` must be an origin of the tenant's own apps (otherwise 422). `challenge` is the S256 challenge of a random verifier that the caller keeps secret (base64url of its SHA-256, 43 characters). After the provider's consent the browser is sent to `return_url` with a one-time `code` (60 seconds, single use) to redeem at POST /api/auth/social/exchange together with the verifier; failures arrive as `error` (provider_denied, provider_failed, link_required, email_unverified, account_unavailable).",
                "operationId": "auth.social.by-provider.get",
                "parameters": [
                    {
                        "name": "provider",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "facebook",
                                "google"
                            ]
                        }
                    },
                    {
                        "name": "return_url",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "https://ulams.app/auth/return"
                        }
                    },
                    {
                        "name": "challenge",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM"
                        }
                    }
                ],
                "responses": {
                    "302": {
                        "description": "Redirect to the provider",
                        "content": {
                            "application/json": {}
                        }
                    },
                    "422": {
                        "description": "Unknown provider, return URL not allowed or challenge missing",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/auth/social/{provider}/callback": {
            "get": {
                "tags": [
                    "Auth"
                ],
                "summary": "Redirect after successful login",
                "description": "The provider's callback. Checks the signed, single-use state and sends the browser to the return URL with a one-time `code` (and `complete=false` when the provider gave no e-mail address and the sign-up must be completed) or an `error` reason. An access token is never put in a URL.",
                "operationId": "auth.social.by-provider.callback.get",
                "parameters": [
                    {
                        "name": "provider",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "facebook",
                                "google"
                            ]
                        }
                    },
                    {
                        "name": "state",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "302": {
                        "description": "Redirect to the return URL with a code or an error",
                        "content": {
                            "application/json": {}
                        }
                    },
                    "400": {
                        "description": "The state is missing, forged, expired or already used",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/auth/social/exchange": {
            "post": {
                "tags": [
                    "Auth"
                ],
                "summary": "Exchange a one-time social login code for a token",
                "description": "Redeems the `code` of a social login redirect together with the secret `verifier` whose S256 challenge started the login. The code works once, within 60 seconds, on the tenant that issued it. Call it from the front end's server, never from a page that may be logged. Returns the access token (`complete=true`) or, when the sign-up needs an e-mail address, `pre_user_token` for POST /api/auth/social/complete/{token} (`complete=false`).",
                "operationId": "auth.social.exchange.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "code",
                                    "verifier"
                                ],
                                "properties": {
                                    "code": {
                                        "type": "string"
                                    },
                                    "verifier": {
                                        "description": "43 to 128 characters of [A-Za-z0-9._~-]",
                                        "type": "string"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "The code is invalid, expired, already used or does not match the verifier",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/auth/social/complete/{token}": {
            "post": {
                "tags": [
                    "Auth"
                ],
                "summary": "Complete the missing data from socials",
                "operationId": "auth.social.complete.by-token.post",
                "parameters": [
                    {
                        "name": "token",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "email": {
                                        "type": "string",
                                        "example": "user@ulams.com"
                                    },
                                    "return_url": {
                                        "type": "string",
                                        "example": "https://ulams.app/email/verify"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/auth/email/verify/{id}/{hash}": {
            "get": {
                "tags": [
                    "Auth"
                ],
                "summary": "Email verification",
                "operationId": "auth.email.verify.by-id.by-hash.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "hash",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {}
                        }
                    }
                }
            }
        },
        "/api/auth/email/resend": {
            "post": {
                "tags": [
                    "Auth"
                ],
                "summary": "Resend email verification",
                "operationId": "auth.email.resend.post",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "email": {
                                        "type": "string",
                                        "example": "user@ulams.com"
                                    },
                                    "return_url": {
                                        "type": "string",
                                        "example": "https://ulams.app/email/verify"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/auth/registerable-groups/": {
            "get": {
                "tags": [
                    "Auth"
                ],
                "summary": "List registerable groups",
                "description": "",
                "operationId": "auth.registerable-groups.get",
                "responses": {
                    "200": {
                        "description": "successful operation, returns list of groups",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/components/schemas/Group"
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/auth/device/code": {
            "post": {
                "tags": [
                    "Auth"
                ],
                "summary": "Start a device login (RFC 8628)",
                "description": "No authentication. Throttled to 10 requests per minute per IP.",
                "operationId": "auth.device.code.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "client_name",
                                    "scopes"
                                ],
                                "properties": {
                                    "client_name": {
                                        "type": "string",
                                        "example": "ulams-cli on mateusz-mbp"
                                    },
                                    "scopes": {
                                        "type": "array",
                                        "items": {
                                            "type": "string",
                                            "example": "courses:write"
                                        }
                                    },
                                    "agent": {
                                        "type": "string",
                                        "nullable": true
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Codes and polling interval",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/DeviceCodeResponse"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "invalid_scope",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/DeviceError"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "429": {
                        "description": "Too many requests"
                    }
                }
            }
        },
        "/api/auth/device/token": {
            "post": {
                "tags": [
                    "Auth"
                ],
                "summary": "Poll for the token of a device login (RFC 8628)",
                "description": "No authentication. Poll every `interval` seconds. Errors are HTTP 400 with an RFC 8628 error code. The token is returned once.",
                "operationId": "auth.device.token.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "device_code"
                                ],
                                "properties": {
                                    "device_code": {
                                        "type": "string"
                                    },
                                    "grant_type": {
                                        "type": "string",
                                        "example": "urn:ietf:params:oauth:grant-type:device_code"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Approved: the scoped token",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/DeviceTokenResponse"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "authorization_pending, slow_down, access_denied or expired_token",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/DeviceError"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    },
                    "429": {
                        "description": "Too many requests"
                    }
                }
            }
        },
        "/api/auth/device/requests/{user_code}": {
            "get": {
                "tags": [
                    "Auth"
                ],
                "summary": "Details of a pending device request (for the approval page)",
                "description": "Needs a login token of the approving user (not a scoped token). Throttled to 5 requests per minute per user.",
                "operationId": "auth.device.requests.by-user-code.get",
                "parameters": [
                    {
                        "name": "user_code",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "BDWP-HQPK"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The request",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/DeviceRequest"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "403": {
                        "description": "Scoped tokens cannot approve",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScopeError"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Unknown, expired or already answered code"
                    },
                    "429": {
                        "description": "Too many requests"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/auth/device/requests/{user_code}/approve": {
            "post": {
                "tags": [
                    "Auth"
                ],
                "summary": "Approve a device request",
                "description": "Mints a scoped token for the approving user with the approved scopes that the client requested. The CLI collects it on its next poll.",
                "operationId": "auth.device.requests.by-user-code.approve.post",
                "parameters": [
                    {
                        "name": "user_code",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "scopes"
                                ],
                                "properties": {
                                    "scopes": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        }
                                    },
                                    "expires_in_days": {
                                        "type": "integer",
                                        "example": 90
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Approved",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "properties": {
                                                "status": {
                                                    "type": "string",
                                                    "example": "approved"
                                                },
                                                "scopes": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "token_id": {
                                                    "type": "string"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "403": {
                        "description": "Scoped tokens cannot approve"
                    },
                    "404": {
                        "description": "Unknown, expired or already answered code"
                    },
                    "422": {
                        "description": "No requested scope approved, or invalid lifetime"
                    },
                    "429": {
                        "description": "Too many requests"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/auth/device/requests/{user_code}/deny": {
            "post": {
                "tags": [
                    "Auth"
                ],
                "summary": "Deny a device request",
                "operationId": "auth.device.requests.by-user-code.deny.post",
                "parameters": [
                    {
                        "name": "user_code",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Denied",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "properties": {
                                                "status": {
                                                    "type": "string",
                                                    "example": "denied"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "403": {
                        "description": "Scoped tokens cannot deny"
                    },
                    "404": {
                        "description": "Unknown, expired or already answered code"
                    },
                    "429": {
                        "description": "Too many requests"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/auth/login": {
            "post": {
                "tags": [
                    "Auth"
                ],
                "description": "User login",
                "operationId": "auth.login.post",
                "parameters": [
                    {
                        "name": "email",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "password",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "remember_me",
                        "in": "query",
                        "schema": {
                            "enum": [
                                0,
                                1
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                }
            }
        },
        "/api/auth/impersonate": {
            "post": {
                "tags": [
                    "Auth"
                ],
                "description": "User impersonate",
                "operationId": "auth.impersonate.post",
                "parameters": [
                    {
                        "name": "user_id",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiJson"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                }
            }
        },
        "/api/auth/logout": {
            "post": {
                "tags": [
                    "Auth"
                ],
                "description": "User logout",
                "operationId": "auth.logout.post",
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/meta": {
            "get": {
                "tags": [
                    "Auth"
                ],
                "summary": "Capabilities of this host",
                "operationId": "meta.get",
                "responses": {
                    "200": {
                        "description": "API name, version, contract, host kind and feature flags",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "properties": {
                                                "api": {
                                                    "type": "string",
                                                    "example": "ulams"
                                                },
                                                "version": {
                                                    "type": "string"
                                                },
                                                "contract": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "host": {
                                                    "type": "string"
                                                },
                                                "kind": {
                                                    "type": "string",
                                                    "enum": [
                                                        "tenant",
                                                        "platform"
                                                    ]
                                                },
                                                "features": {
                                                    "properties": {
                                                        "ai": {
                                                            "type": "boolean"
                                                        },
                                                        "courseBuilder": {
                                                            "type": "boolean"
                                                        },
                                                        "livingCourse": {
                                                            "type": "boolean"
                                                        },
                                                        "deviceLogin": {
                                                            "type": "boolean"
                                                        },
                                                        "scopedTokens": {
                                                            "type": "boolean"
                                                        },
                                                        "idempotency": {
                                                            "type": "boolean"
                                                        },
                                                        "platformApi": {
                                                            "type": "boolean"
                                                        },
                                                        "demo": {
                                                            "type": "boolean"
                                                        }
                                                    },
                                                    "type": "object"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/profile/me": {
            "get": {
                "tags": [
                    "Profile"
                ],
                "description": "Get logged user info",
                "operationId": "profile.me.get",
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Profile"
                ],
                "description": "Update the profile",
                "operationId": "profile.me.put",
                "parameters": [
                    {
                        "name": "first_name",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "last_name",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "age",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "number"
                        }
                    },
                    {
                        "name": "gender",
                        "in": "query",
                        "description": "1 - male, 2 - female",
                        "required": false,
                        "schema": {
                            "type": "number"
                        }
                    },
                    {
                        "name": "country",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "city",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "street",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "postcode",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "phone",
                        "in": "query",
                        "description": "phone",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/profile/me-auth": {
            "put": {
                "tags": [
                    "Profile"
                ],
                "description": "Update the profile authorization data",
                "operationId": "profile.me-auth.put",
                "parameters": [
                    {
                        "name": "email",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/profile/password": {
            "put": {
                "tags": [
                    "Profile"
                ],
                "description": "Update password",
                "operationId": "profile.password.put",
                "parameters": [
                    {
                        "name": "current_password",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "new_password",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "new_confirm_password",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/profile/interests": {
            "put": {
                "tags": [
                    "Profile"
                ],
                "summary": "Update user interests",
                "operationId": "profile.interests.put",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "interests": {
                                        "description": "Array categories ids",
                                        "type": "array",
                                        "items": {
                                            "type": "number"
                                        }
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/profile/upload-avatar": {
            "post": {
                "tags": [
                    "Profile"
                ],
                "description": "Upload avatar",
                "operationId": "profile.upload-avatar.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "$ref": "#/components/schemas/UserAvatar"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/profile/delete-avatar": {
            "delete": {
                "tags": [
                    "Profile"
                ],
                "description": "Delete avatar",
                "operationId": "profile.delete-avatar.delete",
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/profile/settings": {
            "get": {
                "tags": [
                    "Profile"
                ],
                "description": "Get user settings",
                "operationId": "profile.settings.get",
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Profile"
                ],
                "summary": "Update user settings",
                "operationId": "profile.settings.put",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "setting-key": {
                                        "description": "Example setting",
                                        "type": "object",
                                        "example": "example-value"
                                    },
                                    "setting-key2": {
                                        "description": "Example setting",
                                        "type": "object",
                                        "example": "example-value2"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/profile": {
            "delete": {
                "tags": [
                    "Profile"
                ],
                "description": "Delete user profile",
                "operationId": "profile.delete",
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/profile/delete/init": {
            "post": {
                "tags": [
                    "Profile"
                ],
                "description": "Create user deletion request",
                "operationId": "profile.delete.init.post",
                "parameters": [
                    {
                        "name": "return_url",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "https://ulams.app/delete-account"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/profile/delete/{userId}/{token}": {
            "get": {
                "tags": [
                    "Profile"
                ],
                "description": "Create user deletion request",
                "operationId": "profile.delete.by-userid.by-token.get",
                "parameters": [
                    {
                        "name": "userId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "token",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/auth/register": {
            "post": {
                "tags": [
                    "Auth"
                ],
                "description": "Register new user",
                "operationId": "auth.register.post",
                "parameters": [
                    {
                        "name": "first_name",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "last_name",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "email",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "password",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "password_confirmation",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "return_url",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "example": "https://ulams.app/email/verify"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/auth/tokens": {
            "get": {
                "tags": [
                    "Auth"
                ],
                "summary": "My scoped API tokens",
                "operationId": "auth.tokens.get",
                "parameters": [
                    {
                        "name": "include_revoked",
                        "in": "query",
                        "schema": {
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Active scoped tokens of the signed-in user",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/ApiToken"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "403": {
                        "description": "Token lacks the tokens:read scope",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScopeError"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Auth"
                ],
                "summary": "Create a scoped API token (the secret is returned once)",
                "operationId": "auth.tokens.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "name",
                                    "scopes"
                                ],
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "example": "ulams-cli on my laptop",
                                        "maxLength": 100
                                    },
                                    "scopes": {
                                        "description": "Scopes or @presets (read-only, author, admin, learner, ci)",
                                        "type": "array",
                                        "items": {
                                            "type": "string",
                                            "example": "courses:write"
                                        }
                                    },
                                    "expires_in_days": {
                                        "type": "integer",
                                        "example": 90,
                                        "maximum": 365,
                                        "minimum": 1
                                    },
                                    "kind": {
                                        "type": "string",
                                        "enum": [
                                            "cli",
                                            "agent",
                                            "ci",
                                            "integration"
                                        ]
                                    },
                                    "agent_name": {
                                        "type": "string",
                                        "nullable": true
                                    },
                                    "rate_limit_per_minute": {
                                        "type": "integer",
                                        "nullable": true
                                    },
                                    "resource_ids": {
                                        "description": "Limit the token to these resources, for example the id of one saved report for a BI tool: it can then call only the endpoints that name one of them",
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        },
                                        "nullable": true
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/ApiTokenCreated"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "403": {
                        "description": "Token lacks tokens:write",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScopeError"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Invalid scopes, lifetime, limit reached or scopes exceed the calling token's"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/auth/tokens/{id}": {
            "delete": {
                "tags": [
                    "Auth"
                ],
                "summary": "Revoke one of my scoped tokens",
                "operationId": "auth.tokens.by-id.delete",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Revoked",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "403": {
                        "description": "Somebody else's token"
                    },
                    "404": {
                        "description": "Unknown token"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "patch": {
                "tags": [
                    "Auth"
                ],
                "summary": "Change the per-minute rate limit of one of my tokens",
                "operationId": "auth.tokens.by-id.patch",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "rate_limit_per_minute"
                                ],
                                "properties": {
                                    "rate_limit_per_minute": {
                                        "description": "null removes the limit",
                                        "type": "integer",
                                        "nullable": true,
                                        "maximum": 6000,
                                        "minimum": 1
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Updated token",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/ApiToken"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "403": {
                        "description": "Somebody else's token"
                    },
                    "404": {
                        "description": "Unknown token"
                    },
                    "422": {
                        "description": "Invalid limit"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/auth/tokens/{id}/usage": {
            "get": {
                "tags": [
                    "Auth"
                ],
                "summary": "Request counts of one of my tokens per day, and its rate limit window",
                "operationId": "auth.tokens.by-id.usage.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "days",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "default": 30,
                            "maximum": 90,
                            "minimum": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Usage",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/ApiTokenUsage"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "403": {
                        "description": "Somebody else's token"
                    },
                    "404": {
                        "description": "Unknown token"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/auth/tokens/current": {
            "get": {
                "tags": [
                    "Auth"
                ],
                "summary": "The token this request is authenticated with",
                "operationId": "auth.tokens.current.get",
                "responses": {
                    "200": {
                        "description": "Token, user and host",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "properties": {
                                                "id": {
                                                    "type": "string",
                                                    "nullable": true
                                                },
                                                "name": {
                                                    "type": "string",
                                                    "nullable": true
                                                },
                                                "scoped": {
                                                    "type": "boolean"
                                                },
                                                "scopes": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "kind": {
                                                    "type": "string",
                                                    "nullable": true
                                                },
                                                "agent_name": {
                                                    "type": "string",
                                                    "nullable": true
                                                },
                                                "created_via": {
                                                    "type": "string",
                                                    "nullable": true
                                                },
                                                "expires_at": {
                                                    "type": "string",
                                                    "format": "date-time",
                                                    "nullable": true
                                                },
                                                "last_used_at": {
                                                    "type": "string",
                                                    "format": "date-time",
                                                    "nullable": true
                                                },
                                                "user": {
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        },
                                                        "email": {
                                                            "type": "string"
                                                        }
                                                    },
                                                    "type": "object"
                                                },
                                                "host": {
                                                    "type": "string"
                                                },
                                                "host_kind": {
                                                    "type": "string",
                                                    "enum": [
                                                        "tenant",
                                                        "platform"
                                                    ]
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/authoring-metrics/courses": {
            "get": {
                "tags": [
                    "Authoring metrics"
                ],
                "summary": "Authoring metric of courses",
                "description": "One snapshot per course built with the Course Builder: generation, AI edit, interview and model time in seconds, build and maintenance cost in micro USD, the number of model calls and failed calls, element counts and how many AI elements were accepted unchanged, revised on request or edited by an author. Author time is null until review time is recorded. Needs the permission authoring_metrics_read.",
                "operationId": "admin.authoring-metrics.courses.list",
                "parameters": [
                    {
                        "name": "from",
                        "in": "query",
                        "description": "Courses created on or after this date (YYYY-MM-DD)",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "description": "Courses created on or before this date (YYYY-MM-DD)",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "course_id[]",
                        "in": "query",
                        "description": "Only these courses",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "List of course snapshots",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/authoring-metrics/courses/export": {
            "get": {
                "tags": [
                    "Authoring metrics"
                ],
                "summary": "Export the authoring metric",
                "description": "Download the snapshots as CSV or JSON lines, one row per course, with the same filters as the list. Every row carries method_version so the file says which definitions produced the numbers. Needs authoring_metrics_read.",
                "operationId": "admin.authoring-metrics.courses.export",
                "parameters": [
                    {
                        "name": "format",
                        "in": "query",
                        "description": "csv (default) or jsonl",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "csv",
                                "jsonl"
                            ]
                        }
                    },
                    {
                        "name": "from",
                        "in": "query",
                        "description": "Courses created on or after this date (YYYY-MM-DD)",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "description": "Courses created on or before this date (YYYY-MM-DD)",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "course_id[]",
                        "in": "query",
                        "description": "Only these courses",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The file",
                        "content": {
                            "text/csv": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/authoring-metrics/courses/{course}": {
            "get": {
                "tags": [
                    "Authoring metrics"
                ],
                "summary": "Authoring metric of one course",
                "description": "The snapshot of one course with the time of every pipeline stage (outline, lessons, quizzes, apply and the rest, each marked exact, coarse or incomplete) and the split of its AI elements. Needs authoring_metrics_read, or being the author of the course's builder session. 404 when the course was not built with the Course Builder.",
                "operationId": "admin.authoring-metrics.courses.by-id.get",
                "parameters": [
                    {
                        "name": "course",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Snapshot, stages and elements",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "404": {
                        "description": "Not built with the Course Builder"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/bookmarks": {
            "get": {
                "tags": [
                    "Admin Bookmarks"
                ],
                "summary": "Get a listing of the bookmarks",
                "description": "Get all bookmarks",
                "operationId": "admin.bookmarks.get",
                "parameters": [
                    {
                        "name": "order_by",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "created_at",
                                "id",
                                "value"
                            ]
                        }
                    },
                    {
                        "name": "order",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "ASC",
                                "DESC"
                            ]
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Pagination Page Number",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "default": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Pagination Per Page",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "default": 15
                        }
                    },
                    {
                        "name": "has_value",
                        "in": "query",
                        "description": "Has value",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "bookmarkable_id",
                        "in": "query",
                        "description": "Bookmarkalbe ID",
                        "required": false,
                        "schema": {
                            "type": "number"
                        }
                    },
                    {
                        "name": "bookmarkable_ids[]",
                        "in": "query",
                        "description": "An array of bookmark IDs.",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "number"
                            }
                        }
                    },
                    {
                        "name": "bookmarkable_type",
                        "in": "query",
                        "description": "Bookmarkalbe type",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Admin Bookmarks"
                ],
                "summary": "Store a newly created bookmark",
                "description": "Store Bookmark",
                "operationId": "admin.bookmarks.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/AdminBookmarkCreateRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Successfull operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/BookmarkResource"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/bookmarks/{id}": {
            "delete": {
                "tags": [
                    "Admin Bookmarks"
                ],
                "summary": "Remove the specified bookmark",
                "description": "Delete Bookmarks",
                "operationId": "admin.bookmarks.by-id.delete",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of bookmark",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "patch": {
                "tags": [
                    "Admin Bookmarks"
                ],
                "summary": "Update bookmark",
                "description": "Store Bookmark",
                "operationId": "admin.bookmarks.by-id.patch",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of bookmark",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/AdminBookmarkCreateRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Successfull operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/BookmarkResource"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/bookmarks": {
            "get": {
                "tags": [
                    "Bookmarks"
                ],
                "summary": "Get a listing of the bookmarks",
                "description": "Get all bookmarks",
                "operationId": "bookmarks.get",
                "parameters": [
                    {
                        "name": "order_by",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "created_at",
                                "id",
                                "value"
                            ]
                        }
                    },
                    {
                        "name": "order",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "ASC",
                                "DESC"
                            ]
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Pagination Page Number",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "default": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Pagination Per Page",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "default": 15
                        }
                    },
                    {
                        "name": "has_value",
                        "in": "query",
                        "description": "Has value",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "bookmarkable_id",
                        "in": "query",
                        "description": "Bookmarkalbe ID",
                        "required": false,
                        "schema": {
                            "type": "number"
                        }
                    },
                    {
                        "name": "bookmarkable_ids[]",
                        "in": "query",
                        "description": "An array of bookmark IDs.",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "number"
                            }
                        }
                    },
                    {
                        "name": "bookmarkable_type",
                        "in": "query",
                        "description": "Bookmarkalbe type",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Bookmarks"
                ],
                "summary": "Store a newly created bookmark",
                "description": "Store Bookmark",
                "operationId": "bookmarks.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/BookmarkCreateRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Successfull operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/BookmarkResource"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/bookmarks/{id}": {
            "delete": {
                "tags": [
                    "Bookmarks"
                ],
                "summary": "Remove the specified bookmark",
                "description": "Delete Bookmarks",
                "operationId": "bookmarks.by-id.delete",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of bookmark",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "patch": {
                "tags": [
                    "Bookmarks"
                ],
                "summary": "Update bookmark",
                "description": "Store Bookmark",
                "operationId": "bookmarks.by-id.patch",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of bookmark",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/BookmarkCreateRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Successfull operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/BookmarkResource"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/bulk-notifications/send": {
            "post": {
                "tags": [
                    "Admin Bulk Notifications"
                ],
                "summary": "Store a newly notification",
                "description": "Store Bulk Notification",
                "operationId": "admin.bulk-notifications.send.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/SendUserBulkNotificationRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Successfull operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/BulkNotificationResource"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/bulk-notifications/send/multicast": {
            "post": {
                "tags": [
                    "Admin Bulk Notifications"
                ],
                "summary": "Store a newly notification",
                "description": "Store Bulk Notification",
                "operationId": "admin.bulk-notifications.send.multicast.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/SendMulticastBulkNotificationRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Successfull operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/BulkNotificationResource"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/bulk-notifications": {
            "get": {
                "tags": [
                    "Admin Bulk Notifications"
                ],
                "summary": "Get a listing of the bulk notifications",
                "description": "Get all Bulk Notifications",
                "operationId": "admin.bulk-notifications.get",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Pagination Page Number",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "default": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Pagination Per Page",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "default": 15
                        }
                    },
                    {
                        "name": "channel",
                        "in": "query",
                        "description": "Bulk notification channel [Ulams\\BulkNotifications\\Channels\\PushNotificationChannel]",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/notifications/tokens": {
            "post": {
                "tags": [
                    "Notification Device Tokens"
                ],
                "summary": "Store a newly notification device token",
                "description": "Store Notification Device Token",
                "operationId": "notifications.tokens.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateDeviceTokenRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Successfull operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/orders": {
            "get": {
                "tags": [
                    "Admin Orders"
                ],
                "description": "Search orders",
                "operationId": "admin.orders.get",
                "parameters": [
                    {
                        "name": "order_by",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "created_at",
                                "updated_at",
                                "user_id"
                            ]
                        }
                    },
                    {
                        "name": "order",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "ASC",
                                "DESC"
                            ]
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Pagination Page Number",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Pagination Per Page",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 15
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "User (buyer) ID",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "product_id",
                        "in": "query",
                        "description": "Product ID",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "productable_id",
                        "in": "query",
                        "description": "Productable ID (for example Course Id)",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "productable_type",
                        "in": "query",
                        "description": "Productable type (class) - required if productable_id is sent",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "Status (0 = PROCESSING, 1 = PAID, 2 = CANCELLED)",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/orders/{id}": {
            "get": {
                "tags": [
                    "Admin Orders"
                ],
                "summary": "Display the specified Order",
                "description": "Get Order",
                "operationId": "admin.orders.by-id.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of Order",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/orders/export": {
            "get": {
                "tags": [
                    "Admin Orders"
                ],
                "description": "Export orders to file",
                "operationId": "admin.orders.export.get",
                "parameters": [
                    {
                        "name": "order_by",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "created_at",
                                "updated_at",
                                "user_id"
                            ]
                        }
                    },
                    {
                        "name": "order",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "ASC",
                                "DESC"
                            ]
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "User (buyer) ID",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "product_id",
                        "in": "query",
                        "description": "Product ID",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "productable_id",
                        "in": "query",
                        "description": "Productable ID (for example Course Id)",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "productable_type",
                        "in": "query",
                        "description": "Productable type (class) - required if productable_id is sent",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "Status (0 = PROCESSING, 1 = PAID, 2 = CANCELLED)",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "format",
                        "in": "query",
                        "description": "File format",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "csv",
                                "xlsx",
                                "xls"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/products": {
            "get": {
                "tags": [
                    "Admin Products"
                ],
                "description": "Search products",
                "operationId": "admin.products.get",
                "parameters": [
                    {
                        "name": "order_by",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "created_at",
                                "updated_at",
                                "name"
                            ]
                        }
                    },
                    {
                        "name": "order",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "ASC",
                                "DESC"
                            ]
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Pagination Page Number",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Pagination Per Page",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 15
                        }
                    },
                    {
                        "name": "productable_id",
                        "in": "query",
                        "description": "Productable ID (for example Course Id)",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "productable_type",
                        "in": "query",
                        "description": "Productable type (class) - required if productable_id is sent",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "free",
                        "in": "query",
                        "description": "Find free (price = 0)",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "name",
                        "in": "query",
                        "description": "Partial name filter",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "type",
                        "in": "query",
                        "description": "Type (`single`, `bundle`, `subscription`)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "purchasable",
                        "in": "query",
                        "description": "Purchasable filter",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "tags",
                        "in": "query",
                        "description": "Tags",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/products/": {
            "post": {
                "tags": [
                    "Admin Product"
                ],
                "description": "Create product",
                "operationId": "admin.products.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/json": {
                            "schema": {
                                "required": [
                                    "name",
                                    "price"
                                ],
                                "properties": {
                                    "name": {
                                        "type": "string"
                                    },
                                    "description": {
                                        "type": "string"
                                    },
                                    "price": {
                                        "type": "integer"
                                    },
                                    "price_old": {
                                        "type": "integer"
                                    },
                                    "tax_rate": {
                                        "type": "integer"
                                    },
                                    "extra_fees": {
                                        "type": "integer"
                                    },
                                    "purchasable": {
                                        "type": "boolean"
                                    },
                                    "teaser_url": {
                                        "type": "string"
                                    },
                                    "poster": {
                                        "description": "image upload",
                                        "type": "string"
                                    },
                                    "duration": {
                                        "type": "string"
                                    },
                                    "limit_per_user": {
                                        "type": "integer"
                                    },
                                    "limit_total": {
                                        "type": "integer"
                                    },
                                    "productables": {
                                        "type": "array",
                                        "items": {}
                                    },
                                    "categories": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        }
                                    },
                                    "tags": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        }
                                    },
                                    "related_products": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        }
                                    },
                                    "language": {
                                        "type": "string"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/products/{id}": {
            "get": {
                "tags": [
                    "Admin Products"
                ],
                "description": "Read product",
                "operationId": "admin.products.by-id.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Admin Product"
                ],
                "description": "Create product",
                "operationId": "admin.products.by-id.put",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/json": {
                            "schema": {
                                "required": [],
                                "properties": {
                                    "name": {
                                        "type": "string"
                                    },
                                    "description": {
                                        "type": "string"
                                    },
                                    "price": {
                                        "type": "integer"
                                    },
                                    "price_old": {
                                        "type": "integer"
                                    },
                                    "tax_rate": {
                                        "type": "number",
                                        "format": "float"
                                    },
                                    "extra_fees": {
                                        "type": "integer"
                                    },
                                    "purchasable": {
                                        "type": "boolean"
                                    },
                                    "teaser_url": {
                                        "type": "string"
                                    },
                                    "poster": {
                                        "description": "image upload",
                                        "type": "string"
                                    },
                                    "duration": {
                                        "type": "string"
                                    },
                                    "limit_per_user": {
                                        "type": "integer"
                                    },
                                    "limit_total": {
                                        "type": "integer"
                                    },
                                    "productables": {
                                        "type": "array",
                                        "items": {}
                                    },
                                    "categories": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        }
                                    },
                                    "tags": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        }
                                    },
                                    "related_products": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        }
                                    },
                                    "language": {
                                        "description": "language",
                                        "type": "string"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Admin Products"
                ],
                "description": "Delete product",
                "operationId": "admin.products.by-id.delete",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/products/{id}/attach": {
            "post": {
                "tags": [
                    "Admin Product"
                ],
                "description": "Attach product to user",
                "operationId": "admin.products.by-id.attach.post",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of Product",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/json": {
                            "schema": {
                                "required": [
                                    "user_id"
                                ],
                                "properties": {
                                    "user_id": {
                                        "type": "integer"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/products/{id}/detach": {
            "post": {
                "tags": [
                    "Admin Product"
                ],
                "description": "Detach product from user",
                "operationId": "admin.products.by-id.detach.post",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of Product",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/json": {
                            "schema": {
                                "required": [
                                    "user_id"
                                ],
                                "properties": {
                                    "user_id": {
                                        "type": "integer"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/products/{id}/trigger-event-manually/{idTemplate}": {
            "post": {
                "tags": [
                    "Admin Product"
                ],
                "summary": "Manually triggered event for users of the product",
                "operationId": "admin.products.by-id.trigger-event-manually.by-idtemplate.post",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of Product",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "idTemplate",
                        "in": "path",
                        "description": "id of Template",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Event dispatched successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "422": {
                        "description": "one of the parameters has invalid format"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/productables/": {
            "get": {
                "tags": [
                    "Admin Product"
                ],
                "description": "Get list of all productables",
                "operationId": "admin.productables.get",
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/productables/attach": {
            "post": {
                "tags": [
                    "Admin Products"
                ],
                "description": "Attach productable to user",
                "operationId": "admin.productables.attach.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/json": {
                            "schema": {
                                "required": [
                                    "productable_id",
                                    "productable_type",
                                    "user_id"
                                ],
                                "properties": {
                                    "productable_id": {
                                        "type": "integer"
                                    },
                                    "productable_type": {
                                        "type": "string"
                                    },
                                    "user_id": {
                                        "type": "integer"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/productables/detach": {
            "post": {
                "tags": [
                    "Admin Product"
                ],
                "description": "Detach product from user",
                "operationId": "admin.productables.detach.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/json": {
                            "schema": {
                                "required": [
                                    "productable_id",
                                    "productable_type",
                                    "user_id"
                                ],
                                "properties": {
                                    "productable_id": {
                                        "type": "integer"
                                    },
                                    "productable_type": {
                                        "type": "string"
                                    },
                                    "user_id": {
                                        "type": "integer"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/productables/registered": {
            "get": {
                "tags": [
                    "Admin Product"
                ],
                "description": "List of registered Productable types",
                "operationId": "admin.productables.registered.get",
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/productables/product": {
            "get": {
                "tags": [
                    "Admin Product"
                ],
                "description": "Get single product for this productable (if it exists)",
                "operationId": "admin.productables.product.get",
                "parameters": [
                    {
                        "name": "productable_type",
                        "in": "query",
                        "description": "Productable class",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "productable_id",
                        "in": "query",
                        "description": "Productable id",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/cart": {
            "get": {
                "tags": [
                    "Cart"
                ],
                "description": "Get cart details",
                "operationId": "cart.get",
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/cart/products": {
            "post": {
                "tags": [
                    "Cart"
                ],
                "description": "Add product to cart and/or set product quantity",
                "operationId": "cart.products.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/json": {
                            "schema": {
                                "required": [
                                    "id"
                                ],
                                "properties": {
                                    "id": {
                                        "type": "integer"
                                    },
                                    "quantity": {
                                        "type": "integer"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/cart/missing": {
            "post": {
                "tags": [
                    "Cart"
                ],
                "description": "Add missing products to Cart",
                "operationId": "cart.missing.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/json": {
                            "schema": {
                                "required": [
                                    "id"
                                ],
                                "properties": {
                                    "products": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        }
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/cart/add": {
            "post": {
                "tags": [
                    "Cart"
                ],
                "description": "Add productable to cart",
                "operationId": "cart.add.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/json": {
                            "schema": {
                                "required": [
                                    "productable_id",
                                    "productable_type"
                                ],
                                "properties": {
                                    "productable_id": {
                                        "type": "integer"
                                    },
                                    "productable_type": {
                                        "type": "string"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/cart/products/{id}": {
            "delete": {
                "tags": [
                    "Cart"
                ],
                "description": "Remove product from cart",
                "operationId": "cart.products.by-id.delete",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "product id",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/orders": {
            "get": {
                "tags": [
                    "Orders"
                ],
                "description": "Search orders",
                "operationId": "orders.get",
                "parameters": [
                    {
                        "name": "order_by",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "created_at",
                                "updated_at",
                                "user_id"
                            ]
                        }
                    },
                    {
                        "name": "order",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "ASC",
                                "DESC"
                            ]
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Pagination Page Number",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Pagination Per Page",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 15
                        }
                    },
                    {
                        "name": "product_id",
                        "in": "query",
                        "description": "Product ID",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "productable_id",
                        "in": "query",
                        "description": "Productable ID (for example Course Id)",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "productable_type",
                        "in": "query",
                        "description": "Productable type (class) - required if productable_id is sent",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "Status (0 = PROCESSING, 1 = PAID, 2 = CANCELLED)",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/orders/{id}": {
            "get": {
                "tags": [
                    "Orders"
                ],
                "summary": "Display the specified Order",
                "description": "Get Order",
                "operationId": "orders.by-id.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of Order",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/cart/pay": {
            "post": {
                "tags": [
                    "Cart"
                ],
                "description": "Pay for cart",
                "operationId": "cart.pay.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/json": {
                            "schema": {
                                "required": [
                                    "paymentMethodId"
                                ],
                                "properties": {
                                    "paymentMethodId": {
                                        "type": "string"
                                    },
                                    "client_name": {
                                        "type": "string"
                                    },
                                    "client_email": {
                                        "type": "string"
                                    },
                                    "client_street": {
                                        "type": "string"
                                    },
                                    "client_street_number": {
                                        "type": "string"
                                    },
                                    "client_postal": {
                                        "type": "string"
                                    },
                                    "client_city": {
                                        "type": "string"
                                    },
                                    "client_country": {
                                        "type": "string"
                                    },
                                    "client_company": {
                                        "type": "string"
                                    },
                                    "client_taxid": {
                                        "type": "string"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/product/{id}/pay": {
            "post": {
                "tags": [
                    "Cart"
                ],
                "description": "Pay for single product",
                "operationId": "product.by-id.pay.post",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Product id",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/json": {
                            "schema": {
                                "required": [
                                    "paymentMethodId"
                                ],
                                "properties": {
                                    "paymentMethodId": {
                                        "type": "string"
                                    },
                                    "client_name": {
                                        "type": "string"
                                    },
                                    "client_email": {
                                        "type": "string"
                                    },
                                    "client_street": {
                                        "type": "string"
                                    },
                                    "client_street_number": {
                                        "type": "string"
                                    },
                                    "client_postal": {
                                        "type": "string"
                                    },
                                    "client_city": {
                                        "type": "string"
                                    },
                                    "client_country": {
                                        "type": "string"
                                    },
                                    "client_company": {
                                        "type": "string"
                                    },
                                    "client_taxid": {
                                        "type": "string"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The product is not purchasable or the user reached its limits",
                        "content": {
                            "application/json": {}
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/products": {
            "get": {
                "tags": [
                    "Products"
                ],
                "description": "Search products",
                "operationId": "products.get",
                "parameters": [
                    {
                        "name": "order_by",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "created_at",
                                "updated_at",
                                "name"
                            ]
                        }
                    },
                    {
                        "name": "order",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "ASC",
                                "DESC"
                            ]
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Pagination Page Number",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Pagination Per Page",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 15
                        }
                    },
                    {
                        "name": "productable_id",
                        "in": "query",
                        "description": "Productable ID (for example Course Id)",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "productable_type",
                        "in": "query",
                        "description": "Productable type (class) - required if productable_id is sent",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "free",
                        "in": "query",
                        "description": "Find free (price = 0)",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "name",
                        "in": "query",
                        "description": "Partial name filter",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "type",
                        "in": "query",
                        "description": "Type (`single` or `bundle`)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "tags",
                        "in": "query",
                        "description": "Tags",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/products/my": {
            "get": {
                "tags": [
                    "Products"
                ],
                "description": "Search my products",
                "operationId": "products.my.get",
                "parameters": [
                    {
                        "name": "order_by",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "created_at",
                                "updated_at",
                                "id"
                            ]
                        }
                    },
                    {
                        "name": "order",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "ASC",
                                "DESC"
                            ]
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Pagination Page Number",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Pagination Per Page",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 15
                        }
                    },
                    {
                        "name": "type",
                        "in": "query",
                        "description": "Type (`single`, `bundle`, `subscription`, `subscription-all-in`)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/MyProductResource"
                                            }
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/products/{id}": {
            "get": {
                "tags": [
                    "Products"
                ],
                "description": "Read product",
                "operationId": "products.by-id.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/products/cancel/{id}": {
            "post": {
                "tags": [
                    "Products"
                ],
                "description": "Cancel recursive product",
                "operationId": "products.cancel.by-id.post",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/productables/attach": {
            "post": {
                "tags": [
                    "Products"
                ],
                "description": "Attach productable to user",
                "operationId": "productables.attach.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/json": {
                            "schema": {
                                "required": [
                                    "productable_id",
                                    "productable_type"
                                ],
                                "properties": {
                                    "productable_id": {
                                        "type": "integer"
                                    },
                                    "productable_type": {
                                        "type": "string"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/categories": {
            "get": {
                "tags": [
                    "Categories"
                ],
                "description": "Get Categories",
                "operationId": "categories.get",
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                }
            }
        },
        "/api/categories/tree": {
            "get": {
                "tags": [
                    "Categories"
                ],
                "description": "Get Categories Tree",
                "operationId": "categories.tree.get",
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                }
            }
        },
        "/api/admin/categories/{id}": {
            "get": {
                "tags": [
                    "Categories"
                ],
                "description": "Get single Categories",
                "operationId": "admin.categories.by-id.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                }
            },
            "post": {
                "tags": [
                    "Categories"
                ],
                "summary": "Update category",
                "description": "Update single Categories",
                "operationId": "admin.categories.by-id.post",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "example": "Dokumentacja"
                                    },
                                    "description": {
                                        "type": "string"
                                    },
                                    "icon_class": {
                                        "type": "string",
                                        "example": "fa-business-time"
                                    },
                                    "is_active": {
                                        "type": "boolean",
                                        "example": "true"
                                    },
                                    "parent_id": {
                                        "type": "?integer",
                                        "example": "null"
                                    },
                                    "order": {
                                        "type": "number",
                                        "example": "1"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Categories"
                ],
                "summary": "Destroy category",
                "description": "Destroy the specified category",
                "operationId": "admin.categories.by-id.delete",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/categories": {
            "post": {
                "tags": [
                    "Categories"
                ],
                "summary": "Category create",
                "description": "Create single Categories",
                "operationId": "admin.categories.post",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "example": "Dokumentacja"
                                    },
                                    "description": {
                                        "type": "string"
                                    },
                                    "icon_class": {
                                        "type": "string",
                                        "example": "fa-business-time"
                                    },
                                    "is_active": {
                                        "type": "boolean",
                                        "example": "true"
                                    },
                                    "parent_id": {
                                        "type": "?integer",
                                        "example": "null"
                                    },
                                    "order": {
                                        "type": "number",
                                        "example": "1"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/categories/sort": {
            "post": {
                "tags": [
                    "Categories"
                ],
                "operationId": "admin.categories.sort.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/AdminCategorySortRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Successfull operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/cmi5": {
            "post": {
                "tags": [
                    "cmi5"
                ],
                "summary": "Convert ZIP Cmi5 Package into Ulams LMS Cmi5 storage",
                "operationId": "cmi5.upload",
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "properties": {
                                    "file": {
                                        "type": "string",
                                        "format": "binary"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Cmi5 data",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Cmi5Response"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Endpoint requires authentication"
                    },
                    "403": {
                        "description": "User doesn't have required access rights"
                    },
                    "500": {
                        "description": "Server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/cmi5/player/{cmi5AuId}": {
            "get": {
                "tags": [
                    "cmi5"
                ],
                "summary": "Launch a cmi5 AU",
                "description": "Needs `cmi5_read` (students have it). Returns the player page, or with `format=json` the launch URL on the tenant content origin. The URL carries a one-time launch token, never the learner's access token (ADR 0046).",
                "operationId": "cmi5.player.by-cmi5auid.get",
                "parameters": [
                    {
                        "name": "cmi5AuId",
                        "in": "path",
                        "description": "Unique id cmi5 au identifier",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "format",
                        "in": "query",
                        "description": "`json` returns {data: {url, origin}} instead of the player page",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "json"
                            ]
                        }
                    },
                    {
                        "name": "course_id",
                        "in": "query",
                        "description": "Course id",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "topic_id",
                        "in": "query",
                        "description": "Topic id",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": ""
                    },
                    "401": {
                        "description": "Endpoint requires authentication"
                    },
                    "403": {
                        "description": "User doesn't have required access rights"
                    },
                    "500": {
                        "description": "Server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/cmi5/": {
            "get": {
                "tags": [
                    "cmi5"
                ],
                "summary": "Get a listing of the cmi5",
                "operationId": "cmi5.list",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "description": "page",
                        "schema": {
                            "type": "number"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "per_page",
                        "schema": {
                            "type": "number"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "List of available cmi5s",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Cmi5PageResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Endpoint requires authentication"
                    },
                    "403": {
                        "description": "User doesn't have required access rights"
                    },
                    "500": {
                        "description": "Server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/cmi5/{id}": {
            "delete": {
                "tags": [
                    "cmi5"
                ],
                "summary": "Delete cmi5 package by id",
                "operationId": "cmi5.delete",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Cmi5 id",
                        "required": true,
                        "schema": {
                            "type": "number"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Cmi5 deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Endpoint requires authentication"
                    },
                    "403": {
                        "description": "User doesn't have required access rights"
                    },
                    "500": {
                        "description": "Server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/code-exercises/launches/{topic}": {
            "post": {
                "tags": [
                    "Code exercises"
                ],
                "summary": "Open a code exercise",
                "description": "Code exercises (ADR 0170). The exercise runs in the browser sandbox on the tenant content origin; this\nAPI hands the page the exercise and the runner's address, and records the results the page reports for\nthe learner's own session (no token ever reaches the frame).",
                "operationId": "code-exercises.launches.by-topic.post",
                "parameters": [
                    {
                        "name": "topic",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "{runner: {url, version}, exercise, attempts}; runner.url is the sandboxed runner page on the content origin",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "no access to the course"
                    },
                    "404": {
                        "description": "not a code exercise, or the type is switched off"
                    },
                    "503": {
                        "description": "no content origin"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/code-exercises/topics/{topic}/attempts": {
            "get": {
                "tags": [
                    "Code exercises"
                ],
                "summary": "My attempts at a code exercise",
                "operationId": "code-exercises.topics.by-topic.attempts.get",
                "parameters": [
                    {
                        "name": "topic",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The caller's own attempts, newest first",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "no access to the course"
                    },
                    "404": {
                        "description": "not a code exercise"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Code exercises"
                ],
                "summary": "Report the result of a run",
                "description": "The learner's browser ran the visible tests and reports each test's result. The score is recomputed here and the attempt is stored as a practice attempt (verified = false): it moves the topic's progress by its completion rule and records a learner signal, and never counts for certificates or compliance.",
                "operationId": "code-exercises.topics.by-topic.attempts.post",
                "parameters": [
                    {
                        "name": "topic",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "results"
                                ],
                                "properties": {
                                    "results": {
                                        "type": "array",
                                        "items": {
                                            "required": [
                                                "name",
                                                "status"
                                            ],
                                            "properties": {
                                                "name": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string",
                                                    "enum": [
                                                        "pass",
                                                        "fail",
                                                        "error"
                                                    ]
                                                },
                                                "message": {
                                                    "type": "string",
                                                    "nullable": true
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "files_hash": {
                                        "description": "sha256 of the submitted files",
                                        "type": "string",
                                        "nullable": true
                                    },
                                    "runner": {
                                        "type": "string",
                                        "nullable": true
                                    },
                                    "duration_ms": {
                                        "type": "integer",
                                        "nullable": true
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "{attempt, status}; status 1 means the topic is complete",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "no access to the course"
                    },
                    "404": {
                        "description": "not a code exercise"
                    },
                    "422": {
                        "description": "invalid result"
                    },
                    "429": {
                        "description": "too many requests"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/code-exercises/topics/{topic}/preview": {
            "get": {
                "tags": [
                    "Code exercises"
                ],
                "summary": "Preview a code exercise as its author",
                "description": "The same answer as a launch, for a user who may edit the course. Nothing is tracked.",
                "operationId": "admin.code-exercises.topics.by-topic.preview.get",
                "parameters": [
                    {
                        "name": "topic",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "{runner, exercise}",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "not allowed to edit the course"
                    },
                    "404": {
                        "description": "not a code exercise"
                    },
                    "503": {
                        "description": "no content origin"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/code-exercises/topics/{topic}/attempts": {
            "get": {
                "tags": [
                    "Code exercises"
                ],
                "summary": "Attempts at a code exercise (teacher report)",
                "description": "Every learner's attempts at the exercise, newest first, for a user who may edit the course. Practice attempts are marked verified = false.",
                "operationId": "admin.code-exercises.topics.by-topic.attempts.get",
                "parameters": [
                    {
                        "name": "topic",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "maximum": 100
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "A page of attempts with the learner's id and name",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "not allowed to edit the course"
                    },
                    "404": {
                        "description": "not a code exercise"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/commerce/products": {
            "get": {
                "tags": [
                    "Commerce"
                ],
                "summary": "Prices and product state of everything this tenant sells",
                "description": "One row per sellable that has a price: its type (course, bundle or access_pass), name, price in minor units, whether it is for sale, whether it is published, and the product at the commerce provider (id, variant, last sync, last sync error). Needs the permission commerce_prices_manage.",
                "operationId": "admin.commerce.products.list",
                "responses": {
                    "200": {
                        "description": "List of sellables with a price",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/commerce/products/{type}/{id}": {
            "put": {
                "tags": [
                    "Commerce"
                ],
                "summary": "Set the price of a sellable and put it on or off sale",
                "description": "Records the price (minor units and an ISO currency) and whether the sellable is for sale, then queues the sync to the commerce provider. The product is enabled at the provider only while it is for sale and published. Needs commerce_prices_manage.",
                "operationId": "admin.commerce.products.by-type.by-id.put",
                "parameters": [
                    {
                        "name": "type",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "course",
                                "bundle",
                                "access_pass"
                            ]
                        }
                    },
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "price_minor",
                                    "currency"
                                ],
                                "properties": {
                                    "price_minor": {
                                        "type": "integer",
                                        "minimum": 1
                                    },
                                    "currency": {
                                        "type": "string",
                                        "example": "EUR"
                                    },
                                    "for_sale": {
                                        "type": "boolean"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "The sellable with its price",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "404": {
                        "description": "No such sellable"
                    },
                    "422": {
                        "description": "Invalid price"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/commerce/bundles": {
            "post": {
                "tags": [
                    "Commerce"
                ],
                "summary": "Create a bundle of courses",
                "description": "A bundle is bought once and grants every course in it. It has no price until one is set with PUT /api/admin/commerce/products/bundle/{id}. Needs commerce_prices_manage.",
                "operationId": "admin.commerce.bundles.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "name",
                                    "course_ids"
                                ],
                                "properties": {
                                    "name": {
                                        "type": "string"
                                    },
                                    "description": {
                                        "type": "string"
                                    },
                                    "course_ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        }
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "The bundle",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "422": {
                        "description": "Invalid bundle"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/commerce/access-passes": {
            "post": {
                "tags": [
                    "Commerce"
                ],
                "summary": "Create an access pass",
                "description": "An access pass sells a course or a bundle for a number of days; the learner's access ends that many days after the purchase. It has no price until one is set with PUT /api/admin/commerce/products/access_pass/{id}. Needs commerce_prices_manage.",
                "operationId": "admin.commerce.access-passes.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "name",
                                    "subject_type",
                                    "subject_id",
                                    "days"
                                ],
                                "properties": {
                                    "name": {
                                        "type": "string"
                                    },
                                    "subject_type": {
                                        "type": "string",
                                        "enum": [
                                            "course",
                                            "bundle"
                                        ]
                                    },
                                    "subject_id": {
                                        "type": "integer"
                                    },
                                    "days": {
                                        "type": "integer",
                                        "maximum": 3650,
                                        "minimum": 1
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "The access pass",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "422": {
                        "description": "Invalid pass"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/commerce/webhooks/{provider}": {
            "post": {
                "tags": [
                    "Commerce webhooks"
                ],
                "summary": "Receive a signed order event of the commerce provider",
                "description": "Inbound order events of a commerce provider (ADR 0130). Public route, authenticated by the signature with the\ntenant's own secret, never by a session: the body is verified (HMAC over `<t>.<raw body>`, 300 s tolerance,\nthe secret being rotated out also accepted), its event id must equal the `Ulams-Event-Id` header, and its channel\nmust be this tenant's channel. A valid event is stored once per event id and queued; a duplicate answers 200\nwith no work. The payload is untrusted: only the envelope is read, and the job re-reads the order from the provider.",
                "operationId": "commerce.webhooks.by-provider.post",
                "parameters": [
                    {
                        "name": "provider",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "202": {
                        "description": "the event is stored and queued",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "200": {
                        "description": "duplicate delivery, nothing to do",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "invalid or expired signature, malformed event or another tenant's channel"
                    },
                    "404": {
                        "description": "unknown provider or webhooks not configured"
                    },
                    "413": {
                        "description": "body too large"
                    },
                    "429": {
                        "description": "rate limit"
                    }
                }
            }
        },
        "/api/admin/compliance/assignments": {
            "get": {
                "tags": [
                    "Compliance"
                ],
                "summary": "List required-training assignments",
                "description": "Required training. Admin endpoints need `compliance_manage`; `my-assignments` is the learner's own list\nand `team/assignments` lists the direct reports of the manager that is logged in.",
                "operationId": "admin.compliance.assignments.get",
                "parameters": [
                    {
                        "name": "status",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "assigned",
                                "overdue",
                                "completed",
                                "cancelled"
                            ]
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "course_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "default": 25
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "assignments with user, course and certificate",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Compliance"
                ],
                "summary": "Assign a required course to users",
                "operationId": "admin.compliance.assignments.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "course_id",
                                    "user_ids"
                                ],
                                "properties": {
                                    "course_id": {
                                        "type": "integer"
                                    },
                                    "user_ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        }
                                    },
                                    "due_at": {
                                        "type": "string",
                                        "format": "date-time",
                                        "nullable": true
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "one assignment per user (existing open ones are returned unchanged)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/compliance/assignments/{id}": {
            "delete": {
                "tags": [
                    "Compliance"
                ],
                "summary": "Cancel an open assignment",
                "operationId": "admin.compliance.assignments.by-id.delete",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "cancelled assignment",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "404": {
                        "description": "Unknown assignment"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/compliance/my-assignments": {
            "get": {
                "tags": [
                    "Compliance"
                ],
                "summary": "My required training",
                "operationId": "compliance.my-assignments.get",
                "responses": {
                    "200": {
                        "description": "the logged-in user's assignments, newest first",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/compliance/team/assignments": {
            "get": {
                "tags": [
                    "Compliance"
                ],
                "summary": "Required training of my direct reports",
                "operationId": "compliance.team.assignments.get",
                "parameters": [
                    {
                        "name": "status",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "assigned",
                                "overdue",
                                "completed",
                                "cancelled"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "assignments of the users that have the logged-in user as manager (empty for everyone else)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/compliance/competencies": {
            "get": {
                "tags": [
                    "Compliance"
                ],
                "summary": "The competency framework as a tree",
                "description": "The competency framework: a tree of competencies (areas and skills). Reading needs `compliance_manage` or\n`compliance_competencies` (authors pick from it); changing it needs `compliance_manage`.",
                "operationId": "admin.compliance.competencies.get",
                "responses": {
                    "200": {
                        "description": "competencies with nested children",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Compliance"
                ],
                "summary": "Add a competency",
                "operationId": "admin.compliance.competencies.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "name"
                                ],
                                "properties": {
                                    "name": {
                                        "type": "string"
                                    },
                                    "code": {
                                        "type": "string",
                                        "nullable": true
                                    },
                                    "description": {
                                        "type": "string",
                                        "nullable": true
                                    },
                                    "parent_id": {
                                        "type": "integer",
                                        "nullable": true
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "the competency",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/compliance/competencies/{id}": {
            "put": {
                "tags": [
                    "Compliance"
                ],
                "summary": "Rename or move a competency",
                "operationId": "admin.compliance.competencies.by-id.put",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "the competency",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Moving it under itself or its descendants"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Compliance"
                ],
                "summary": "Delete a competency (its sub-competencies move up, course tags go)",
                "operationId": "admin.compliance.competencies.by-id.delete",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "deleted",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Unknown competency"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/compliance/courses/{course}/competencies": {
            "get": {
                "tags": [
                    "Compliance"
                ],
                "summary": "Competency tags of a course (confirmed and suggested)",
                "description": "Competency tags of a course. AI suggests, the author confirms: suggestions are `suggested` and count for\nnothing (no skill profile, no rule) until confirmed. Allowed for `compliance_manage`, or for\n`compliance_competencies` on a course the user authors.",
                "operationId": "admin.compliance.courses.by-course.competencies.get",
                "parameters": [
                    {
                        "name": "course",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "tags with status, source, rationale and the lessons they point at",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/compliance/courses/{course}/competencies/{competency}": {
            "put": {
                "tags": [
                    "Compliance"
                ],
                "summary": "Tag a course with a competency (confirmed by the author), or confirm a suggestion",
                "operationId": "admin.compliance.courses.by-course.competencies.by-competency.put",
                "parameters": [
                    {
                        "name": "course",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "competency",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "the confirmed tag",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Unknown course or competency"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Compliance"
                ],
                "summary": "Remove a tag or reject a suggestion",
                "operationId": "admin.compliance.courses.by-course.competencies.by-competency.delete",
                "parameters": [
                    {
                        "name": "course",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "competency",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "removed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/compliance/courses/{course}/competencies/suggest": {
            "post": {
                "tags": [
                    "Compliance"
                ],
                "summary": "Ask the AI which competencies the course teaches",
                "description": "One AI call (logged with model, tokens and cost). Replaces the pending suggestions; confirmed tags are untouched. Needs a competency framework and at least one lesson.",
                "operationId": "admin.compliance.courses.by-course.competencies.suggest.post",
                "parameters": [
                    {
                        "name": "course",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "the new suggestions, for the author to confirm",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "503": {
                        "description": "AI is not configured or the call failed"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/compliance/courses/{course}/settings": {
            "get": {
                "tags": [
                    "Compliance"
                ],
                "summary": "Compliance settings of a course (defaults when none are saved)",
                "description": "Compliance policy of a course. Permission `compliance_manage`.",
                "operationId": "admin.compliance.courses.by-course.settings.get",
                "parameters": [
                    {
                        "name": "course",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "mandatory, validity_days, recertify_before_days, default_due_days, reminder_days, escalation_days",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "404": {
                        "description": "Unknown course"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Compliance"
                ],
                "summary": "Save the compliance settings of a course",
                "operationId": "admin.compliance.courses.by-course.settings.put",
                "parameters": [
                    {
                        "name": "course",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "mandatory": {
                                        "type": "boolean"
                                    },
                                    "validity_days": {
                                        "description": "Days a new certificate stays valid; null = never expires",
                                        "type": "integer",
                                        "nullable": true
                                    },
                                    "recertify_before_days": {
                                        "description": "Start recertification this many days before expiry; 0 = off",
                                        "type": "integer",
                                        "nullable": true
                                    },
                                    "default_due_days": {
                                        "description": "Due date offset for assignments without an explicit date",
                                        "type": "integer",
                                        "nullable": true
                                    },
                                    "reminder_days": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "nullable": true
                                    },
                                    "escalation_days": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "nullable": true
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "saved settings",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/compliance/dashboard": {
            "get": {
                "tags": [
                    "Compliance"
                ],
                "summary": "Compliance dashboard",
                "description": "Required training (open, overdue, completed, completion rate, average days to complete), certificate health (valid, expiring in 30 and 90 days, expired, revoked) and the same per course, the most overdue first.",
                "operationId": "admin.compliance.dashboard.get",
                "parameters": [
                    {
                        "name": "course_id",
                        "in": "query",
                        "description": "Limit to one course",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "assignments, certificates and courses blocks",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/compliance/managers": {
            "get": {
                "tags": [
                    "Compliance"
                ],
                "summary": "List manager links",
                "description": "Who escalations of a user's overdue training go to. Permission `compliance_manage`. Until an HRIS\nimport exists (Phase 6.3) the links are maintained here.",
                "operationId": "admin.compliance.managers.get",
                "responses": {
                    "200": {
                        "description": "user_id and manager_id pairs",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/compliance/managers/{user}": {
            "put": {
                "tags": [
                    "Compliance"
                ],
                "summary": "Set or clear the manager of a user",
                "operationId": "admin.compliance.managers.by-user.put",
                "parameters": [
                    {
                        "name": "user",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "manager_id": {
                                        "type": "integer",
                                        "nullable": true
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "the link, or null when cleared",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/compliance/paths": {
            "get": {
                "tags": [
                    "Compliance"
                ],
                "summary": "List learning paths with their steps",
                "description": "Learning paths: ordered courses with prerequisites. Admin endpoints need `compliance_manage`;\n`my-paths` is the learner's own view.",
                "operationId": "admin.compliance.paths.get",
                "responses": {
                    "200": {
                        "description": "paths with steps (course_id, position, prerequisites)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Compliance"
                ],
                "summary": "Create a learning path",
                "operationId": "admin.compliance.paths.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "title"
                                ],
                                "properties": {
                                    "title": {
                                        "type": "string"
                                    },
                                    "description": {
                                        "type": "string",
                                        "nullable": true
                                    },
                                    "steps": {
                                        "description": "Ordered; prerequisites are course ids of this path",
                                        "type": "array",
                                        "items": {
                                            "properties": {
                                                "course_id": {
                                                    "type": "integer"
                                                },
                                                "prerequisites": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "integer"
                                                    }
                                                }
                                            },
                                            "type": "object"
                                        }
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "the path",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "422": {
                        "description": "Unknown course, foreign prerequisite or a cycle"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/compliance/paths/{id}": {
            "get": {
                "tags": [
                    "Compliance"
                ],
                "summary": "Show a learning path",
                "operationId": "admin.compliance.paths.by-id.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "the path with enrolment counts",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Unknown path"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Compliance"
                ],
                "summary": "Update a learning path (steps are replaced when sent)",
                "operationId": "admin.compliance.paths.by-id.put",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "the path",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Compliance"
                ],
                "summary": "Delete a learning path (its assignments stay)",
                "operationId": "admin.compliance.paths.by-id.delete",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "deleted",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Unknown path"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/compliance/paths/{id}/enrollments": {
            "post": {
                "tags": [
                    "Compliance"
                ],
                "summary": "Enrol users in a learning path",
                "operationId": "admin.compliance.paths.by-id.enrollments.post",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "user_ids"
                                ],
                                "properties": {
                                    "user_ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        }
                                    },
                                    "due_at": {
                                        "type": "string",
                                        "format": "date-time",
                                        "nullable": true
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "enrolments (a user already in the path keeps theirs)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/compliance/my-paths": {
            "get": {
                "tags": [
                    "Compliance"
                ],
                "summary": "My learning paths",
                "operationId": "compliance.my-paths.get",
                "responses": {
                    "200": {
                        "description": "each enrolment with the path steps and their status (done, available, locked)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/compliance/report": {
            "get": {
                "tags": [
                    "Compliance"
                ],
                "summary": "Compliance report",
                "description": "Compliance report and audit export. Permission `compliance_report`. Datasets: `assignments` (required\ntraining and its outcome), `certificates` (every certificate with the course version it attests) and `audit`\n(hash-chained Living Course audit entries, when that package is installed).",
                "operationId": "admin.compliance.report.get",
                "parameters": [
                    {
                        "name": "dataset",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "assignments",
                                "certificates",
                                "audit"
                            ]
                        }
                    },
                    {
                        "name": "course_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "assignments: assigned, overdue, completed, cancelled; certificates: valid, expired, revoked",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "from",
                        "in": "query",
                        "description": "assigned or issued on or after this date",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "description": "assigned or issued on or before this date",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "default": 50
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "columns and rows of the dataset, with pagination meta",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "422": {
                        "description": "Unknown dataset"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/compliance/report/export": {
            "get": {
                "tags": [
                    "Compliance"
                ],
                "summary": "Audit export of a compliance dataset",
                "description": "Streams every matching row as CSV (default) or JSON lines. The export itself is recorded (who, dataset, filters, row count).",
                "operationId": "admin.compliance.report.export.get",
                "parameters": [
                    {
                        "name": "dataset",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "assignments",
                                "certificates",
                                "audit"
                            ]
                        }
                    },
                    {
                        "name": "format",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "default": "csv",
                            "enum": [
                                "csv",
                                "jsonl"
                            ]
                        }
                    },
                    {
                        "name": "course_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "from",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "file download"
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "422": {
                        "description": "Unknown dataset"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/compliance/rules": {
            "get": {
                "tags": [
                    "Compliance"
                ],
                "summary": "List enrolment rules",
                "description": "Enrolment rules: \"a user with these attributes is enrolled in this path, due in N days\". Permission\n`compliance_manage`. Attributes: `group` (group names), a user column or a custom user field (model-fields).\nRules run when a user is saved and in the daily `compliance:process`.",
                "operationId": "admin.compliance.rules.get",
                "responses": {
                    "200": {
                        "description": "rules",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Compliance"
                ],
                "summary": "Create an enrolment rule",
                "operationId": "admin.compliance.rules.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "name",
                                    "path_id",
                                    "conditions"
                                ],
                                "properties": {
                                    "name": {
                                        "type": "string"
                                    },
                                    "path_id": {
                                        "type": "integer"
                                    },
                                    "active": {
                                        "type": "boolean"
                                    },
                                    "due_days": {
                                        "type": "integer",
                                        "nullable": true
                                    },
                                    "conditions": {
                                        "description": "All must hold",
                                        "type": "array",
                                        "items": {
                                            "properties": {
                                                "attribute": {
                                                    "type": "string",
                                                    "example": "department"
                                                },
                                                "operator": {
                                                    "type": "string",
                                                    "enum": [
                                                        "equals",
                                                        "not_equals",
                                                        "in",
                                                        "contains",
                                                        "starts_with",
                                                        "ends_with",
                                                        "exists"
                                                    ]
                                                },
                                                "value": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                }
                                            },
                                            "type": "object"
                                        }
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "the rule",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/compliance/rules/{id}": {
            "put": {
                "tags": [
                    "Compliance"
                ],
                "summary": "Update an enrolment rule",
                "operationId": "admin.compliance.rules.by-id.put",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "the rule",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Unknown rule"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Compliance"
                ],
                "summary": "Delete an enrolment rule (existing enrolments stay)",
                "operationId": "admin.compliance.rules.by-id.delete",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "deleted",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Unknown rule"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/compliance/rules/{id}/evaluate": {
            "post": {
                "tags": [
                    "Compliance"
                ],
                "summary": "Preview or run a rule now",
                "operationId": "admin.compliance.rules.by-id.evaluate.post",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "dry_run": {
                                        "type": "boolean",
                                        "default": true
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "count and a sample of the users that match and are not enrolled yet; enrolled count when dry_run is false",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/compliance/schedules": {
            "get": {
                "tags": [
                    "Compliance"
                ],
                "summary": "List scheduled reports",
                "description": "Scheduled reports: a compliance dataset, or a saved report of the report builder, e-mailed as CSV, JSON lines or (saved\nreports) XLSX every day, week or month to tenant users. A saved report runs once per recipient with that recipient's own\npermissions. Permission `compliance_report`.",
                "operationId": "admin.compliance.schedules.get",
                "responses": {
                    "200": {
                        "description": "schedules",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Compliance"
                ],
                "summary": "Schedule a report",
                "operationId": "admin.compliance.schedules.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "name",
                                    "frequency",
                                    "recipient_ids"
                                ],
                                "properties": {
                                    "name": {
                                        "type": "string"
                                    },
                                    "dataset": {
                                        "description": "A compliance dataset; give this or saved_report_id",
                                        "type": "string",
                                        "enum": [
                                            "assignments",
                                            "certificates",
                                            "audit"
                                        ]
                                    },
                                    "saved_report_id": {
                                        "description": "A saved report the caller can see (report builder); it runs once per recipient with the recipient's own permissions",
                                        "type": "string"
                                    },
                                    "frequency": {
                                        "type": "string",
                                        "enum": [
                                            "daily",
                                            "weekly",
                                            "monthly"
                                        ]
                                    },
                                    "format": {
                                        "description": "xlsx only for a saved report",
                                        "type": "string",
                                        "enum": [
                                            "csv",
                                            "jsonl",
                                            "xlsx"
                                        ]
                                    },
                                    "filters": {
                                        "description": "course_id, user_id, status, from, to (datasets only)",
                                        "type": "object"
                                    },
                                    "recipient_ids": {
                                        "description": "Ids of users of this tenant",
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        }
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "the schedule; the first run is the next 06:00",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/compliance/schedules/{id}": {
            "put": {
                "tags": [
                    "Compliance"
                ],
                "summary": "Update a scheduled report",
                "operationId": "admin.compliance.schedules.by-id.put",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "the schedule",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Unknown schedule"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Compliance"
                ],
                "summary": "Delete a scheduled report",
                "operationId": "admin.compliance.schedules.by-id.delete",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "deleted",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Unknown schedule"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/compliance/my-skills": {
            "get": {
                "tags": [
                    "Compliance"
                ],
                "summary": "My skill profile",
                "description": "Learner skill profiles: the confirmed competencies of the courses a learner has done, with when they were earned\nand when they lapse.",
                "operationId": "compliance.my-skills.get",
                "responses": {
                    "200": {
                        "description": "competencies with the courses that prove them, earned_at and expires_at",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/compliance/users/{user}/skills": {
            "get": {
                "tags": [
                    "Compliance"
                ],
                "summary": "The skill profile of a user",
                "operationId": "admin.compliance.users.by-user.skills.get",
                "parameters": [
                    {
                        "name": "user",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "competencies",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "404": {
                        "description": "Unknown user"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/consultation-access-enquiries": {
            "get": {
                "tags": [
                    "Admin Consultation Access"
                ],
                "summary": "Get all consultation access enquiries",
                "operationId": "admin.consultation-access-enquiries.get",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "consultation_id",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "number"
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "number"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "pending",
                                "approved"
                            ]
                        }
                    },
                    {
                        "name": "proposed_at_from",
                        "in": "query",
                        "description": "Proposed at from",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "proposed_at_to",
                        "in": "query",
                        "description": "Proposed at to",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "is_coming",
                        "in": "query",
                        "description": "approved future or past consultations",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "true",
                                "false"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successfull operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/ConsultationAccessEnquiryResource"
                                            }
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/consultation-access-enquiries/approve/{proposedTermId}": {
            "post": {
                "tags": [
                    "Admin Consultation Access"
                ],
                "summary": "Approve the specified consultation access enquiry by proposed term id",
                "operationId": "admin.consultation-access-enquiries.approve.by-proposedtermid.post",
                "parameters": [
                    {
                        "name": "proposedTermId",
                        "in": "path",
                        "description": "proposedTermId",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/AdminApproveConsultationAccessEnquiryRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/consultation-access-enquiries/disapprove/{id}": {
            "post": {
                "tags": [
                    "Admin Consultation Access"
                ],
                "summary": "Disapprove the specified consultation access enquiry by id",
                "operationId": "admin.consultation-access-enquiries.disapprove.by-id.post",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/AdminDisapproveConsultationAccessEnquiryRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/consultation-access-enquiries": {
            "get": {
                "tags": [
                    "Consultation Access"
                ],
                "summary": "Get my consultation access enquiries",
                "operationId": "consultation-access-enquiries.get",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "consultation_id",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "number"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "pending",
                                "approved"
                            ]
                        }
                    },
                    {
                        "name": "proposed_at_from",
                        "in": "query",
                        "description": "Proposed at from",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "proposed_at_to",
                        "in": "query",
                        "description": "Proposed at to",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "is_coming",
                        "in": "query",
                        "description": "approved future or past consultations",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "true",
                                "false"
                            ]
                        }
                    },
                    {
                        "name": "consultation_term_ids[]",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {}
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successfull operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/ConsultationAccessEnquiryResource"
                                            }
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Consultation Access"
                ],
                "summary": "Store a newly Consultation Access Enqiury",
                "description": "Store Consultation Access Enqiury",
                "operationId": "consultation-access-enquiries.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateConsultationAccessEnquiryRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Successfull operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/ConsultationAccessEnquiryResource"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/consultation-access-enquiries/{id}": {
            "get": {
                "tags": [
                    "Consultation Access"
                ],
                "summary": "Get my consultation access enquiry by id",
                "operationId": "consultation-access-enquiries.by-id.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successfull operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/ConsultationAccessEnquiryResource"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Consultation Access"
                ],
                "summary": "Remove the specified Consultation Access Enquiry",
                "description": "Delete Consultation Access Enquiry",
                "operationId": "consultation-access-enquiries.by-id.delete",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "patch": {
                "tags": [
                    "Consultation Access"
                ],
                "summary": "Update Consultation Access Enqiury",
                "description": "Update Consultation Access Enqiury",
                "operationId": "consultation-access-enquiries.by-id.patch",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/UpdateConsultationAccessEnquiryRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Successfull operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/ConsultationAccessEnquiryResource"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/consultation-access-enquiries/{id}/join": {
            "get": {
                "tags": [
                    "Consultation Access"
                ],
                "summary": "Get url to consultation by enquiry id",
                "operationId": "consultation-access-enquiries.by-id.join.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successfull operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/JoinConsultationAccessResource"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/consultations/report-term/{orderItemId}": {
            "post": {
                "tags": [
                    "Consultations"
                ],
                "summary": "Report term with bought consultation",
                "description": "Report term consultation",
                "operationId": "consultations.report-term.by-orderitemid.post",
                "parameters": [
                    {
                        "name": "orderItemId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "term": {
                                        "type": "string",
                                        "example": "2022-10-12 10:45"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/consultations/approve-term/{consultationTermId}": {
            "get": {
                "tags": [
                    "Consultations"
                ],
                "description": "Approve reported term with consultation author",
                "operationId": "consultations.approve-term.by-consultationtermid.get",
                "parameters": [
                    {
                        "name": "consultationTermId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "term",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "2024-10-31 10:45"
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/consultations/reject-term/{consultationTermId}": {
            "get": {
                "tags": [
                    "Consultations"
                ],
                "description": "Reject reported term with consultation author",
                "operationId": "consultations.reject-term.by-consultationtermid.get",
                "parameters": [
                    {
                        "name": "consultationTermId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "term",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "2024-10-31 10:45"
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/consultations/generate-jitsi/{consultationTermId}": {
            "get": {
                "tags": [
                    "Consultations"
                ],
                "description": "Generate jitsi object for approved consultation term",
                "operationId": "consultations.generate-jitsi.by-consultationtermid.get",
                "parameters": [
                    {
                        "name": "consultationTermId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "term",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "2024-10-31 10:45"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/consultations": {
            "get": {
                "tags": [
                    "Consultations"
                ],
                "summary": "Get a listing of the Consultations.",
                "description": "Get all Consultations",
                "operationId": "consultations.get",
                "parameters": [
                    {
                        "name": "order_by",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "id",
                                "name",
                                "status",
                                "duration",
                                "active_from",
                                "active_to",
                                "created_at"
                            ]
                        }
                    },
                    {
                        "name": "order",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "ASC",
                                "DESC"
                            ]
                        }
                    },
                    {
                        "name": "only_with_categories",
                        "in": "query",
                        "description": "Consultation has categories",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Pagination Page Number",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "default": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Pagination Per Page",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "default": 15
                        }
                    },
                    {
                        "name": "name",
                        "in": "query",
                        "description": "Consultation name %LIKE%",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "Consultation status == ",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/consultations/me": {
            "get": {
                "tags": [
                    "Consultations"
                ],
                "summary": "Get a listing of the Consultations bought by user.",
                "description": "Get a listing of the Consultations bought by user",
                "operationId": "consultations.me.get",
                "parameters": [
                    {
                        "name": "order_by",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "finished_at",
                                "started_at",
                                "created_at",
                                "name"
                            ]
                        }
                    },
                    {
                        "name": "order",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "ASC",
                                "DESC"
                            ]
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Pagination Page Number",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "default": 1
                        }
                    },
                    {
                        "name": "paginate",
                        "in": "query",
                        "description": "If true, list convert to paginate",
                        "required": false,
                        "schema": {
                            "type": "boolean",
                            "default": false
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Pagination Per Page",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "default": 15
                        }
                    },
                    {
                        "name": "name",
                        "in": "query",
                        "description": "Consultation name %LIKE%",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "ids[]",
                        "in": "query",
                        "description": "Integer array",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "Consultation status == ",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/consultations/proposed-terms/{orderItemId}": {
            "get": {
                "tags": [
                    "Consultations"
                ],
                "description": "Get proposedTerm For OrderItem",
                "operationId": "consultations.proposed-terms.by-orderitemid.get",
                "parameters": [
                    {
                        "name": "orderItemId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/consultations/{id}": {
            "get": {
                "tags": [
                    "Consultations"
                ],
                "summary": "Display the specified Consultation",
                "description": "Get Consultation",
                "operationId": "consultations.by-id.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of Consultation",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/consultations/my-schedule": {
            "get": {
                "tags": [
                    "Consultations"
                ],
                "description": "Get Consultation schedule for tutor",
                "operationId": "consultations.my-schedule.get",
                "parameters": [
                    {
                        "name": "ids[]",
                        "in": "query",
                        "description": "Consultation ID integer array",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "integer"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/consultations/finish-term/{consultationTermId}": {
            "post": {
                "tags": [
                    "Consultations"
                ],
                "summary": "Finish consultation term",
                "description": "Finish consultation term",
                "operationId": "consultations.finish-term.by-consultationtermid.post",
                "parameters": [
                    {
                        "name": "consultationTermId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "finished_at": {
                                        "type": "string",
                                        "example": "2024-10-04 12:02:12"
                                    },
                                    "term": {
                                        "type": "string",
                                        "example": "2024-10-04 12:02:12"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/consultations": {
            "get": {
                "tags": [
                    "Admin Consultations"
                ],
                "operationId": "admin.consultations.get",
                "parameters": [
                    {
                        "name": "order_by",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "id",
                                "name",
                                "status",
                                "duration",
                                "active_from",
                                "active_to",
                                "created_at"
                            ]
                        }
                    },
                    {
                        "name": "order",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "ASC",
                                "DESC"
                            ]
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Pagination Page Number",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "default": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Pagination Per Page",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "default": 15
                        }
                    },
                    {
                        "name": "name",
                        "in": "query",
                        "description": "Consultation name %LIKE%",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "Consultation status == ",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "only_with_categories",
                        "in": "query",
                        "description": "Consultation has categories",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Admin Consultations"
                ],
                "summary": "Store a newly created Consultation in storage",
                "description": "Store Consultation",
                "operationId": "admin.consultations.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/Consultation"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/consultations/{id}": {
            "get": {
                "tags": [
                    "Admin Consultations"
                ],
                "summary": "Display the specified Consultation",
                "description": "Get Consultation",
                "operationId": "admin.consultations.by-id.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of Consultation",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Admin Consultations"
                ],
                "summary": "Update the specified Consultation in storage",
                "description": "Update Consultation",
                "operationId": "admin.consultations.by-id.put",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of Consultation",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/Consultation"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Admin Consultations"
                ],
                "summary": "Remove the specified Consultation from storage",
                "description": "Delete Consultation",
                "operationId": "admin.consultations.by-id.delete",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of Consultation",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/consultations/{id}/schedule": {
            "get": {
                "tags": [
                    "Consultations"
                ],
                "description": "Get Consultation schedule",
                "operationId": "admin.consultations.by-id.schedule.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of Consultation",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "date_from",
                        "in": "query",
                        "description": "Course term date from",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "date_to",
                        "in": "query",
                        "description": "Course term date to",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "Course term status: not_reported, reported, reject, approved",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/consultations/change-term/{consultationTermId}": {
            "post": {
                "tags": [
                    "Consultations"
                ],
                "summary": "Change term in consultation with tutor",
                "description": "Change term consultation with tutor",
                "operationId": "consultations.change-term.by-consultationtermid.post",
                "parameters": [
                    {
                        "name": "consultationTermId",
                        "in": "path",
                        "description": "id of Consultation Term",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "executed_at": {
                                        "type": "string",
                                        "example": "2024-10-31 10:45"
                                    },
                                    "term": {
                                        "type": "string",
                                        "example": "2024-10-31 10:45"
                                    },
                                    "for_all_users": {
                                        "type": "boolean"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/consultations/users/assignable": {
            "get": {
                "tags": [
                    "Admin Consultations"
                ],
                "description": "Get users assignable to consultations",
                "operationId": "admin.consultations.users.assignable.get",
                "parameters": [
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/core/packages": {
            "get": {
                "tags": [
                    "Core Admin"
                ],
                "summary": "List installed ulams packages",
                "description": "List of installed ulams packages with versions",
                "operationId": "core.packages.get",
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/csp-report": {
            "post": {
                "tags": [
                    "Core"
                ],
                "summary": "Collect a Content Security Policy violation report",
                "description": "Public, rate limited (60 per minute and IP), body up to 16 KB. Accepts `application/csp-report` (report-uri) and `application/reports+json` (Reporting API). Only the directive, the host of the blocked resource and the path of the page are kept, aggregated with a counter, and pruned after 30 days.",
                "operationId": "csp-report.post",
                "requestBody": {
                    "content": {
                        "application/csp-report": {
                            "schema": {
                                "type": "object"
                            }
                        },
                        "application/reports+json": {
                            "schema": {
                                "type": "array",
                                "items": {
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "204": {
                        "description": "Report accepted"
                    },
                    "400": {
                        "description": "The body is not a JSON report"
                    },
                    "413": {
                        "description": "The body is larger than 16 KB"
                    },
                    "415": {
                        "description": "Unsupported content type"
                    },
                    "429": {
                        "description": "Too many reports"
                    }
                }
            }
        },
        "/api/admin/csp-reports": {
            "get": {
                "tags": [
                    "Core Admin"
                ],
                "summary": "List the aggregated CSP violation reports",
                "description": "Admins only. Newest first.",
                "operationId": "admin.csp-reports.get",
                "parameters": [
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "maximum": 100,
                            "minimum": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "directive": {
                                                        "type": "string",
                                                        "example": "frame-src"
                                                    },
                                                    "blocked_host": {
                                                        "type": "string",
                                                        "example": "tool.example.test"
                                                    },
                                                    "document_path": {
                                                        "type": "string",
                                                        "example": "/learn/1/2"
                                                    },
                                                    "count": {
                                                        "type": "integer"
                                                    },
                                                    "first_seen_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "last_seen_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Endpoint requires authentication"
                    },
                    "403": {
                        "description": "User is not an admin"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/health-check": {
            "get": {
                "tags": [
                    "Api"
                ],
                "summary": "Check health of the application",
                "operationId": "health-check.get",
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "properties": {
                                            "db_status": {
                                                "type": "string"
                                            },
                                            "redis_status": {
                                                "type": "string"
                                            },
                                            "cpu_usage": {
                                                "type": "string"
                                            },
                                            "disk": {
                                                "type": "string"
                                            }
                                        },
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/admin/course-access-enquiries": {
            "get": {
                "tags": [
                    "Admin Course Access"
                ],
                "summary": "Get all course access enquiries",
                "operationId": "admin.course-access-enquiries.get",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "course_id",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "number"
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "number"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "pending",
                                "approved"
                            ]
                        }
                    },
                    {
                        "name": "order",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "order_by",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successfull operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/CourseAccessEnquiryResource"
                                            }
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/course-access-enquiries/{id}": {
            "delete": {
                "tags": [
                    "Admin Course Access"
                ],
                "summary": "Remove the specified Course Access Enquiry",
                "description": "Delete Course Access Enquiry",
                "operationId": "admin.course-access-enquiries.by-id.delete",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/course-access-enquiries/approve/{id}": {
            "post": {
                "tags": [
                    "Admin Course Access"
                ],
                "summary": "Approve the specified Course Access Enquiry",
                "description": "Approve Course Access Enquiry",
                "operationId": "admin.course-access-enquiries.approve.by-id.post",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/courses/{id}/access": {
            "get": {
                "tags": [
                    "Admin Courses"
                ],
                "summary": "Get list of users and groups with access to the course",
                "description": "Get list of users and groups with access to the course",
                "operationId": "admin.courses.by-id.access.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of course",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiJson"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/courses/{id}/access/add": {
            "post": {
                "tags": [
                    "Admin Courses"
                ],
                "summary": "Add users and groups with access to the course",
                "description": "Add users and groups with access to the course",
                "operationId": "admin.courses.by-id.access.add.post",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of course",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "users": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        }
                                    },
                                    "groups": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        }
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiJson"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/courses/{id}/access/remove": {
            "post": {
                "tags": [
                    "Admin Courses"
                ],
                "summary": "Remove users and groups with access to the course",
                "description": "Remove users and groups with access to the course",
                "operationId": "admin.courses.by-id.access.remove.post",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of course",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "users": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        }
                                    },
                                    "groups": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        }
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiJson"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/courses/{id}/access/set": {
            "post": {
                "tags": [
                    "Admin Courses"
                ],
                "summary": "Set users and groups with access to the course",
                "description": "Set users and groups with access to the course",
                "operationId": "admin.courses.by-id.access.set.post",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of course",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "users": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        }
                                    },
                                    "groups": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        }
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiJson"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/courses/my": {
            "get": {
                "tags": [
                    "Courses"
                ],
                "summary": "Get my course list IDs",
                "description": "Get my course list IDs",
                "operationId": "courses.my.get",
                "parameters": [
                    {
                        "name": "active",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "enum": [
                                0,
                                1
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/course-access-enquiries": {
            "get": {
                "tags": [
                    "Course Access"
                ],
                "summary": "Get my course access enquiries",
                "description": "",
                "operationId": "course-access-enquiries.get",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "course_id",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "number"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "pending",
                                "approved"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successfull operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/CourseAccessEnquiryResource"
                                            }
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Course Access"
                ],
                "summary": "Store a newly Course Access Enqiury",
                "description": "Store Course Access Enqiury",
                "operationId": "course-access-enquiries.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateCourseAccessEnquiryApiRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Successfull operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/CourseAccessEnquiryResource"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/course-access-enquiries/{id}": {
            "delete": {
                "tags": [
                    "Course Access"
                ],
                "summary": "Remove the specified Course Access Enquiry",
                "description": "Delete Course Access Enquiry",
                "operationId": "course-access-enquiries.by-id.delete",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/course-versions/courses/{course}/compare": {
            "get": {
                "tags": [
                    "Admin Course Versions"
                ],
                "summary": "Semantic diff of two versions or releases of a course: moved elements, citations, quiz answer keys and a summary",
                "description": "Compare any two versions or releases of a course (ADR 0192, CV-2). Keyed by the LMS course id like the release list;\n`from` and `to` are version ids or release ids of the same builder session (a variant course can be compared with its\nbase this way). No AI gate: it works with AI switched off, and it makes no model call. Read-only; visible to the\nsession author and to tenant admins (the session policy). A pair that names something of another session is a 404.",
                "operationId": "admin.course-versions.courses.by-course.compare.get",
                "parameters": [
                    {
                        "name": "course",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "from",
                        "in": "query",
                        "description": "Version id or release id (the older side)",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "description": "Version id or release id (the newer side)",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "diffVersion, summary, changes, quiz, fragments, from, to, courseId, sessionId",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "another author's course"
                    },
                    "404": {
                        "description": "the course was not made with the Course Builder, or a version or release is not part of it"
                    },
                    "422": {
                        "description": "from or to is missing"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/course-as-code/courses/{course}/blueprint": {
            "get": {
                "tags": [
                    "Admin Course-as-code"
                ],
                "summary": "Export a course as a Blueprint v3 document (current version, drift, applied version)",
                "description": "Course-as-code API (ADR 0160, prefix `/api/admin/course-as-code`, `auth:api`, permission\n`course_builder_use`). It works with AI off: there is no AI gate on this route group. A push is\nalways a proposed version; a person approves it (agent tokens and MCP clients never can).",
                "operationId": "admin.course-as-code.courses.by-course.blueprint.get",
                "parameters": [
                    {
                        "name": "course",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "the blueprint with versionId, appliedVersionId and drift",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "another author's course"
                    },
                    "404": {
                        "description": "unknown course"
                    },
                    "409": {
                        "description": "NOT_ADOPTED (no builder session) or NO_BLUEPRINT"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/course-as-code/sessions/{session}/imports": {
            "post": {
                "tags": [
                    "Admin Course-as-code"
                ],
                "summary": "Import a Blueprint v3 document as a proposed version of kind import",
                "operationId": "admin.course-as-code.sessions.by-session.imports.post",
                "parameters": [
                    {
                        "name": "session",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "document",
                                    "baseVersionId"
                                ],
                                "properties": {
                                    "document": {
                                        "type": "object"
                                    },
                                    "baseVersionId": {
                                        "type": "string"
                                    },
                                    "message": {
                                        "type": "string"
                                    },
                                    "allowPending": {
                                        "description": "store the import although an open update proposal edits the same elements",
                                        "type": "boolean"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "proposed version, element diff and warnings",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "200": {
                        "description": "unchanged: the document equals the current version, no version is created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "another author's session"
                    },
                    "404": {
                        "description": "unknown session"
                    },
                    "409": {
                        "description": "BASE_OUTDATED (with the remote diff), PROPOSAL_PENDING (an open update proposal edits the same elements) or NO_BLUEPRINT"
                    },
                    "413": {
                        "description": "document too large"
                    },
                    "422": {
                        "description": "INVALID_BLUEPRINT, BASE_UNKNOWN or a missing field"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/course-as-code/versions/{version}": {
            "get": {
                "tags": [
                    "Admin Course-as-code"
                ],
                "summary": "One version with its Blueprint v3 document (what a three-way merge needs as the base)",
                "operationId": "admin.course-as-code.versions.by-version.get",
                "parameters": [
                    {
                        "name": "version",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "the version and its document",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "another author's session"
                    },
                    "404": {
                        "description": "unknown version"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/course-as-code/sessions/{session}/drift": {
            "post": {
                "tags": [
                    "Admin Course-as-code"
                ],
                "summary": "Read admin edits made after the last apply back into a proposed author version",
                "operationId": "admin.course-as-code.sessions.by-session.drift.post",
                "parameters": [
                    {
                        "name": "session",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "dryRun": {
                                        "type": "boolean"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "proposed version with what was absorbed and what could not be mapped back",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "200": {
                        "description": "nothing to absorb (or dryRun): the same listing, no version",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "another author's session"
                    },
                    "404": {
                        "description": "unknown session"
                    },
                    "409": {
                        "description": "NO_BLUEPRINT or NOT_APPLIED"
                    },
                    "422": {
                        "description": "INVALID_BLUEPRINT"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/course-as-code/versions/{version}/diff": {
            "get": {
                "tags": [
                    "Admin Course-as-code"
                ],
                "summary": "Element-aware diff of a version against its parent or ?against=",
                "operationId": "admin.course-as-code.versions.by-version.diff.get",
                "parameters": [
                    {
                        "name": "version",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "against",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "changes",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/course-as-code/versions/{version}/approve": {
            "post": {
                "tags": [
                    "Admin Course-as-code"
                ],
                "summary": "Approve a proposed import (people and CLI tokens; never agents or MCP clients)",
                "operationId": "admin.course-as-code.versions.by-version.approve.post",
                "parameters": [
                    {
                        "name": "version",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "approved; apply it next",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "APPROVAL_REQUIRES_HUMAN"
                    },
                    "409": {
                        "description": "not proposed, or STALE_PROPOSAL (the course changed after the import was proposed)"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/course-as-code/sessions/{session}/apply": {
            "post": {
                "tags": [
                    "Admin Course-as-code"
                ],
                "summary": "Apply the current version to the course (no AI needed)",
                "operationId": "admin.course-as-code.sessions.by-session.apply.post",
                "parameters": [
                    {
                        "name": "session",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "202": {
                        "description": "apply run",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/course-as-code/sessions/{session}/publish": {
            "post": {
                "tags": [
                    "Admin Course-as-code"
                ],
                "summary": "Publish the applied course (no AI needed)",
                "operationId": "admin.course-as-code.sessions.by-session.publish.post",
                "parameters": [
                    {
                        "name": "session",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "published",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "blocking items or unacknowledged warnings"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/course-builder/sessions": {
            "get": {
                "tags": [
                    "Admin Course Builder"
                ],
                "summary": "My builder sessions",
                "operationId": "admin.course-builder.sessions.get",
                "responses": {
                    "200": {
                        "description": "list",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Admin Course Builder"
                ],
                "summary": "Start a builder session",
                "description": "AI Course Builder REST API (prefix `/api/admin/course-builder`, `auth:api`, permission\n`course_builder_use`). UI actions sent as runs and these endpoints share the same services, so\nthe CLI and the MCP server can drive the builder without the UI.",
                "operationId": "admin.course-builder.sessions.post",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "title": {
                                        "type": "string"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "session with its state snapshot",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "daily limit reached"
                    },
                    "503": {
                        "description": "AI disabled"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/course-builder/sessions/{session}": {
            "get": {
                "tags": [
                    "Admin Course Builder"
                ],
                "summary": "A session's state snapshot",
                "operationId": "admin.course-builder.sessions.by-session.get",
                "parameters": [
                    {
                        "name": "session",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "snapshot",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "another author's session"
                    },
                    "404": {
                        "description": "unknown"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Admin Course Builder"
                ],
                "summary": "Delete a session (an applied course is kept)",
                "operationId": "admin.course-builder.sessions.by-session.delete",
                "parameters": [
                    {
                        "name": "session",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "deleted",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/course-builder/sessions/{session}/sources": {
            "post": {
                "tags": [
                    "Admin Course Builder"
                ],
                "summary": "Upload a source (MD, PDF, DOCX); ingestion and the interview start by themselves",
                "operationId": "admin.course-builder.sessions.by-session.sources.post",
                "parameters": [
                    {
                        "name": "session",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "properties": {
                                    "file": {
                                        "type": "string",
                                        "format": "binary"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "202": {
                        "description": "source and ingest run",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "rejected upload"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/course-builder/sessions/{session}/sources/{source}": {
            "get": {
                "tags": [
                    "Admin Course Builder"
                ],
                "summary": "A source with its section tree",
                "operationId": "admin.course-builder.sessions.by-session.sources.by-source.get",
                "parameters": [
                    {
                        "name": "session",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "source",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "source",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/course-builder/sessions/{session}/citations": {
            "get": {
                "tags": [
                    "Admin Course Builder"
                ],
                "summary": "Sources panel: sections with the elements that cite them",
                "operationId": "admin.course-builder.sessions.by-session.citations.get",
                "parameters": [
                    {
                        "name": "session",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "sources, sections, citing elements",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/course-builder/sessions/{session}/outline": {
            "post": {
                "tags": [
                    "Admin Course Builder"
                ],
                "summary": "Edit the course structure: rename, move, add, remove, set the lesson format",
                "operationId": "admin.course-builder.sessions.by-session.outline.post",
                "parameters": [
                    {
                        "name": "session",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "action": {
                                        "type": "string"
                                    },
                                    "id": {
                                        "type": "string"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "new author version, re-apply run",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiJson"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "the edit is not valid"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/course-builder/sessions/{session}/elements/{element}/variants": {
            "post": {
                "tags": [
                    "Admin Course Builder"
                ],
                "summary": "Give me options: 2 or 3 proposals for one element, compared side by side",
                "operationId": "admin.course-builder.sessions.by-session.elements.by-element.variants.post",
                "parameters": [
                    {
                        "name": "session",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "element",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "count": {
                                        "type": "integer"
                                    },
                                    "instruction": {
                                        "type": "string"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "202": {
                        "description": "run id",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/course-builder/fragments/{fragment}": {
            "get": {
                "tags": [
                    "Admin Course Builder"
                ],
                "summary": "One source fragment (citation popover)",
                "operationId": "admin.course-builder.fragments.by-fragment.get",
                "parameters": [
                    {
                        "name": "fragment",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "fragment",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/course-builder/sessions/{session}/brief": {
            "get": {
                "tags": [
                    "Admin Course Builder"
                ],
                "summary": "Course Brief",
                "operationId": "admin.course-builder.sessions.by-session.brief.get",
                "parameters": [
                    {
                        "name": "session",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "brief",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Admin Course Builder"
                ],
                "summary": "Edit the Course Brief",
                "operationId": "admin.course-builder.sessions.by-session.brief.put",
                "parameters": [
                    {
                        "name": "session",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "brief",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "invalid"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/course-builder/sessions/{session}/runs": {
            "post": {
                "tags": [
                    "Admin Course Builder"
                ],
                "summary": "Start a run from a chat message or a UI action (AG-UI RunAgentInput)",
                "operationId": "admin.course-builder.sessions.by-session.runs.post",
                "parameters": [
                    {
                        "name": "session",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "messages": {
                                        "type": "array",
                                        "items": {
                                            "type": "object"
                                        }
                                    },
                                    "forwardedProps": {
                                        "type": "object"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "202": {
                        "description": "run id (null when the action finished in the request)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/course-builder/runs/{run}": {
            "get": {
                "tags": [
                    "Admin Course Builder"
                ],
                "summary": "Status of one run (poll it for --wait)",
                "operationId": "admin.course-builder.runs.by-run.get",
                "parameters": [
                    {
                        "name": "run",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "the run and its steps",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/CourseBuilderRunStatus"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "another author's session"
                    },
                    "404": {
                        "description": "unknown run"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/course-builder/runs/{run}/cancel": {
            "post": {
                "tags": [
                    "Admin Course Builder"
                ],
                "summary": "Cancel a run",
                "operationId": "admin.course-builder.runs.by-run.cancel.post",
                "parameters": [
                    {
                        "name": "run",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "cancelled",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/course-builder/runs/{run}/steps/{step}/retry": {
            "post": {
                "tags": [
                    "Admin Course Builder"
                ],
                "summary": "Retry one failed generation step",
                "operationId": "admin.course-builder.runs.by-run.steps.by-step.retry.post",
                "parameters": [
                    {
                        "name": "run",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "step",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "202": {
                        "description": "queued",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/course-builder/sessions/{session}/versions": {
            "get": {
                "tags": [
                    "Admin Course Builder"
                ],
                "summary": "Blueprint version history",
                "operationId": "admin.course-builder.sessions.by-session.versions.get",
                "parameters": [
                    {
                        "name": "session",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "versions",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/course-builder/versions/{version}": {
            "get": {
                "tags": [
                    "Admin Course Builder"
                ],
                "summary": "A blueprint version with fragment labels",
                "operationId": "admin.course-builder.versions.by-version.get",
                "parameters": [
                    {
                        "name": "version",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "version",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/course-builder/versions/{version}/diff": {
            "get": {
                "tags": [
                    "Admin Course Builder"
                ],
                "summary": "Element-aware diff against another version (default: its parent)",
                "operationId": "admin.course-builder.versions.by-version.diff.get",
                "parameters": [
                    {
                        "name": "version",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "against",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "changes",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/course-builder/versions/{version}/approve": {
            "post": {
                "tags": [
                    "Admin Course Builder"
                ],
                "summary": "Approve a proposal (outline or patch)",
                "operationId": "admin.course-builder.versions.by-version.approve.post",
                "parameters": [
                    {
                        "name": "version",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "approved",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiJson"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/course-builder/versions/{version}/reject": {
            "post": {
                "tags": [
                    "Admin Course Builder"
                ],
                "summary": "Reject a proposal",
                "operationId": "admin.course-builder.versions.by-version.reject.post",
                "parameters": [
                    {
                        "name": "version",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "rejected",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiJson"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/course-builder/versions/{version}/restore": {
            "post": {
                "tags": [
                    "Admin Course Builder"
                ],
                "summary": "Restore an old version as a new one",
                "operationId": "admin.course-builder.versions.by-version.restore.post",
                "parameters": [
                    {
                        "name": "version",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "restored",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiJson"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/course-builder/sessions/{session}/undo": {
            "post": {
                "tags": [
                    "Admin Course Builder"
                ],
                "summary": "Undo the last content change",
                "operationId": "admin.course-builder.sessions.by-session.undo.post",
                "parameters": [
                    {
                        "name": "session",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "current version",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiJson"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/course-builder/sessions/{session}/redo": {
            "post": {
                "tags": [
                    "Admin Course Builder"
                ],
                "summary": "Redo",
                "operationId": "admin.course-builder.sessions.by-session.redo.post",
                "parameters": [
                    {
                        "name": "session",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "current version",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiJson"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/course-builder/sessions/{session}/apply": {
            "post": {
                "tags": [
                    "Admin Course Builder"
                ],
                "summary": "Approve the apply of the current version",
                "operationId": "admin.course-builder.sessions.by-session.apply.post",
                "parameters": [
                    {
                        "name": "session",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "202": {
                        "description": "apply run",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/course-builder/sessions/{session}/publish-check": {
            "get": {
                "tags": [
                    "Admin Course Builder"
                ],
                "summary": "Blocking items and warnings before publishing",
                "operationId": "admin.course-builder.sessions.by-session.publish-check.get",
                "parameters": [
                    {
                        "name": "session",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "blocking, warnings and facts",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/course-builder/sessions/{session}/new-site": {
            "post": {
                "tags": [
                    "Admin Course Builder"
                ],
                "summary": "Create a new site and move the session there (platform operators; TENANCY_NEW_SITES)",
                "operationId": "admin.course-builder.sessions.by-session.new-site.post",
                "parameters": [
                    {
                        "name": "session",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "202": {
                        "description": "queued",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "not allowed"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/course-builder/sessions/{session}/publish": {
            "post": {
                "tags": [
                    "Admin Course Builder"
                ],
                "summary": "Publish the applied course (409 while blocking items or unacknowledged warnings remain; body acknowledgedWarnings)",
                "operationId": "admin.course-builder.sessions.by-session.publish.post",
                "parameters": [
                    {
                        "name": "session",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "published",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/course-builder/sessions/{session}/usage": {
            "get": {
                "tags": [
                    "Admin Course Builder"
                ],
                "summary": "AI calls of the session by task and model",
                "operationId": "admin.course-builder.sessions.by-session.usage.get",
                "parameters": [
                    {
                        "name": "session",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "usage",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/course-builder/sessions/{session}/variants": {
            "get": {
                "tags": [
                    "Admin Course Builder"
                ],
                "summary": "Course variants by level and role: status, own course, drift from the base, estimate and cap",
                "operationId": "admin.course-builder.sessions.by-session.variants.get",
                "parameters": [
                    {
                        "name": "session",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "variants, cap, base and estimate",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "another author's session"
                    },
                    "404": {
                        "description": "unknown"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Admin Course Builder"
                ],
                "summary": "Create variants from the interview answer (or add some later); start=true drafts their outlines in one run",
                "operationId": "admin.course-builder.sessions.by-session.variants.post",
                "parameters": [
                    {
                        "name": "session",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "audiences": {
                                        "type": "array",
                                        "items": {
                                            "type": "object"
                                        }
                                    },
                                    "start": {
                                        "type": "boolean"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "the variants created and the run, when started",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "the base course is not applied yet"
                    },
                    "422": {
                        "description": "not valid, or over COURSE_BUILDER_MAX_VARIANTS"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/course-builder/variants/{variant}": {
            "delete": {
                "tags": [
                    "Admin Course Builder"
                ],
                "summary": "Retire a variant (its course, if it has one, is kept)",
                "operationId": "admin.course-builder.variants.by-variant.delete",
                "parameters": [
                    {
                        "name": "variant",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "retired",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "patch": {
                "tags": [
                    "Admin Course Builder"
                ],
                "summary": "Rename, reorder or retire a variant",
                "operationId": "admin.course-builder.variants.by-variant.patch",
                "parameters": [
                    {
                        "name": "variant",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "the variant",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/course-builder/sessions/{session}/events": {
            "get": {
                "tags": [
                    "Admin Course Builder"
                ],
                "summary": "AG-UI event stream (SSE)",
                "description": "AG-UI events over SSE (ADR 0011). On connect: a STATE_SNAPSHOT (not stored, no id), then every\nstored event after `Last-Event-ID` (or `?after=`), then new events as they are appended. The\nconnection closes after `course_builder.sse.max_seconds` (25 s) so PHP-FPM workers are not held;\nthe client reconnects with the last id. Between polls the loop watches the session's \"last event\"\nkey in the cache and only queries the table when it moved (polling fallback every 500 ms).",
                "operationId": "admin.course-builder.sessions.by-session.events.get",
                "parameters": [
                    {
                        "name": "session",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "after",
                        "in": "query",
                        "description": "resume after this event id (or Last-Event-ID header)",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "text/event-stream"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/course-versions/courses/{course}/releases": {
            "get": {
                "tags": [
                    "Admin Course Versions"
                ],
                "summary": "Releases of a course (what learners got), newest first, with a summary of what changed",
                "description": "Course releases (ADR 0192): the versions of a course that learners actually got, newest first. Keyed by the LMS\ncourse id, like the Insights page. No AI gate: it works with AI switched off. Visible to the session author and to\ntenant admins (the session policy); read-only, a release is written by the apply step only.",
                "operationId": "admin.course-versions.courses.by-course.releases.get",
                "parameters": [
                    {
                        "name": "course",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "perPage",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "maximum": 100
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "releases, total, page, perPage, sessionId",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "another author's course"
                    },
                    "404": {
                        "description": "the course was not made with the Course Builder"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/course-versions/releases/{release}": {
            "get": {
                "tags": [
                    "Admin Course Versions"
                ],
                "summary": "One release with the blueprint document of its version",
                "operationId": "admin.course-versions.releases.by-release.get",
                "parameters": [
                    {
                        "name": "release",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "release and document",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "another author's course"
                    },
                    "404": {
                        "description": "unknown release"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/course-builder/style-profiles": {
            "get": {
                "tags": [
                    "Admin Course Builder"
                ],
                "summary": "Style profiles of the academy, newest first (filter with status, scopeType, scopeId)",
                "description": "Style profiles (ADR 0196): the cited, author-approved reading of an organisation's style guide. Anyone who may use\nthe Course Builder can list, read and propose profiles (a profile belongs to the whole academy, like a theme);\nediting and deleting a suggestion is for its creator or an admin; approving is for admins, because an approved\nprofile shapes every course drafted afterwards. The style guide is an untrusted upload; its text never leaves the\nextraction call.",
                "operationId": "admin.course-builder.style-profiles.get",
                "parameters": [
                    {
                        "name": "status",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "suggested",
                                "approved",
                                "superseded"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "profiles",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "no access to the Course Builder"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Admin Course Builder"
                ],
                "summary": "Propose a style profile: upload a style guide (file, MD/PDF/DOCX) to have it read and cited, or send values by hand (profile, optionally from an existing profile id)",
                "operationId": "admin.course-builder.style-profiles.post",
                "requestBody": {
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "properties": {
                                    "file": {
                                        "type": "string",
                                        "format": "binary"
                                    },
                                    "name": {
                                        "type": "string"
                                    },
                                    "profile": {
                                        "type": "string"
                                    },
                                    "from": {
                                        "type": "string"
                                    },
                                    "scopeType": {
                                        "type": "string",
                                        "enum": [
                                            "tenant",
                                            "brief"
                                        ]
                                    },
                                    "scopeId": {
                                        "type": "string"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "the suggested profile with what was dropped as warnings",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "rejected upload or invalid body"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/course-builder/style-profiles/{profile}": {
            "get": {
                "tags": [
                    "Admin Course Builder"
                ],
                "summary": "A style profile with the passages it cites and its diff against the approved profile",
                "operationId": "admin.course-builder.style-profiles.by-profile.get",
                "parameters": [
                    {
                        "name": "profile",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "profile, diff, cited fragments",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "unknown"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Admin Course Builder"
                ],
                "summary": "Delete a suggested or superseded profile",
                "operationId": "admin.course-builder.style-profiles.by-profile.delete",
                "parameters": [
                    {
                        "name": "profile",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "deleted",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "approved profiles are replaced, not deleted"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "patch": {
                "tags": [
                    "Admin Course Builder"
                ],
                "summary": "Edit a suggested profile (values and name); invalid values are dropped and reported",
                "operationId": "admin.course-builder.style-profiles.by-profile.patch",
                "parameters": [
                    {
                        "name": "profile",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "name": {
                                        "type": "string"
                                    },
                                    "profile": {
                                        "type": "object"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "the profile",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "not the creator or an admin"
                    },
                    "409": {
                        "description": "no longer a suggestion"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/course-builder/style-profiles/{profile}/approve": {
            "post": {
                "tags": [
                    "Admin Course Builder"
                ],
                "summary": "Approve a suggested profile (admins); it supersedes the approved profile of its scope",
                "operationId": "admin.course-builder.style-profiles.by-profile.approve.post",
                "parameters": [
                    {
                        "name": "profile",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "approved",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "not an admin"
                    },
                    "409": {
                        "description": "not a suggestion"
                    },
                    "422": {
                        "description": "empty profile"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/course-builder/style-profiles/{profile}/check": {
            "get": {
                "tags": [
                    "Admin Course Builder"
                ],
                "summary": "Style check: where a course departs from a profile (banned phrases, terminology, casing, landing components, image alt text; reading level and sentence length as hints). Only the author of the course or an admin; nothing is changed",
                "operationId": "admin.course-builder.style-profiles.by-profile.check.get",
                "parameters": [
                    {
                        "name": "profile",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "course",
                        "in": "query",
                        "description": "LMS course id of a course made with the builder (a variant's course too)",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "blocking, warnings and hints, each with the style guide passages it comes from",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "another author's course"
                    },
                    "404": {
                        "description": "unknown profile or course"
                    },
                    "422": {
                        "description": "course missing"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/course-versions/courses/{course}/versions": {
            "get": {
                "tags": [
                    "Admin Course Versions"
                ],
                "summary": "All versions of a course's branch (proposals, rejected and undone ones too), newest first, with the session's variants",
                "description": "Every version of a course's branch, not only the ones learners got (ADR 0192, CV-3): proposals, rejected and undone\nversions as well, newest first, for the \"show all versions\" toggle and the pickers of the compare screen. Keyed by the\nLMS course id like the release list. `branch=all` lists the versions of every branch of the session (the base and its\nvariants), so a variant can be picked against the base. The variants of the session come with it. No AI gate and no\nmodel call; read-only; visible to the session author and to tenant admins (the session policy). The documents are not\npart of the list: the compare endpoint reads them.",
                "operationId": "admin.course-versions.courses.by-course.versions.get",
                "parameters": [
                    {
                        "name": "course",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "branch",
                        "in": "query",
                        "description": "`all` lists the versions of every branch of the session",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "own",
                                "all"
                            ]
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "perPage",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "maximum": 200
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "versions, variants, total, page, perPage, sessionId, variantId, courseId, baseCourseId",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "another author's course"
                    },
                    "404": {
                        "description": "the course was not made with the Course Builder"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/course-variant-groups": {
            "get": {
                "tags": [
                    "Course Variants"
                ],
                "summary": "List the families of course variants, optionally the one a course belongs to",
                "description": "Families of course variants for admins (ADR 0192, permission `course_variants_assign`): the family's settings\n(lock assigned variants, pin the course mandatory training counts, placement check, hints), who is in which variant, an\nassignment of learners or groups, and the placement questions.",
                "operationId": "admin.course-variant-groups.get",
                "parameters": [
                    {
                        "name": "course_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "groups with settings and counts",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/course-variant-groups/{group}": {
            "get": {
                "tags": [
                    "Course Variants"
                ],
                "summary": "One family: settings, variant courses, where learners are and the placement check",
                "operationId": "admin.course-variant-groups.by-group.get",
                "parameters": [
                    {
                        "name": "group",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "the family",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Unknown family"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Course Variants"
                ],
                "summary": "Change the settings of a family",
                "operationId": "admin.course-variant-groups.by-group.put",
                "parameters": [
                    {
                        "name": "group",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "pinned_course_id": {
                                        "description": "Mandatory training counts only this course of the family; null lets any variant count",
                                        "type": "integer",
                                        "nullable": true
                                    },
                                    "lock_assigned": {
                                        "description": "A variant assigned by an admin or a rule cannot be changed by the learner",
                                        "type": "boolean"
                                    },
                                    "placement_enabled": {
                                        "type": "boolean"
                                    },
                                    "hints_enabled": {
                                        "type": "boolean"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "the family",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "The pinned course is not in the family"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/course-variant-groups/{group}/assignments": {
            "get": {
                "tags": [
                    "Course Variants"
                ],
                "summary": "Who is in which variant (current assignments, with the source of each)",
                "operationId": "admin.course-variant-groups.by-group.assignments.get",
                "parameters": [
                    {
                        "name": "group",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "assignments and per-variant counts",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Course Variants"
                ],
                "summary": "Assign learners or user groups to a variant; the learner sees it as assigned by their organisation",
                "operationId": "admin.course-variant-groups.by-group.assignments.put",
                "parameters": [
                    {
                        "name": "group",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "course_id"
                                ],
                                "properties": {
                                    "course_id": {
                                        "type": "integer"
                                    },
                                    "user_ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        }
                                    },
                                    "group_ids": {
                                        "description": "User groups; their members (and subgroups) are assigned",
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        }
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "assigned (learners whose variant changed) and matched",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Not a variant of this family, or nobody selected"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/course-variant-groups/{group}/placement": {
            "get": {
                "tags": [
                    "Course Variants"
                ],
                "summary": "The placement questions with their answer key and citations",
                "operationId": "admin.course-variant-groups.by-group.placement.get",
                "parameters": [
                    {
                        "name": "group",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "enabled, available, levels and items",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/course-variant-groups/{group}/placement/rebuild": {
            "post": {
                "tags": [
                    "Course Variants"
                ],
                "summary": "Choose the placement questions again from the family's cited quiz questions (no model call)",
                "operationId": "admin.course-variant-groups.by-group.placement.rebuild.post",
                "parameters": [
                    {
                        "name": "group",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "items and levels counts; zero items when the family has too few suitable questions",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/courses/{course}/placement": {
            "get": {
                "tags": [
                    "Course Variants"
                ],
                "summary": "The placement questions of a course's family (no answer key); 404 when the check is off or not ready",
                "description": "The optional placement check for learners (ADR 0192). Advisory only: the result suggests a variant with its reason and\nthe learner confirms it or picks another. Scored by code from cited quiz questions that already exist; nothing about\nthe learner is sent to a model. Needs access to the family.",
                "operationId": "courses.by-course.placement.get",
                "parameters": [
                    {
                        "name": "course",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "questions: id, type, stem, options (id, text); cited quiz questions chosen for the levels of the family",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "No access to the family"
                    },
                    "404": {
                        "description": "No placement check for this course"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/courses/{course}/placement/attempts": {
            "post": {
                "tags": [
                    "Course Variants"
                ],
                "summary": "Score a placement attempt by code and get the suggested variant with the reason (advisory)",
                "operationId": "courses.by-course.placement.attempts.post",
                "parameters": [
                    {
                        "name": "course",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "answers"
                                ],
                                "properties": {
                                    "answers": {
                                        "description": "Question id to the option ids chosen",
                                        "type": "object",
                                        "additionalProperties": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        }
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "id, scores per level, suggestedCourseId, reason; the answers are not stored",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "No access to the family"
                    },
                    "404": {
                        "description": "No placement check for this course"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/course-variant-groups/{group}/rules": {
            "get": {
                "tags": [
                    "Course Variants"
                ],
                "summary": "List the assignment rules of a family",
                "description": "Assignment rules of a family (the `variant` action of the enrolment rules, ADR 0192): \"a learner whose attributes match\n * all conditions is put in this variant\". Rules route learners who already have access and have no variant yet; they never\nenrol anyone and never override a learner's own choice or an admin's assignment. Permission `course_variants_assign`.",
                "operationId": "admin.course-variant-groups.by-group.rules.get",
                "parameters": [
                    {
                        "name": "group",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "rules in the order they are tried",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Course Variants"
                ],
                "summary": "Create an assignment rule",
                "operationId": "admin.course-variant-groups.by-group.rules.post",
                "parameters": [
                    {
                        "name": "group",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "name",
                                    "course_id",
                                    "conditions"
                                ],
                                "properties": {
                                    "name": {
                                        "type": "string"
                                    },
                                    "course_id": {
                                        "description": "The variant course it assigns",
                                        "type": "integer"
                                    },
                                    "active": {
                                        "type": "boolean"
                                    },
                                    "position": {
                                        "type": "integer"
                                    },
                                    "conditions": {
                                        "description": "All must hold",
                                        "type": "array",
                                        "items": {
                                            "properties": {
                                                "attribute": {
                                                    "type": "string",
                                                    "example": "department"
                                                },
                                                "operator": {
                                                    "type": "string",
                                                    "enum": [
                                                        "equals",
                                                        "not_equals",
                                                        "in",
                                                        "contains",
                                                        "starts_with",
                                                        "ends_with",
                                                        "exists"
                                                    ]
                                                },
                                                "value": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                }
                                            },
                                            "type": "object"
                                        }
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "the rule",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/course-variant-groups/{group}/rules/{rule}": {
            "put": {
                "tags": [
                    "Course Variants"
                ],
                "summary": "Update an assignment rule",
                "operationId": "admin.course-variant-groups.by-group.rules.by-rule.put",
                "parameters": [
                    {
                        "name": "group",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "rule",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "the rule",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Unknown rule"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Course Variants"
                ],
                "summary": "Delete an assignment rule (learners already assigned stay)",
                "operationId": "admin.course-variant-groups.by-group.rules.by-rule.delete",
                "parameters": [
                    {
                        "name": "group",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "rule",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "deleted",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Unknown rule"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/course-variant-groups/{group}/rules/{rule}/evaluate": {
            "post": {
                "tags": [
                    "Course Variants"
                ],
                "summary": "Preview or run a rule now",
                "operationId": "admin.course-variant-groups.by-group.rules.by-rule.evaluate.post",
                "parameters": [
                    {
                        "name": "group",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "rule",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "dry_run": {
                                        "type": "boolean",
                                        "default": true
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "count and a sample of the learners the rule would assign; assigned count when dry_run is false",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/courses/{course}/variants": {
            "get": {
                "tags": [
                    "Course Variants"
                ],
                "summary": "The variants of a course's family for the picker (public data), or null when it has none",
                "description": "Variants of a course for learners (ADR 0192, CV-5): the picker's data (public, like the course page), the learner's own\nvariant and the choice to change it, and the hint to switch. `{course}` is the default course or any variant of the\nfamily. The LMS owns who may open what; choosing needs access to the family.",
                "operationId": "courses.by-course.variants.get",
                "parameters": [
                    {
                        "name": "course",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "groupId, defaultCourseId and variants (courseId, title, label, level, role, isDefault, description, duration); data is null for a course without variants",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/courses/{course}/variant": {
            "get": {
                "tags": [
                    "Course Variants"
                ],
                "summary": "The signed-in learner's variant of this course's family, whether they may change it, the placement check and a hint to switch",
                "operationId": "courses.by-course.variant.get",
                "parameters": [
                    {
                        "name": "course",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "variants, current (courseId, source, reason, byOrganisation), effectiveCourseId, enrolled, canChange, lockedReason, placement, hint",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "The course has no variants"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Course Variants"
                ],
                "summary": "Choose or switch variant: enrols the learner in the variant's course through the family entitlement and carries over identical completed topics",
                "operationId": "courses.by-course.variant.put",
                "parameters": [
                    {
                        "name": "course",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "course_id"
                                ],
                                "properties": {
                                    "course_id": {
                                        "description": "The variant course to move to",
                                        "type": "integer"
                                    },
                                    "source": {
                                        "type": "string",
                                        "default": "self",
                                        "enum": [
                                            "self",
                                            "placement",
                                            "hint"
                                        ]
                                    },
                                    "attempt_id": {
                                        "description": "With source placement: the placement attempt whose suggestion is confirmed",
                                        "type": "string"
                                    },
                                    "hint_id": {
                                        "description": "With source hint: the hint that is accepted",
                                        "type": "integer"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "the state as in GET, plus changed and carried (topics completed by carry-over)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "No access to the family, or the variant was assigned by the organisation and the family is locked"
                    },
                    "422": {
                        "description": "Not a variant of this course, not available, or the placement attempt or hint does not match"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/courses/{course}/variant/hints/{hint}/dismiss": {
            "post": {
                "tags": [
                    "Course Variants"
                ],
                "summary": "Dismiss a hint to switch variant; hints stop for this course",
                "operationId": "courses.by-course.variant.hints.by-hint.dismiss.post",
                "parameters": [
                    {
                        "name": "course",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "hint",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "the state as in GET",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Unknown hint"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/courses/{id}/export": {
            "get": {
                "tags": [
                    "Admin Courses"
                ],
                "description": "Exports course to ZIP package ",
                "operationId": "admin.courses.by-id.export.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "number"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/courses/zip/import": {
            "post": {
                "tags": [
                    "Admin Courses"
                ],
                "description": "Imports course from ZIP package ",
                "operationId": "admin.courses.zip.import.post",
                "requestBody": {
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "required": [
                                    "file"
                                ],
                                "properties": {
                                    "file": {
                                        "type": "file",
                                        "format": "file"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Course imported successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "description": "The imported course (id, title, status and the other simple-resource fields)",
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "The package could not be imported",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "error": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/courses/{id}/clone": {
            "get": {
                "tags": [
                    "Admin Courses"
                ],
                "description": "Course cloning",
                "operationId": "admin.courses.by-id.clone.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "number"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/courses": {
            "get": {
                "tags": [
                    "Courses"
                ],
                "summary": "Get a listing of the Courses.",
                "description": "Get all Courses",
                "operationId": "courses.get",
                "parameters": [
                    {
                        "name": "order_by",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "created_at",
                                "title",
                                "duration",
                                "only_with_categories"
                            ]
                        }
                    },
                    {
                        "name": "order",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "ASC",
                                "DESC"
                            ]
                        }
                    },
                    {
                        "name": "only_with_categories",
                        "in": "query",
                        "description": "Consultation has categories",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Pagination Page Number",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "default": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Pagination Per Page",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "default": 15
                        }
                    },
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Course title %LIKE%",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "category_id",
                        "in": "query",
                        "description": "Category ID. When applied all courses with given cat_id and children categories are searched. Prohibited with categories",
                        "required": false,
                        "schema": {
                            "type": "number"
                        }
                    },
                    {
                        "name": "categories[]",
                        "in": "query",
                        "description": "An array of categories IDs. When applied all courses with given categories ids and children categories are searched. Prohibited with category_id",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "number"
                            }
                        }
                    },
                    {
                        "name": "authors[]",
                        "in": "query",
                        "description": "An array of author IDs",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "number"
                            }
                        }
                    },
                    {
                        "name": "tag",
                        "in": "query",
                        "description": "Tag name exactly",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "tag[]",
                        "in": "query",
                        "description": "An array of tags",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    },
                    {
                        "name": "ids[]",
                        "in": "query",
                        "description": "An array of IDs",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "number"
                            }
                        }
                    },
                    {
                        "name": "free",
                        "in": "query",
                        "description": "Will show only free courses",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/admin/courses": {
            "get": {
                "tags": [
                    "Admin Courses"
                ],
                "summary": "Get a listing of the Courses.",
                "description": "Get all Courses",
                "operationId": "admin.courses.get",
                "parameters": [
                    {
                        "name": "order_by",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "created_at",
                                "title",
                                "duration"
                            ]
                        }
                    },
                    {
                        "name": "order",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "ASC",
                                "DESC"
                            ]
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Pagination Page Number",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "default": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Pagination Per Page",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "default": 15
                        }
                    },
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Course title %LIKE%",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "category_id",
                        "in": "query",
                        "description": "Category ID. When applied all courses with given cat_id and children categories are searched",
                        "required": false,
                        "schema": {
                            "type": "number"
                        }
                    },
                    {
                        "name": "authors",
                        "in": "query",
                        "description": "Authors",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/components/schemas/User"
                            }
                        }
                    },
                    {
                        "name": "tag",
                        "in": "query",
                        "description": "Tag name exactly",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "free",
                        "in": "query",
                        "description": "Will show only free courses",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "Course status: published, draft, archived",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "group_id",
                        "in": "query",
                        "description": "Group",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Admin Courses"
                ],
                "summary": "Store a newly created Course in storage",
                "description": "Store Course",
                "operationId": "admin.courses.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/Course"
                            }
                        },
                        "multipart/form-data": {
                            "schema": {
                                "$ref": "#/components/schemas/Course"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/courses/authored": {
            "get": {
                "tags": [
                    "Courses"
                ],
                "summary": "Get a listing of the authored Courses.",
                "description": "Get all Courses",
                "operationId": "courses.authored.get",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Pagination Page Number",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "default": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Pagination Per Page",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "default": 15
                        }
                    },
                    {
                        "name": "order_by",
                        "in": "query",
                        "description": "Order by column",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "created_at",
                                "title",
                                "id",
                                "status"
                            ]
                        }
                    },
                    {
                        "name": "order",
                        "in": "query",
                        "description": "Order direction",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "ASC",
                                "DESC"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/courses/{id}": {
            "get": {
                "tags": [
                    "Courses"
                ],
                "summary": "Display the specified Course",
                "description": "Get Course",
                "operationId": "courses.by-id.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of Course",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/courses/{id}/program": {
            "get": {
                "tags": [
                    "Courses"
                ],
                "summary": "Display the specified Course program/curriculum/syllabus. No token required when course is free",
                "description": "Get Course",
                "operationId": "courses.by-id.program.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of Course",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/courses/{id}/scorm": {
            "get": {
                "tags": [
                    "Courses"
                ],
                "summary": "Display the specified Course scorm View to be embeede with iframe",
                "description": "Get Course",
                "operationId": "courses.by-id.scorm.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of Course",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "text/html": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/courses/{id}": {
            "post": {
                "tags": [
                    "Admin Courses"
                ],
                "summary": "Update the specified Course in storage",
                "description": "Update Course",
                "operationId": "admin.courses.by-id.post",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of Course",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "$ref": "#/components/schemas/Course"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Admin Courses"
                ],
                "summary": "Remove the specified Course from storage",
                "description": "Delete Course",
                "operationId": "admin.courses.by-id.delete",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of Course",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/courses/sort": {
            "post": {
                "tags": [
                    "Admin Courses"
                ],
                "summary": "Sorts Lessons or Topics",
                "description": "Sorts Lessons or Topics by sending course_id, class (Topic or Lesson) and array of tuple [class_id, order]. Example\n     * `{\"class\":\"Lesson\",\"orders\":[[3,0],[2,1],[4,2],[5,3],[6,4],[7,5],[1,6],[71,7]], \"course_id\":1}`\n     * ",
                "operationId": "admin.courses.sort.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "course_id": {
                                        "type": "integer"
                                    },
                                    "class": {
                                        "type": "string"
                                    },
                                    "orders": {
                                        "type": "array",
                                        "items": {
                                            "type": "array",
                                            "items": {
                                                "type": "integer"
                                            }
                                        }
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/tags/uniqueTags": {
            "get": {
                "tags": [
                    "Courses"
                ],
                "summary": "Endpoints get unique tags from active courses",
                "description": "Get unique tags",
                "operationId": "tags.uniquetags.get",
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/courses/{id}/preview/{topic_id}": {
            "get": {
                "tags": [
                    "Courses"
                ],
                "summary": "Preview the specified Course Topic is set to preview",
                "description": "Get Topic with Topicable",
                "operationId": "courses.by-id.preview.by-topic-id.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of Course",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "topic_id",
                        "in": "path",
                        "description": "id of Topic",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {}
                        }
                    }
                }
            }
        },
        "/api/tutors": {
            "get": {
                "tags": [
                    "Courses"
                ],
                "description": "Get Tutors",
                "operationId": "tutors.get",
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/tutors/{id}": {
            "get": {
                "tags": [
                    "Courses"
                ],
                "description": "Get tutor course/author ID ",
                "operationId": "tutors.by-id.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "number"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/courses/users/assignable": {
            "get": {
                "tags": [
                    "Admin Courses"
                ],
                "description": "Get users assignable to course",
                "operationId": "admin.courses.users.assignable.get",
                "parameters": [
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/courses/progress": {
            "get": {
                "tags": [
                    "Courses"
                ],
                "description": "Get Progresses",
                "operationId": "courses.progress.get",
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/courses/progress/paginated": {
            "get": {
                "tags": [
                    "Courses"
                ],
                "description": "Get Paginated Progresses",
                "operationId": "courses.progress.paginated.get",
                "parameters": [
                    {
                        "name": "order_by",
                        "in": "path",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "order",
                        "in": "path",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "title",
                                "obtained"
                            ]
                        }
                    },
                    {
                        "name": "status",
                        "in": "path",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "planned",
                                "started",
                                "finished"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/courses/progress/{course_id}": {
            "get": {
                "tags": [
                    "Courses"
                ],
                "description": "Show user course progress",
                "operationId": "courses.progress.by-course-id.get",
                "parameters": [
                    {
                        "name": "course_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "number"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "patch": {
                "tags": [
                    "Courses"
                ],
                "description": "Show user course progress",
                "operationId": "courses.progress.by-course-id.patch",
                "parameters": [
                    {
                        "name": "course_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "number"
                        }
                    },
                    {
                        "name": "progress[]",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "properties": {
                                    "topic_id": {
                                        "type": "integer"
                                    },
                                    "status": {
                                        "type": "integer"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/courses/progress/{topic_id}/ping": {
            "put": {
                "tags": [
                    "Courses"
                ],
                "description": "Update time in course by ping.",
                "operationId": "courses.progress.by-topic-id.ping.put",
                "parameters": [
                    {
                        "name": "topic_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "number"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/courses/progress/{topic_id}/h5p": {
            "post": {
                "tags": [
                    "Courses"
                ],
                "description": "Update h5p progress in course quiz.",
                "operationId": "courses.progress.by-topic-id.h5p.post",
                "parameters": [
                    {
                        "name": "topic_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "number"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "event": {
                                        "description": "The verb IRI (with the statement in `data`) or the whole xAPI statement object; a statement is stored as `data` and its verb as the event",
                                        "oneOf": [
                                            {
                                                "type": "string",
                                                "example": "http://adlnet.gov/expapi/verbs/attempted"
                                            },
                                            {
                                                "type": "object"
                                            }
                                        ]
                                    },
                                    "data": {
                                        "type": "object"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/lessons": {
            "get": {
                "tags": [
                    "Admin Courses"
                ],
                "summary": "Get a listing of the Lessons.",
                "description": "Get all Lessons",
                "operationId": "admin.lessons.get",
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Admin Courses"
                ],
                "summary": "Store a newly created Lesson in storage",
                "description": "Store Lesson",
                "operationId": "admin.lessons.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/Lesson"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/lessons/{id}": {
            "get": {
                "tags": [
                    "Admin Courses"
                ],
                "summary": "Display the specified Lesson",
                "description": "Get Lesson",
                "operationId": "admin.lessons.by-id.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of Lesson",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Admin Courses"
                ],
                "summary": "Update the specified Lesson in storage",
                "description": "Update Lesson",
                "operationId": "admin.lessons.by-id.put",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of Lesson",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/Lesson"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Admin Courses"
                ],
                "summary": "Remove the specified Lesson from storage",
                "description": "Delete Lesson",
                "operationId": "admin.lessons.by-id.delete",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of Lesson",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/lessons/{id}/clone": {
            "post": {
                "tags": [
                    "Admin Courses"
                ],
                "summary": "Clone Lesson",
                "description": "Clone Lesson with topics",
                "operationId": "admin.lessons.by-id.clone.post",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of Lesson",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/topics": {
            "get": {
                "tags": [
                    "Admin Courses"
                ],
                "summary": "Get a listing of the Topics.",
                "description": "Get all Topics",
                "operationId": "admin.topics.get",
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Admin Courses"
                ],
                "summary": "Store a newly created Topic in storage",
                "description": "Store Topic. Depending on `topicable_type` values are different. Endpoint does create both `Topic` and 1:1 related `Content` based on creating class ",
                "operationId": "admin.topics.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/x-www-form-urlencoded": {
                            "schema": {
                                "$ref": "#/components/schemas/Topic"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/topics/{id}": {
            "get": {
                "tags": [
                    "Admin Courses"
                ],
                "summary": "Display the specified Topic",
                "description": "Get Topic",
                "operationId": "admin.topics.by-id.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of Topic",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Admin Courses"
                ],
                "summary": "Update the specified Topic in storage",
                "description": "Update Topic",
                "operationId": "admin.topics.by-id.put",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of Topic",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/Topic"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Admin Courses"
                ],
                "summary": "Remove the specified Topic from storage",
                "description": "Delete Topic",
                "operationId": "admin.topics.by-id.delete",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of Topic",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/topics/types": {
            "get": {
                "tags": [
                    "Admin Courses"
                ],
                "summary": "Get a listing of the Availabe Topic Content Types Classes.",
                "description": "Get all Topic Contents",
                "operationId": "admin.topics.types.get",
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/topics/{id}/clone": {
            "post": {
                "tags": [
                    "Admin Courses"
                ],
                "summary": "Clone topic",
                "description": "Clone Topic.",
                "operationId": "admin.topics.by-id.clone.post",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of Topic",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Topic cloned successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/topics/{topic_id}/resources/": {
            "get": {
                "tags": [
                    "Admin Courses"
                ],
                "summary": "Get list of resources",
                "description": "Get list of resources",
                "operationId": "admin.topics.by-topic-id.resources.get",
                "parameters": [
                    {
                        "name": "topic_id",
                        "in": "path",
                        "description": "id of Topic",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Admin Courses"
                ],
                "summary": "Post new resource",
                "description": "Post new resource",
                "operationId": "admin.topics.by-topic-id.resources.post",
                "parameters": [
                    {
                        "name": "topic_id",
                        "in": "path",
                        "description": "id of Topic",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "properties": {
                                    "resource": {
                                        "type": "string",
                                        "format": "binary"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/topics/{topic_id}/resources/{resource_id}": {
            "delete": {
                "tags": [
                    "Admin Courses"
                ],
                "summary": "Delete resource",
                "description": "Delete resource",
                "operationId": "admin.topics.by-topic-id.resources.by-resource-id.delete",
                "parameters": [
                    {
                        "name": "topic_id",
                        "in": "path",
                        "description": "id of Topic",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "resource_id",
                        "in": "path",
                        "description": "id of Resource",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "patch": {
                "tags": [
                    "Admin Courses"
                ],
                "summary": "Rename resource",
                "description": "Rename resource",
                "operationId": "admin.topics.by-topic-id.resources.by-resource-id.patch",
                "parameters": [
                    {
                        "name": "topic_id",
                        "in": "path",
                        "description": "id of Topic",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "resource_id",
                        "in": "path",
                        "description": "id of Resource",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "name": {
                                        "type": "string"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/csv/groups/group_id": {
            "get": {
                "tags": [
                    "Admin CSV"
                ],
                "description": "Exports users to csv",
                "operationId": "admin.csv.groups.group-id.get",
                "parameters": [
                    {
                        "name": "format",
                        "in": "query",
                        "description": "exported file format",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiJson"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/csv/groups": {
            "post": {
                "tags": [
                    "Admin CSV"
                ],
                "description": "Imports group from csv",
                "operationId": "csv.groups",
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "properties": {
                                    "file": {
                                        "type": "file",
                                        "format": "file"
                                    },
                                    "return_url": {
                                        "description": "Address where the new user set the password",
                                        "type": "string",
                                        "example": "https://ulams.app/set-password"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/csv/users": {
            "get": {
                "tags": [
                    "Admin CSV"
                ],
                "description": "Exports users to csv",
                "operationId": "admin.csv.users.get",
                "parameters": [
                    {
                        "name": "search",
                        "in": "query",
                        "description": "will search through first_name, last_name and email",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "role",
                        "in": "query",
                        "description": "user role",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "format",
                        "in": "query",
                        "description": "exported file format",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "will check if user is_active",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "onboarding",
                        "in": "query",
                        "description": "will check if user completed onboarding",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "from",
                        "in": "query",
                        "description": "users created after this date",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "description": "users created before this date",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/csv": {}
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Admin CSV"
                ],
                "description": "Imports users from csv",
                "operationId": "csv.users-add",
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "properties": {
                                    "file": {
                                        "type": "file",
                                        "format": "file"
                                    },
                                    "return_url": {
                                        "description": "Address where the new user set the password",
                                        "type": "string",
                                        "example": "https://ulams.app/set-password"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/demo": {
            "get": {
                "tags": [
                    "Demo"
                ],
                "summary": "Demo mode status and the accounts used for the automatic login",
                "description": "Exists only on a tenant with DEMO_MODE=true; 404 everywhere else.",
                "operationId": "demo.get",
                "responses": {
                    "200": {
                        "description": "Demo mode is on",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "properties": {
                                                "enabled": {
                                                    "type": "boolean"
                                                },
                                                "users": {
                                                    "type": "array",
                                                    "items": {
                                                        "properties": {
                                                            "role": {
                                                                "type": "string",
                                                                "enum": [
                                                                    "student",
                                                                    "tutor",
                                                                    "admin"
                                                                ]
                                                            },
                                                            "email": {
                                                                "type": "string"
                                                            }
                                                        },
                                                        "type": "object"
                                                    }
                                                },
                                                "front_url": {
                                                    "type": "string",
                                                    "nullable": true
                                                },
                                                "admin_url": {
                                                    "type": "string",
                                                    "nullable": true
                                                },
                                                "reset_cron": {
                                                    "type": "string",
                                                    "nullable": true
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Demo mode is off"
                    }
                }
            }
        },
        "/api/demo/login": {
            "post": {
                "tags": [
                    "Demo"
                ],
                "summary": "Log in as the demo student or admin without a password",
                "description": "Issues a regular Passport token for the seeded account of that role, with the same response body as /api/auth/login. The demo student is given access to every published course. Exists only on a tenant with DEMO_MODE=true.",
                "operationId": "demo.login.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "role"
                                ],
                                "properties": {
                                    "role": {
                                        "type": "string",
                                        "enum": [
                                            "student",
                                            "tutor",
                                            "admin"
                                        ]
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Logged in",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "properties": {
                                                "token": {
                                                    "type": "string"
                                                },
                                                "expires_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Demo mode is off"
                    },
                    "422": {
                        "description": "Unknown role, or no seeded account for it"
                    }
                }
            }
        },
        "/api/admin/dictionaries/{id}/access": {
            "get": {
                "tags": [
                    "Admin Dictionaries"
                ],
                "summary": "Get list of users with access to the dictionary",
                "operationId": "admin.dictionaries.by-id.access.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of Dictionary",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successfull operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/DictionaryAccessAdminResource"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Admin Dictionaries"
                ],
                "summary": "Add users with access to the dictionary",
                "operationId": "admin.dictionaries.by-id.access.post",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of Dictionary",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/SetDictionaryAccessRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Successfull operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/dictionaries/access": {
            "get": {
                "tags": [
                    "Dictionaries"
                ],
                "summary": "Display my dictionaries",
                "operationId": "dictionaries.access.get",
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/DictionaryAccessResource"
                                            }
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/dictionaries": {
            "get": {
                "tags": [
                    "Admin Dictionaries"
                ],
                "summary": "Get a listing of the Dictionaries",
                "operationId": "admin.dictionaries.get",
                "parameters": [
                    {
                        "name": "order_by",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "id",
                                "name",
                                "created_at"
                            ]
                        }
                    },
                    {
                        "name": "order",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "ASC",
                                "DESC"
                            ]
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Pagination Page Number",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "default": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Pagination Per Page",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "default": 15
                        }
                    },
                    {
                        "name": "name",
                        "in": "query",
                        "description": "name %LIKE%",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/DictionaryResource"
                                            }
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Admin Dictionaries"
                ],
                "summary": "Store a newly created dictionary in storage",
                "operationId": "admin.dictionaries.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateDictionaryRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Successfull operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/DictionaryResource"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/dictionaries/{id}": {
            "get": {
                "tags": [
                    "Admin Dictionaries"
                ],
                "summary": "Display the specified Dictionary",
                "operationId": "admin.dictionaries.by-id.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of Dictionary",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successfull operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/DictionaryResource"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Admin Dictionaries"
                ],
                "summary": "Update the specified Dictionary in storage",
                "operationId": "admin.dictionaries.by-id.put",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of Dictionary",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/UpdateDictionaryRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Successfull operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/DictionaryResource"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Admin Dictionaries"
                ],
                "summary": "Remove the specified Dictionary from storage",
                "operationId": "admin.dictionaries.by-id.delete",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of Dictionary",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successfull operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/dictionary-words": {
            "get": {
                "tags": [
                    "Admin Dictionary Words"
                ],
                "summary": "Get a listing of the Dictionary Word",
                "operationId": "admin.dictionary-words.get",
                "parameters": [
                    {
                        "name": "order_by",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "id",
                                "name",
                                "created_at"
                            ]
                        }
                    },
                    {
                        "name": "order",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "ASC",
                                "DESC"
                            ]
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Pagination Page Number",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "default": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Pagination Per Page",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "default": 15
                        }
                    },
                    {
                        "name": "word",
                        "in": "query",
                        "description": "word %LIKE%",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "dictionary_id",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "category_ids[]",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "number"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/DictionaryWordSimpleResource"
                                            }
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Admin Dictionary Words"
                ],
                "summary": "Store a newly created dictionary word in storage",
                "operationId": "admin.dictionary-words.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateDictionaryWordRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Successfull operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/DictionaryWordResource"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/dictionary-words/{id}": {
            "get": {
                "tags": [
                    "Admin Dictionary Words"
                ],
                "summary": "Display the specified Dictionary Word",
                "operationId": "admin.dictionary-words.by-id.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of Dictionary Word",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successfull operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/DictionaryWordResource"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Admin Dictionary Words"
                ],
                "summary": "Update the specified Dictionary Word in storage",
                "operationId": "admin.dictionary-words.by-id.put",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of Dictionary",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateDictionaryWordRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Successfull operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/DictionaryWordResource"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Admin Dictionary Words"
                ],
                "summary": "Remove the specified Dictionary Word from storage",
                "operationId": "admin.dictionary-words.by-id.delete",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of Dictionary",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successfull operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/dictionary-words/import": {
            "post": {
                "tags": [
                    "Admin Dictionary Words"
                ],
                "summary": "Import dictionary words from file",
                "operationId": "admin.dictionary-words.import.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "$ref": "#/components/schemas/ImportDictionaryWordRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Successfull operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/dictionaries/{slug}/words": {
            "get": {
                "tags": [
                    "Dictionaries"
                ],
                "summary": "Get a listing of the Dictionary Word",
                "operationId": "dictionaries.by-slug.words.get",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "word",
                        "in": "query",
                        "description": "word %ILIKE%",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "word_start",
                        "in": "query",
                        "description": "word ILIKE%",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "category_ids[]",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "number"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/DictionaryWordSimpleResource"
                                            }
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/dictionaries/{slug}/words/{id}": {
            "get": {
                "tags": [
                    "Dictionaries"
                ],
                "summary": "Display the specified Dictionary Word",
                "operationId": "dictionaries.by-slug.words.by-id.get",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of Dictionary Word",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successfull operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/DictionaryWordResource"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too Many Requests"
                    }
                }
            }
        },
        "/api/dictionaries/{slug}/words/categories": {
            "get": {
                "tags": [
                    "Dictionaries"
                ],
                "summary": "Get the categories used in the dictionary for a given slug",
                "operationId": "dictionaries.by-slug.words.categories.get",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "word",
                        "in": "query",
                        "description": "word %ILIKE%",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "word_start",
                        "in": "query",
                        "description": "word ILIKE%",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "category_ids[]",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "number"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/DictionaryWordCategorySimpleResource"
                                            }
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/admin/example-plugin/greetings": {
            "post": {
                "tags": [
                    "Admin Example plugin"
                ],
                "summary": "Send the tenant's greeting to a user (dispatches GreetingSent)",
                "operationId": "admin.example-plugin.greetings.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/ExamplePluginSendGreetingRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/ExamplePluginGreetingResource"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Not authenticated"
                    },
                    "403": {
                        "description": "Missing the example-plugin_send-greeting permission"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/example-plugin/hello": {
            "get": {
                "tags": [
                    "Example plugin"
                ],
                "summary": "The tenant's greeting",
                "operationId": "example-plugin.hello.get",
                "parameters": [
                    {
                        "name": "name",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 80
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/ExamplePluginGreetingResource"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/admin/file/list": {
            "get": {
                "tags": [
                    "Files"
                ],
                "summary": "Lists files prefixed by given directory name",
                "operationId": "admin.file.list.get",
                "parameters": [
                    {
                        "name": "directory",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "default": "/"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "default": "1"
                        }
                    },
                    {
                        "name": "perPage",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "default": "50"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "properties": {
                                            "name": {
                                                "type": "string"
                                            },
                                            "created_at": {
                                                "type": "string",
                                                "format": "datetime"
                                            },
                                            "mime": {
                                                "type": "string",
                                                "format": "mime"
                                            },
                                            "url": {
                                                "type": "string",
                                                "format": "url"
                                            }
                                        },
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "302": {
                        "description": "request contains invalid parameters"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "405": {
                        "description": "Target directory access is not allowed"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/file/find": {
            "get": {
                "tags": [
                    "Files"
                ],
                "summary": "Lists files found by name",
                "operationId": "admin.file.find.get",
                "parameters": [
                    {
                        "name": "directory",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "default": "/"
                        }
                    },
                    {
                        "name": "name",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "default": "1"
                        }
                    },
                    {
                        "name": "perPage",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "default": "50"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "properties": {
                                            "name": {
                                                "type": "string"
                                            },
                                            "created_at": {
                                                "type": "string",
                                                "format": "datetime"
                                            },
                                            "mime": {
                                                "type": "string",
                                                "format": "mime"
                                            },
                                            "url": {
                                                "type": "string",
                                                "format": "url"
                                            }
                                        },
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "302": {
                        "description": "request contains invalid parameters"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "405": {
                        "description": "Target directory access is not allowed"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/file/upload": {
            "post": {
                "tags": [
                    "Files"
                ],
                "summary": "Upload files using multipart form-data",
                "operationId": "admin.file.upload.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "required": [
                                    "file[]",
                                    "target"
                                ],
                                "properties": {
                                    "file[]": {
                                        "type": "array",
                                        "items": {
                                            "type": "string",
                                            "format": "binary"
                                        }
                                    },
                                    "target": {
                                        "type": "string",
                                        "default": "/"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Paths of the stored files",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "string",
                                                "example": "/uploads/photo.jpg"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "422": {
                        "description": "server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/file/move": {
            "post": {
                "tags": [
                    "Files"
                ],
                "summary": "Move the file from one path to another",
                "operationId": "admin.file.move.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "required": [
                                    "source_url",
                                    "destination_url"
                                ],
                                "properties": {
                                    "source_url": {
                                        "type": "string"
                                    },
                                    "destination_url": {
                                        "type": "string"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "The file was moved",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "302": {
                        "description": "invalid request"
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "422": {
                        "description": "Couldn't perform the action"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/file/delete": {
            "delete": {
                "tags": [
                    "Files"
                ],
                "summary": "Delete given file",
                "operationId": "admin.file.delete.delete",
                "parameters": [
                    {
                        "name": "url",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The file was deleted",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "file doesn't exists"
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "405": {
                        "description": "specified file is out of bounds of the allowed paths"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/h5p/contents": {
            "get": {
                "tags": [
                    "Admin H5P"
                ],
                "summary": "List H5P contents with the number of topics using each",
                "description": "Needs h5p_list, or h5p_author_list (then only own contents are listed).",
                "operationId": "admin.h5p.contents.get",
                "parameters": [
                    {
                        "name": "title",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "main_library",
                        "in": "query",
                        "description": "machine name, e.g. H5P.MultiChoice",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "author_id",
                        "in": "query",
                        "description": "only with h5p_list",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "0 returns all rows without pagination",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "order_by",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "id",
                                "title",
                                "main_library",
                                "library",
                                "user_id",
                                "created_at",
                                "updated_at",
                                "count_h5p"
                            ]
                        }
                    },
                    {
                        "name": "order",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "ASC",
                                "DESC"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/H5PContentListItem"
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/h5p/unused": {
            "delete": {
                "tags": [
                    "Admin H5P"
                ],
                "summary": "Delete H5P contents that no topic uses",
                "description": "Needs h5p_delete. Deletes through the H5P service (content files, user states, results).",
                "operationId": "admin.h5p.unused.delete",
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "data": {
                                            "properties": {
                                                "ids": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "integer"
                                                    }
                                                },
                                                "failed": {
                                                    "type": "array",
                                                    "items": {
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "message": {
                                                                "type": "string"
                                                            }
                                                        },
                                                        "type": "object"
                                                    }
                                                }
                                            },
                                            "type": "object"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/identity/audit": {
            "get": {
                "tags": [
                    "Admin Identity"
                ],
                "summary": "Identity audit trail, newest first",
                "description": "The identity audit trail (permission `identity_audit_read`): hash-chained, append-only, never holds tokens,\nassertions or secrets.",
                "operationId": "identity.audit.list",
                "parameters": [
                    {
                        "name": "action",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "provider_id",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "before_id",
                        "in": "query",
                        "description": "Page: entries older than this id",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "default": 50,
                            "maximum": 200,
                            "minimum": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Entries",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/IdentityAuditEntry"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Needs identity_audit_read"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/identity/audit/verify": {
            "get": {
                "tags": [
                    "Admin Identity"
                ],
                "summary": "Recompute the hash chain of the audit trail",
                "operationId": "identity.audit.verify",
                "responses": {
                    "200": {
                        "description": "Result",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "properties": {
                                                "ok": {
                                                    "type": "boolean"
                                                },
                                                "checked": {
                                                    "type": "integer"
                                                },
                                                "broken_id": {
                                                    "type": "integer",
                                                    "nullable": true
                                                },
                                                "reason": {
                                                    "type": "string",
                                                    "nullable": true
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Needs identity_audit_read"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/identity/providers": {
            "get": {
                "tags": [
                    "Admin Identity"
                ],
                "summary": "Identity providers of this academy",
                "description": "Identity providers of the tenant (admin only, permission `identity_provider_manage`). The client secret is\nwrite-only: responses say whether one is set and, for long secrets, its last four characters.",
                "operationId": "identity.providers.list",
                "responses": {
                    "200": {
                        "description": "Providers",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/IdentityProvider"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Needs identity_provider_manage"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Admin Identity"
                ],
                "summary": "Add an OpenID Connect or SAML identity provider",
                "operationId": "identity.providers.create",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/IdentityProviderInput"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/IdentityProvider"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Needs identity_provider_manage"
                    },
                    "422": {
                        "description": "Invalid input, duplicate slug, or the academy has too many providers"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/identity/providers/{provider}": {
            "get": {
                "tags": [
                    "Admin Identity"
                ],
                "summary": "One identity provider",
                "operationId": "identity.providers.get",
                "parameters": [
                    {
                        "name": "provider",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Provider",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/IdentityProvider"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not found"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Admin Identity"
                ],
                "summary": "Change an identity provider (leave client_secret out to keep the stored one)",
                "operationId": "identity.providers.update",
                "parameters": [
                    {
                        "name": "provider",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/IdentityProviderInput"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Updated",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/IdentityProvider"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not found"
                    },
                    "422": {
                        "description": "Invalid input"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Admin Identity"
                ],
                "summary": "Delete an identity provider and its account links (accounts stay)",
                "operationId": "identity.providers.delete",
                "parameters": [
                    {
                        "name": "provider",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Deleted",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not found"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/identity/providers/{provider}/metadata/refresh": {
            "post": {
                "tags": [
                    "Admin Identity"
                ],
                "summary": "Fetch the SAML identity provider metadata again",
                "operationId": "identity.providers.metadata.refresh",
                "parameters": [
                    {
                        "name": "provider",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "accept_changes": {
                                        "description": "Apply a changed entity id and replace the trusted certificates with the ones in the metadata (an administrator's decision)",
                                        "type": "boolean"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Outcome",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/IdentityMetadataRefresh"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not found"
                    },
                    "422": {
                        "description": "Not a SAML provider with a metadata URL"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/identity/providers/{provider}/sp-keys/rotate": {
            "post": {
                "tags": [
                    "Admin Identity"
                ],
                "summary": "Prepare or activate the next SAML service provider key pair",
                "operationId": "identity.providers.spkeys.rotate",
                "parameters": [
                    {
                        "name": "provider",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "step"
                                ],
                                "properties": {
                                    "step": {
                                        "description": "prepare: generate the next pair and publish it in the SP metadata; promote: make it the current pair once the identity provider has imported it",
                                        "type": "string",
                                        "enum": [
                                            "prepare",
                                            "promote"
                                        ]
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Rotated",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "properties": {
                                                "step": {
                                                    "type": "string"
                                                },
                                                "fingerprint": {
                                                    "description": "SHA-256 of the certificate",
                                                    "type": "string"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not found"
                    },
                    "422": {
                        "description": "Not a SAML provider, or nothing prepared to promote"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/identity/providers/{provider}/scim-tokens": {
            "get": {
                "tags": [
                    "Admin Identity"
                ],
                "summary": "SCIM tokens of an identity provider, active and revoked",
                "description": "OpenAPI description of the SCIM token endpoints of an identity provider (permission identity_scim_manage).",
                "operationId": "identity.providers.scim-tokens.list",
                "parameters": [
                    {
                        "name": "provider",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Tokens (the secret is never listed)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/ApiToken"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Needs identity_scim_manage"
                    },
                    "404": {
                        "description": "Not found"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Admin Identity"
                ],
                "summary": "Create a SCIM token for an identity provider (shown once; at most two active, for rotation)",
                "operationId": "identity.providers.scim-tokens.create",
                "parameters": [
                    {
                        "name": "provider",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "name"
                                ],
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "maxLength": 100
                                    },
                                    "expires_in_days": {
                                        "description": "Default 365",
                                        "type": "integer",
                                        "maximum": 365,
                                        "minimum": 1
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created: copy the token now",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/ApiTokenCreated"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Needs identity_scim_manage"
                    },
                    "404": {
                        "description": "Not found"
                    },
                    "422": {
                        "description": "Invalid input, or two tokens are already active"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/identity/providers/{provider}/scim-tokens/{token}": {
            "delete": {
                "tags": [
                    "Admin Identity"
                ],
                "summary": "Revoke a SCIM token",
                "operationId": "identity.providers.scim-tokens.revoke",
                "parameters": [
                    {
                        "name": "provider",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "token",
                        "in": "path",
                        "description": "Id of the token",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Revoked",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Needs identity_scim_manage"
                    },
                    "404": {
                        "description": "Not found"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/identity/saml/{slug}/metadata": {
            "get": {
                "tags": [
                    "Identity"
                ],
                "summary": "SAML service provider metadata of an identity provider",
                "description": "SAML 2.0 service provider endpoints of a tenant's identity provider (plan 4.2): the SP metadata an administrator\ngives the IdP, the assertion consumer service the browser posts the IdP's response to, single logout, and the\ncall that starts a logout from this side. Public routes on the tenant API host (the provider rows live in the\ntenant's own database), except the logout call, which needs the user's token.",
                "operationId": "identity.saml.metadata",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "SAML 2.0 metadata XML: entity id (this URL), assertion consumer service, single logout service and the certificates to import at the identity provider",
                        "content": {
                            "application/samlmetadata+xml": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Unknown provider or not a SAML provider"
                    }
                }
            }
        },
        "/api/identity/saml/{slug}/acs": {
            "post": {
                "tags": [
                    "Identity"
                ],
                "summary": "Assertion consumer service: the identity provider's browser POST (SAMLResponse and RelayState)",
                "operationId": "identity.saml.acs",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/x-www-form-urlencoded": {
                            "schema": {
                                "required": [
                                    "SAMLResponse",
                                    "RelayState"
                                ],
                                "properties": {
                                    "SAMLResponse": {
                                        "description": "Base64 SAML response, at most 256 KB",
                                        "type": "string"
                                    },
                                    "RelayState": {
                                        "description": "The signed login state this service gave the identity provider in the AuthnRequest redirect",
                                        "type": "string"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "302": {
                        "description": "Redirect to the return URL with ?code=... (success) or ?error=provider_failed|link_required|email_required|email_unverified|account_unavailable|signup_disabled"
                    },
                    "400": {
                        "description": "The state is invalid, expired or already used (nothing trusted says where to send the browser)"
                    },
                    "413": {
                        "description": "The body is too large"
                    }
                }
            }
        },
        "/api/identity/saml/{slug}/slo": {
            "get": {
                "tags": [
                    "Identity"
                ],
                "summary": "Single logout service (redirect binding): a LogoutRequest from the identity provider or the LogoutResponse to ours",
                "operationId": "identity.saml.slo",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "SAMLRequest",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "SAMLResponse",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "RelayState",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "SigAlg",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "Signature",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "302": {
                        "description": "Redirect to the identity provider with our LogoutResponse, or to the return URL after a logout started here"
                    },
                    "200": {
                        "description": "Logged out; the identity provider has no logout response endpoint"
                    },
                    "400": {
                        "description": "The message is not valid: unsigned, wrong issuer or destination, expired, replayed or unknown"
                    },
                    "404": {
                        "description": "Unknown provider or not a SAML provider"
                    }
                }
            },
            "post": {
                "tags": [
                    "Identity"
                ],
                "summary": "Single logout service (POST binding with an enveloped XML signature)",
                "operationId": "identity.saml.slo.post",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/x-www-form-urlencoded": {
                            "schema": {
                                "properties": {
                                    "SAMLRequest": {
                                        "type": "string"
                                    },
                                    "SAMLResponse": {
                                        "type": "string"
                                    },
                                    "RelayState": {
                                        "type": "string"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "302": {
                        "description": "Redirect to the identity provider with our LogoutResponse, or to the return URL"
                    },
                    "200": {
                        "description": "Logged out"
                    },
                    "400": {
                        "description": "The message is not valid"
                    },
                    "404": {
                        "description": "Unknown provider or not a SAML provider"
                    }
                }
            }
        },
        "/api/identity/saml/{slug}/logout": {
            "post": {
                "tags": [
                    "Identity"
                ],
                "summary": "Sign out of this academy and, when the identity provider supports it, start single logout there",
                "operationId": "identity.saml.logout",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "return_to": {
                                        "description": "Where the browser lands after the identity provider logged it out; must be an origin of this academy",
                                        "type": "string",
                                        "format": "uri"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "The token is revoked. redirect_url is the signed LogoutRequest URL to send the browser to, or null when this login did not come from the provider or it has no single logout",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "properties": {
                                                "redirect_url": {
                                                    "type": "string",
                                                    "format": "uri",
                                                    "nullable": true
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Unknown provider or not a SAML provider"
                    },
                    "422": {
                        "description": "Return URL not allowed"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/scim/v2/ServiceProviderConfig": {
            "get": {
                "tags": [
                    "SCIM"
                ],
                "summary": "SCIM service provider configuration (RFC 7644 4)",
                "description": "OpenAPI description of the SCIM 2.0 server (RFC 7643, 7644) at /api/scim/v2. It is for identity providers (Entra ID,\nOkta, Keycloak and others) and is excluded from the CLI (front/cli/spec/exclusions.yaml). Every request needs a\nSCIM bearer token (`Authorization: Bearer ulams_pat_...`) created for one identity provider; errors use the SCIM\nerror schema with `scimType`; responses are `application/scim+json` with an `ETag` header.",
                "operationId": "scim.service-provider-config.get",
                "responses": {
                    "200": {
                        "description": "Capabilities of this SCIM server",
                        "content": {
                            "application/scim+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScimResource"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "No valid SCIM token",
                        "content": {
                            "application/scim+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScimError"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "scim": []
                    }
                ]
            }
        },
        "/api/scim/v2/ResourceTypes": {
            "get": {
                "tags": [
                    "SCIM"
                ],
                "summary": "SCIM resource types",
                "operationId": "scim.resource-types.list",
                "responses": {
                    "200": {
                        "description": "User and Group",
                        "content": {
                            "application/scim+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScimListResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "No valid SCIM token",
                        "content": {
                            "application/scim+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScimError"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "scim": []
                    }
                ]
            }
        },
        "/api/scim/v2/ResourceTypes/{id}": {
            "get": {
                "tags": [
                    "SCIM"
                ],
                "summary": "One SCIM resource type",
                "operationId": "scim.resource-types.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The resource type",
                        "content": {
                            "application/scim+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScimResource"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Unknown resource type",
                        "content": {
                            "application/scim+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScimError"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "scim": []
                    }
                ]
            }
        },
        "/api/scim/v2/Schemas": {
            "get": {
                "tags": [
                    "SCIM"
                ],
                "summary": "SCIM schemas (User, EnterpriseUser, Group)",
                "operationId": "scim.schemas.list",
                "responses": {
                    "200": {
                        "description": "Schema definitions",
                        "content": {
                            "application/scim+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScimListResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "No valid SCIM token",
                        "content": {
                            "application/scim+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScimError"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "scim": []
                    }
                ]
            }
        },
        "/api/scim/v2/Schemas/{id}": {
            "get": {
                "tags": [
                    "SCIM"
                ],
                "summary": "One SCIM schema by its URN",
                "operationId": "scim.schemas.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The schema",
                        "content": {
                            "application/scim+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScimResource"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Unknown schema",
                        "content": {
                            "application/scim+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScimError"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "scim": []
                    }
                ]
            }
        },
        "/api/scim/v2/Users": {
            "get": {
                "tags": [
                    "SCIM"
                ],
                "summary": "List or filter the users this identity provider provisioned",
                "operationId": "scim.users.list",
                "parameters": [
                    {
                        "name": "filter",
                        "in": "query",
                        "description": "RFC 7644 filter: eq ne co sw ew gt ge lt le pr, and, or, not, value paths. Attributes: id, userName, externalId, emails.value, emails[...], active, name.givenName, name.familyName, meta.lastModified, meta.created",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "startIndex",
                        "in": "query",
                        "description": "1-based, default 1",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "count",
                        "in": "query",
                        "description": "Default 100, at most 200; 0 returns only totalResults",
                        "schema": {
                            "type": "integer",
                            "maximum": 200,
                            "minimum": 0
                        }
                    },
                    {
                        "name": "attributes",
                        "in": "query",
                        "description": "Comma-separated attributes to return",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "excludedAttributes",
                        "in": "query",
                        "description": "Comma-separated attributes to leave out",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "A page of users",
                        "content": {
                            "application/scim+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScimUserList"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "invalidFilter or invalidValue",
                        "content": {
                            "application/scim+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScimError"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "No valid SCIM token",
                        "content": {
                            "application/scim+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScimError"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "scim": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "SCIM"
                ],
                "summary": "Create a user (or adopt an existing account the provider is trusted for)",
                "operationId": "scim.users.create",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/scim+json": {
                            "schema": {
                                "$ref": "#/components/schemas/ScimUser"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created: Location and ETag headers set",
                        "content": {
                            "application/scim+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScimUser"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "invalidSyntax or invalidValue",
                        "content": {
                            "application/scim+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScimError"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "uniqueness: userName, externalId or e-mail already used",
                        "content": {
                            "application/scim+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScimError"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "scim": []
                    }
                ]
            }
        },
        "/api/scim/v2/Users/.search": {
            "post": {
                "tags": [
                    "SCIM"
                ],
                "summary": "Search users with a request body (RFC 7644 3.4.3)",
                "operationId": "scim.users.search",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/scim+json": {
                            "schema": {
                                "$ref": "#/components/schemas/ScimSearchRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "A page of users",
                        "content": {
                            "application/scim+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScimUserList"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "invalidSyntax or invalidFilter",
                        "content": {
                            "application/scim+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScimError"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "scim": []
                    }
                ]
            }
        },
        "/api/scim/v2/Users/{id}": {
            "get": {
                "tags": [
                    "SCIM"
                ],
                "summary": "One user",
                "operationId": "scim.users.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "If-None-Match",
                        "in": "header",
                        "description": "The version you have; a match answers 304",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "attributes",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "excludedAttributes",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The user with its ETag",
                        "content": {
                            "application/scim+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScimUser"
                                }
                            }
                        }
                    },
                    "304": {
                        "description": "Not modified"
                    },
                    "404": {
                        "description": "Not a user of this provider",
                        "content": {
                            "application/scim+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScimError"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "scim": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "SCIM"
                ],
                "summary": "Replace a user (omitted attributes are cleared; an omitted active keeps the current state)",
                "operationId": "scim.users.replace",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "If-Match",
                        "in": "header",
                        "description": "A version (ETag) from meta.version; a stale one answers 412",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/scim+json": {
                            "schema": {
                                "$ref": "#/components/schemas/ScimUser"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "The updated user",
                        "content": {
                            "application/scim+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScimUser"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "invalidValue or mutability",
                        "content": {
                            "application/scim+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScimError"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Administrators cannot be changed",
                        "content": {
                            "application/scim+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScimError"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not a user of this provider",
                        "content": {
                            "application/scim+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScimError"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "uniqueness",
                        "content": {
                            "application/scim+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScimError"
                                }
                            }
                        }
                    },
                    "412": {
                        "description": "Stale If-Match",
                        "content": {
                            "application/scim+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScimError"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "scim": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "SCIM"
                ],
                "summary": "Deprovision a user: deactivate, revoke every session and token, keep the learning record (anonymise when configured)",
                "operationId": "scim.users.delete",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "If-Match",
                        "in": "header",
                        "description": "A version (ETag) from meta.version; a stale one answers 412",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "Deprovisioned"
                    },
                    "403": {
                        "description": "Administrators cannot be changed",
                        "content": {
                            "application/scim+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScimError"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not a user of this provider",
                        "content": {
                            "application/scim+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScimError"
                                }
                            }
                        }
                    },
                    "412": {
                        "description": "Stale If-Match",
                        "content": {
                            "application/scim+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScimError"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "scim": []
                    }
                ]
            },
            "patch": {
                "tags": [
                    "SCIM"
                ],
                "summary": "Change a user with add, replace and remove operations (all or none)",
                "operationId": "scim.users.patch",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "If-Match",
                        "in": "header",
                        "description": "A version (ETag) from meta.version; a stale one answers 412",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/scim+json": {
                            "schema": {
                                "$ref": "#/components/schemas/ScimPatchOp"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "The updated user",
                        "content": {
                            "application/scim+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScimUser"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "invalidSyntax, invalidPath, invalidValue, noTarget or mutability",
                        "content": {
                            "application/scim+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScimError"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Administrators cannot be changed",
                        "content": {
                            "application/scim+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScimError"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not a user of this provider",
                        "content": {
                            "application/scim+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScimError"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "uniqueness",
                        "content": {
                            "application/scim+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScimError"
                                }
                            }
                        }
                    },
                    "412": {
                        "description": "Stale If-Match",
                        "content": {
                            "application/scim+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScimError"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "scim": []
                    }
                ]
            }
        },
        "/api/scim/v2/Groups": {
            "get": {
                "tags": [
                    "SCIM"
                ],
                "summary": "List or filter the groups this identity provider created",
                "operationId": "scim.groups.list",
                "parameters": [
                    {
                        "name": "filter",
                        "in": "query",
                        "description": "RFC 7644 filter. Attributes: id, displayName, externalId, members.value, members[value eq ...], meta.lastModified, meta.created",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "startIndex",
                        "in": "query",
                        "description": "1-based, default 1",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "count",
                        "in": "query",
                        "description": "Default 100, at most 200; 0 returns only totalResults",
                        "schema": {
                            "type": "integer",
                            "maximum": 200,
                            "minimum": 0
                        }
                    },
                    {
                        "name": "attributes",
                        "in": "query",
                        "description": "Comma-separated attributes to return",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "excludedAttributes",
                        "in": "query",
                        "description": "Comma-separated attributes to leave out, for example members",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "A page of groups",
                        "content": {
                            "application/scim+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScimGroupList"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "invalidFilter or invalidValue",
                        "content": {
                            "application/scim+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScimError"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "scim": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "SCIM"
                ],
                "summary": "Create a group, optionally with members (users of this provider)",
                "operationId": "scim.groups.create",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/scim+json": {
                            "schema": {
                                "$ref": "#/components/schemas/ScimGroup"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created: Location and ETag headers set",
                        "content": {
                            "application/scim+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScimGroup"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "invalidSyntax or invalidValue, for example a member that is not a user of this provider",
                        "content": {
                            "application/scim+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScimError"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "uniqueness: the displayName (also of groups this provider did not create) or externalId is used",
                        "content": {
                            "application/scim+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScimError"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "scim": []
                    }
                ]
            }
        },
        "/api/scim/v2/Groups/.search": {
            "post": {
                "tags": [
                    "SCIM"
                ],
                "summary": "Search groups with a request body (RFC 7644 3.4.3)",
                "operationId": "scim.groups.search",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/scim+json": {
                            "schema": {
                                "$ref": "#/components/schemas/ScimSearchRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "A page of groups",
                        "content": {
                            "application/scim+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScimGroupList"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "invalidSyntax or invalidFilter",
                        "content": {
                            "application/scim+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScimError"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "scim": []
                    }
                ]
            }
        },
        "/api/scim/v2/Groups/{id}": {
            "get": {
                "tags": [
                    "SCIM"
                ],
                "summary": "One group with the members this provider provisioned",
                "operationId": "scim.groups.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "If-None-Match",
                        "in": "header",
                        "description": "The version you have; a match answers 304",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "attributes",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "excludedAttributes",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The group with its ETag",
                        "content": {
                            "application/scim+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScimGroup"
                                }
                            }
                        }
                    },
                    "304": {
                        "description": "Not modified"
                    },
                    "404": {
                        "description": "Not a group of this provider",
                        "content": {
                            "application/scim+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScimError"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "scim": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "SCIM"
                ],
                "summary": "Replace a group (a missing members attribute keeps the membership; an empty list empties it)",
                "operationId": "scim.groups.replace",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "If-Match",
                        "in": "header",
                        "description": "A version (ETag) from meta.version; a stale one answers 412",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/scim+json": {
                            "schema": {
                                "$ref": "#/components/schemas/ScimGroup"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "The updated group",
                        "content": {
                            "application/scim+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScimGroup"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "invalidValue or mutability",
                        "content": {
                            "application/scim+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScimError"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not a group of this provider",
                        "content": {
                            "application/scim+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScimError"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "uniqueness",
                        "content": {
                            "application/scim+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScimError"
                                }
                            }
                        }
                    },
                    "412": {
                        "description": "Stale If-Match",
                        "content": {
                            "application/scim+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScimError"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "scim": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "SCIM"
                ],
                "summary": "Delete a group: the access it gave goes, the people stay",
                "operationId": "scim.groups.delete",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "If-Match",
                        "in": "header",
                        "description": "A version (ETag) from meta.version; a stale one answers 412",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "Deleted"
                    },
                    "404": {
                        "description": "Not a group of this provider",
                        "content": {
                            "application/scim+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScimError"
                                }
                            }
                        }
                    },
                    "412": {
                        "description": "Stale If-Match",
                        "content": {
                            "application/scim+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScimError"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "scim": []
                    }
                ]
            },
            "patch": {
                "tags": [
                    "SCIM"
                ],
                "summary": "Rename a group and add, replace or remove members (all or none)",
                "operationId": "scim.groups.patch",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "If-Match",
                        "in": "header",
                        "description": "A version (ETag) from meta.version; a stale one answers 412",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/scim+json": {
                            "schema": {
                                "$ref": "#/components/schemas/ScimPatchOp"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "The updated group",
                        "content": {
                            "application/scim+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScimGroup"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "invalidSyntax, invalidPath, invalidValue, noTarget or mutability",
                        "content": {
                            "application/scim+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScimError"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not a group of this provider",
                        "content": {
                            "application/scim+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScimError"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "uniqueness",
                        "content": {
                            "application/scim+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScimError"
                                }
                            }
                        }
                    },
                    "412": {
                        "description": "Stale If-Match",
                        "content": {
                            "application/scim+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScimError"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "scim": []
                    }
                ]
            }
        },
        "/api/identity/providers": {
            "get": {
                "tags": [
                    "Identity"
                ],
                "summary": "Identity providers a learner can sign in with",
                "description": "Sign-in through a tenant's identity provider (OpenID Connect and SAML 2.0; SAML endpoints are in {@see SamlController}). Public routes on the tenant API host: the\nprovider rows live in the tenant's own database, so another tenant's slug, state or code never resolves here.",
                "operationId": "identity.providers.public",
                "responses": {
                    "200": {
                        "description": "Enabled providers: slug, name and protocol, nothing else",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "slug": {
                                                        "type": "string",
                                                        "example": "acme-keycloak"
                                                    },
                                                    "name": {
                                                        "type": "string",
                                                        "example": "Acme staff"
                                                    },
                                                    "protocol": {
                                                        "type": "string",
                                                        "enum": [
                                                            "oidc",
                                                            "saml"
                                                        ]
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/identity/sso/{slug}/start": {
            "get": {
                "tags": [
                    "Identity"
                ],
                "summary": "Start a sign-in (OpenID Connect or SAML): redirects the browser to the provider",
                "operationId": "identity.sso.start",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "challenge",
                        "in": "query",
                        "description": "base64url SHA-256 of a verifier only the caller's server knows (43 characters)",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "return_to",
                        "in": "query",
                        "description": "Where to send the browser afterwards; must be an origin of this academy (default: the learner app)",
                        "schema": {
                            "type": "string",
                            "format": "uri"
                        }
                    }
                ],
                "responses": {
                    "302": {
                        "description": "Redirect to the provider's authorization endpoint (OpenID Connect) or single sign-on URL with a signed AuthnRequest (SAML)"
                    },
                    "404": {
                        "description": "Unknown or disabled provider"
                    },
                    "422": {
                        "description": "Return URL not allowed or challenge missing"
                    },
                    "502": {
                        "description": "The provider could not be reached or is misconfigured"
                    }
                }
            }
        },
        "/api/identity/oidc/{slug}/callback": {
            "get": {
                "tags": [
                    "Identity"
                ],
                "summary": "Where the provider sends the browser back; redirects to the return URL with a one-time code or an error",
                "operationId": "identity.oidc.callback",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "state",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "code",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "error",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "302": {
                        "description": "Redirect to the return URL with ?code=... (success) or ?error=provider_denied|provider_failed|link_required|email_required|email_unverified|account_unavailable|signup_disabled"
                    },
                    "400": {
                        "description": "The state is invalid, expired or already used"
                    }
                }
            }
        },
        "/api/identity/sso/exchange": {
            "post": {
                "tags": [
                    "Identity"
                ],
                "summary": "Redeem the one-time code with the verifier for an access token",
                "operationId": "identity.sso.exchange",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "code",
                                    "verifier"
                                ],
                                "properties": {
                                    "code": {
                                        "description": "The one-time code from the return URL (43 characters)",
                                        "type": "string"
                                    },
                                    "verifier": {
                                        "description": "The secret whose SHA-256 was sent as the challenge (43 to 128 characters)",
                                        "type": "string"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Access token",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "properties": {
                                                "token": {
                                                    "type": "string"
                                                },
                                                "expires_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "The code is invalid, expired, used already or does not match the verifier"
                    }
                }
            }
        },
        "/api/images/img": {
            "get": {
                "tags": [
                    "Images"
                ],
                "summary": "Resize an image on the fly and redirect to the cached copy",
                "description": "Optional legacy resize API, kept for self-hosted admin and third-party clients; prefer a CDN or the front's image service. Public endpoint, throttled by `images.render`. The cached file name is `sha1(path . json_encode(params))` plus the extension, so the same request always returns the same URL. The first request creates the copy, optimises it and stores it on the configured disk; later requests only redirect. A failed resize does not return an error status: the redirect points to an SVG that contains the error message.",
                "operationId": "images.img.get",
                "parameters": [
                    {
                        "name": "path",
                        "in": "query",
                        "description": "Path of the source image on the storage disk",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "avatars/1/avatar.jpg"
                        }
                    },
                    {
                        "name": "size",
                        "in": "query",
                        "description": "Predefined size from `config('images.public.size_definitions')`; wins over `w` and `h`",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "thumbnail"
                        }
                    },
                    {
                        "name": "w",
                        "in": "query",
                        "description": "Target width in pixels; the aspect ratio is kept and the image is never enlarged",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "example": 100
                        }
                    },
                    {
                        "name": "h",
                        "in": "query",
                        "description": "Target height in pixels; the aspect ratio is kept and the image is never enlarged",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "example": 100
                        }
                    },
                    {
                        "name": "format",
                        "in": "query",
                        "description": "Output format; the source extension is kept when it is omitted or unsupported",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "jpg",
                                "png",
                                "gif",
                                "webp"
                            ]
                        }
                    }
                ],
                "responses": {
                    "302": {
                        "description": "Redirect to the cached, resized file",
                        "headers": {
                            "Location": {
                                "description": "URL of the cached file",
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests (`images.render` throttle)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Too Many Attempts."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "tags": [
                    "Images"
                ],
                "summary": "Resize many images at once",
                "description": "Optional legacy resize API, kept for self-hosted admin and third-party clients; prefer a CDN or the front's image service. Public endpoint, throttled by `images.render`. Returns one entry per requested image, in the same order, with the URL of the cached copy.",
                "operationId": "images.img.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "paths"
                                ],
                                "properties": {
                                    "paths": {
                                        "type": "array",
                                        "items": {
                                            "required": [
                                                "path"
                                            ],
                                            "properties": {
                                                "path": {
                                                    "description": "Path of the source image on the storage disk",
                                                    "type": "string",
                                                    "example": "avatars/1/avatar.jpg"
                                                },
                                                "params": {
                                                    "properties": {
                                                        "size": {
                                                            "description": "Predefined size",
                                                            "type": "string",
                                                            "example": "thumbnail",
                                                            "nullable": true
                                                        },
                                                        "w": {
                                                            "type": "integer",
                                                            "example": 100,
                                                            "nullable": true,
                                                            "maximum": 4096,
                                                            "minimum": 1
                                                        },
                                                        "h": {
                                                            "type": "integer",
                                                            "example": 100,
                                                            "nullable": true,
                                                            "maximum": 4096,
                                                            "minimum": 1
                                                        }
                                                    },
                                                    "type": "object",
                                                    "nullable": true
                                                }
                                            },
                                            "type": "object"
                                        },
                                        "maxItems": 20,
                                        "minItems": 1
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Resized images",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "properties": {
                                            "url": {
                                                "type": "string",
                                                "example": "http://localhost/storage/imgcache/68840270724ee4ff0b481f4fbd2299e13dfe2447.jpg"
                                            },
                                            "path": {
                                                "type": "string",
                                                "example": "imgcache/68840270724ee4ff0b481f4fbd2299e13dfe2447.jpg"
                                            },
                                            "hash": {
                                                "type": "string",
                                                "example": "68840270724ee4ff0b481f4fbd2299e13dfe2447"
                                            }
                                        },
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error (more than 20 paths, a dimension outside 1-4096)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string"
                                        },
                                        "errors": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many requests (`images.render` throttle)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Too Many Attempts."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/interactive/launches/{topic}": {
            "post": {
                "tags": [
                    "Interactive"
                ],
                "summary": "Start an Interactive topic",
                "description": "Learners play an Interactive topic from the tenant content origin (ADR 0086). The frame never gets a\ntoken: the lesson page forwards the bridge's events through the front BFF with the learner's session.",
                "operationId": "interactive.launches.by-topic.post",
                "parameters": [
                    {
                        "name": "topic",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "{url, version, manifest, topic}; url is the entry file on the content origin",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "no access to the course"
                    },
                    "404": {
                        "description": "not an Interactive topic, or the type is switched off"
                    },
                    "503": {
                        "description": "no content origin"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/interactive/showcase": {
            "get": {
                "tags": [
                    "Interactive"
                ],
                "summary": "The interactive shown on a landing page",
                "description": "Public, throttled. The first Interactive topic of the first published public course that has one, in the shape of a launch ({url, version, manifest, topic}). Nothing is tracked.",
                "operationId": "interactive.showcase.get",
                "responses": {
                    "200": {
                        "description": "{url, version, manifest, topic}",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "no public interactive, or the type is switched off"
                    },
                    "429": {
                        "description": "too many requests"
                    },
                    "503": {
                        "description": "no content origin"
                    }
                }
            }
        },
        "/api/interactive/topics/{topic}/events": {
            "post": {
                "tags": [
                    "Interactive"
                ],
                "summary": "Progress events from the lesson page",
                "description": "A batch of at most 40 bridge events (stepChanged, progress, complete, score, event) for the logged-in learner. Completion follows the topic's completion rule.",
                "operationId": "interactive.topics.by-topic.events.post",
                "parameters": [
                    {
                        "name": "topic",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "events"
                                ],
                                "properties": {
                                    "events": {
                                        "type": "array",
                                        "items": {
                                            "type": "object"
                                        }
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "{status, progress}; status 1 means the topic is complete",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "no access to the course"
                    },
                    "404": {
                        "description": "not an Interactive topic"
                    },
                    "422": {
                        "description": "invalid batch"
                    },
                    "429": {
                        "description": "too many requests"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/interactive": {
            "get": {
                "tags": [
                    "Admin Interactive"
                ],
                "summary": "List interactive packages",
                "description": "The interactive package library (ADR 0086): uploaded zip packages, versioned and immutable.",
                "operationId": "interactive.list",
                "parameters": [
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "packages",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/InteractivePackagePageResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "interactive_manage required"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Admin Interactive"
                ],
                "summary": "Upload a package (.zip with ulams-interactive.json)",
                "operationId": "interactive.create",
                "requestBody": {
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "required": [
                                    "file"
                                ],
                                "properties": {
                                    "file": {
                                        "type": "string",
                                        "format": "binary"
                                    },
                                    "title": {
                                        "type": "string"
                                    },
                                    "change_note": {
                                        "type": "string"
                                    },
                                    "accept_network": {
                                        "description": "Confirm the manifest's network origins; without it a manifest that lists some answers 422 with errors.network",
                                        "type": "boolean"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "package with version 1",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/InteractivePackageDetailResponse"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "rejected upload or invalid manifest"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/interactive/{id}": {
            "get": {
                "tags": [
                    "Admin Interactive"
                ],
                "summary": "Show a package with its current manifest",
                "operationId": "interactive.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "package",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/InteractivePackageDetailResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "not found"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Admin Interactive"
                ],
                "summary": "Rename a package",
                "operationId": "interactive.update",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "package",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/InteractivePackageDetailResponse"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Admin Interactive"
                ],
                "summary": "Delete a package with all versions and files",
                "operationId": "interactive.delete",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "deleted",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "topics use this package"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/interactive/{id}/versions": {
            "get": {
                "tags": [
                    "Admin Interactive"
                ],
                "summary": "List versions",
                "operationId": "interactive.versions",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "versions",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/InteractiveVersionListResponse"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Admin Interactive"
                ],
                "summary": "Upload a new version (the manifest id must match)",
                "operationId": "interactive.add-version",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "required": [
                                    "file"
                                ],
                                "properties": {
                                    "file": {
                                        "type": "string",
                                        "format": "binary"
                                    },
                                    "change_note": {
                                        "type": "string"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "package with the new current version",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/InteractivePackageDetailResponse"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "rejected upload or invalid manifest"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/interactive/{id}/preview": {
            "get": {
                "tags": [
                    "Admin Interactive"
                ],
                "summary": "Admin preview of a version on the content origin (nothing is tracked)",
                "operationId": "interactive.preview",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "version",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "{url, nonce, version, manifest}",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/InteractivePreviewResponse"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "no content origin"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/order-invoices/{id}": {
            "get": {
                "tags": [
                    "Invoices"
                ],
                "summary": "Get invoice identified by a given id identifier of order",
                "operationId": "order-invoices.by-id.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of Order",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiJson"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/knowledge/exports": {
            "get": {
                "tags": [
                    "Admin Knowledge"
                ],
                "summary": "Knowledge exports, newest first",
                "description": "Knowledge packs for company RAG (Phase 7.6). Admin only (`knowledge_manage`); packs live in the tenant's own\ndatabase and storage, so an id from another tenant never resolves.",
                "operationId": "knowledge.exports.list",
                "parameters": [
                    {
                        "name": "course_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Exports",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/KnowledgeExport"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Needs knowledge_manage"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Admin Knowledge"
                ],
                "summary": "Start a knowledge export of one course or of the whole tenant",
                "operationId": "knowledge.exports.create",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "scope"
                                ],
                                "properties": {
                                    "scope": {
                                        "type": "string",
                                        "enum": [
                                            "course",
                                            "tenant"
                                        ]
                                    },
                                    "course_id": {
                                        "description": "Required for scope course",
                                        "type": "integer"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "202": {
                        "description": "Queued",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/KnowledgeExport"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Needs knowledge_manage"
                    },
                    "422": {
                        "description": "Unknown course, or a course learners cannot see"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/knowledge/exports/{export}": {
            "get": {
                "tags": [
                    "Admin Knowledge"
                ],
                "summary": "One knowledge export",
                "operationId": "knowledge.exports.get",
                "parameters": [
                    {
                        "name": "export",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Export",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/KnowledgeExport"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not found"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/knowledge/exports/{export}/download": {
            "get": {
                "tags": [
                    "Admin Knowledge"
                ],
                "summary": "Download a file of a ready export (manifest.json, chunks.jsonl or index.json)",
                "operationId": "knowledge.exports.download",
                "parameters": [
                    {
                        "name": "export",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "file",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "manifest",
                                "chunks",
                                "index"
                            ]
                        }
                    },
                    {
                        "name": "course",
                        "in": "query",
                        "description": "Course of a tenant export (for manifest and chunks)",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The file (JSON, or JSON Lines for chunks)",
                        "content": {
                            "application/x-ndjson": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not found, or the export is not ready"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/knowledge/courses/{course}/latest": {
            "get": {
                "tags": [
                    "Admin Knowledge"
                ],
                "summary": "The latest ready export of a course",
                "operationId": "knowledge.courses.latest",
                "parameters": [
                    {
                        "name": "course",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Export",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/KnowledgeExport"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "The course was never exported"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/learner-insights/nudges/opened": {
            "post": {
                "tags": [
                    "Learner insights"
                ],
                "summary": "The learner followed the link of a nudge (the frontend sends the signed `n` of the link)",
                "operationId": "learner-insights.nudges.opened.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "n"
                                ],
                                "properties": {
                                    "n": {
                                        "type": "string"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "202": {
                        "description": "Recorded (once per nudge)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiJson"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "The token is not genuine or the nudge belongs to another learner"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/learner-insights/courses/{course}/summary": {
            "get": {
                "tags": [
                    "Learner insights admin"
                ],
                "summary": "Per-course analytics: progress, completion, quiz performance, status distribution and interventions",
                "operationId": "admin.learner-insights.courses.by-course.summary.get",
                "parameters": [
                    {
                        "name": "course",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "period",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 30,
                            "enum": [
                                7,
                                30,
                                90
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Aggregates; `smallGroup` is true (and only `enrolled` is given) below the minimum group size",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiJson"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Needs learner_insights_view or authorship of the course"
                    },
                    "404": {
                        "description": "Unknown course"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/learner-insights/courses/{course}/elements": {
            "get": {
                "tags": [
                    "Learner insights admin"
                ],
                "summary": "The sections that confuse people: per element struggle rate, remediation and recovery, with the top reasons",
                "operationId": "admin.learner-insights.courses.by-course.elements.get",
                "parameters": [
                    {
                        "name": "course",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "period",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 30,
                            "enum": [
                                7,
                                30,
                                90
                            ]
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "struggle",
                                "active",
                                "recovery"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Elements; those with fewer active learners than the minimum group are returned as `hidden`; `improvable` says whether a proposal can be made for the element",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiJson"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Needs learner_insights_view or authorship of the course"
                    },
                    "404": {
                        "description": "Unknown course"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/learner-insights/courses/{course}/learners": {
            "get": {
                "tags": [
                    "Learner insights admin"
                ],
                "summary": "Learners who are struggling or at risk, with the reasons (individual data)",
                "operationId": "admin.learner-insights.courses.by-course.learners.get",
                "parameters": [
                    {
                        "name": "course",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "struggling",
                                "at_risk",
                                "on_track"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Individual statuses",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiJson"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Needs learner_insights_view_individuals, or the tenant setting that lets course authors see individuals"
                    },
                    "404": {
                        "description": "Unknown course"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/learner-insights/learners/{user}/courses/{course}/timeline": {
            "get": {
                "tags": [
                    "Learner insights admin"
                ],
                "summary": "One learner's signals in a course with element labels (support)",
                "operationId": "admin.learner-insights.learners.by-user.courses.by-course.timeline.get",
                "parameters": [
                    {
                        "name": "user",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "course",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Newest first",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiJson"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Needs learner_insights_view_individuals"
                    },
                    "404": {
                        "description": "Unknown course or learner"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/learner-insights/backfill": {
            "post": {
                "tags": [
                    "Learner insights admin"
                ],
                "summary": "Build signals from existing data for a course or the whole tenant (queued)",
                "operationId": "admin.learner-insights.backfill.post",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "courseId": {
                                        "type": "integer"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "202": {
                        "description": "Queued",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiJson"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Needs learner_insights_manage"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/learner-insights/signals": {
            "post": {
                "tags": [
                    "Learner insights"
                ],
                "summary": "Record a media signal (replay, seek back) from the player",
                "operationId": "learner-insights.signals.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "type",
                                    "topicId",
                                    "ref"
                                ],
                                "properties": {
                                    "type": {
                                        "type": "string",
                                        "enum": [
                                            "media.replayed",
                                            "media.seeked_back"
                                        ]
                                    },
                                    "topicId": {
                                        "type": "integer"
                                    },
                                    "value": {
                                        "description": "Seconds",
                                        "type": "number"
                                    },
                                    "media": {
                                        "type": "string",
                                        "enum": [
                                            "video",
                                            "audio"
                                        ]
                                    },
                                    "ref": {
                                        "description": "Client generated id, used to drop duplicates",
                                        "type": "string",
                                        "format": "uuid"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "202": {
                        "description": "Accepted (nothing is stored when the module is off or the learner opted out)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiJson"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The learner may not attend the course of the topic"
                    },
                    "404": {
                        "description": "Unknown topic"
                    },
                    "429": {
                        "description": "Too many signals"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/learner-insights/courses/{course}/elements/{elementKey}/improve": {
            "post": {
                "tags": [
                    "Learner insights admin"
                ],
                "summary": "Propose an improvement for an element learners struggle with: the estimate and the aggregated evidence first, then (confirmEstimate) a Living Course proposal of kind insights",
                "operationId": "admin.learner-insights.courses.by-course.elements.by-element-key.improve.post",
                "parameters": [
                    {
                        "name": "course",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "elementKey",
                        "in": "path",
                        "description": "The element key of the insights table (a Course Builder element id)",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "confirmEstimate": {
                                        "type": "boolean"
                                    },
                                    "period": {
                                        "type": "integer",
                                        "default": 30,
                                        "enum": [
                                            7,
                                            30,
                                            90
                                        ]
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Without confirmEstimate: `estimateUsd` and the `evidence` that would be sent (aggregates only); or the open proposal of the element (`kept_existing`)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiJson"
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "The proposal was created and its analysis started; review it as a Living Course proposal",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiJson"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Needs authorship of the course or learner_insights_view, and authorship of its builder session or living_course_review"
                    },
                    "404": {
                        "description": "Unknown course, or the element was not built with the Course Builder"
                    },
                    "422": {
                        "description": "Group below the minimum size, nothing to cite, element not improvable, or the budget blocks the analysis"
                    },
                    "429": {
                        "description": "The daily limit of improvement proposals of the course is reached"
                    },
                    "503": {
                        "description": "AI is disabled"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/learner-insights/me": {
            "get": {
                "tags": [
                    "Learner insights"
                ],
                "summary": "The learner's own statuses with reasons, their privacy settings and the retention periods",
                "operationId": "learner-insights.me.get",
                "responses": {
                    "200": {
                        "description": "`enabled` (module on for the tenant), `settings`, `courses` (status and reasons per course and element), `retention`",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiJson"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Learner insights"
                ],
                "summary": "Erase the learner's personalisation data (the opt-out and consent settings stay)",
                "operationId": "learner-insights.me.delete",
                "responses": {
                    "200": {
                        "description": "Rows deleted per table",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiJson"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/learner-insights/me/settings": {
            "put": {
                "tags": [
                    "Learner insights"
                ],
                "summary": "Opt out of personalisation, switch personal help or nudges, give or withdraw consent",
                "operationId": "learner-insights.me.settings.put",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "enabled": {
                                        "type": "boolean"
                                    },
                                    "help": {
                                        "type": "boolean"
                                    },
                                    "nudges": {
                                        "type": "boolean"
                                    },
                                    "consent": {
                                        "type": "boolean"
                                    },
                                    "eraseExisting": {
                                        "description": "With enabled=false: also delete what was recorded before",
                                        "type": "boolean"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "The settings after the change",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiJson"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Invalid value"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/learner-insights/me/export": {
            "get": {
                "tags": [
                    "Learner insights"
                ],
                "summary": "Download everything stored about the learner (signals, statuses, transitions) as JSON",
                "operationId": "learner-insights.me.export.get",
                "responses": {
                    "200": {
                        "description": "A JSON file"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/learner-insights/courses/{course}/presentation": {
            "get": {
                "tags": [
                    "Learner insights"
                ],
                "summary": "How the course is presented to the learner (density, steps, navigation, hints) and why",
                "operationId": "learner-insights.courses.by-course.presentation.get",
                "parameters": [
                    {
                        "name": "course",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`adaptive` (the tenant switch), `profile` (what to show), `derived` (what the rules chose), `overrides` (the learner's choices), `why`",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiJson"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The learner may not attend the course"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Learner insights"
                ],
                "summary": "Override how the course is presented (for example show the whole lesson); null removes an override",
                "operationId": "learner-insights.courses.by-course.presentation.put",
                "parameters": [
                    {
                        "name": "course",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "density": {
                                        "type": "string",
                                        "nullable": true,
                                        "enum": [
                                            "comfortable",
                                            "compact"
                                        ]
                                    },
                                    "chunking": {
                                        "type": "string",
                                        "nullable": true,
                                        "enum": [
                                            "whole",
                                            "steps"
                                        ]
                                    },
                                    "navigation": {
                                        "type": "string",
                                        "nullable": true,
                                        "enum": [
                                            "linear",
                                            "overview"
                                        ]
                                    },
                                    "hints": {
                                        "type": "integer",
                                        "nullable": true,
                                        "enum": [
                                            0,
                                            1,
                                            2,
                                            3
                                        ]
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "The profile after the change",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiJson"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The learner may not attend the course"
                    },
                    "422": {
                        "description": "Invalid option"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/learner-insights/settings": {
            "get": {
                "tags": [
                    "Learner insights admin"
                ],
                "summary": "The effective rule thresholds of the tenant (defaults and tenant settings)",
                "operationId": "admin.learner-insights.settings.get",
                "responses": {
                    "200": {
                        "description": "Rules by name, each with its parameters",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiJson"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Needs learner_insights_manage"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/learner-insights/courses/{course}/settings": {
            "get": {
                "tags": [
                    "Learner insights admin"
                ],
                "summary": "Thresholds of one course: the overrides and the effective values",
                "operationId": "admin.learner-insights.courses.by-course.settings.get",
                "parameters": [
                    {
                        "name": "course",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`overrides` and `effective`",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiJson"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Needs learner_insights_manage"
                    },
                    "404": {
                        "description": "Unknown course"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Learner insights admin"
                ],
                "summary": "Replace the threshold overrides of one course",
                "operationId": "admin.learner-insights.courses.by-course.settings.put",
                "parameters": [
                    {
                        "name": "course",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "rules": {
                                        "type": "object",
                                        "example": {
                                            "inactivity": {
                                                "inactive_days": 5
                                            }
                                        }
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "`overrides` and `effective`",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiJson"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Needs learner_insights_manage"
                    },
                    "404": {
                        "description": "Unknown course"
                    },
                    "422": {
                        "description": "Unknown rule or parameter, or an invalid value"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/learner-insights/courses/{course}/topics/{topic}/support": {
            "get": {
                "tags": [
                    "Learner insights"
                ],
                "summary": "Extra help for the learner in a topic, with the reasons it was offered",
                "operationId": "learner-insights.courses.by-course.topics.by-topic.support.get",
                "parameters": [
                    {
                        "name": "course",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "topic",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`enabled`, and per assignment: `status` (generating or ready), `kind`, `document` (declarative blocks), `citations`, `reasons`, `why`, `feedback`",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiJson"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The learner may not attend the course"
                    },
                    "404": {
                        "description": "Unknown topic or the topic is not in the course"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/learner-insights/assignments/{assignment}/feedback": {
            "post": {
                "tags": [
                    "Learner insights"
                ],
                "summary": "Say whether a piece of extra help was useful",
                "operationId": "learner-insights.assignments.by-assignment.feedback.post",
                "parameters": [
                    {
                        "name": "assignment",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "helpful"
                                ],
                                "properties": {
                                    "helpful": {
                                        "type": "boolean"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Saved",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiJson"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not the learner's assignment"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/learner-insights/assignments/{assignment}/hide": {
            "post": {
                "tags": [
                    "Learner insights"
                ],
                "summary": "Hide a piece of extra help",
                "operationId": "learner-insights.assignments.by-assignment.hide.post",
                "parameters": [
                    {
                        "name": "assignment",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Hidden",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiJson"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not the learner's assignment"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/learner-insights/assignments/{assignment}/reflection": {
            "post": {
                "tags": [
                    "Learner insights"
                ],
                "summary": "Get feedback on the learner's own explanation of the idea (the text is sent to the AI provider and not stored)",
                "operationId": "learner-insights.assignments.by-assignment.reflection.post",
                "parameters": [
                    {
                        "name": "assignment",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "text"
                                ],
                                "properties": {
                                    "text": {
                                        "type": "string",
                                        "maxLength": 2000
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "`correct`, `missing`, `followUp`, `citations`, `remaining`",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiJson"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not the learner's assignment"
                    },
                    "429": {
                        "description": "Daily limit reached"
                    },
                    "503": {
                        "description": "AI is disabled or the feedback could not be produced"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/liascript": {
            "get": {
                "tags": [
                    "Admin LiaScript"
                ],
                "summary": "List LiaScript sources",
                "description": "LiaScript sources (spec 1.1): versioned Markdown plus assets.",
                "operationId": "liascript.list",
                "responses": {
                    "200": {
                        "description": "documents",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/LiaScriptDocumentPageResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "liascript_manage required"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Admin LiaScript"
                ],
                "summary": "Create from Markdown, an .md file or a .zip (Markdown + assets)",
                "operationId": "liascript.create",
                "requestBody": {
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "properties": {
                                    "title": {
                                        "type": "string"
                                    },
                                    "markdown": {
                                        "type": "string"
                                    },
                                    "file": {
                                        "type": "string",
                                        "format": "binary"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "document with version 1 and warnings",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/LiaScriptDocumentResponse"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "invalid Markdown or upload"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/liascript/{id}": {
            "get": {
                "tags": [
                    "Admin LiaScript"
                ],
                "summary": "Show a LiaScript source",
                "operationId": "liascript.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "document",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/LiaScriptDocumentResponse"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Admin LiaScript"
                ],
                "summary": "Rename a LiaScript source",
                "operationId": "liascript.update",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "document",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/LiaScriptDocumentResponse"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Admin LiaScript"
                ],
                "summary": "Delete a LiaScript source with all versions and assets",
                "operationId": "liascript.delete",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "deleted",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/liascript/{id}/source": {
            "get": {
                "tags": [
                    "Admin LiaScript"
                ],
                "summary": "Markdown of the current or a given version",
                "operationId": "admin.liascript.by-id.source.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "version",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "text/markdown",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiJson"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/liascript/{id}/versions": {
            "get": {
                "tags": [
                    "Admin LiaScript"
                ],
                "summary": "List versions",
                "operationId": "liascript.versions-list",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "versions",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/LiaScriptVersionListResponse"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Admin LiaScript"
                ],
                "summary": "Add a version from Markdown or an upload",
                "operationId": "liascript.versions-add",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "document",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/LiaScriptDocumentResponse"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/liascript/{id}/versions/{version}/restore": {
            "post": {
                "tags": [
                    "Admin LiaScript"
                ],
                "summary": "Restore a version (adds a new version with its content)",
                "operationId": "liascript.versions-restore",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "version",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "document",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/LiaScriptDocumentResponse"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/liascript/{id}/preview": {
            "post": {
                "tags": [
                    "Admin LiaScript"
                ],
                "summary": "Live preview of unsaved Markdown on the tenant content origin",
                "description": "Publishes the text as a short-lived draft next to the current version (its assets resolve) and returns a player URL without progress tracking. Nothing is saved as a version.",
                "operationId": "liascript.preview",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "markdown"
                                ],
                                "properties": {
                                    "markdown": {
                                        "type": "string"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "{url, sections, warnings}",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/LiaScriptPreviewResponse"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "invalid Markdown"
                    },
                    "503": {
                        "description": "no content origin or player not installed"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/liascript/launches/{topic}": {
            "post": {
                "tags": [
                    "LiaScript"
                ],
                "summary": "Start a LiaScript topic on the tenant content origin",
                "description": "Learners play a LiaScript topic on the tenant content origin and the player reports progress.",
                "operationId": "liascript.launches.by-topic.post",
                "parameters": [
                    {
                        "name": "topic",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "{url, sections, version}; url carries a topic-scoped progress token in its fragment",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "no access to the course"
                    },
                    "404": {
                        "description": "not a LiaScript topic"
                    },
                    "503": {
                        "description": "no content origin or player not installed"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/liascript/progress/{topic}": {
            "post": {
                "tags": [
                    "LiaScript"
                ],
                "summary": "Progress reported by the content-origin player",
                "description": "Authenticated with the progress token (X-Ulams-Tracking-Token). The topic is complete when the learner reaches the last section, or LiaScript reports completed/passed.",
                "operationId": "liascript.progress.by-topic.post",
                "parameters": [
                    {
                        "name": "topic",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "location": {
                                        "type": "integer"
                                    },
                                    "status": {
                                        "type": "string"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "{status: in_progress|complete}",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "invalid or expired token"
                    }
                }
            }
        },
        "/api/admin/living-course/sessions/{session}/audit": {
            "get": {
                "tags": [
                    "Admin Living Course"
                ],
                "summary": "Audit entries of a session (filters: action, actorType, from, to, source)",
                "description": "The audit trail (ADR 0034): who decided what and when, tied to the source revision and the\nblueprint versions. Per session for its author and admins; tenant-wide for admins.",
                "operationId": "admin.living-course.sessions.by-session.audit.get",
                "parameters": [
                    {
                        "name": "session",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "entries",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "not allowed"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/living-course/sessions/{session}/audit/export": {
            "get": {
                "tags": [
                    "Admin Living Course"
                ],
                "summary": "Export the audit entries of a session as CSV or JSON",
                "operationId": "admin.living-course.sessions.by-session.audit.export.get",
                "parameters": [
                    {
                        "name": "session",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "format",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "csv",
                                "json"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "file"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/living-course/sessions/{session}/audit/verify": {
            "get": {
                "tags": [
                    "Admin Living Course"
                ],
                "summary": "Verify the hash chain of the audit trail",
                "operationId": "admin.living-course.sessions.by-session.audit.verify.get",
                "parameters": [
                    {
                        "name": "session",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "verdict",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/living-course/audit/export": {
            "get": {
                "tags": [
                    "Admin Living Course"
                ],
                "summary": "Tenant-wide audit export (admins)",
                "operationId": "admin.living-course.audit.export.get",
                "responses": {
                    "200": {
                        "description": "file"
                    },
                    "403": {
                        "description": "admins only"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/living-course/audit/verify": {
            "get": {
                "tags": [
                    "Admin Living Course"
                ],
                "summary": "Tenant-wide chain verification (admins)",
                "operationId": "admin.living-course.audit.verify.get",
                "responses": {
                    "200": {
                        "description": "verdict",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "admins only"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/living-course/connectors": {
            "get": {
                "tags": [
                    "Admin Living Course"
                ],
                "summary": "The source connectors this installation offers, with their settings schema",
                "description": "Connecting a source through a connector, checking it on demand and rotating its webhook secret.",
                "operationId": "admin.living-course.connectors.get",
                "responses": {
                    "200": {
                        "description": "connectors",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/living-course/sessions/{session}/sources/connect": {
            "post": {
                "tags": [
                    "Admin Living Course"
                ],
                "summary": "Add a source through a connector (Git repository, web pages, plugins); validates and fetches revision 1",
                "operationId": "admin.living-course.sessions.by-session.sources.connect.post",
                "parameters": [
                    {
                        "name": "session",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "connector": {
                                        "type": "string"
                                    },
                                    "config": {
                                        "type": "object"
                                    },
                                    "secrets": {
                                        "type": "object"
                                    },
                                    "schedule": {
                                        "type": "string"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "connection, source and the webhook secret (shown once)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "settings refused by the connector"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/living-course/connections/{connection}/check": {
            "post": {
                "tags": [
                    "Admin Living Course"
                ],
                "summary": "Check the source now",
                "operationId": "admin.living-course.connections.by-connection.check.post",
                "parameters": [
                    {
                        "name": "connection",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "commit": {
                                        "description": "the commit a CI job runs for (7 to 64 hex characters); recorded on the new revision",
                                        "type": "string"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "202": {
                        "description": "queued",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "nothing to check"
                    },
                    "422": {
                        "description": "not a commit id"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/living-course/connections/{connection}/webhook-secret": {
            "post": {
                "tags": [
                    "Admin Living Course"
                ],
                "summary": "Rotate the webhook secret (returned once)",
                "operationId": "admin.living-course.connections.by-connection.webhook-secret.post",
                "parameters": [
                    {
                        "name": "connection",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "the new secret",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/living-course/connections/{connection}": {
            "put": {
                "tags": [
                    "Admin Living Course"
                ],
                "summary": "Change a connection: schedule, automatic analysis, learner notice settings, paused",
                "description": "Settings of a source connection and disconnecting it (history is kept).",
                "operationId": "admin.living-course.connections.by-connection.put",
                "parameters": [
                    {
                        "name": "connection",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "connection",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "not allowed"
                    },
                    "404": {
                        "description": "unknown"
                    },
                    "422": {
                        "description": "invalid"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Admin Living Course"
                ],
                "summary": "Disconnect a source (revisions and the audit trail are kept)",
                "operationId": "admin.living-course.connections.by-connection.delete",
                "parameters": [
                    {
                        "name": "connection",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "disconnected",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "not allowed"
                    },
                    "404": {
                        "description": "unknown"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/living-course/courses/{course}/notices": {
            "get": {
                "tags": [
                    "Living Course learner"
                ],
                "summary": "The caller's open update notices for a course",
                "description": "Learner side (ADR 0033): the caller's own notices about updated courses, and the opt-in \"an\n * update is under review\" marker. Notices never change progress.",
                "operationId": "living-course.courses.by-course.notices.get",
                "parameters": [
                    {
                        "name": "course",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "notices",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "not signed in"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/living-course/notices/{notice}/dismiss": {
            "post": {
                "tags": [
                    "Living Course learner"
                ],
                "summary": "Mark a notice as reviewed",
                "operationId": "living-course.notices.by-notice.dismiss.post",
                "parameters": [
                    {
                        "name": "notice",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "dismissed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "not the caller's notice"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/living-course/courses/{course}/freshness": {
            "get": {
                "tags": [
                    "Living Course learner"
                ],
                "summary": "Topics with an update under review (only when the course shows it)",
                "operationId": "living-course.courses.by-course.freshness.get",
                "parameters": [
                    {
                        "name": "course",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "topics",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "unknown course"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/living-course/oauth/{provider}/start": {
            "post": {
                "tags": [
                    "Admin Living Course"
                ],
                "summary": "The vendor sign-in address for Connect your account (provider google or notion); the session must be one the caller may change",
                "description": "\"Connect your Google or Notion account\" for the Drive and Notion connectors. The start needs the same right\nas connecting a source; the callback is the vendor's redirect and is authorised by the encrypted,\nexpiring state of the start. The tokens never reach the browser: it only gets a one-time grant id that\nthe connect request redeems.",
                "operationId": "admin.living-course.oauth.by-provider.start.post",
                "parameters": [
                    {
                        "name": "provider",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "google",
                                "notion"
                            ]
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "sessionId": {
                                        "type": "string"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "url to send the browser to",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "another author's session"
                    },
                    "422": {
                        "description": "sign-in not set up on this installation"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/living-course/oauth/{provider}/callback": {
            "get": {
                "tags": [
                    "Living Course"
                ],
                "summary": "The vendor's redirect after the sign-in: redirects to the studio with a one-time grant, or answers with it",
                "operationId": "living-course.oauth.by-provider.callback.get",
                "parameters": [
                    {
                        "name": "provider",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "google",
                                "notion"
                            ]
                        }
                    },
                    {
                        "name": "code",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "state",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "grant (when no return address is configured)"
                    },
                    "302": {
                        "description": "redirect to the studio"
                    },
                    "422": {
                        "description": "sign-in refused or expired"
                    }
                }
            }
        },
        "/api/admin/living-course/sessions/{session}/proposals": {
            "get": {
                "tags": [
                    "Admin Living Course"
                ],
                "summary": "Update proposals of a session, newest first",
                "description": "Update proposals: list and detail (decisions, analysis and apply are added by their own endpoints).",
                "operationId": "admin.living-course.sessions.by-session.proposals.get",
                "parameters": [
                    {
                        "name": "session",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "proposals",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "another author's session"
                    },
                    "404": {
                        "description": "unknown session"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/living-course/proposals/{proposal}": {
            "get": {
                "tags": [
                    "Admin Living Course"
                ],
                "summary": "A proposal with its items grouped by lesson, citations and source changes",
                "operationId": "admin.living-course.proposals.by-proposal.get",
                "parameters": [
                    {
                        "name": "proposal",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "proposal",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "another author's session"
                    },
                    "404": {
                        "description": "unknown proposal"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/living-course/proposals/{proposal}/analyse": {
            "post": {
                "tags": [
                    "Admin Living Course"
                ],
                "summary": "Start or resume the AI analysis (confirmEstimate when above the automatic threshold)",
                "operationId": "admin.living-course.proposals.by-proposal.analyse.post",
                "parameters": [
                    {
                        "name": "proposal",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "confirmEstimate": {
                                        "type": "boolean"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "202": {
                        "description": "analysis started",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "estimate must be confirmed"
                    },
                    "422": {
                        "description": "budget blocked"
                    },
                    "503": {
                        "description": "AI disabled"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/living-course/proposals/{proposal}/items/{item}/accept": {
            "post": {
                "tags": [
                    "Admin Living Course"
                ],
                "summary": "Accept one item",
                "operationId": "admin.living-course.proposals.by-proposal.items.by-item.accept.post",
                "parameters": [
                    {
                        "name": "proposal",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "item",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "the item",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiJson"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "not allowed"
                    },
                    "404": {
                        "description": "unknown"
                    },
                    "409": {
                        "description": "not decidable now"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/living-course/proposals/{proposal}/items/{item}/reject": {
            "post": {
                "tags": [
                    "Admin Living Course"
                ],
                "summary": "Reject one item (keep the earlier version of the element)",
                "operationId": "admin.living-course.proposals.by-proposal.items.by-item.reject.post",
                "parameters": [
                    {
                        "name": "proposal",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "item",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "the item",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiJson"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "not allowed"
                    },
                    "404": {
                        "description": "unknown"
                    },
                    "409": {
                        "description": "not decidable now"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/living-course/proposals/{proposal}/items/{item}/accept-in-group": {
            "post": {
                "tags": [
                    "Admin Living Course"
                ],
                "summary": "Accept one item and the same patch in the other proposals of its group (the course's variants)",
                "operationId": "admin.living-course.proposals.by-proposal.items.by-item.accept-in-group.post",
                "parameters": [
                    {
                        "name": "proposal",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "item",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "the item and proposal, how many other items were accepted (accepted) and in which proposals",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "not allowed"
                    },
                    "404": {
                        "description": "unknown"
                    },
                    "409": {
                        "description": "not decidable now"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/living-course/proposals/{proposal}/items/{item}/reset": {
            "post": {
                "tags": [
                    "Admin Living Course"
                ],
                "summary": "Back to undecided",
                "operationId": "admin.living-course.proposals.by-proposal.items.by-item.reset.post",
                "parameters": [
                    {
                        "name": "proposal",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "item",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "the item",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiJson"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "not allowed"
                    },
                    "404": {
                        "description": "unknown"
                    },
                    "409": {
                        "description": "not decidable now"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/living-course/proposals/{proposal}/items/{item}/regenerate": {
            "post": {
                "tags": [
                    "Admin Living Course"
                ],
                "summary": "Ask for another version of one element ({comment}); one call, at most three per item",
                "operationId": "admin.living-course.proposals.by-proposal.items.by-item.regenerate.post",
                "parameters": [
                    {
                        "name": "proposal",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "item",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "the item",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "not allowed"
                    },
                    "404": {
                        "description": "unknown"
                    },
                    "409": {
                        "description": "not decidable now"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/living-course/proposals/{proposal}/items/{item}/suggest-lesson": {
            "post": {
                "tags": [
                    "Admin Living Course"
                ],
                "summary": "Suggest a new lesson for a new source section no lesson covers (one AI call; the item becomes `new_lesson` for review as a diff)",
                "operationId": "admin.living-course.proposals.by-proposal.items.by-item.suggest-lesson.post",
                "parameters": [
                    {
                        "name": "proposal",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "item",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "the item with the suggested lesson",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "not allowed"
                    },
                    "404": {
                        "description": "unknown"
                    },
                    "409": {
                        "description": "not an uncovered section, or settled"
                    },
                    "422": {
                        "description": "budget"
                    },
                    "503": {
                        "description": "AI disabled"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/living-course/proposals/{proposal}/accept-all": {
            "post": {
                "tags": [
                    "Admin Living Course"
                ],
                "summary": "Accept every undecided update, no-change and removal item",
                "operationId": "admin.living-course.proposals.by-proposal.accept-all.post",
                "parameters": [
                    {
                        "name": "proposal",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "the proposal",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "not allowed"
                    },
                    "409": {
                        "description": "already settled"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/living-course/proposals/{proposal}/reject": {
            "post": {
                "tags": [
                    "Admin Living Course"
                ],
                "summary": "Reject the whole proposal and acknowledge the source revision",
                "operationId": "admin.living-course.proposals.by-proposal.reject.post",
                "parameters": [
                    {
                        "name": "proposal",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "the proposal",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "not allowed"
                    },
                    "409": {
                        "description": "already settled"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/living-course/proposals/{proposal}/reanalyse": {
            "post": {
                "tags": [
                    "Admin Living Course"
                ],
                "summary": "Replace the proposal by a new one from the newest source revision",
                "operationId": "admin.living-course.proposals.by-proposal.reanalyse.post",
                "parameters": [
                    {
                        "name": "proposal",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "the new proposal",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "already settled"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/living-course/proposals/{proposal}/learner-note": {
            "put": {
                "tags": [
                    "Admin Living Course"
                ],
                "summary": "The text learners see for updated lessons (plain text, up to 500 characters)",
                "operationId": "admin.living-course.proposals.by-proposal.learner-note.put",
                "parameters": [
                    {
                        "name": "proposal",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "note": {
                                        "type": "string"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "note",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "already settled"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/living-course/proposals/{proposal}/apply": {
            "post": {
                "tags": [
                    "Admin Living Course"
                ],
                "summary": "Apply the accepted items as a new course version (409 with conflicting items or admin edits)",
                "operationId": "admin.living-course.proposals.by-proposal.apply.post",
                "parameters": [
                    {
                        "name": "proposal",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "overwrite": {
                                        "type": "boolean"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "202": {
                        "description": "apply run",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "conflicts or admin edits"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/living-course/sessions/{session}/sources": {
            "get": {
                "tags": [
                    "Admin Living Course"
                ],
                "summary": "Sources of a session with connection, sync state and revisions",
                "description": "Sources of a builder session with their sync state, and their revisions.",
                "operationId": "admin.living-course.sessions.by-session.sources.get",
                "parameters": [
                    {
                        "name": "session",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "sources",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "another author's session"
                    },
                    "404": {
                        "description": "unknown session"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/living-course/sources/{source}/revisions": {
            "get": {
                "tags": [
                    "Admin Living Course"
                ],
                "summary": "Revisions of a source, newest first",
                "operationId": "admin.living-course.sources.by-source.revisions.get",
                "parameters": [
                    {
                        "name": "source",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "revisions",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "another author's session"
                    },
                    "404": {
                        "description": "unknown source"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Admin Living Course"
                ],
                "summary": "Upload a new version of a source (MD, PDF or DOCX): creates a revision and its fragment diff",
                "operationId": "admin.living-course.sources.by-source.revisions.post",
                "parameters": [
                    {
                        "name": "source",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "properties": {
                                    "file": {
                                        "type": "string",
                                        "format": "binary"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "the new revision",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "200": {
                        "description": "the file is the latest revision already (unchanged: true)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "rejected upload"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/living-course/revisions/{revision}/changes": {
            "get": {
                "tags": [
                    "Admin Living Course"
                ],
                "summary": "Fragment changes of a revision against the synced revision it was compared with (or ?against=<revision id>)",
                "operationId": "admin.living-course.revisions.by-revision.changes.get",
                "parameters": [
                    {
                        "name": "revision",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "against",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "counts and changes with old and new text and word diffs",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "unknown revision"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/living-course/revisions/{revision}": {
            "get": {
                "tags": [
                    "Admin Living Course"
                ],
                "summary": "One revision",
                "operationId": "admin.living-course.revisions.by-revision.get",
                "parameters": [
                    {
                        "name": "revision",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "revision",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "another author's session"
                    },
                    "404": {
                        "description": "unknown revision"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/living-course/sessions/{session}/staleness": {
            "get": {
                "tags": [
                    "Admin Living Course"
                ],
                "summary": "Per-element staleness and the course summary",
                "description": "Staleness per element and per course. Works with AI disabled.",
                "operationId": "admin.living-course.sessions.by-session.staleness.get",
                "parameters": [
                    {
                        "name": "session",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "summary and elements",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "another author's session"
                    },
                    "404": {
                        "description": "unknown session"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/living-course/sessions/{session}/style-proposals": {
            "post": {
                "tags": [
                    "Admin Living Course"
                ],
                "summary": "Propose a restyle of the course for an approved style profile (default: the one the brief names, else the academy's). Without confirmEstimate: the estimate only",
                "description": "Restyle proposals (ADR 0196): after a style profile changes, an optional proposal that brings the flagged elements of a\ncourse in line with it. Without `confirmEstimate` it only says what would be rewritten and what it would cost; with it, a\nproposal of kind `style` is created and analysed. The author reviews and applies the diff on the Living Course review\nscreen; nothing changes in the course before that, and a restyle is never started by itself.",
                "operationId": "admin.living-course.sessions.by-session.style-proposals.post",
                "parameters": [
                    {
                        "name": "session",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "styleProfileId": {
                                        "type": "string"
                                    },
                                    "confirmEstimate": {
                                        "type": "boolean"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "state estimate (what and how much) or kept_existing",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "proposal created and analysis started",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "not the author"
                    },
                    "404": {
                        "description": "unknown session or profile"
                    },
                    "409": {
                        "description": "no approved version"
                    },
                    "422": {
                        "description": "profile not approved, nothing to restyle, or budget"
                    },
                    "429": {
                        "description": "daily limit"
                    },
                    "503": {
                        "description": "AI disabled"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/living-course/webhooks/{webhookId}": {
            "post": {
                "tags": [
                    "Living Course webhooks"
                ],
                "summary": "Receive a push webhook of a connected repository",
                "description": "Inbound webhooks of source hosts (ADR 0032). Public route, authenticated by the signature with the\nconnection's own secret: invalid signatures are refused and logged, duplicates answer 200 without\nwork, only pushes to the tracked branch that touch the tracked paths queue a (debounced) check.\nPayloads are never sent to the model and never stored, only their digest; what the revision keeps of a push is the head commit,\nits subject line and the pull request number (`ChangeNote`).",
                "operationId": "living-course.webhooks.by-webhookid.post",
                "parameters": [
                    {
                        "name": "webhookId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "202": {
                        "description": "a check is queued",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "200": {
                        "description": "ignored or duplicate",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "invalid signature"
                    },
                    "404": {
                        "description": "unknown webhook"
                    },
                    "413": {
                        "description": "body too large"
                    },
                    "429": {
                        "description": "rate limit"
                    }
                }
            }
        },
        "/api/cmi5/fetch": {
            "post": {
                "tags": [
                    "cmi5"
                ],
                "summary": "cmi5 token fetch",
                "description": "Exchanges the one-time token of a cmi5 launch URL for an LRS-only session token (`auth-token`). Repeat calls within the session return the same token. Public: the one-time token is the credential.",
                "operationId": "cmi5.fetch.post",
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "description": "one-time launch token",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiJson"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "the launch token is unknown or expired"
                    }
                }
            }
        },
        "/api/cmi5/courses/{id}": {
            "get": {
                "tags": [
                    "cmi5"
                ],
                "summary": "Get Course cmi5 launch params",
                "description": "Course cmi5 launch params",
                "operationId": "cmi5.courses.by-id.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of Course",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/cmi5/statements": {
            "get": {
                "tags": [
                    "cmi5"
                ],
                "summary": "Lists available statements",
                "operationId": "cmi5.statements",
                "parameters": [
                    {
                        "name": "order_by",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "created_at",
                                "id"
                            ]
                        }
                    },
                    {
                        "name": "order",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "ASC",
                                "DESC"
                            ]
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Pagination Page Number",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "default": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Pagination Per Page",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "default": 15
                        }
                    },
                    {
                        "name": "verb",
                        "in": "query",
                        "description": "Verb display name or id",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "account",
                        "in": "query",
                        "description": "Account name or homePage",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "registration",
                        "in": "query",
                        "description": "Registration uuid",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "object",
                        "in": "query",
                        "description": "Object type",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "version",
                        "in": "query",
                        "description": "Version",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "date_from",
                        "in": "query",
                        "description": "Date from",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "date_to",
                        "in": "query",
                        "description": "Date to",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "List of available statements",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/LrsStatementPageResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Endpoint requires authentication"
                    },
                    "403": {
                        "description": "User doesn't have required access rights"
                    },
                    "500": {
                        "description": "Server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/lti/endpoints": {
            "get": {
                "tags": [
                    "Admin LTI"
                ],
                "summary": "Our LTI endpoints and issuer, to register us elsewhere",
                "description": "Registrations (permission `lti_manage`): tools we launch and platforms that launch us, plus\nthe URLs and key set to give to the other side.",
                "operationId": "admin.lti.endpoints.get",
                "responses": {
                    "200": {
                        "description": "issuer, JWKS URL, platform and tool endpoints",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "lti_manage required"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/lti/tools": {
            "get": {
                "tags": [
                    "Admin LTI"
                ],
                "summary": "List registered tools",
                "operationId": "admin.lti.tools.get",
                "responses": {
                    "200": {
                        "description": "tools",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Admin LTI"
                ],
                "summary": "Register a tool (we issue client_id and deployment_id)",
                "operationId": "admin.lti.tools.post",
                "responses": {
                    "201": {
                        "description": "tool",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/lti/tools/{tool}": {
            "get": {
                "tags": [
                    "Admin LTI"
                ],
                "summary": "Show a tool",
                "operationId": "admin.lti.tools.by-tool.get",
                "parameters": [
                    {
                        "name": "tool",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "tool",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Admin LTI"
                ],
                "summary": "Update a tool",
                "operationId": "admin.lti.tools.by-tool.put",
                "parameters": [
                    {
                        "name": "tool",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "tool",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Admin LTI"
                ],
                "summary": "Delete a tool without topics",
                "operationId": "admin.lti.tools.by-tool.delete",
                "parameters": [
                    {
                        "name": "tool",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "deleted",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "used by topics"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/lti/tools/{tool}/deep-link": {
            "post": {
                "tags": [
                    "Admin LTI"
                ],
                "summary": "Start deep linking into a lesson",
                "operationId": "admin.lti.tools.by-tool.deep-link.post",
                "parameters": [
                    {
                        "name": "tool",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "{url} to open in a window",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/lti/platforms": {
            "get": {
                "tags": [
                    "Admin LTI"
                ],
                "summary": "List platforms that may launch us",
                "operationId": "admin.lti.platforms.get",
                "responses": {
                    "200": {
                        "description": "platforms",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Admin LTI"
                ],
                "summary": "Register a platform",
                "operationId": "admin.lti.platforms.post",
                "responses": {
                    "201": {
                        "description": "platform",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/lti/platforms/{platform}": {
            "get": {
                "tags": [
                    "Admin LTI"
                ],
                "summary": "Show a platform",
                "operationId": "admin.lti.platforms.by-platform.get",
                "parameters": [
                    {
                        "name": "platform",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "platform",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Admin LTI"
                ],
                "summary": "Update a platform",
                "operationId": "admin.lti.platforms.by-platform.put",
                "parameters": [
                    {
                        "name": "platform",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "platform",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Admin LTI"
                ],
                "summary": "Delete a platform",
                "operationId": "admin.lti.platforms.by-platform.delete",
                "parameters": [
                    {
                        "name": "platform",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "deleted",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/lti/frame-origins": {
            "get": {
                "tags": [
                    "LTI"
                ],
                "summary": "Origins of the enabled external tools of this tenant",
                "description": "For the front's Content Security Policy: the `frame-src` of a learner page must name the origins a tool launch loads (its OIDC login, launch and deep-linking URLs). Public and cached for 5 minutes; it reveals only the origins of tools the tenant registered for its learners.",
                "operationId": "lti.frame-origins.get",
                "responses": {
                    "200": {
                        "description": "Sorted, unique origins (`scheme://host[:port]`)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "string",
                                                "example": "https://www.geogebra.org"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/lti/jwks": {
            "get": {
                "tags": [
                    "LTI"
                ],
                "summary": "Public key set of this tenant (LTI platform and tool side)",
                "description": "Also served at /.well-known/jwks.json. Contains the next, active and recently retired keys.",
                "operationId": "lti.jwks.get",
                "responses": {
                    "200": {
                        "description": "JWKS",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiJson"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/lti/platform/ags/{course}/lineitems": {
            "get": {
                "tags": [
                    "LTI"
                ],
                "summary": "AGS: list line items",
                "description": "AGS 2.0 endpoints of the platform side. Authenticated with an access token from\n/api/lti/platform/token; every line item belongs to the token's tool and the course in the URL.",
                "operationId": "lti.platform.ags.by-course.lineitems.get",
                "parameters": [
                    {
                        "name": "course",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "line item container",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiJson"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "invalid token"
                    }
                }
            },
            "post": {
                "tags": [
                    "LTI"
                ],
                "summary": "AGS: create a line item",
                "operationId": "lti.platform.ags.by-course.lineitems.post",
                "parameters": [
                    {
                        "name": "course",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "line item",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiJson"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "scope lineitem required"
                    }
                }
            }
        },
        "/api/lti/platform/ags/{course}/lineitems/{lineItem}": {
            "get": {
                "tags": [
                    "LTI"
                ],
                "summary": "AGS: read a line item",
                "operationId": "lti.platform.ags.by-course.lineitems.by-lineitem.get",
                "parameters": [
                    {
                        "name": "course",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "lineItem",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "line item",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiJson"
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "tags": [
                    "LTI"
                ],
                "summary": "AGS: update a line item",
                "operationId": "lti.platform.ags.by-course.lineitems.by-lineitem.put",
                "parameters": [
                    {
                        "name": "course",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "lineItem",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "line item",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiJson"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "tags": [
                    "LTI"
                ],
                "summary": "AGS: delete a line item",
                "operationId": "lti.platform.ags.by-course.lineitems.by-lineitem.delete",
                "parameters": [
                    {
                        "name": "course",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "lineItem",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "deleted"
                    }
                }
            }
        },
        "/api/lti/platform/ags/{course}/lineitems/{lineItem}/scores": {
            "post": {
                "tags": [
                    "LTI"
                ],
                "summary": "AGS: post a score",
                "operationId": "lti.platform.ags.by-course.lineitems.by-lineitem.scores.post",
                "parameters": [
                    {
                        "name": "course",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "lineItem",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "stored; completes the topic when Completed or FullyGraded"
                    }
                }
            }
        },
        "/api/lti/platform/ags/{course}/lineitems/{lineItem}/results": {
            "get": {
                "tags": [
                    "LTI"
                ],
                "summary": "AGS: latest result per learner",
                "operationId": "lti.platform.ags.by-course.lineitems.by-lineitem.results.get",
                "parameters": [
                    {
                        "name": "course",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "lineItem",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "result container",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiJson"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/lti/platform/nrps/{course}": {
            "get": {
                "tags": [
                    "LTI"
                ],
                "summary": "NRPS: members of a course (membership container)",
                "description": "Bearer token from /api/lti/platform/token with scope https://purl.imsglobal.org/spec/lti-nrps/scope/contextmembership.readonly. Names and e-mails only when the tool registration shares them. Paged by `limit` (max 100) and `page`; a Link header with rel=next points to the next page. `role` filters by LTI role.",
                "operationId": "lti.platform.nrps.by-course.get",
                "parameters": [
                    {
                        "name": "course",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "maximum": 100
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "role",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "application/vnd.ims.lti-nrps.v2.membershipcontainer+json",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiJson"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "invalid token"
                    },
                    "403": {
                        "description": "scope missing or NRPS not enabled for the tool"
                    },
                    "404": {
                        "description": "the course holds no link of this tool"
                    }
                }
            }
        },
        "/api/lti/launches/{topic}": {
            "post": {
                "tags": [
                    "LTI"
                ],
                "summary": "Start an LTI launch of an external-tool topic",
                "description": "Returns the tool's OIDC login URL (with a signed, 2-minute login_hint) to open in an iframe or a new window.",
                "operationId": "lti.launches.by-topic.post",
                "parameters": [
                    {
                        "name": "topic",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "{url, presentation, tool}",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "no access to the topic"
                    },
                    "404": {
                        "description": "unknown topic"
                    },
                    "409": {
                        "description": "the tool is disabled"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/lti/platform/authorize": {
            "get": {
                "tags": [
                    "LTI"
                ],
                "summary": "OIDC authentication endpoint (the tool redirects the browser here)",
                "description": "Checks client_id, redirect_uri and the login_hint (single use) and posts a signed id_token to the tool. Also accepts POST.",
                "operationId": "lti.platform.authorize.get",
                "responses": {
                    "200": {
                        "description": "auto-submitting form to the tool"
                    },
                    "400": {
                        "description": "invalid request"
                    },
                    "401": {
                        "description": "unknown client, invalid or reused login hint"
                    }
                }
            }
        },
        "/api/lti/platform/token": {
            "post": {
                "tags": [
                    "LTI"
                ],
                "summary": "AGS access token (OAuth 2 client credentials with a JWT client assertion)",
                "operationId": "lti.platform.token.post",
                "responses": {
                    "200": {
                        "description": "{access_token, token_type, expires_in, scope}",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiJson"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "invalid request or scope"
                    },
                    "401": {
                        "description": "invalid client assertion"
                    }
                }
            }
        },
        "/api/lti/platform/deep-links": {
            "post": {
                "tags": [
                    "LTI"
                ],
                "summary": "Deep-linking return URL (the tool posts the author's selection here)",
                "description": "Verifies the LtiDeepLinkingResponse JWT and creates one external-tool topic per ltiResourceLink item in the lesson the request was made for.",
                "operationId": "lti.platform.deep-links.post",
                "responses": {
                    "200": {
                        "description": "confirmation page; posts {type: 'ulams:lti:deep-link', topics} to the opener"
                    },
                    "401": {
                        "description": "invalid or reused response"
                    }
                }
            }
        },
        "/api/lti/tool/login": {
            "get": {
                "tags": [
                    "LTI"
                ],
                "summary": "OIDC login initiation from a registered platform (also POST)",
                "operationId": "lti.tool.login.get",
                "parameters": [
                    {
                        "name": "lti_storage_target",
                        "in": "query",
                        "description": "Client Side postMessage Storage: the platform's storage frame. Present: the response is a page that puts the nonce in the platform's storage before it continues.",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "302": {
                        "description": "redirect to the platform's OIDC auth URL"
                    },
                    "200": {
                        "description": "storage page that continues to the platform's OIDC auth URL (lti_storage_target given)"
                    },
                    "400": {
                        "description": "unknown platform or missing login_hint"
                    }
                }
            }
        },
        "/api/lti/tool/launch": {
            "post": {
                "tags": [
                    "LTI"
                ],
                "summary": "LTI launch (resource link or deep-linking request) from a registered platform",
                "description": "Resource link: maps the platform user, grants course access and redirects to the front with a one-time code. Deep linking: shows the course picker.",
                "operationId": "lti.tool.launch.post",
                "responses": {
                    "302": {
                        "description": "redirect to the front landing page"
                    },
                    "200": {
                        "description": "course picker (deep linking)"
                    },
                    "401": {
                        "description": "invalid launch"
                    }
                }
            }
        },
        "/api/lti/tool/launch/verify": {
            "post": {
                "tags": [
                    "LTI"
                ],
                "summary": "Second step of a launch whose login used the platform's storage (Client Side postMessage Storage)",
                "description": "Posted by the storage page with the id_token, the state and the value read from the platform's storage. A different value is refused; an empty one (storage unavailable) falls back to the server-side state. Then it behaves like /api/lti/tool/launch.",
                "operationId": "lti.tool.launch.verify.post",
                "responses": {
                    "302": {
                        "description": "redirect to the front landing page"
                    },
                    "200": {
                        "description": "course picker (deep linking)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiJson"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "the value does not match, or the login expired"
                    }
                }
            }
        },
        "/api/lti/tool/deep-link": {
            "post": {
                "tags": [
                    "LTI"
                ],
                "summary": "Return the courses picked in the deep-linking picker to the platform",
                "operationId": "lti.tool.deep-link.post",
                "responses": {
                    "200": {
                        "description": "auto-submitting form with the LtiDeepLinkingResponse JWT",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiJson"
                                }
                            }
                        }
                    },
                    "410": {
                        "description": "the deep-linking session expired"
                    }
                }
            }
        },
        "/api/lti/tool/exchange": {
            "post": {
                "tags": [
                    "LTI"
                ],
                "summary": "Exchange the one-time launch code for an API token",
                "operationId": "lti.tool.exchange.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "code": {
                                        "type": "string"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "{token, course_id}",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "expired or used code"
                    }
                }
            }
        },
        "/api/mattermost/me": {
            "get": {
                "tags": [
                    "Mattermost"
                ],
                "summary": "List all of the available mattermost teams and channels for a user",
                "description": "ist all of the available mattermost teams and channels for a user",
                "operationId": "mattermost.me.get",
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/mattermost/generate_credentials": {
            "get": {
                "tags": [
                    "Mattermost"
                ],
                "summary": "Generates user (creates one if not exists) credentials and sets a new random password",
                "description": "Generates user (creates one if not exists) credentials and sets a new random password",
                "operationId": "mattermost.generate-credentials.get",
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/mattermost/reset_password": {
            "get": {
                "tags": [
                    "Mattermost"
                ],
                "summary": "Sends request for mattermost to send reset password link with email",
                "description": "Sends request for mattermost to send reset password link with email",
                "operationId": "mattermost.reset-password.get",
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/model-fields": {
            "get": {
                "tags": [
                    "Model Fields"
                ],
                "summary": "Lists available Model extended fields",
                "operationId": "admin.model-fields.get",
                "parameters": [
                    {
                        "name": "class_type",
                        "in": "query",
                        "description": "class type of which field is extended",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "pagination page number",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "number of items per page",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "order",
                        "in": "query",
                        "description": "order direction",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "order_by",
                        "in": "query",
                        "description": "order by field",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "list of available fields",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "description": "map of templates identified by a slug value",
                                    "type": "object",
                                    "additionalProperties": {
                                        "$ref": "#/components/schemas/ModelField"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                }
            },
            "post": {
                "tags": [
                    "Admin Model Fields"
                ],
                "summary": "Create or update metafile",
                "operationId": "model-fields.create",
                "requestBody": {
                    "description": "Metadata attributes",
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/Metadata"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Metadata created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ModelFieldMetadataResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "422": {
                        "description": "one of the parameters has invalid format"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Admin Model Fields"
                ],
                "summary": "delete metafile and related values from model",
                "operationId": "model-fields.delete",
                "requestBody": {
                    "description": "Metadata attributes",
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/Metadata"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Metadata created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiBooleanResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "422": {
                        "description": "one of the parameters has invalid format"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/model-fields": {
            "get": {
                "tags": [
                    "Model Fields"
                ],
                "summary": "Lists available Model extended fields",
                "operationId": "model-fields.get",
                "parameters": [
                    {
                        "name": "class_type",
                        "in": "query",
                        "description": "class type of which field is extended",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "list of available fields",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "description": "map of templates identified by a slug value",
                                    "type": "object",
                                    "additionalProperties": {
                                        "$ref": "#/components/schemas/ModelField"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                }
            }
        },
        "/api/admin/notifications/all": {
            "get": {
                "tags": [
                    "Notifications Admin"
                ],
                "summary": "Get notifications",
                "description": "Get paginated list of notifications sent using `database` channel",
                "operationId": "admin.notifications.all.get",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Pagination Page Number",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "default": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Pagination Per Page",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "default": 15
                        }
                    },
                    {
                        "name": "event",
                        "in": "query",
                        "description": "Event class filter",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "include_read",
                        "in": "query",
                        "description": "Include read notifications",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "date_from",
                        "in": "query",
                        "description": "From date filter",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "date_to",
                        "in": "query",
                        "description": "To date filter",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "user",
                        "in": "path",
                        "description": "User Id (if empty, will return all notifications)",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/notifications": {
            "get": {
                "tags": [
                    "Notifications Admin"
                ],
                "summary": "Get list of events for which notifications exist",
                "description": "Get list of events for which notifications exist",
                "operationId": "admin.notifications.get",
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/notifications/events": {
            "get": {
                "tags": [
                    "Notifications Admin"
                ],
                "summary": "Get list of events for which notifications exist",
                "description": "Get list of events for which notifications exist",
                "operationId": "admin.notifications.events.get",
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/notifications/{notification}/read": {
            "post": {
                "tags": [
                    "Notifications"
                ],
                "summary": "Mark notification as read",
                "description": "Mark notification as read",
                "operationId": "notifications.by-notification.read.post",
                "parameters": [
                    {
                        "name": "notification",
                        "in": "path",
                        "description": "Notification uuid / id",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/notifications/read-all": {
            "post": {
                "tags": [
                    "Notifications Admin"
                ],
                "summary": "Mark all notifications as read",
                "description": "Mark all notifications as read",
                "operationId": "admin.notifications.read-all.post",
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/pages": {
            "get": {
                "tags": [
                    "Pages"
                ],
                "summary": "Lists available pages",
                "operationId": "admin.pages.get",
                "responses": {
                    "200": {
                        "description": "list of available pages",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "description": "map of pages identified by a slug value",
                                    "type": "object",
                                    "additionalProperties": {
                                        "$ref": "#/components/schemas/Page"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Pages"
                ],
                "summary": "Create a new page identified by id",
                "operationId": "pages.create",
                "requestBody": {
                    "description": "Page attributes",
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/Page"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "page created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/PageResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "409": {
                        "description": "there already is a page identified by chosen slug identifier"
                    },
                    "422": {
                        "description": "one of the parameters has invalid format"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/pages/{id}": {
            "get": {
                "tags": [
                    "Pages"
                ],
                "summary": "Read a page identified by a given id identifier",
                "operationId": "admin.pages.by-id.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Unique human-readable page identifier",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Page"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Pages"
                ],
                "summary": "Delete a page identified by a id",
                "operationId": "pages.delete",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Unique human-readable page identifier",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "page deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiBooleanResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "400": {
                        "description": "cannot find a page with provided slug identifier"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "patch": {
                "tags": [
                    "Pages"
                ],
                "summary": "Update an existing page identified by id",
                "operationId": "pages.update",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Unique human-readable page identifier",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "description": "Page attributes",
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/Page"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "page updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/PageResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "400": {
                        "description": "cannot find a page with provided slug identifier"
                    },
                    "422": {
                        "description": "one of the parameters has invalid format"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/pages": {
            "get": {
                "tags": [
                    "Pages"
                ],
                "summary": "Lists available pages",
                "operationId": "pages.get",
                "responses": {
                    "200": {
                        "description": "list of available pages",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "description": "map of pages identified by a slug value",
                                    "type": "object",
                                    "additionalProperties": {
                                        "$ref": "#/components/schemas/Page"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                }
            }
        },
        "/api/pages/{slug}": {
            "get": {
                "tags": [
                    "Pages"
                ],
                "summary": "Read a page identified by a given slug identifier",
                "operationId": "pages.by-slug.get",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "description": "Unique human-readable page identifier",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Page"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                }
            }
        },
        "/api/admin/payments": {
            "get": {
                "tags": [
                    "Admin Payments"
                ],
                "summary": "Search payments",
                "description": "Get filtered and paginated Payments",
                "operationId": "admin.payments.get",
                "parameters": [
                    {
                        "name": "order_by",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "created_at",
                                "updated_at",
                                "status",
                                "payable_id",
                                "user_id",
                                "amount",
                                "order_id",
                                "id"
                            ]
                        }
                    },
                    {
                        "name": "order",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "ASC",
                                "DESC"
                            ]
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Pagination Page Number",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "default": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Pagination Per Page",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "default": 15
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "Payment status",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "new",
                                "paid",
                                "cancelled"
                            ]
                        }
                    },
                    {
                        "name": "order_id",
                        "in": "query",
                        "description": "External order id (e.g. from payment provider)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "payable_id",
                        "in": "query",
                        "description": "Id of payable (e.g. order model id)",
                        "required": false,
                        "schema": {
                            "type": "number"
                        }
                    },
                    {
                        "name": "payable_type",
                        "in": "query",
                        "description": "Full classname of payable model (eg. Ulams\\Cart\\Models\\Order)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "Id of user",
                        "required": false,
                        "schema": {
                            "type": "number"
                        }
                    },
                    {
                        "name": "date_from",
                        "in": "query",
                        "description": "Date from",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "date_to",
                        "in": "query",
                        "description": "Date to",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/payments/{id}": {
            "get": {
                "tags": [
                    "Admin Payments"
                ],
                "summary": "Display the specified Payment",
                "description": "Get Payment",
                "operationId": "admin.payments.by-id.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of Payment",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/payments/export": {
            "get": {
                "tags": [
                    "Admin Payments"
                ],
                "summary": "Export payments to file",
                "description": "Export filtered Payments",
                "operationId": "admin.payments.export.get",
                "parameters": [
                    {
                        "name": "order_by",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "created_at",
                                "updated_at",
                                "status",
                                "payable_id",
                                "user_id",
                                "amount",
                                "order_id",
                                "id"
                            ]
                        }
                    },
                    {
                        "name": "order",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "ASC",
                                "DESC"
                            ]
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "Payment status",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "new",
                                "paid",
                                "cancelled"
                            ]
                        }
                    },
                    {
                        "name": "order_id",
                        "in": "query",
                        "description": "External order id (e.g. from payment provider)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "payable_id",
                        "in": "query",
                        "description": "Id of payable (e.g. order model id)",
                        "required": false,
                        "schema": {
                            "type": "number"
                        }
                    },
                    {
                        "name": "payable_type",
                        "in": "query",
                        "description": "Full classname of payable model (eg. Ulams\\Cart\\Models\\Order)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "Id of user",
                        "required": false,
                        "schema": {
                            "type": "number"
                        }
                    },
                    {
                        "name": "date_from",
                        "in": "query",
                        "description": "Date from",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "date_to",
                        "in": "query",
                        "description": "Date to",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/payments": {
            "get": {
                "tags": [
                    "Payments"
                ],
                "summary": "Search payments",
                "description": "Get filtered and paginated Payments",
                "operationId": "payments.get",
                "parameters": [
                    {
                        "name": "order_by",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "created_at",
                                "updated_at",
                                "status",
                                "payable_id",
                                "user_id",
                                "amount",
                                "order_id",
                                "id"
                            ]
                        }
                    },
                    {
                        "name": "order",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "ASC",
                                "DESC"
                            ]
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Pagination Page Number",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "default": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Pagination Per Page",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "default": 15
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "Payment status",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "new",
                                "paid",
                                "cancelled"
                            ]
                        }
                    },
                    {
                        "name": "order_id",
                        "in": "query",
                        "description": "External order id (e.g. from payment provider)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "payable_id",
                        "in": "query",
                        "description": "Id of payable (e.g. order id)",
                        "required": false,
                        "schema": {
                            "type": "number"
                        }
                    },
                    {
                        "name": "payable_type",
                        "in": "query",
                        "description": "Full classname of payable model (eg. Ulams\\Cart\\Models\\Order)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "date_from",
                        "in": "query",
                        "description": "Date from",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "date_to",
                        "in": "query",
                        "description": "Date to",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/payments/{id}": {
            "get": {
                "tags": [
                    "Payments"
                ],
                "summary": "Display the specified Payment",
                "description": "Get Payment",
                "operationId": "payments.by-id.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of Payment",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/pencil-spaces/login": {
            "post": {
                "tags": [
                    "Pencil Spaces"
                ],
                "summary": "Generate a direct login link",
                "operationId": "pencil-spaces.login.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/LoginPencilSpaceRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Successfull operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "data": {
                                            "properties": {
                                                "url": {
                                                    "type": "string"
                                                }
                                            },
                                            "type": "object"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/roles": {
            "get": {
                "tags": [
                    "Admin Permissions"
                ],
                "summary": "Lists available roles",
                "operationId": "admin.roles.get",
                "responses": {
                    "200": {
                        "description": "list of available roles",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "description": "Roles",
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/components/schemas/Role"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Admin Permissions"
                ],
                "summary": "Find or Create a Role",
                "operationId": "roles.create",
                "requestBody": {
                    "description": "Role attributes. Just name, rest are omitted",
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/Role"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Role created of found successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/RoleResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "422": {
                        "description": "one of the parameters has invalid format"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/roles/{name}": {
            "get": {
                "tags": [
                    "Admin Permissions"
                ],
                "summary": "Read a role and returns list of all permissions ",
                "operationId": "admin.roles.by-name.get",
                "parameters": [
                    {
                        "name": "name",
                        "in": "path",
                        "description": "Unique human-readable template identifier",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "list of available roles",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "description": "Permissions",
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/components/schemas/Permission"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Admin Permissions"
                ],
                "summary": "Delete a Role identified by a name",
                "operationId": "roles.delete",
                "parameters": [
                    {
                        "name": "name",
                        "in": "path",
                        "description": "Unique human-readable role identifier",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "role deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiBooleanResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "400": {
                        "description": "cannot find a role with provided slug identifier"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "patch": {
                "tags": [
                    "Admin Permissions"
                ],
                "summary": "Update an existing Role identified by name by list or new permissions",
                "operationId": "roles.update",
                "parameters": [
                    {
                        "name": "name",
                        "in": "path",
                        "description": "Unique human-readable role identifier",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "description": "Array of named permissions",
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "permissions": {
                                        "description": "Permissions",
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        }
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "role updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/PermissionListResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "400": {
                        "description": "cannot find a role with provided slug identifier"
                    },
                    "422": {
                        "description": "one of the parameters has invalid format"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/policies/{policy}/variants/{variant}/academy": {
            "get": {
                "tags": [
                    "Policies"
                ],
                "summary": "The academy of a department",
                "description": "The request for the department's academy and where it stands: queued, provisioning, transferring, done (with the studio, admin and front addresses of the new academy) or failed (with the reason). `available` says whether this caller may ask for one.",
                "operationId": "admin.policies.by-id.variants.by-variant.academy.get",
                "parameters": [
                    {
                        "name": "policy",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "variant",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "academy (null when none was requested), available, themes",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "404": {
                        "description": "Unknown policy or department"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Policies"
                ],
                "summary": "Create an academy of its own for a department",
                "description": "Queues a new tenant created from a template (the platform records it as created for this department and enforces its limit), styled with the chosen theme preset and accent, and moves the department's builder session there; the author is invited and applies and publishes the course in the academy. Asking again after a failure resumes. The policy, its certificates and its dashboard stay in this tenant.",
                "operationId": "admin.policies.by-id.variants.by-variant.academy.post",
                "parameters": [
                    {
                        "name": "policy",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "variant",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "theme": {
                                        "description": "a theme preset",
                                        "type": "string"
                                    },
                                    "accent": {
                                        "type": "string",
                                        "example": "#C2552D"
                                    },
                                    "template": {
                                        "description": "tenant template slug; default the installation's",
                                        "type": "string"
                                    },
                                    "name": {
                                        "type": "string"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "202": {
                        "description": "queued",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Not a platform administrator, or new sites are off"
                    },
                    "404": {
                        "description": "Unknown policy or department"
                    },
                    "409": {
                        "description": "Being created, already done, or the course is not generated yet"
                    },
                    "422": {
                        "description": "Invalid theme, accent or template"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Policies"
                ],
                "summary": "Remove the academy of a department",
                "description": "Deletes the academy's tenant with everything in it (database, files, settings). The platform keeps the record of who created it.",
                "operationId": "admin.policies.by-id.variants.by-variant.academy.delete",
                "parameters": [
                    {
                        "name": "policy",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "variant",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "removed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "404": {
                        "description": "Unknown policy, department or academy"
                    },
                    "409": {
                        "description": "Being created"
                    },
                    "502": {
                        "description": "The platform could not remove it"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/policies/{policy}/dashboard": {
            "get": {
                "tags": [
                    "Policies"
                ],
                "summary": "Policy owner dashboard",
                "description": "Per department: assigned, completed, pending and overdue; per person: the course version taken, the policy version their certificate certifies and the certificate. Counts assignments of the department courses whatever created them.",
                "operationId": "admin.policies.by-id.dashboard.get",
                "parameters": [
                    {
                        "name": "policy",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "variant",
                        "in": "query",
                        "description": "department (variant id)",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "assigned",
                                "overdue",
                                "completed",
                                "cancelled"
                            ]
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "default": 25
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "departments and one page of people",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "404": {
                        "description": "Unknown policy"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/policies/{policy}/dashboard/export": {
            "get": {
                "tags": [
                    "Policies"
                ],
                "summary": "Export the people of the policy dashboard as CSV",
                "description": "Every matching person as CSV (UTF-8, spreadsheet formulas neutralised). The export is recorded with who exported it, like the compliance exports.",
                "operationId": "admin.policies.by-id.dashboard.export.get",
                "parameters": [
                    {
                        "name": "policy",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "variant",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "assigned",
                                "overdue",
                                "completed",
                                "cancelled"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "text/csv"
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "404": {
                        "description": "Unknown policy"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/policies/my-changes": {
            "get": {
                "tags": [
                    "Policies"
                ],
                "summary": "Why I was given this training again",
                "description": "For each of the caller's assignments that an approved policy change created: the policy, its new version, the source diff in one sentence, whether it is an exam or the course, and the assignment it belongs to. Only the caller's own rows.",
                "operationId": "policies.my-changes.get",
                "responses": {
                    "200": {
                        "description": "one row per policy change assignment, newest first",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/policies": {
            "get": {
                "tags": [
                    "Policies"
                ],
                "summary": "List policies",
                "description": "All policies for `policy_manage`, the caller's own for `policy_owner`.",
                "operationId": "admin.policies.get",
                "responses": {
                    "200": {
                        "description": "policies with current and pending version and department count",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Policies"
                ],
                "summary": "Create a policy from an uploaded document",
                "description": "Stores the policy file as version 1 (a draft) and one variant per department with its audience group. Nothing is generated until `variants/generate` is called. The policy file is treated as untrusted input.",
                "operationId": "admin.policies.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "required": [
                                    "title",
                                    "file",
                                    "departments"
                                ],
                                "properties": {
                                    "title": {
                                        "type": "string"
                                    },
                                    "file": {
                                        "description": "Markdown, PDF or DOCX",
                                        "type": "string",
                                        "format": "binary"
                                    },
                                    "owner_user_id": {
                                        "description": "only with policy_manage; default the caller",
                                        "type": "integer"
                                    },
                                    "minor_due_days": {
                                        "type": "integer",
                                        "default": 14
                                    },
                                    "major_due_days": {
                                        "type": "integer",
                                        "default": 30
                                    },
                                    "brief": {
                                        "description": "totalMinutes, lessonMinutes, language, tone",
                                        "type": "object"
                                    },
                                    "departments": {
                                        "description": "1 to 12 departments",
                                        "type": "array",
                                        "items": {
                                            "required": [
                                                "label"
                                            ],
                                            "properties": {
                                                "label": {
                                                    "type": "string"
                                                },
                                                "group_id": {
                                                    "description": "existing audience group; a new one is created when omitted",
                                                    "type": "integer",
                                                    "nullable": true
                                                },
                                                "seniority": {
                                                    "type": "string",
                                                    "enum": [
                                                        "junior",
                                                        "mid",
                                                        "senior",
                                                        "mixed"
                                                    ]
                                                },
                                                "priorExperience": {
                                                    "type": "string",
                                                    "enum": [
                                                        "none",
                                                        "some",
                                                        "expert"
                                                    ]
                                                },
                                                "totalMinutes": {
                                                    "type": "integer",
                                                    "nullable": true
                                                }
                                            },
                                            "type": "object"
                                        }
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "the policy with its versions and variants",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "422": {
                        "description": "Validation error or rejected file"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/policies/{policy}": {
            "get": {
                "tags": [
                    "Policies"
                ],
                "summary": "Show a policy",
                "operationId": "admin.policies.by-id.get",
                "parameters": [
                    {
                        "name": "policy",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "the policy with versions, variants and the generation cost estimate",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "404": {
                        "description": "Unknown policy"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/policies/{policy}/versions": {
            "get": {
                "tags": [
                    "Policies"
                ],
                "summary": "List the versions of a policy",
                "operationId": "admin.policies.by-id.versions.get",
                "parameters": [
                    {
                        "name": "policy",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "versions, oldest first",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "404": {
                        "description": "Unknown policy"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Policies"
                ],
                "summary": "Upload a new version of a policy",
                "description": "The file becomes the next version, in review, and a new revision of each department's source: Living Course detects what changed and proposes the update of each department's course (one proposal per department, reviewed item by item through the living-course endpoints). The first version must be approved, and no other version may wait for a decision. A file with the same text as the current version is refused.",
                "operationId": "admin.policies.by-id.versions.post",
                "parameters": [
                    {
                        "name": "policy",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "required": [
                                    "file"
                                ],
                                "properties": {
                                    "file": {
                                        "description": "Markdown, PDF or DOCX",
                                        "type": "string",
                                        "format": "binary"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "the version with its departments' rollouts",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "404": {
                        "description": "Unknown policy"
                    },
                    "409": {
                        "description": "Not ready for a change, or the same text"
                    },
                    "422": {
                        "description": "Rejected file"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/policies/{policy}/variants": {
            "get": {
                "tags": [
                    "Policies"
                ],
                "summary": "List the department variants of a policy",
                "description": "Each variant carries its stage, read from the Course Builder session: waiting, ingesting, interview, outlining, outline_review, generating, apply_review, applying, applied or failed.",
                "operationId": "admin.policies.by-id.variants.get",
                "parameters": [
                    {
                        "name": "policy",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "variants with department, group, session, course and stage",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "404": {
                        "description": "Unknown policy"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/policies/{policy}/variants/generate": {
            "post": {
                "tags": [
                    "Policies"
                ],
                "summary": "Generate the department courses of a policy",
                "description": "Starts one Course Builder session per department from the policy file, one after the other, up to the outline review. The owner then reviews, approves and applies each course in the Studio as for any generated course; every lesson and question cites the policy text. Uses AI; the call is refused when AI is switched off.",
                "operationId": "admin.policies.by-id.variants.generate.post",
                "parameters": [
                    {
                        "name": "policy",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "variant_ids": {
                                        "description": "only these departments (default: all that wait)",
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        }
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "202": {
                        "description": "the variants requested now",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "404": {
                        "description": "Unknown policy"
                    },
                    "422": {
                        "description": "Nothing to generate"
                    },
                    "503": {
                        "description": "AI is disabled"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/policies/{policy}/versions/{number}": {
            "get": {
                "tags": [
                    "Policies"
                ],
                "summary": "Review a policy version",
                "description": "The source diff, each department's proposal and where it stands, the suggested change class with its reasons, what still blocks approval, and the pre-flight: how many certificates approving will revoke and how many people it will reassign, per department (`?class=minor|major` previews the other class).",
                "operationId": "admin.policies.by-id.versions.by-number.get",
                "parameters": [
                    {
                        "name": "policy",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "number",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "class",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "minor",
                                "major"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "the version with review details",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "404": {
                        "description": "Unknown policy or version"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/policies/{policy}/versions/{number}/approve": {
            "post": {
                "tags": [
                    "Policies"
                ],
                "summary": "Approve a policy version",
                "description": "First version: works once every department course is applied and published in the Studio; the courses become mandatory for the department's group, the group is enrolled through a rule on a one-course path, and the version becomes the one learners are trained on. A change: every department course is updated from its proposal and, when all are, certificates linked to the previous version are revoked and those people are given the exam (minor) or the course (major) with the policy's due days. The change class is suggested from the proposals; the owner may raise it, and may lower it only with a `reason`. A decision of the owner (or of an admin acting for an absent owner, which the audit records); nothing approves itself, and no AI decides who completes anything.",
                "operationId": "admin.policies.by-id.versions.by-number.approve.post",
                "parameters": [
                    {
                        "name": "policy",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "number",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "change_class": {
                                        "type": "string",
                                        "enum": [
                                            "minor",
                                            "major"
                                        ]
                                    },
                                    "reason": {
                                        "description": "required to approve a change as a lower class than suggested",
                                        "type": "string"
                                    },
                                    "overwrite": {
                                        "description": "replace edits made in the admin after the last apply",
                                        "type": "boolean"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "the version (status applying until every department is updated, then approved)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "404": {
                        "description": "Unknown policy or version"
                    },
                    "409": {
                        "description": "Not waiting for approval, or the update conflicts with edits"
                    },
                    "422": {
                        "description": "Something blocks approval, or a lower class without a reason"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/policies/{policy}/versions/{number}/reject": {
            "post": {
                "tags": [
                    "Policies"
                ],
                "summary": "Reject a policy version in review",
                "description": "The change is not adopted: its open proposals are rejected, the current version stays in force and nobody is retrained. A corrected file is uploaded as a new version.",
                "operationId": "admin.policies.by-id.versions.by-number.reject.post",
                "parameters": [
                    {
                        "name": "policy",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "number",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "reason"
                                ],
                                "properties": {
                                    "reason": {
                                        "type": "string"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "the rejected version",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "404": {
                        "description": "Unknown policy or version"
                    },
                    "409": {
                        "description": "Only a change in review can be rejected"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/question": {
            "get": {
                "tags": [
                    "Question"
                ],
                "summary": "Lists available questions",
                "operationId": "admin.question.get",
                "responses": {
                    "200": {
                        "description": "list of available questions",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "description": "map of questions",
                                    "type": "object",
                                    "additionalProperties": {
                                        "$ref": "#/components/schemas/Question"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Question"
                ],
                "summary": "Create a new question identified by id",
                "operationId": "admin.question.post",
                "parameters": [
                    {
                        "name": "title",
                        "in": "path",
                        "description": "Question title",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "questionnaire_id",
                        "in": "path",
                        "description": "Questionnaire's id",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "order_by",
                        "in": "path",
                        "description": "Order by field",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "order",
                        "in": "path",
                        "description": "Order direction",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "description": "Question attributes",
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/Question"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Question created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/Question"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "422": {
                        "description": "one of the parameters has invalid format"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/question/{id}": {
            "get": {
                "tags": [
                    "Question"
                ],
                "summary": "Read a question identified by a given id identifier",
                "operationId": "admin.question.by-id.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Unique human-readable question identifier",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Question"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Question"
                ],
                "summary": "Delete a question identified by a id",
                "operationId": "admin.question.by-id.delete",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Unique human-readable question identifier",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Question deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "400": {
                        "description": "cannot find a question"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "patch": {
                "tags": [
                    "Question"
                ],
                "summary": "Update an existing question identified by id",
                "operationId": "admin.question.by-id.patch",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Unique human-readable question identifier",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "description": "Question attributes",
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/Question"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Question updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/Question"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "400": {
                        "description": "cannot find a question with provided slug identifier"
                    },
                    "422": {
                        "description": "one of the parameters has invalid format"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/question-answers/{id}": {
            "get": {
                "tags": [
                    "QuestionAnswersForQuestionaire"
                ],
                "summary": "Lists questions answers for questionaire",
                "operationId": "admin.question-answers.by-id.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of questionnaire",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "questionnaire_model_id",
                        "in": "query",
                        "description": "id of questionnaire model",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "question_id",
                        "in": "query",
                        "description": "id of question",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "order",
                        "in": "query",
                        "description": "Order direction",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "order_by",
                        "in": "query",
                        "description": "Order by field",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "filter by answer user_id",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "updated_at_from",
                        "in": "query",
                        "description": "From date filter",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "updated_at_to",
                        "in": "query",
                        "description": "To date filter",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Lists questions answers for questionaire",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "description": "map of questions",
                                    "type": "object",
                                    "additionalProperties": {
                                        "$ref": "#/components/schemas/QuestionAnswer"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/question-answers/{id}/change-visibility": {
            "post": {
                "tags": [
                    "QuestionAnswersForQuestionaire"
                ],
                "summary": "Change answer visibility on front",
                "operationId": "admin.question-answers.by-id.change-visibility.post",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of question answer",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "description": "Question answer change visibility",
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/QuestionnaireAnswerChangeVisibility"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Question answers visibility changed successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/QuestionAnswer"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/questionnaire": {
            "get": {
                "tags": [
                    "Questionnaire"
                ],
                "summary": "Lists available questionnaires",
                "operationId": "admin.questionnaire.get",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "order_by",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "id",
                                "created_at",
                                "title"
                            ]
                        }
                    },
                    {
                        "name": "order",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "ASC",
                                "DESC"
                            ]
                        }
                    },
                    {
                        "name": "title",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "list of available questionnaires",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "description": "map of questionnaires",
                                    "type": "object",
                                    "additionalProperties": {
                                        "$ref": "#/components/schemas/Questionnaire"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Questionnaire"
                ],
                "summary": "Create a new questionnaire",
                "operationId": "admin.questionnaire.post",
                "requestBody": {
                    "description": "Questionnaire attributes",
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/Questionnaire"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Questionnaire created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/Questionnaire"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "409": {
                        "description": "there already is a questionnaire"
                    },
                    "422": {
                        "description": "one of the parameters has invalid format"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/questionnaire/{id}": {
            "get": {
                "tags": [
                    "Questionnaire"
                ],
                "summary": "Read a questionnaire identified by a given id identifier",
                "operationId": "admin.questionnaire.by-id.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Unique human-readable questionnaire identifier",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Questionnaire"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Questionnaire"
                ],
                "summary": "Delete a questionnaire identified by a id",
                "operationId": "admin.questionnaire.by-id.delete",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Unique human-readable questionnaire identifier",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Questionnaire deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "400": {
                        "description": "cannot find a questionnaire"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "patch": {
                "tags": [
                    "Questionnaire"
                ],
                "summary": "Update an existing questionnaire identified by id",
                "operationId": "admin.questionnaire.by-id.patch",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Unique human-readable questionnaire identifier",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "description": "Questionnaire attributes",
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/Questionnaire"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Questionnaire updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/Questionnaire"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "400": {
                        "description": "cannot find a questionnaire"
                    },
                    "422": {
                        "description": "one of the parameters has invalid format"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/questionnaire-model": {
            "get": {
                "tags": [
                    "QuestionnaireModelType"
                ],
                "summary": "Lists available questionnaire model type",
                "operationId": "admin.questionnaire-model.get",
                "responses": {
                    "200": {
                        "description": "list of available questionnaire model type",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "description": "map of questionnaire model type",
                                    "type": "object",
                                    "additionalProperties": {
                                        "$ref": "#/components/schemas/QuestionnaireModelType"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/questionnaire/report/{id}/{model_type_id}/{model_id}": {
            "get": {
                "tags": [
                    "QuestionnaireReportForModel"
                ],
                "summary": "Read a questionnaire report identified by a given id identifier and model type and model identified",
                "operationId": "admin.questionnaire.report.by-id.by-model-type-id.by-model-id.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "questionnaire identifier",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "model_type_id",
                        "in": "path",
                        "description": "questionnaire model type identified",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "model_id",
                        "in": "path",
                        "description": "model identifier",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/QuestionnaireReportResource"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/questionnaire/assign/{model_type_title}/{model_id}/{id}/{target_group}": {
            "patch": {
                "tags": [
                    "Questionnaire"
                ],
                "summary": "assign a questionnaire model",
                "operationId": "admin.questionnaire.assign.by-model-type-title.by-model-id.by-id.by-target-group.patch",
                "parameters": [
                    {
                        "name": "model_type_title",
                        "in": "path",
                        "description": "Name of Model (Course, Webinar etd.)",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "model_id",
                        "in": "path",
                        "description": "id of Model (Course, Webinar etd.)",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of questionnaire",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "target_group",
                        "in": "path",
                        "description": "Target Group: user or author",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "display_frequency_minutes": {
                                        "description": "Display frequency in minutes",
                                        "type": "integer"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Questionnaire model assign successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "400": {
                        "description": "cannot find a questionnaire"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/questionnaire/unassign/{model_type_title}/{model_id}/{id}/{target_group}": {
            "delete": {
                "tags": [
                    "Questionnaire"
                ],
                "summary": "unassign a questionnaire model",
                "operationId": "admin.questionnaire.unassign.by-model-type-title.by-model-id.by-id.by-target-group.delete",
                "parameters": [
                    {
                        "name": "model_type_title",
                        "in": "path",
                        "description": "Name of Model (Course, Webinar etd.)",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "model_id",
                        "in": "path",
                        "description": "id of Model (Course, Webinar etd.)",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of questionnaire",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "target_group",
                        "in": "path",
                        "description": "Target Group: user or author",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Questionnaire model unassign successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "400": {
                        "description": "cannot find a questionnaire"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/questionnaire/{model_type_title}/{model_id}": {
            "get": {
                "tags": [
                    "Questionnaire"
                ],
                "summary": "Lists available questionnaires",
                "operationId": "questionnaire.by-model-type-title.by-model-id.get",
                "parameters": [
                    {
                        "name": "model_type_title",
                        "in": "path",
                        "description": "Name of Model (Course, Webinar etd.)",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "model_id",
                        "in": "path",
                        "description": "id of Model (Course, Webinar etd.)",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "list of available questionnaires",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "description": "map of questionnaires",
                                    "type": "object",
                                    "additionalProperties": {
                                        "$ref": "#/components/schemas/Questionnaire"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/questionnaire/{model_type_title}/{model_id}/{id}": {
            "get": {
                "tags": [
                    "Questionnaire"
                ],
                "summary": "Read a questionnaire identified by a given id identifier and model",
                "operationId": "questionnaire.by-model-type-title.by-model-id.by-id.get",
                "parameters": [
                    {
                        "name": "model_type_title",
                        "in": "path",
                        "description": "Name of Model (Course, Webinar etd.)",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "model_id",
                        "in": "path",
                        "description": "id of Model (Course, Webinar etd.)",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of Questionnaire",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Questionnaire"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Questionnaire"
                ],
                "summary": "Save a questionnaire answers",
                "operationId": "questionnaire.by-model-type-title.by-model-id.by-id.post",
                "parameters": [
                    {
                        "name": "model_type_title",
                        "in": "path",
                        "description": "Name of Model (Course, Webinar etd.)",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "model_id",
                        "in": "path",
                        "description": "id of Model (Course, Webinar etd.)",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of questionnaire",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "description": "Answer attributes",
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/QuestionnaireAnswerRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Questionnaire"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/questionnaire/stars/{model_type_title}/{model_id}": {
            "get": {
                "tags": [
                    "QuestionnaireStars"
                ],
                "summary": "Read a questionnaire stars identified by a given model title and model id identifier",
                "operationId": "questionnaire.stars.by-model-type-title.by-model-id.get",
                "parameters": [
                    {
                        "name": "model_type_title",
                        "in": "path",
                        "description": "Name of Model (Course, Webinar etd.)",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "model_id",
                        "in": "path",
                        "description": "id of Model (Course, Webinar etd.)",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/QuestionnaireStarsResource"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                }
            }
        },
        "/api/questionnaire/{model_type_title}/{model_id}/questions/{question_id}/answers": {
            "get": {
                "tags": [
                    "Questionnaire"
                ],
                "summary": "Read a question answers by a given model title and model id identifier",
                "operationId": "questionnaire.by-model-type-title.by-model-id.questions.by-question-id.answers.get",
                "parameters": [
                    {
                        "name": "model_type_title",
                        "in": "path",
                        "description": "Name of Model (Course, Webinar etd.)",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "model_id",
                        "in": "path",
                        "description": "id of Model (Course, Webinar etd.)",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "question_id",
                        "in": "path",
                        "description": "id of Question",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "order_by",
                        "in": "query",
                        "description": "order by (created_at, updated_at, rate)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "order",
                        "in": "query",
                        "description": "order direction (ASC, DESC)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "answers on page",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "page number",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/QuestionAnswer"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                }
            }
        },
        "/api/questionnaire/{model_type_title}/{model_id}/questions/{question_id}/stars": {
            "get": {
                "tags": [
                    "Questionnaire"
                ],
                "summary": "Read a model stars by a given model title, model id identifier and question id.",
                "operationId": "questionnaire.by-model-type-title.by-model-id.questions.by-question-id.stars.get",
                "parameters": [
                    {
                        "name": "model_type_title",
                        "in": "path",
                        "description": "Name of Model (Course, Webinar etd.)",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "model_id",
                        "in": "path",
                        "description": "id of Model (Course, Webinar etd.)",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "question_id",
                        "in": "path",
                        "description": "id of Question",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ModelStarsResponse"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                }
            }
        },
        "/api/admin/reporting/datasets": {
            "get": {
                "tags": [
                    "Reporting"
                ],
                "summary": "Datasets a report can be built on",
                "description": "The datasets the caller may run reports on (assignments, certificates, audit, authoring, ai_usage; each only when its package is installed and the caller holds the dataset's permission), with every column: type, label, the filter operators it accepts, whether it can be grouped or aggregated and whether it holds personal data. Needs the permission reporting_read.",
                "operationId": "admin.reporting.datasets.list",
                "responses": {
                    "200": {
                        "description": "The datasets with their columns",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/reporting/odata": {
            "get": {
                "tags": [
                    "Reporting"
                ],
                "summary": "OData service document",
                "description": "OData v4 service document: one entity set Report_{id} per saved report whose feed is on and that the token's user may see (a token limited to one report lists only that one). Auth: a reports:read access token as Bearer, or as the password of HTTP Basic (the user name is ignored), which is how Excel and Power BI send it.",
                "operationId": "reporting.odata.service.get",
                "responses": {
                    "200": {
                        "description": "The entity sets",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "@odata.context": {
                                            "type": "string"
                                        },
                                        "value": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "name": {
                                                        "type": "string"
                                                    },
                                                    "kind": {
                                                        "type": "string"
                                                    },
                                                    "url": {
                                                        "type": "string"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "No or invalid token (with a Basic challenge)"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/reporting/odata/$metadata": {
            "get": {
                "tags": [
                    "Reporting"
                ],
                "summary": "OData metadata document",
                "description": "The CSDL (XML) of the feed: one entity type per report with a RowNumber key and a property per output column, typed. Capabilities annotations say that only $select, $top, $skip and $count are supported.",
                "operationId": "reporting.odata.metadata.get",
                "responses": {
                    "200": {
                        "description": "CSDL XML",
                        "content": {
                            "application/xml": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "No or invalid token"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/reporting/odata/{entity}": {
            "get": {
                "tags": [
                    "Reporting"
                ],
                "summary": "Rows of a saved report as an OData entity set",
                "description": "The rows of the saved report named Report_{id}, 5 000 per page with @odata.nextLink. Supports $select, $top, $skip, $count=true and $format=json. $filter, $orderby, $apply, $expand and the other options answer 501: the saved report is the filter, the grouping and the order. Groups of fewer learners than the threshold are withheld (a row with Withheld true), as in every other output. Each request is recorded as an export of channel feed.",
                "operationId": "reporting.odata.entity-set.get",
                "parameters": [
                    {
                        "name": "entity",
                        "in": "path",
                        "description": "Report_ followed by the id of the saved report",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "$select",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "$top",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "$skip",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "$count",
                        "in": "query",
                        "schema": {
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OData JSON: @odata.context, value, optional @odata.count and @odata.nextLink",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "@odata.context": {
                                            "type": "string"
                                        },
                                        "@odata.count": {
                                            "type": "integer"
                                        },
                                        "@odata.nextLink": {
                                            "type": "string"
                                        },
                                        "value": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "No or invalid token"
                    },
                    "403": {
                        "description": "The token's user may not run this report, or the token is limited to another report"
                    },
                    "404": {
                        "description": "No such feed"
                    },
                    "409": {
                        "description": "The report needs repair"
                    },
                    "501": {
                        "description": "An unsupported query option"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/reporting/query": {
            "post": {
                "tags": [
                    "Reporting"
                ],
                "summary": "Preview a report definition",
                "description": "Runs a report definition against one dataset with the caller's own permissions and returns at most 500 rows and the total. A row-level report lists `columns`; a grouped report lists `groupBy` and `aggregates` and returns the groups followed by their aggregates. On a dataset that holds learners, every group with fewer distinct learners than the threshold (10 by default) is withheld: it is replaced, together with the smallest remaining group when needed so that it cannot be derived by subtraction, by one row marked `_withheld`. Needs reporting_read and the permission of the dataset (see the datasets endpoint). 422 lists what is wrong with the definition, by path.",
                "operationId": "admin.reporting.query.run",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "dataset"
                                ],
                                "properties": {
                                    "dataset": {
                                        "description": "Key of a dataset, for example assignments",
                                        "type": "string",
                                        "example": "assignments"
                                    },
                                    "columns": {
                                        "description": "Row-level report: the columns to list",
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        }
                                    },
                                    "filters": {
                                        "description": "All filters apply (AND). op is eq, neq, in, not_in, lt, lte, gt, gte, between, contains or is_null; value is a scalar, a list (in, not_in), two values (between) or a boolean (is_null)",
                                        "type": "array",
                                        "items": {
                                            "required": [
                                                "column",
                                                "op"
                                            ],
                                            "properties": {
                                                "column": {
                                                    "type": "string"
                                                },
                                                "op": {
                                                    "type": "string"
                                                },
                                                "value": {}
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "dateRange": {
                                        "description": "Restrict a date column to a preset (last_7_days, last_30_days, last_90_days, last_12_months, this_month, last_month, this_quarter, this_year, last_year) or to from and to dates (YYYY-MM-DD, inclusive)",
                                        "required": [
                                            "column"
                                        ],
                                        "properties": {
                                            "column": {
                                                "type": "string"
                                            },
                                            "preset": {
                                                "type": "string"
                                            },
                                            "from": {
                                                "type": "string",
                                                "format": "date"
                                            },
                                            "to": {
                                                "type": "string",
                                                "format": "date"
                                            }
                                        },
                                        "type": "object"
                                    },
                                    "groupBy": {
                                        "description": "A column name, or {column, bucket} with bucket day, week, month, quarter or year on a date column (the output column is named column_bucket)",
                                        "type": "array",
                                        "items": {
                                            "oneOf": [
                                                {
                                                    "type": "string"
                                                },
                                                {
                                                    "type": "object"
                                                }
                                            ]
                                        }
                                    },
                                    "aggregates": {
                                        "type": "array",
                                        "items": {
                                            "required": [
                                                "fn",
                                                "as"
                                            ],
                                            "properties": {
                                                "fn": {
                                                    "type": "string",
                                                    "enum": [
                                                        "count",
                                                        "count_distinct",
                                                        "sum",
                                                        "avg",
                                                        "min",
                                                        "max"
                                                    ]
                                                },
                                                "column": {
                                                    "type": "string"
                                                },
                                                "as": {
                                                    "description": "Name of the output column, lower case letters, digits and underscores",
                                                    "type": "string"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "sort": {
                                        "description": "Output columns, first one first",
                                        "type": "array",
                                        "items": {
                                            "required": [
                                                "column"
                                            ],
                                            "properties": {
                                                "column": {
                                                    "type": "string"
                                                },
                                                "dir": {
                                                    "type": "string",
                                                    "enum": [
                                                        "asc",
                                                        "desc"
                                                    ]
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "limit": {
                                        "description": "Most rows the report returns",
                                        "type": "integer"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "columns (name, type, label), rows and meta: mode, total_rows, preview_rows, truncated, withheld_groups, min_group_size",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "No reporting_read, or no permission for the dataset"
                    },
                    "422": {
                        "description": "The definition is invalid"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/reporting/saved": {
            "get": {
                "tags": [
                    "Reporting"
                ],
                "summary": "Saved reports the caller can see",
                "description": "The caller's own reports and the reports shared with one of their roles (administrators with reporting_manage see all). Each has can_edit, runnable (the caller holds the permission of its dataset) and needs_repair with the problems when its dataset or a column it uses no longer exists. Needs reporting_read.",
                "operationId": "admin.reporting.reports.list",
                "responses": {
                    "200": {
                        "description": "Saved reports",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Reporting"
                ],
                "summary": "Save a report",
                "description": "Saves a report definition (see the query endpoint) under a name. visibility is private (the default) or roles with shared_roles naming tenant roles. The caller must hold reporting_create and the permission of the definition's dataset.",
                "operationId": "admin.reporting.reports.create",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "name",
                                    "definition"
                                ],
                                "properties": {
                                    "name": {
                                        "type": "string"
                                    },
                                    "description": {
                                        "type": "string"
                                    },
                                    "visibility": {
                                        "type": "string",
                                        "enum": [
                                            "private",
                                            "roles"
                                        ]
                                    },
                                    "shared_roles": {
                                        "description": "Role names of this tenant, for example tutor",
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        }
                                    },
                                    "definition": {
                                        "description": "A report definition, as for POST /api/admin/reporting/query",
                                        "type": "object"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "The saved report",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "422": {
                        "description": "Invalid definition or sharing"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/reporting/saved/{id}": {
            "get": {
                "tags": [
                    "Reporting"
                ],
                "summary": "One saved report",
                "operationId": "admin.reporting.reports.by-id.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The saved report with its definition",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not found, or not visible to the caller"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Reporting"
                ],
                "summary": "Change a saved report",
                "description": "Only the owner (who holds reporting_create) or an administrator with reporting_manage. Any of name, description, visibility, shared_roles, definition and feed_enabled (the OData feed for BI tools; reporting_manage only).",
                "operationId": "admin.reporting.reports.by-id.put",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "name": {
                                        "type": "string"
                                    },
                                    "description": {
                                        "type": "string"
                                    },
                                    "visibility": {
                                        "type": "string",
                                        "enum": [
                                            "private",
                                            "roles"
                                        ]
                                    },
                                    "shared_roles": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        }
                                    },
                                    "definition": {
                                        "type": "object"
                                    },
                                    "feed_enabled": {
                                        "description": "Offer the report as a read-only OData feed (needs reporting_manage)",
                                        "type": "boolean"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "The saved report",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Not the owner"
                    },
                    "404": {
                        "description": "Not found"
                    },
                    "422": {
                        "description": "Invalid definition or sharing"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Reporting"
                ],
                "summary": "Delete a saved report",
                "operationId": "admin.reporting.reports.by-id.delete",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Deleted",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Not the owner"
                    },
                    "404": {
                        "description": "Not found"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/reporting/saved/{id}/run": {
            "get": {
                "tags": [
                    "Reporting"
                ],
                "summary": "Run a saved report",
                "description": "Runs the report with the caller's own permissions and scope. format=json (default) answers like the query endpoint (500 rows and the total); csv, jsonl and xlsx stream every row up to 1 000 000 (an XLSX sheet holds 1 048 575) and are recorded as exports. Groups of fewer learners than the threshold are withheld in every format. 403 when the caller lacks the permission of the dataset, 409 when the report needs repair.",
                "operationId": "admin.reporting.reports.by-id.run",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "format",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "default": "json",
                            "enum": [
                                "json",
                                "csv",
                                "jsonl",
                                "xlsx"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "json: columns, rows and meta; csv, jsonl and xlsx: a file",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "404": {
                        "description": "Not found"
                    },
                    "409": {
                        "description": "The report needs repair"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/reports/metrics": {
            "get": {
                "tags": [
                    "Admin Reports"
                ],
                "summary": "Get list of available metrics",
                "description": "",
                "operationId": "admin.reports.metrics.get",
                "responses": {
                    "200": {
                        "description": "successful operation, returns User data",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/reports/report": {
            "get": {
                "tags": [
                    "Admin Reports"
                ],
                "summary": "Get list of available metrics",
                "description": "",
                "operationId": "admin.reports.report.get",
                "parameters": [
                    {
                        "name": "metric",
                        "in": "query",
                        "description": "one of available metrics",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "date",
                        "in": "query",
                        "description": "date from which report should be loaded (if there exists historical data), limit will be ignored and only datapoints with which record was created will be loaded; don't send this param to always get fresh report; send today date if you want to get latest stored report",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "how many datapoints should be returned. To get all datapoints set limit as -1",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation, returns User data",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/reports/available-for-user": {
            "get": {
                "tags": [
                    "Admin Reports"
                ],
                "summary": "Get list of available metrics for logged user",
                "description": "",
                "operationId": "admin.reports.available-for-user.get",
                "responses": {
                    "200": {
                        "description": "successful operation, returns User data",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/stats/available": {
            "get": {
                "tags": [
                    "Admin Reports"
                ],
                "summary": "Get list of available stats for models",
                "description": "",
                "operationId": "admin.stats.available.get",
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/stats/course/{course_id}": {
            "get": {
                "tags": [
                    "Admin Reports"
                ],
                "summary": "Calculate stats for Course",
                "description": "",
                "operationId": "admin.stats.course.by-course-id.get",
                "parameters": [
                    {
                        "name": "course_id",
                        "in": "path",
                        "description": "Course ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "stats",
                        "in": "query",
                        "description": "array of stats to be calculated, leave empty to calculate all available stats",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/stats/topic/{topic_id}": {
            "get": {
                "tags": [
                    "Admin Reports"
                ],
                "summary": "Calculate stats for Topic",
                "description": "",
                "operationId": "admin.stats.topic.by-topic-id.get",
                "parameters": [
                    {
                        "name": "topic_id",
                        "in": "path",
                        "description": "Topic ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "stats[]",
                        "in": "query",
                        "description": "array of stats to be calculated, leave empty to calculate all available stats",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/stats/cart": {
            "get": {
                "tags": [
                    "Admin Reports"
                ],
                "summary": "Calculate stats for Cart",
                "description": "",
                "operationId": "admin.stats.cart.get",
                "parameters": [
                    {
                        "name": "stats",
                        "in": "query",
                        "description": "array of stats to be calculated, leave empty to calculate all available stats",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/stats/date-range": {
            "get": {
                "tags": [
                    "Admin Reports"
                ],
                "summary": "Calculate stats for Course",
                "description": "",
                "operationId": "admin.stats.date-range.get",
                "parameters": [
                    {
                        "name": "date_from",
                        "in": "path",
                        "description": "Date from",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "date_to",
                        "in": "path",
                        "description": "Date to",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "stats",
                        "in": "query",
                        "description": "array of stats to be calculated, leave empty to calculate all available stats",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/stats/course/{course_id}/export": {
            "get": {
                "tags": [
                    "Admin Reports"
                ],
                "summary": "Export stat for Course",
                "description": "",
                "operationId": "admin.stats.course.by-course-id.export.get",
                "parameters": [
                    {
                        "name": "course_id",
                        "in": "path",
                        "description": "Course ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "stat",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {}
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/stats/topic/{topic_id}/export": {
            "get": {
                "tags": [
                    "Admin Reports"
                ],
                "summary": "Export stat for Topic",
                "description": "",
                "operationId": "admin.stats.topic.by-topic-id.export.get",
                "parameters": [
                    {
                        "name": "topic_id",
                        "in": "path",
                        "description": "Topic ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "stat",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {}
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/scorm/launch/{uuid}": {
            "post": {
                "tags": [
                    "SCORM"
                ],
                "summary": "Start a SCO on the tenant content origin",
                "description": "Issues a SCO-scoped tracking token and returns the player URL on the content origin. `url` is null when no content origin is configured; use /api/scorm/play/{uuid} then.",
                "operationId": "scorm.launch.by-uuid.post",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "description": "SCO uuid",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Player URL (or null) and token expiry",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "404": {
                        "description": "unknown SCO"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/scorm/content/{uuid}": {
            "get": {
                "tags": [
                    "SCORM"
                ],
                "summary": "Launch data for the content-origin player",
                "description": "Authenticated with the tracking token from /api/scorm/launch/{uuid} in the X-Ulams-Tracking-Token header, not with a user token.",
                "operationId": "scorm.content.by-uuid.get",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "description": "SCO uuid",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "SCORM version, entry URL relative to the content origin, learner CMI",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "invalid, expired or foreign tracking token"
                    }
                }
            }
        },
        "/api/scorm/content/{uuid}/track": {
            "post": {
                "tags": [
                    "SCORM"
                ],
                "summary": "Store CMI data sent by the content-origin player",
                "description": "Authenticated with the tracking token in the X-Ulams-Tracking-Token header.",
                "operationId": "scorm.content.by-uuid.track.post",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "description": "SCO uuid",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "cmi": {
                                        "type": "object"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "stored",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "invalid, expired or foreign tracking token"
                    }
                }
            }
        },
        "/api/scorm/assets/scorm-again.min.js": {
            "get": {
                "tags": [
                    "SCORM"
                ],
                "summary": "Vendored scorm-again runtime (MIT) for the legacy player",
                "operationId": "scorm.assets.scorm-again-min-js.get",
                "responses": {
                    "200": {
                        "description": "JavaScript"
                    }
                }
            }
        },
        "/api/admin/scorm/upload": {
            "post": {
                "tags": [
                    "SCORM"
                ],
                "summary": "Convert ZIP Scorm Package into Ulams LMS Scorm storage",
                "operationId": "scorm.upload",
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "properties": {
                                    "zip": {
                                        "type": "string",
                                        "format": "binary"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "scorm data",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScormUploadResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/scorm/parse": {
            "post": {
                "tags": [
                    "SCORM"
                ],
                "summary": "Parse ZIP Scorm to see if it's valid",
                "operationId": "scorm.parse",
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "properties": {
                                    "zip": {
                                        "type": "string",
                                        "format": "binary"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "scorm data",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScormParseResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/scorm/play/{uuid}": {
            "get": {
                "tags": [
                    "SCORM"
                ],
                "summary": "Read a page identified by a given slug identifier",
                "operationId": "scorm.play.by-uuid.get",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "description": "Unique uuid scorm identifier",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": ""
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/scorm/show/{uuid}": {
            "get": {
                "tags": [
                    "SCORM"
                ],
                "summary": "Read a page identified by a given slug identifier",
                "operationId": "scorm.show.by-uuid.get",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "description": "Unique uuid scorm identifier",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": ""
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/scorm/": {
            "get": {
                "tags": [
                    "SCORM"
                ],
                "summary": "Read a page identified by a given slug identifier",
                "operationId": "scorm.list",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "description": "page",
                        "schema": {
                            "type": "number"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "per_page",
                        "schema": {
                            "type": "number"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScormPackagePageResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/scorm/scos": {
            "get": {
                "tags": [
                    "SCORM"
                ],
                "summary": "Get all scos",
                "operationId": "scorm.scos",
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScormScoListResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/scorm/{scorm_id}": {
            "delete": {
                "tags": [
                    "SCORM"
                ],
                "summary": "Delete scorm package by id",
                "operationId": "scorm.delete",
                "parameters": [
                    {
                        "name": "scorm_id",
                        "in": "path",
                        "description": "Scorm package id",
                        "required": true,
                        "schema": {
                            "type": "number"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/scorm/track/{uuid}": {
            "post": {
                "tags": [
                    "SCORM"
                ],
                "summary": "Track Scorm user progress",
                "operationId": "scorm.track.by-uuid.post",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "description": "Unique uuid scorm identifier",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "scorm data",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/scorm/track/{scoId}/{key}": {
            "get": {
                "tags": [
                    "SCORM"
                ],
                "summary": "Get user progress by scorm sco id and scorm data key",
                "operationId": "scorm.track.by-scoid.by-key.get",
                "parameters": [
                    {
                        "name": "scoId",
                        "in": "path",
                        "description": "Unique scorm identifier",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "key",
                        "in": "path",
                        "description": "Unique scorm data key",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiJson"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/config": {
            "get": {
                "tags": [
                    "Admin Settings"
                ],
                "summary": "Get admin config",
                "description": "Get a listing of registered config keys",
                "operationId": "admin.config.get",
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "tags": [
                    "Admin Settings"
                ],
                "summary": "Set config for registered config keys",
                "operationId": "admin.config.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "config": {
                                        "type": "array",
                                        "items": {
                                            "type": "object"
                                        }
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/settings": {
            "get": {
                "tags": [
                    "Admin Settings"
                ],
                "description": "Get Settings paginated",
                "operationId": "admin.settings.get",
                "parameters": [
                    {
                        "name": "group",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Pagination Page Number",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "default": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Pagination Per Page",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "default": 15
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Admin Settings"
                ],
                "summary": "Settings create",
                "description": "Create single setting",
                "operationId": "admin.settings.post",
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/settings/{id}": {
            "get": {
                "tags": [
                    "Admin Settings"
                ],
                "description": "Get single settings",
                "operationId": "admin.settings.by-id.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Admin Settings"
                ],
                "summary": "Update setting",
                "description": "Update single setting",
                "operationId": "admin.settings.by-id.put",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Admin Settings"
                ],
                "summary": "Destroy setting",
                "description": "Destroy the specified setting",
                "operationId": "admin.settings.by-id.delete",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/settings/groups": {
            "get": {
                "tags": [
                    "Admin Settings"
                ],
                "description": "Get Settings unique groups",
                "operationId": "admin.settings.groups.get",
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/theme/logo": {
            "post": {
                "tags": [
                    "Admin Settings"
                ],
                "summary": "Upload the tenant logo",
                "description": "Stores a PNG or SVG logo (at most 200 KB; a PNG at most 4096 px a side) in the storage of the current tenant and saves it as the public setting theme.logo, with an optional text alternative as theme.logoAlt. The type is taken from the content. An SVG is checked against an allow-list and stored in its re-serialised form; one with a script, style sheet, event attribute, DOCTYPE, foreignObject or a reference to another address is refused with the reason. The stored name is random and the previous logo file is removed. Needs settings_update. Throttled to 20 requests per minute per user.",
                "operationId": "admin.theme.logo.store",
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "required": [
                                    "logo"
                                ],
                                "properties": {
                                    "logo": {
                                        "description": "PNG or SVG file, at most 200 KB",
                                        "type": "string",
                                        "format": "binary"
                                    },
                                    "alt": {
                                        "description": "Text alternative of the logo; the company name when empty",
                                        "type": "string",
                                        "maxLength": 120
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "the stored logo",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "not signed in"
                    },
                    "403": {
                        "description": "missing permission"
                    },
                    "422": {
                        "description": "not an accepted logo, or too large"
                    },
                    "429": {
                        "description": "too many requests"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Admin Settings"
                ],
                "summary": "Remove the tenant logo",
                "description": "Removes theme.logo and theme.logoAlt and deletes the stored file; the learner site falls back to the company name as text. Needs settings_update.",
                "operationId": "admin.theme.logo.destroy",
                "responses": {
                    "200": {
                        "description": "removed (also when there was no logo)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "not signed in"
                    },
                    "403": {
                        "description": "missing permission"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/config": {
            "get": {
                "tags": [
                    "Settings"
                ],
                "summary": "Get a listing of public config values.",
                "description": "Get public config values",
                "operationId": "config.get",
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/settings": {
            "get": {
                "tags": [
                    "Settings"
                ],
                "summary": "Get a listing of the public and enuerable settings.",
                "description": "Get settings",
                "operationId": "settings.get",
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/settings/{group}/{key}": {
            "get": {
                "tags": [
                    "Settings"
                ],
                "summary": "Display the specified public setting",
                "description": "Get Course",
                "operationId": "settings.by-group.by-key.get",
                "parameters": [
                    {
                        "name": "group",
                        "in": "path",
                        "description": "group of setting",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "key",
                        "in": "path",
                        "description": "key of setting",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/stationary-events": {
            "get": {
                "tags": [
                    "Admin Stationary Events"
                ],
                "summary": "Get a listing of the Stationary events",
                "description": "Get all Stationary Events",
                "operationId": "admin.stationary-events.get",
                "parameters": [
                    {
                        "name": "order_by",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "finished_at",
                                "started_at",
                                "created_at",
                                "name"
                            ]
                        }
                    },
                    {
                        "name": "order",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "ASC",
                                "DESC"
                            ]
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Pagination Page Number",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "default": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Pagination Per Page",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "default": 15
                        }
                    },
                    {
                        "name": "name",
                        "in": "query",
                        "description": "Stationary event name %LIKE%",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "draft",
                                "archived",
                                "published",
                                "published_unactivated"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Admin Stationary Events"
                ],
                "summary": "Store a newly created Stationary event in storage",
                "description": "Store Stationary Event",
                "operationId": "admin.stationary-events.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/stationary-event-create-request"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/stationary-events/{id}": {
            "get": {
                "tags": [
                    "Admin Stationary Events"
                ],
                "summary": "Display the specified Stationary Event",
                "description": "Get Stationary Event",
                "operationId": "admin.stationary-events.by-id.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of Stationary event",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Admin Stationary Events"
                ],
                "summary": "Update the specified Stationary Event in storage",
                "description": "Update Stationary Events",
                "operationId": "admin.stationary-events.by-id.put",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of Stationary Events",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/stationary-event-update-request"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Admin Stationary Events"
                ],
                "summary": "Remove the specified Stationary Event from storage",
                "description": "Delete Stationary Event",
                "operationId": "admin.stationary-events.by-id.delete",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of Stationary Event",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/stationary-events": {
            "get": {
                "tags": [
                    "Stationary Events"
                ],
                "summary": "Get a listing of published stationary events",
                "description": "Get all stationary events with published or published_unactivated status",
                "operationId": "stationary-events.get",
                "parameters": [
                    {
                        "name": "order_by",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "finished_at",
                                "started_at",
                                "created_at",
                                "name"
                            ]
                        }
                    },
                    {
                        "name": "order",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "ASC",
                                "DESC"
                            ]
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Pagination Page Number",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "default": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Pagination Per Page",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "default": 15
                        }
                    },
                    {
                        "name": "name",
                        "in": "query",
                        "description": "Stationary event name %ILIKE%",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "categories",
                        "in": "query",
                        "description": "An array of categories IDs",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "number"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/stationary-events/me": {
            "get": {
                "tags": [
                    "Stationary Events"
                ],
                "summary": "Get a listing of stationary events bought by user",
                "description": "Get a listing of stationary events bought by user",
                "operationId": "stationary-events.me.get",
                "parameters": [
                    {
                        "name": "order_by",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "finished_at",
                                "started_at",
                                "created_at",
                                "name"
                            ]
                        }
                    },
                    {
                        "name": "order",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "ASC",
                                "DESC"
                            ]
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Pagination Page Number",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "default": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Pagination Per Page",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "default": 15
                        }
                    },
                    {
                        "name": "name",
                        "in": "query",
                        "description": "Stationary event name %LIKE%",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/stationary-events/{id}": {
            "get": {
                "tags": [
                    "Stationary Events"
                ],
                "summary": "Display the specified Stationary Event.",
                "description": "Get stationary event by id with published or published_unactivated status",
                "operationId": "stationary-events.by-id.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of Stationary event",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/tags": {
            "get": {
                "tags": [
                    "Tags"
                ],
                "description": "Display a listing of the Tag",
                "operationId": "tags.get",
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                }
            }
        },
        "/api/tags/unique": {
            "get": {
                "tags": [
                    "Tags"
                ],
                "description": "Display the unique Tags",
                "operationId": "tags.unique.get",
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                }
            }
        },
        "/api/admin/tags": {
            "post": {
                "tags": [
                    "Tags"
                ],
                "description": "Create multiple Tags",
                "operationId": "admin.tags.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "model_type": {
                                        "type": "string",
                                        "example": "Category"
                                    },
                                    "model_id": {
                                        "type": "integer",
                                        "example": "1"
                                    },
                                    "tags": {
                                        "type": "array",
                                        "items": {
                                            "properties": {
                                                "title": {
                                                    "type": "string",
                                                    "example": "Nowości"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "401": {
                        "description": "Unauthenticated",
                        "content": {
                            "application/json": {}
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "content": {
                            "application/json": {}
                        }
                    },
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Tags"
                ],
                "summary": "Destroy Tags",
                "description": "Destroy Tags",
                "operationId": "admin.tags.delete",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "tags": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer",
                                            "example": "1"
                                        }
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "401": {
                        "description": "Unauthenticated",
                        "content": {
                            "application/json": {}
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "content": {
                            "application/json": {}
                        }
                    },
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/tags/{tag}": {
            "get": {
                "tags": [
                    "Tags"
                ],
                "description": "Display the specified Tag",
                "operationId": "admin.tags.by-tag.get",
                "parameters": [
                    {
                        "name": "tag",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "401": {
                        "description": "Unauthenticated",
                        "content": {
                            "application/json": {}
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "content": {
                            "application/json": {}
                        }
                    },
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not found",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/tags/unique": {
            "get": {
                "tags": [
                    "Tags"
                ],
                "description": "Display the unique Tags (admin)",
                "operationId": "admin.tags.unique.get",
                "responses": {
                    "401": {
                        "description": "Unauthenticated",
                        "content": {
                            "application/json": {}
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "content": {
                            "application/json": {}
                        }
                    },
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/tasks": {
            "get": {
                "tags": [
                    "Admin Tasks"
                ],
                "summary": "Get a listing of the tasks",
                "description": "Get all Tasks",
                "operationId": "admin.tasks.get",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Pagination Page Number",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "default": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Pagination Per Page",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "default": 15
                        }
                    },
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Task title %LIKE%",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "type",
                        "in": "query",
                        "description": "Task type",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "Task user_id",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "created_by_id",
                        "in": "query",
                        "description": "Task created_by_id",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "related_type",
                        "in": "query",
                        "description": "Task related_type",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "related_id",
                        "in": "query",
                        "description": "Task related_id",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "related_ids[]",
                        "in": "query",
                        "description": "An array of related_id",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "number"
                            }
                        }
                    },
                    {
                        "name": "due_date_from",
                        "in": "query",
                        "description": "Due date from",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "due_date_to",
                        "in": "query",
                        "description": "Due date to",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Admin Tasks"
                ],
                "summary": "Store a newly created task",
                "description": "Store Task",
                "operationId": "admin.tasks.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/AdminTaskCreateRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Successfull operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/TaskResource"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/tasks/{id}": {
            "get": {
                "tags": [
                    "Admin Tasks"
                ],
                "summary": "Task details",
                "description": "Get task details by ID",
                "operationId": "admin.tasks.by-id.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of task",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Successfull operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/TaskDetailsResource"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Admin Tasks"
                ],
                "summary": "Remove the specified task",
                "description": "Delete Task",
                "operationId": "admin.tasks.by-id.delete",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of task",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "patch": {
                "tags": [
                    "Admin Tasks"
                ],
                "summary": "Update the specified task",
                "description": "Update Task",
                "operationId": "admin.tasks.by-id.patch",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of task",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/AdminTaskCreateRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Successfull operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/TaskResource"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/tasks/complete/{id}": {
            "post": {
                "tags": [
                    "Admin Tasks"
                ],
                "summary": "Complete task",
                "description": "Complete Task",
                "operationId": "admin.tasks.complete.by-id.post",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of task",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Successfull operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/TaskResource"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/tasks/incomplete/{id}": {
            "post": {
                "tags": [
                    "Admin Tasks"
                ],
                "summary": "Incomplete task",
                "description": "Incomplete Task",
                "operationId": "admin.tasks.incomplete.by-id.post",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of task",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Successfull operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/TaskResource"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/tasks/notes": {
            "post": {
                "tags": [
                    "Admin Tasks Notes"
                ],
                "summary": "Store a newly created task note",
                "description": "Store Task Note",
                "operationId": "admin.tasks.notes.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/TaskNoteCreateRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Successfull operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/TaskNoteResource"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/tasks/notes/{id}": {
            "delete": {
                "tags": [
                    "Admin Tasks Notes"
                ],
                "summary": "Remove the specified task notes",
                "description": "Delete Task Note",
                "operationId": "admin.tasks.notes.by-id.delete",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of task note",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "patch": {
                "tags": [
                    "Admin Tasks Notes"
                ],
                "summary": "Update task note",
                "description": "Update Task Note",
                "operationId": "admin.tasks.notes.by-id.patch",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of task note",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/TaskNoteCreateRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Successfull operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/TaskNoteResource"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/tasks": {
            "get": {
                "tags": [
                    "Tasks"
                ],
                "summary": "Get a listing of the tasks",
                "description": "Get all Tasks",
                "operationId": "tasks.get",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Pagination Page Number",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "default": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Pagination Per Page",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "default": 15
                        }
                    },
                    {
                        "name": "title",
                        "in": "query",
                        "description": "Task title %LIKE%",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "type",
                        "in": "query",
                        "description": "Task type",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "Task user_id",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "created_by_id",
                        "in": "query",
                        "description": "Task created_by_id",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "related_type",
                        "in": "query",
                        "description": "Task related_type",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "related_id",
                        "in": "query",
                        "description": "Task related_id",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "related_ids[]",
                        "in": "query",
                        "description": "An array of related_id",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "number"
                            }
                        }
                    },
                    {
                        "name": "due_date_from",
                        "in": "query",
                        "description": "Due date from",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "due_date_to",
                        "in": "query",
                        "description": "Due date to",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Tasks"
                ],
                "summary": "Store a newly created task",
                "description": "Store Task",
                "operationId": "tasks.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/TaskCreateRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Successfull operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/TaskResource"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/tasks/{id}": {
            "get": {
                "tags": [
                    "Tasks"
                ],
                "summary": "Task details",
                "description": "Get task details by ID",
                "operationId": "tasks.by-id.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of task",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Successfull operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/TaskDetailsResource"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Tasks"
                ],
                "summary": "Remove the specified task",
                "description": "Delete Task",
                "operationId": "tasks.by-id.delete",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of task",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "patch": {
                "tags": [
                    "Tasks"
                ],
                "summary": "Update task",
                "description": "Store Task",
                "operationId": "tasks.by-id.patch",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/TaskCreateRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Successfull operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/TaskResource"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/tasks/complete/{id}": {
            "post": {
                "tags": [
                    "Tasks"
                ],
                "summary": "Complete task",
                "description": "Complete Task",
                "operationId": "tasks.complete.by-id.post",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of task",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Successfull operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/TaskResource"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/tasks/incomplete/{id}": {
            "post": {
                "tags": [
                    "Tasks"
                ],
                "summary": "Incomplete task",
                "description": "Incomplete Task",
                "operationId": "tasks.incomplete.by-id.post",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of task",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Successfull operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/TaskResource"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/tasks/notes": {
            "post": {
                "tags": [
                    "Tasks Notes"
                ],
                "summary": "Store a newly created task note",
                "description": "Store Task Note",
                "operationId": "tasks.notes.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/TaskNoteCreateRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Successfull operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/TaskNoteResource"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/tasks/notes/{id}": {
            "delete": {
                "tags": [
                    "Tasks Notes"
                ],
                "summary": "Remove the specified task notes",
                "description": "Delete Task Note",
                "operationId": "tasks.notes.by-id.delete",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of task note",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "patch": {
                "tags": [
                    "Tasks Notes"
                ],
                "summary": "Update task note",
                "description": "Update Task Note",
                "operationId": "tasks.notes.by-id.patch",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID of task note",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/TaskNoteCreateRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Successfull operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/TaskNoteResource"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/templates/email/render": {
            "post": {
                "tags": [
                    "Templates"
                ],
                "summary": "Render an unsaved e-mail template draft with sample data",
                "description": "Nothing is stored and nothing is sent. Returns the rendered HTML with the sample values of the event, the MJML errors reported by the renderer and accessibility warnings (warnings never fail the request). Throttled to 30 requests per minute per user.",
                "operationId": "templates.email.render",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "event",
                                    "title",
                                    "content"
                                ],
                                "properties": {
                                    "event": {
                                        "description": "event full classname, as listed by GET /api/admin/templates/events",
                                        "type": "string"
                                    },
                                    "title": {
                                        "description": "subject",
                                        "type": "string"
                                    },
                                    "content": {
                                        "description": "MJML (or HTML) source, up to 512 KiB",
                                        "type": "string"
                                    },
                                    "locale": {
                                        "description": "language code (en, pl, zh) the draft is written for; sample values are rendered in it",
                                        "type": "string",
                                        "nullable": true
                                    },
                                    "sample_overrides": {
                                        "description": "variable name to sample value, for this preview only",
                                        "type": "object",
                                        "additionalProperties": {
                                            "type": "string"
                                        }
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "rendered draft",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/EmailTemplateDraft"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "422": {
                        "description": "validation error"
                    },
                    "429": {
                        "description": "too many requests"
                    },
                    "503": {
                        "description": "the MJML renderer is unavailable"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/templates/email/test-send": {
            "post": {
                "tags": [
                    "Templates"
                ],
                "summary": "Send an unsaved e-mail template draft to the signed-in admin",
                "description": "Renders the draft like the render endpoint and sends it, with the subject prefixed by [Test], only to the e-mail address of the authenticated user. There is no recipient field. Throttled to 5 requests per minute per user.",
                "operationId": "templates.email.test-send",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "event",
                                    "title",
                                    "content"
                                ],
                                "properties": {
                                    "event": {
                                        "type": "string"
                                    },
                                    "title": {
                                        "type": "string"
                                    },
                                    "content": {
                                        "type": "string"
                                    },
                                    "locale": {
                                        "description": "language code (en, pl, zh) the draft is written for",
                                        "type": "string",
                                        "nullable": true
                                    },
                                    "sample_overrides": {
                                        "type": "object",
                                        "additionalProperties": {
                                            "type": "string"
                                        }
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "the draft was sent to the signed-in admin",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/EmailTemplateDraft"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "422": {
                        "description": "validation error"
                    },
                    "429": {
                        "description": "too many requests"
                    },
                    "503": {
                        "description": "the MJML renderer is unavailable"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/templates/email/images": {
            "post": {
                "tags": [
                    "Templates"
                ],
                "summary": "Upload an image for an e-mail template",
                "description": "Stores a PNG, JPEG, GIF or WebP image (up to 2 MB by default) in the storage of the current tenant and returns its public URL, which e-mail clients fetch remotely. The type is sniffed from the content; SVG and every other type is refused. The stored name is random. Throttled to 30 requests per minute per user.",
                "operationId": "templates.email.images",
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "required": [
                                    "image"
                                ],
                                "properties": {
                                    "image": {
                                        "description": "PNG, JPEG, GIF or WebP file",
                                        "type": "string",
                                        "format": "binary"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "the stored image",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "properties": {
                                                "url": {
                                                    "description": "public URL to put in mj-image src",
                                                    "type": "string"
                                                },
                                                "name": {
                                                    "description": "path in the tenant storage",
                                                    "type": "string"
                                                },
                                                "mime": {
                                                    "type": "string"
                                                },
                                                "size": {
                                                    "description": "bytes",
                                                    "type": "integer"
                                                },
                                                "width": {
                                                    "type": "integer"
                                                },
                                                "height": {
                                                    "type": "integer"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "422": {
                        "description": "not an accepted image, or too large"
                    },
                    "429": {
                        "description": "too many requests"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/certificates/verify/{certificateId}": {
            "get": {
                "tags": [
                    "Template PDFs"
                ],
                "summary": "Verify a certificate",
                "description": "Public and throttled. Returns the status (valid, expired or revoked), the course, the holder name (masked per tenant setting), issue and expiry dates. Unknown ids answer 404.",
                "operationId": "certificates.verify.by-certificateid.get",
                "parameters": [
                    {
                        "name": "certificateId",
                        "in": "path",
                        "description": "random certificate id encoded in the QR code",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "properties": {
                                                "certificate_id": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string",
                                                    "enum": [
                                                        "valid",
                                                        "expired",
                                                        "revoked"
                                                    ]
                                                },
                                                "title": {
                                                    "type": "string"
                                                },
                                                "course_title": {
                                                    "type": "string",
                                                    "nullable": true
                                                },
                                                "course_variant": {
                                                    "description": "The variant of the course the holder completed (for example Expert), null for a course without variants",
                                                    "type": "string",
                                                    "nullable": true
                                                },
                                                "holder_name": {
                                                    "type": "string",
                                                    "nullable": true
                                                },
                                                "issued_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "expires_at": {
                                                    "type": "string",
                                                    "format": "date-time",
                                                    "nullable": true
                                                },
                                                "revoked_at": {
                                                    "type": "string",
                                                    "format": "date-time",
                                                    "nullable": true
                                                },
                                                "superseded_by_policy_version": {
                                                    "description": "the policy version that replaced what the certificate certified, when it was revoked for that reason",
                                                    "type": "integer",
                                                    "nullable": true
                                                },
                                                "issuer": {
                                                    "type": "string"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "unknown certificate id"
                    },
                    "429": {
                        "description": "too many requests"
                    }
                }
            }
        },
        "/api/admin/pdfs/{id}/revoke": {
            "post": {
                "tags": [
                    "Template PDFs"
                ],
                "summary": "Revoke a certificate",
                "description": "Marks the certificate revoked. It stays verifiable and shows as revoked. Needs the fabricjs_pdf_revoke permission.",
                "operationId": "admin.pdfs.by-id.revoke.post",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of the generated PDF",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "reason"
                                ],
                                "properties": {
                                    "reason": {
                                        "type": "string",
                                        "maxLength": 500
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "404": {
                        "description": "unknown PDF"
                    },
                    "422": {
                        "description": "Validation error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/pdfs": {
            "get": {
                "tags": [
                    "Template PDFs"
                ],
                "summary": "Get generated PDFs",
                "description": "Get paginated list of PDFs generated by templates",
                "operationId": "pdfs.get",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Pagination Page Number",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "default": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Pagination Per Page",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "default": 15
                        }
                    },
                    {
                        "name": "assignable_type",
                        "in": "query",
                        "description": "Assignable type (Ulams\\Courses\\Models\\Course)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "assignable_id",
                        "in": "query",
                        "description": "Assignable ID",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/pdfs/{id}": {
            "get": {
                "tags": [
                    "Template PDFs"
                ],
                "summary": "Display the specified generated PDF",
                "description": "Get generated PDF",
                "operationId": "pdfs.by-id.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of generated PDF",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/pdfs": {
            "get": {
                "tags": [
                    "Admin Template PDFs"
                ],
                "summary": "Display the specified generated PDF",
                "description": "Get generated PDF, IF user_id or template_id is provided all records are returned, otherwise list is paginated ",
                "operationId": "admin.pdfs.get",
                "parameters": [
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "either user_id",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "template_id",
                        "in": "query",
                        "description": "or user_id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/pdfs/generate/{id}": {
            "get": {
                "tags": [
                    "Template PDFs"
                ],
                "summary": "Download a generated PDF (certificate)",
                "description": "Returns the stored PDF, or renders it from its pdfme template and variables through the PDF renderer service",
                "operationId": "pdfs.generate.by-id.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of the generated PDF",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiJson"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "legacy (ReportBro) or invalid template"
                    },
                    "503": {
                        "description": "PDF renderer unavailable"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/pdfs/preview": {
            "post": {
                "tags": [
                    "Template PDFs"
                ],
                "summary": "Preview a pdfme template with sample data",
                "description": "Renders a pdfme template (unsaved designer content) with the mocked variables of the event, through the PDF renderer service",
                "operationId": "admin.pdfs.preview.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "event",
                                    "content"
                                ],
                                "properties": {
                                    "event": {
                                        "type": "string",
                                        "example": "Ulams\\\\Courses\\\\Events\\\\CourseFinished"
                                    },
                                    "content": {
                                        "description": "pdfme template (object or JSON string)",
                                        "type": "object"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/pdf": {}
                        }
                    },
                    "403": {
                        "description": "no template create/update permission"
                    },
                    "422": {
                        "description": "invalid template or unknown event"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/pdfs/fonts": {
            "get": {
                "tags": [
                    "Template PDFs"
                ],
                "summary": "Fonts available in PDF templates",
                "description": "Fonts bundled with the PDF renderer (SIL OFL); the admin designer loads them from /api/pdfs/fonts/{file}",
                "operationId": "pdfs.fonts.get",
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/pdfs/fonts/{file}": {
            "get": {
                "tags": [
                    "Template PDFs"
                ],
                "summary": "Font file used in PDF templates",
                "operationId": "pdfs.fonts.by-file.get",
                "parameters": [
                    {
                        "name": "file",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "NotoSans-Regular.ttf"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "font/ttf": {}
                        }
                    },
                    "404": {
                        "description": "unknown font"
                    }
                }
            }
        },
        "/api/admin/events/trigger-manually/{id}": {
            "post": {
                "tags": [
                    "Templates"
                ],
                "summary": "Manually triggered event for users",
                "operationId": "events.trigger-manually",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Template id",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "users": {
                                        "description": "Ids of users",
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        }
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Event dispatched successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "422": {
                        "description": "one of the parameters has invalid format"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/templates": {
            "get": {
                "tags": [
                    "Templates"
                ],
                "summary": "Lists available templates",
                "operationId": "admin.templates.get",
                "parameters": [
                    {
                        "name": "channel",
                        "in": "query",
                        "description": "Channel class for filtering",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "event",
                        "in": "query",
                        "description": "Event class for filtering",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "locale",
                        "in": "query",
                        "description": "Language code (en, pl, zh) the template is written for",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "list of available templates",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "description": "map of templates identified by a slug value",
                                    "type": "object",
                                    "additionalProperties": {
                                        "$ref": "#/components/schemas/Template"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Templates"
                ],
                "summary": "Create a new template identified by id",
                "operationId": "templates.create",
                "requestBody": {
                    "description": "Template attributes",
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/Template"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "template created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/TemplateResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "409": {
                        "description": "there already is a template identified by chosen slug identifier"
                    },
                    "422": {
                        "description": "one of the parameters has invalid format"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/templates/{id}": {
            "get": {
                "tags": [
                    "Templates"
                ],
                "summary": "Read a template identified by a given id identifier",
                "operationId": "admin.templates.by-id.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Unique human-readable template identifier",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Template"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Templates"
                ],
                "summary": "Delete a template identified by a id",
                "operationId": "templates.delete",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Unique human-readable template identifier",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "template deleted successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiBooleanResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "400": {
                        "description": "cannot find a template with provided slug identifier"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "patch": {
                "tags": [
                    "Templates"
                ],
                "summary": "Update an existing template identified by id",
                "operationId": "templates.update",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Unique human-readable template identifier",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "description": "Template attributes",
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/Template"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "template updated successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/TemplateRecordResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "400": {
                        "description": "cannot find a template with provided slug identifier"
                    },
                    "422": {
                        "description": "one of the parameters has invalid format"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/templates/variables": {
            "get": {
                "tags": [
                    "Templates"
                ],
                "summary": "Dictionary list of available template variables",
                "operationId": "templates.variables",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Unique human-readable template identifier",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/TemplateVariablesResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/templates/{id}/preview": {
            "get": {
                "tags": [
                    "Templates"
                ],
                "summary": "Read a template identified by a given id identifier",
                "operationId": "templates.preview",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Unique human-readable template identifier",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Preview details",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/TemplatePreviewResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/templates/{id}/assign": {
            "post": {
                "tags": [
                    "Templates"
                ],
                "summary": "Assign template to model (of class assignable to the Variable Set)",
                "operationId": "templates.assign",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Unique id of template",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "assignable_id": {
                                        "type": "integer"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Preview details",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/TemplateResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/templates/{id}/unassign": {
            "post": {
                "tags": [
                    "Templates"
                ],
                "summary": "Remove template assignment to model",
                "operationId": "templates.unassign",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Unique id of template",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "assignable_id": {
                                        "type": "integer"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Preview details",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/TemplateResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/templates/assignable": {
            "get": {
                "tags": [
                    "Templates"
                ],
                "summary": "Get Templates that can be assigned to model",
                "operationId": "templates.assignable",
                "parameters": [
                    {
                        "name": "assignable_class",
                        "in": "query",
                        "description": "Class of assignable model for which we want to find assignable Templates",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "channel",
                        "in": "query",
                        "description": "Class of channel for which we want to find assignable Templates",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "event",
                        "in": "query",
                        "description": "Class of event for which we want to find assignable Templates",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "List of Templates that can be assigned",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/TemplateListResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/templates/assigned": {
            "get": {
                "tags": [
                    "Templates"
                ],
                "summary": "Get Template assigned to the model",
                "operationId": "templates.assigned",
                "parameters": [
                    {
                        "name": "assignable_class",
                        "in": "query",
                        "description": "Class of assignable model for which we want to fetch assigned Template",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "assignable_id",
                        "in": "query",
                        "description": "Id of assignable model for which we want to fetch assigned Template",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Preview details",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/TemplateListResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "endpoint requires authentication"
                    },
                    "403": {
                        "description": "user doesn't have required access rights"
                    },
                    "500": {
                        "description": "server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/platform/operations": {
            "get": {
                "tags": [
                    "Platform"
                ],
                "summary": "The latest tenant operations",
                "operationId": "platform.operations.get",
                "responses": {
                    "200": {
                        "description": "Up to 50 operations, newest first",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/PlatformOperation"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/platform/operations/{id}": {
            "get": {
                "tags": [
                    "Platform"
                ],
                "summary": "Status and steps of a tenant operation (poll it)",
                "operationId": "platform.operations.by-id.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/PlatformOperation"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Unknown operation"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/platform/templates": {
            "get": {
                "tags": [
                    "Platform"
                ],
                "summary": "List the tenant templates",
                "operationId": "platform.templates.get",
                "responses": {
                    "200": {
                        "description": "Templates",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/PlatformTemplate"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Not a platform administrator, or the token lacks platform:read"
                    },
                    "404": {
                        "description": "The platform API is off, or this is a tenant host"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Platform"
                ],
                "summary": "Create a tenant template, or change the given fields of an existing one",
                "operationId": "platform.templates.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "slug"
                                ],
                                "properties": {
                                    "slug": {
                                        "type": "string",
                                        "example": "policy-academy"
                                    },
                                    "name": {
                                        "type": "string"
                                    },
                                    "theme": {
                                        "type": "string",
                                        "example": "coffee"
                                    },
                                    "accent": {
                                        "type": "string",
                                        "example": "#C2552D"
                                    },
                                    "demo": {
                                        "type": "boolean"
                                    },
                                    "users": {
                                        "type": "integer",
                                        "maximum": 50,
                                        "minimum": 0
                                    },
                                    "env": {
                                        "description": "Inheritable settings only",
                                        "type": "object",
                                        "example": {
                                            "AI_DRIVER": "fake"
                                        },
                                        "additionalProperties": {
                                            "type": "string"
                                        }
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/PlatformTemplate"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "200": {
                        "description": "Updated"
                    },
                    "422": {
                        "description": "Invalid slug or value"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/platform/templates/{slug}": {
            "get": {
                "tags": [
                    "Platform"
                ],
                "summary": "One tenant template",
                "operationId": "platform.templates.by-slug.get",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The template",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/PlatformTemplate"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Unknown template, or the platform API is off"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Platform"
                ],
                "summary": "Remove a tenant template (tenants made from it are untouched)",
                "operationId": "platform.templates.by-slug.delete",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Removed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "properties": {
                                                "slug": {
                                                    "type": "string"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Unknown template, or the platform API is off"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/platform/tenants": {
            "get": {
                "tags": [
                    "Platform"
                ],
                "summary": "List the tenants",
                "operationId": "platform.tenants.get",
                "responses": {
                    "200": {
                        "description": "Tenants",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/PlatformTenant"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Not a platform administrator, or the token lacks platform:read"
                    },
                    "404": {
                        "description": "The platform API is off, or this is a tenant host"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Platform"
                ],
                "summary": "Create a tenant (queued; poll the operation)",
                "operationId": "platform.tenants.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "slug"
                                ],
                                "properties": {
                                    "slug": {
                                        "description": "2-30 lowercase letters and digits, starting with a letter",
                                        "type": "string",
                                        "example": "acme"
                                    },
                                    "name": {
                                        "type": "string"
                                    },
                                    "theme": {
                                        "type": "string",
                                        "example": "coffee"
                                    },
                                    "accent": {
                                        "type": "string",
                                        "example": "#C2552D"
                                    },
                                    "users": {
                                        "type": "integer",
                                        "maximum": 50,
                                        "minimum": 0
                                    },
                                    "demo": {
                                        "type": "boolean"
                                    },
                                    "template": {
                                        "description": "A tenant template: its theme, accent, demo flag and settings are the starting point; the fields above win",
                                        "type": "string"
                                    },
                                    "derived_from": {
                                        "description": "The tenant this one is created for (a department academy); needs purpose and reference, counts against its quota and is recorded",
                                        "type": "string"
                                    },
                                    "purpose": {
                                        "type": "string",
                                        "example": "policy_department"
                                    },
                                    "reference": {
                                        "description": "Asking again with the same reference finds the same tenant",
                                        "type": "string"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "202": {
                        "description": "Queued",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "properties": {
                                                "operation": {
                                                    "$ref": "#/components/schemas/PlatformOperation"
                                                },
                                                "tenant": {
                                                    "$ref": "#/components/schemas/PlatformTenant"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "The tenant exists, an operation for it is in progress, or the parent's quota or the reference's tenant forbids it"
                    },
                    "422": {
                        "description": "Invalid slug or option, or an unknown template"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/platform/tenants/{slug}": {
            "get": {
                "tags": [
                    "Platform"
                ],
                "summary": "One tenant",
                "operationId": "platform.tenants.by-slug.get",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The tenant",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/PlatformTenant"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Unknown tenant, or the platform API is off"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Platform"
                ],
                "summary": "Delete a tenant and all its data (queued; send the slug as confirm)",
                "operationId": "platform.tenants.by-slug.delete",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "confirm"
                                ],
                                "properties": {
                                    "confirm": {
                                        "description": "Must equal the slug",
                                        "type": "string"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "202": {
                        "description": "Queued",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "properties": {
                                                "operation": {
                                                    "$ref": "#/components/schemas/PlatformOperation"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "An operation for this tenant is in progress, or tenants were created from it (delete those first)"
                    },
                    "422": {
                        "description": "confirm does not equal the slug"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/platform/tenants/{slug}/env": {
            "patch": {
                "tags": [
                    "Platform"
                ],
                "summary": "Override or reset inheritable settings (AI driver, models) of a tenant",
                "operationId": "platform.tenants.by-slug.env.patch",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "set": {
                                        "type": "object",
                                        "example": {
                                            "AI_DRIVER": "fake"
                                        },
                                        "additionalProperties": {
                                            "type": "string"
                                        }
                                    },
                                    "unset": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        }
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "The tenant",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/PlatformTenant"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "A key outside the allow-list"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/platform/tenants/{slug}/derived": {
            "get": {
                "tags": [
                    "Platform"
                ],
                "summary": "The tenants created from this one for a purpose",
                "operationId": "platform.tenants.by-slug.derived.get",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Active derived tenants with the record of who asked",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "tenant": {
                                                        "type": "string"
                                                    },
                                                    "template": {
                                                        "type": "string",
                                                        "nullable": true
                                                    },
                                                    "purpose": {
                                                        "type": "string"
                                                    },
                                                    "reference": {
                                                        "type": "string"
                                                    },
                                                    "requested_by": {
                                                        "type": "string",
                                                        "nullable": true
                                                    },
                                                    "created_at": {
                                                        "type": "string"
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Unknown tenant, or the platform API is off"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/quiz-answers/{id}": {
            "patch": {
                "tags": [
                    "Admin Gift Quiz Attempt"
                ],
                "summary": "Update answer",
                "description": "Update answer",
                "operationId": "admin.quiz-answers.by-id.patch",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/AdminUpdateAttemptAnswerRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Successfull operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "data": {},
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/quiz-answers": {
            "post": {
                "tags": [
                    "Gift Quiz Attempt"
                ],
                "summary": "Save your answer",
                "description": "Save your answer",
                "operationId": "quiz-answers.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/SaveAttemptAnswerRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Successfull operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/quiz-answers/all": {
            "post": {
                "tags": [
                    "Gift Quiz Attempt"
                ],
                "summary": "Save your all answers",
                "description": "Save your all answers",
                "operationId": "quiz-answers.all.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/SaveAllAttemptAnswerRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Successfull operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "data": {},
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/gift-questions": {
            "post": {
                "tags": [
                    "Admin Gift Question"
                ],
                "summary": "Store a newly Gift Question",
                "description": "Store Gift Question",
                "operationId": "admin.gift-questions.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/AdminGiftQuestionRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Successfull operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "data": {},
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/gift-questions/{id}": {
            "put": {
                "tags": [
                    "Admin Gift Question"
                ],
                "summary": "Update Gift Question",
                "description": "Update Gift Question",
                "operationId": "admin.gift-questions.by-id.put",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/AdminGiftQuestionRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Successfull operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "data": {},
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Admin Gift Question"
                ],
                "summary": "Remove the specified Gift Question",
                "description": "Delete Gift Question",
                "operationId": "admin.gift-questions.by-id.delete",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/gift-questions/sort": {
            "post": {
                "tags": [
                    "Admin Gift Question"
                ],
                "summary": "Sort Gift Questions",
                "description": "Sort Gift Questions",
                "operationId": "admin.gift-questions.sort.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/AdminSortGiftQuestionRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Successfull operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/gift-questions/export": {
            "get": {
                "tags": [
                    "Admin Gift Question"
                ],
                "summary": "Export Gift Questions",
                "description": "Export Gift Questions",
                "operationId": "admin.gift-questions.export.get",
                "parameters": [
                    {
                        "name": "topic_gift_quiz_id",
                        "in": "path",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "category_ids[]",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {}
                        }
                    },
                    {
                        "name": "ids[]",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {}
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {}
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/gift-questions/import": {
            "post": {
                "tags": [
                    "Admin Gift Question"
                ],
                "summary": "Import Gift Questions",
                "description": "Import Gift Questions",
                "operationId": "admin.gift-questions.import.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "$ref": "#/components/schemas/AdminImportGiftQuestionsRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/gift-quizes": {
            "get": {
                "tags": [
                    "Gift Quiz"
                ],
                "summary": "List gift quizes of a course (for report filter select)",
                "operationId": "admin.gift-quizes.get",
                "parameters": [
                    {
                        "name": "course_id",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successfull operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/GiftQuizSimpleResource"
                                            }
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/gift-quizes/{id}": {
            "get": {
                "tags": [
                    "Gift Quiz"
                ],
                "summary": "Get gift quiz by id",
                "operationId": "admin.gift-quizes.by-id.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successfull operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "data": {},
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Gift Quiz"
                ],
                "summary": "Update gift quiz by id",
                "operationId": "admin.gift-quizes.by-id.put",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/AdminUpdateGiftQuizRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Successfull operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "data": {},
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/quiz-attempts": {
            "get": {
                "tags": [
                    "Admin Gift Quiz Attempt"
                ],
                "summary": "Get all quiz attempts",
                "operationId": "admin.quiz-attempts.get",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "topic_gift_quiz_id",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "number"
                        }
                    },
                    {
                        "name": "course_id",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "number"
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "number"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successfull operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {}
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/quiz-attempts/{id}": {
            "get": {
                "tags": [
                    "Admin Gift Quiz Attempt"
                ],
                "summary": "Get quiz attempt by id",
                "operationId": "admin.quiz-attempts.by-id.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successfull operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "data": {},
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/quiz-attempts/{id}/feedback": {
            "patch": {
                "tags": [
                    "Admin Gift Quiz Attempt"
                ],
                "summary": "Add, edit or remove tutor feedback for a quiz attempt",
                "description": "Sets the tutor feedback (light rich text or video link) on a quiz attempt. Sending null or an empty string removes it.",
                "operationId": "admin.quiz-attempts.by-id.feedback.patch",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/AdminUpdateQuizAttemptFeedbackRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Successfull operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "data": {},
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/quiz-attempts/export": {
            "get": {
                "tags": [
                    "Admin Gift Quiz Attempt"
                ],
                "summary": "Export course quiz results to an XLSX or XLS file",
                "description": "Exports all attempts of all students. Without topic_gift_quiz_id every quiz of the course is exported to a separate worksheet; with it a single worksheet is exported. The format query parameter selects the spreadsheet format (xlsx or xls), defaulting to xlsx.",
                "operationId": "admin.quiz-attempts.export.get",
                "parameters": [
                    {
                        "name": "course_id",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "topic_gift_quiz_id",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "format",
                        "in": "query",
                        "description": "Output spreadsheet format. Defaults to xlsx.",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "default": "xlsx",
                            "enum": [
                                "xlsx",
                                "xls"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successfull operation",
                        "content": {
                            "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {},
                            "application/vnd.ms-excel": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/quiz-attempts": {
            "get": {
                "tags": [
                    "Gift Quiz Attempt"
                ],
                "summary": "Get my quiz attempts",
                "operationId": "quiz-attempts.get",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "topic_gift_quiz_id",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "number"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successfull operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {}
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Gift Quiz Attempt"
                ],
                "summary": "Create a new attempt or return an active attempt",
                "description": "Store Gift Quiz Attempt",
                "operationId": "quiz-attempts.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/GetActiveAttemptRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Successfull operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "data": {},
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/quiz-attempts/{id}": {
            "get": {
                "tags": [
                    "Gift Quiz Attempt"
                ],
                "summary": "Get my quiz attempt by id",
                "operationId": "quiz-attempts.by-id.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successfull operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "data": {},
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/quiz-attempts/{id}/end": {
            "post": {
                "tags": [
                    "Gift Quiz Attempt"
                ],
                "summary": "Finish quiz attempt",
                "operationId": "quiz-attempts.by-id.end.post",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successfull operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "data": {},
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/topic-project-solutions": {
            "get": {
                "tags": [
                    "Admin Project Solution"
                ],
                "summary": "Get a listing of the project solutions",
                "description": "Get all project solutions",
                "operationId": "admin.topic-project-solutions.get",
                "parameters": [
                    {
                        "name": "order_by",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "created_at",
                                "id",
                                "user_id",
                                "topic_id"
                            ]
                        }
                    },
                    {
                        "name": "order",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "ASC",
                                "DESC"
                            ]
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Pagination Page Number",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "default": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Pagination Per Page",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "default": 15
                        }
                    },
                    {
                        "name": "topic_id",
                        "in": "query",
                        "description": "topic id",
                        "required": false,
                        "schema": {
                            "type": "number"
                        }
                    },
                    {
                        "name": "course_id",
                        "in": "query",
                        "description": "course id",
                        "required": false,
                        "schema": {
                            "type": "number"
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "user id",
                        "required": false,
                        "schema": {
                            "type": "number"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/topic-project-solutions/{id}": {
            "get": {
                "tags": [
                    "Admin Project Solution"
                ],
                "summary": "Get a single project solution",
                "description": "Get a single project solution (with tutor feedback) by id",
                "operationId": "admin.topic-project-solutions.by-id.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/ProjectSolutionResource"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Admin Project Solution"
                ],
                "summary": "Remove the specified Project Solution",
                "description": "Delete Project Solution",
                "operationId": "admin.topic-project-solutions.by-id.delete",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/topic-project-solutions/{id}/feedback": {
            "patch": {
                "tags": [
                    "Admin Project Solution"
                ],
                "summary": "Add, edit or remove tutor feedback for a project solution",
                "description": "Sets the tutor feedback (rich text or video link) on a project solution. Sending null or an empty string removes it.",
                "operationId": "admin.topic-project-solutions.by-id.feedback.patch",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/AdminUpdateProjectSolutionFeedbackRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/ProjectSolutionResource"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/topic-project-solutions/{id}/grade": {
            "patch": {
                "tags": [
                    "Admin Project Solution"
                ],
                "summary": "Grade the specified Project Solution",
                "description": "Set score and max_score for a Project Solution",
                "operationId": "admin.topic-project-solutions.by-id.grade.patch",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/AdminGradeProjectSolutionRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/topic-project-solutions": {
            "get": {
                "tags": [
                    "Project Solution"
                ],
                "summary": "Get a listing of the project solutions",
                "description": "Get all my project solutions",
                "operationId": "topic-project-solutions.get",
                "parameters": [
                    {
                        "name": "order_by",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "created_at",
                                "id"
                            ]
                        }
                    },
                    {
                        "name": "order",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "ASC",
                                "DESC"
                            ]
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Pagination Page Number",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "default": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Pagination Per Page",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "default": 15
                        }
                    },
                    {
                        "name": "course_id",
                        "in": "query",
                        "description": "course id",
                        "required": false,
                        "schema": {
                            "type": "number"
                        }
                    },
                    {
                        "name": "topic_id",
                        "in": "query",
                        "description": "topic id",
                        "required": false,
                        "schema": {
                            "type": "number"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Project Solution"
                ],
                "summary": "Store a newly Project Solution",
                "description": "Project Solution",
                "operationId": "topic-project-solutions.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "$ref": "#/components/schemas/CreateProjectSolutionRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Successfull operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/ProjectSolutionResource"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/topic-project-solutions/{id}": {
            "get": {
                "tags": [
                    "Project Solution"
                ],
                "summary": "Get a single project solution",
                "description": "Get my single project solution (with tutor feedback) by id",
                "operationId": "topic-project-solutions.by-id.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/ProjectSolutionResource"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Project Solution"
                ],
                "summary": "Remove the specified Project Solution",
                "description": "Delete Project Solution",
                "operationId": "topic-project-solutions.by-id.delete",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/translations": {
            "get": {
                "tags": [
                    "Admin Translations"
                ],
                "summary": "Get a list of translations stored in the database",
                "description": "Get translations",
                "operationId": "admin.translations.get",
                "parameters": [
                    {
                        "name": "order_by",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "order",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "ASC",
                                "DESC"
                            ]
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Pagination Page Number",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "default": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Pagination Per Page",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "default": 15
                        }
                    },
                    {
                        "name": "group",
                        "in": "query",
                        "description": "Group",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "key",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "public",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Admin Translations"
                ],
                "summary": "Store a newly created translation",
                "description": "Store translation",
                "operationId": "admin.translations.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/language-line-save-request"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/translations/{id}": {
            "get": {
                "tags": [
                    "Admin Translations"
                ],
                "summary": "Display the specified translation",
                "description": "Get translation",
                "operationId": "admin.translations.by-id.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of translation",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Admin Translations"
                ],
                "summary": "Update the specified translation",
                "description": "Update translation",
                "operationId": "admin.translations.by-id.put",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of translation",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/language-line-save-request"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Admin Translations"
                ],
                "summary": "Remove the specified translation",
                "description": "Delete transalation",
                "operationId": "admin.translations.by-id.delete",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of translation",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/translations/retrieve": {
            "post": {
                "tags": [
                    "Admin Translations"
                ],
                "summary": "Retrieve translation",
                "description": "Retrieve translation",
                "operationId": "admin.translations.retrieve.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/retrieve-translation-request"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/translations": {
            "get": {
                "tags": [
                    "Translations"
                ],
                "summary": "Get a list of public translations",
                "description": "Get public translations",
                "operationId": "translations.get",
                "parameters": [
                    {
                        "name": "order_by",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "order",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "ASC",
                                "DESC"
                            ]
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Pagination Page Number",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "default": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Pagination Per Page",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "default": 15
                        }
                    },
                    {
                        "name": "group[]",
                        "in": "query",
                        "description": "An array of translation groups",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    },
                    {
                        "name": "key[]",
                        "in": "query",
                        "description": "An array of translation keys",
                        "required": false,
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/tutor/runs/{run}/events": {
            "get": {
                "tags": [
                    "Tutor"
                ],
                "summary": "AG-UI event stream (SSE) of one streamed tutor answer",
                "description": "Text events are a draft; the `CUSTOM` event `tutor.final` carries the validated answer with its citations and always replaces it. During an open quiz attempt only `tutor.final` is sent. The stream ends after `RUN_FINISHED` or `RUN_ERROR`, or after 25 seconds (reconnect with `Last-Event-ID`).",
                "operationId": "tutor.runs.by-run.events.get",
                "parameters": [
                    {
                        "name": "run",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "after",
                        "in": "query",
                        "description": "resume after this event id (or Last-Event-ID header)",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "text/event-stream"
                    },
                    "404": {
                        "description": "Unknown run, or a run of another learner"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/tutor/courses/{course}/status": {
            "get": {
                "tags": [
                    "Tutor"
                ],
                "summary": "Whether the course tutor is available to the learner, how many questions are left today and whether a quiz attempt is open",
                "operationId": "tutor.courses.by-course.status.get",
                "parameters": [
                    {
                        "name": "course",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`enabled` (tutor on for the tenant), `aiEnabled` (AI on), `remaining` and `dailyLimit` questions, `attemptActive` (a quiz attempt is open: the tutor explains concepts only), `streaming` (the operator allows streamed answers)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiJson"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The learner may not attend the course"
                    },
                    "404": {
                        "description": "Unknown course"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/tutor/courses/{course}/messages": {
            "post": {
                "tags": [
                    "Tutor"
                ],
                "summary": "Ask the course tutor a question; it answers only from the course, with citations",
                "operationId": "tutor.courses.by-course.messages.post",
                "parameters": [
                    {
                        "name": "course",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "text"
                                ],
                                "properties": {
                                    "text": {
                                        "type": "string",
                                        "maxLength": 1000
                                    },
                                    "conversationId": {
                                        "type": "string",
                                        "nullable": true
                                    },
                                    "topicId": {
                                        "description": "The topic the learner has open: its content is added to the search",
                                        "type": "integer",
                                        "nullable": true
                                    },
                                    "stream": {
                                        "description": "Queue the answer and return 202 with a run id; read it at `GET /api/tutor/runs/{run}/events`. Ignored (the answer comes back in the response) when the operator switched streaming off",
                                        "type": "boolean"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "`answer`, `citations` (label, topic, source fragments), `refusal` (none, out_of_scope, attempt_active, unsafe), `inScope`, `remaining` questions today",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiJson"
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "`stream: true`: the question is stored and the answer is queued; `conversationId`, `runId`, `questionId`",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiJson"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "The learner may not attend the course"
                    },
                    "404": {
                        "description": "Unknown course or conversation"
                    },
                    "409": {
                        "description": "The conversation already has an answer running"
                    },
                    "429": {
                        "description": "Daily or monthly limit reached, or too many requests"
                    },
                    "503": {
                        "description": "The tutor is switched off or AI is disabled"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/tutor/courses/{course}/conversations": {
            "get": {
                "tags": [
                    "Tutor"
                ],
                "summary": "The learner's own conversations in a course",
                "operationId": "tutor.courses.by-course.conversations.get",
                "parameters": [
                    {
                        "name": "course",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Newest first",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiJson"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/tutor/conversations/{conversation}": {
            "get": {
                "tags": [
                    "Tutor"
                ],
                "summary": "One of the learner's conversations with its messages",
                "operationId": "tutor.conversations.by-conversation.get",
                "parameters": [
                    {
                        "name": "conversation",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Messages in order",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiJson"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not the learner's conversation"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Tutor"
                ],
                "summary": "Delete one of the learner's conversations",
                "operationId": "tutor.conversations.by-conversation.delete",
                "parameters": [
                    {
                        "name": "conversation",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Deleted",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiJson"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not the learner's conversation"
                    },
                    "409": {
                        "description": "An answer is still being written"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/tutor/courses/{course}/analytics": {
            "get": {
                "tags": [
                    "Tutor"
                ],
                "summary": "Anonymous tutor analytics for a course: questions, out-of-scope share and refusals during attempts",
                "operationId": "admin.tutor.courses.by-course.analytics.get",
                "parameters": [
                    {
                        "name": "course",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Counts only; `smallGroup` below the minimum group size. No transcripts, no names",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiJson"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Needs learner_insights_view or authorship of the course"
                    },
                    "404": {
                        "description": "Unknown course"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/video/states": {
            "get": {
                "tags": [
                    "Video"
                ],
                "summary": "List of processed videos",
                "operationId": "admin.video.states.get",
                "parameters": [
                    {
                        "name": "state",
                        "in": "query",
                        "description": "Video process state (error, finished, coding)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Processed videos with the state of their conversion to HLS",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "id": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "topic_id": {
                                                        "type": "integer",
                                                        "example": 12,
                                                        "nullable": true
                                                    },
                                                    "topic_title": {
                                                        "type": "string",
                                                        "nullable": true
                                                    },
                                                    "json": {
                                                        "description": "The topic json, with the ffmpeg state under `ffmpeg`",
                                                        "type": "object",
                                                        "nullable": true
                                                    },
                                                    "state": {
                                                        "type": "string",
                                                        "nullable": true,
                                                        "enum": [
                                                            "coding",
                                                            "finished",
                                                            "error"
                                                        ]
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Endpoint requires authentication"
                    },
                    "403": {
                        "description": "User doesn't have required access rights"
                    },
                    "500": {
                        "description": "Server-side error"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/vouchers": {
            "get": {
                "tags": [
                    "Admin Vouchers"
                ],
                "summary": "Get a listing of the Vouchers.",
                "description": "Get all Vouchers",
                "operationId": "admin.vouchers.get",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Pagination Page Number",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "default": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Pagination Per Page",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "default": 15
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Admin Vouchers"
                ],
                "summary": "Create Voucher",
                "description": "Create Voucher",
                "operationId": "admin.vouchers.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/Coupon"
                            }
                        },
                        "multipart/form-data": {
                            "schema": {
                                "$ref": "#/components/schemas/Coupon"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/vouchers/{id}": {
            "get": {
                "tags": [
                    "Admin Vouchers"
                ],
                "summary": "Read Voucher",
                "description": "Read Voucher",
                "operationId": "admin.vouchers.by-id.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of Voucher",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Admin Vouchers"
                ],
                "summary": "Delete Voucher",
                "description": "Delete Voucher",
                "operationId": "admin.vouchers.by-id.delete",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of Voucher",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "patch": {
                "tags": [
                    "Admin Vouchers"
                ],
                "summary": "Update Voucher",
                "description": "Update Voucher",
                "operationId": "admin.vouchers.by-id.patch",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of Voucher",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/Coupon"
                            }
                        },
                        "multipart/form-data": {
                            "schema": {
                                "$ref": "#/components/schemas/Coupon"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/cart/voucher": {
            "post": {
                "tags": [
                    "Cart",
                    "Vouchers"
                ],
                "summary": "Add Voucher Code to your Cart",
                "description": "Add Voucher Code to your Cart",
                "operationId": "cart.voucher.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "properties": {
                                    "code": {
                                        "type": "string"
                                    }
                                },
                                "type": "object"
                            }
                        },
                        "multipart/json": {
                            "schema": {
                                "properties": {
                                    "code": {
                                        "type": "string"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Cart",
                    "Vouchers"
                ],
                "summary": "Remove Voucher from your Cart",
                "description": "Remove Voucher from your Cart",
                "operationId": "cart.voucher.delete",
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/webhooks/events": {
            "get": {
                "tags": [
                    "Admin Webhooks"
                ],
                "summary": "Webhook event types (available and planned)",
                "description": "Outgoing webhooks (Phase 7.3). Admin only (`webhook_manage`); the data lives in the tenant's own\ndatabase, so an id from another tenant never resolves.",
                "operationId": "webhooks.events.list",
                "responses": {
                    "200": {
                        "description": "Event types",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/WebhookEventType"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Needs webhook_manage"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/webhooks/endpoints": {
            "get": {
                "tags": [
                    "Admin Webhooks"
                ],
                "summary": "List webhook endpoints",
                "operationId": "webhooks.endpoints.list",
                "responses": {
                    "200": {
                        "description": "Endpoints",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/WebhookEndpoint"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Needs webhook_manage"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Admin Webhooks"
                ],
                "summary": "Create a webhook endpoint (the signing secret is returned once)",
                "operationId": "webhooks.endpoints.create",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "required": [
                                    "url",
                                    "events"
                                ],
                                "properties": {
                                    "url": {
                                        "type": "string",
                                        "example": "https://example.com/hooks/ulams"
                                    },
                                    "description": {
                                        "type": "string",
                                        "nullable": true
                                    },
                                    "events": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        },
                                        "example": [
                                            "course.completed"
                                        ]
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/WebhookEndpoint"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Needs webhook_manage"
                    },
                    "422": {
                        "description": "Invalid events, a URL that is not https or points to a private address, or the endpoint limit"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/webhooks/endpoints/{endpoint}": {
            "get": {
                "tags": [
                    "Admin Webhooks"
                ],
                "summary": "One webhook endpoint",
                "operationId": "webhooks.endpoints.get",
                "parameters": [
                    {
                        "name": "endpoint",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Endpoint",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/WebhookEndpoint"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not found"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Admin Webhooks"
                ],
                "summary": "Change a webhook endpoint (URL, events, enabled)",
                "operationId": "webhooks.endpoints.update",
                "parameters": [
                    {
                        "name": "endpoint",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "url": {
                                        "type": "string"
                                    },
                                    "description": {
                                        "type": "string",
                                        "nullable": true
                                    },
                                    "events": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        }
                                    },
                                    "enabled": {
                                        "type": "boolean"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Updated",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/WebhookEndpoint"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not found"
                    },
                    "422": {
                        "description": "Invalid input"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Admin Webhooks"
                ],
                "summary": "Delete a webhook endpoint and its delivery log",
                "operationId": "webhooks.endpoints.delete",
                "parameters": [
                    {
                        "name": "endpoint",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Deleted",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not found"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/webhooks/endpoints/{endpoint}/rotate-secret": {
            "post": {
                "tags": [
                    "Admin Webhooks"
                ],
                "summary": "Replace the signing secret (returned once; the old one stops working at once)",
                "operationId": "webhooks.endpoints.rotate-secret",
                "parameters": [
                    {
                        "name": "endpoint",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Endpoint with the new secret",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/WebhookEndpoint"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not found"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/webhooks/endpoints/{endpoint}/test": {
            "post": {
                "tags": [
                    "Admin Webhooks"
                ],
                "summary": "Send a sample event once and return the result",
                "operationId": "webhooks.endpoints.test",
                "parameters": [
                    {
                        "name": "endpoint",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "properties": {
                                    "event_type": {
                                        "description": "A sample of this event type; default webhook.test",
                                        "type": "string",
                                        "example": "course.completed"
                                    }
                                },
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "The finished delivery",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/WebhookDelivery"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not found"
                    },
                    "429": {
                        "description": "Too many test sends"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/webhooks/deliveries": {
            "get": {
                "tags": [
                    "Admin Webhooks"
                ],
                "summary": "Delivery log (newest first)",
                "operationId": "webhooks.deliveries.list",
                "parameters": [
                    {
                        "name": "endpoint_id",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "pending",
                                "retrying",
                                "succeeded",
                                "failed",
                                "cancelled"
                            ]
                        }
                    },
                    {
                        "name": "event_type",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "maximum": 100
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Deliveries and pagination meta",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/WebhookDelivery"
                                            }
                                        },
                                        "meta": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/webhooks/deliveries/{delivery}": {
            "get": {
                "tags": [
                    "Admin Webhooks"
                ],
                "summary": "One delivery with its payload and every attempt",
                "operationId": "webhooks.deliveries.get",
                "parameters": [
                    {
                        "name": "delivery",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Delivery",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/WebhookDelivery"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not found"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/webhooks/deliveries/{delivery}/replay": {
            "post": {
                "tags": [
                    "Admin Webhooks"
                ],
                "summary": "Send a delivery again as a new delivery with the same event id",
                "operationId": "webhooks.deliveries.replay",
                "parameters": [
                    {
                        "name": "delivery",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "202": {
                        "description": "The new delivery, queued",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "$ref": "#/components/schemas/WebhookDelivery"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not found"
                    },
                    "429": {
                        "description": "Too many replays"
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/webinars/generate-jitsi/{id}": {
            "get": {
                "tags": [
                    "Webinars"
                ],
                "description": "Generate jitsi object for approved webinar",
                "operationId": "webinars.generate-jitsi.by-id.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/webinars": {
            "get": {
                "tags": [
                    "Webinars"
                ],
                "summary": "Get a listing of the Webinars.",
                "description": "Get all Webinars",
                "operationId": "webinars.get",
                "parameters": [
                    {
                        "name": "order_by",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "finished_at",
                                "started_at",
                                "created_at",
                                "name"
                            ]
                        }
                    },
                    {
                        "name": "order",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "ASC",
                                "DESC"
                            ]
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Pagination Page Number",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "default": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Pagination Per Page",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "default": 15
                        }
                    },
                    {
                        "name": "name",
                        "in": "query",
                        "description": "Webinar name %LIKE%",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "Webinar status == ",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "only_incoming",
                        "in": "query",
                        "description": "Get only incoming webinars",
                        "required": false,
                        "schema": {
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/webinars/{id}": {
            "get": {
                "tags": [
                    "Webinars"
                ],
                "summary": "Display the specified Webinar",
                "description": "Get Webinar",
                "operationId": "webinars.by-id.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of Webinar",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/webinars/me": {
            "get": {
                "tags": [
                    "Webinars"
                ],
                "summary": "Get a listing of the Webinars bought by user.",
                "description": "Get a listing of the Webinars bought by user",
                "operationId": "webinars.me.get",
                "parameters": [
                    {
                        "name": "order_by",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "finished_at",
                                "started_at",
                                "created_at",
                                "name"
                            ]
                        }
                    },
                    {
                        "name": "order",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "ASC",
                                "DESC"
                            ]
                        }
                    },
                    {
                        "name": "paginate",
                        "in": "query",
                        "description": "If true, list convert to paginate",
                        "required": false,
                        "schema": {
                            "type": "boolean",
                            "default": false
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Pagination Page Number",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "default": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Pagination Per Page",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "default": 15
                        }
                    },
                    {
                        "name": "name",
                        "in": "query",
                        "description": "Webinar name %LIKE%",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "Webinar status == ",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/webinars/start-live-stream/{id}": {
            "get": {
                "tags": [
                    "Webinars"
                ],
                "summary": "Start live stream in yt.",
                "description": "Start live stream in yt. Endpoint void",
                "operationId": "webinars.start-live-stream.by-id.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiJson"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/webinars": {
            "get": {
                "tags": [
                    "Admin Webinars"
                ],
                "operationId": "admin.webinars.get",
                "parameters": [
                    {
                        "name": "order_by",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "finished_at",
                                "started_at",
                                "created_at",
                                "name"
                            ]
                        }
                    },
                    {
                        "name": "order",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "ASC",
                                "DESC"
                            ]
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Pagination Page Number",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "default": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Pagination Per Page",
                        "required": false,
                        "schema": {
                            "type": "number",
                            "default": 15
                        }
                    },
                    {
                        "name": "name",
                        "in": "query",
                        "description": "Webinar name %LIKE%",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "description": "Webinar status == ",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "tags": [
                    "Admin Webinars"
                ],
                "summary": "Store a newly created Webinar in storage",
                "description": "Store Webinar",
                "operationId": "admin.webinars.post",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/Webinar"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/webinars/{id}": {
            "get": {
                "tags": [
                    "Admin Webinars"
                ],
                "summary": "Display the specified Webinar",
                "description": "Get Webinars",
                "operationId": "admin.webinars.by-id.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of Webinar",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Admin Webinars"
                ],
                "summary": "Update the specified Webinar in storage",
                "description": "Update Webinar",
                "operationId": "admin.webinars.by-id.put",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of Webinar",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/Webinar"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Admin Webinars"
                ],
                "summary": "Remove the specified Webinar from storage",
                "description": "Delete Webinar",
                "operationId": "admin.webinars.by-id.delete",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of Webinar",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/webinars/users/assignable": {
            "get": {
                "tags": [
                    "Admin Webinars"
                ],
                "description": "Get users assignable to webinars",
                "operationId": "admin.webinars.users.assignable.get",
                "parameters": [
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        },
        "/api/admin/webinars/{id}/users": {
            "get": {
                "tags": [
                    "Admin Webinars"
                ],
                "description": "Get webinars users",
                "operationId": "admin.webinars.by-id.users.get",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "id of Webinar",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiEnvelope"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {}
                        }
                    }
                },
                "security": [
                    {
                        "passport": []
                    }
                ]
            }
        }
    },
    "components": {
        "schemas": {
            "ApiEnvelope": {
                "description": "Every JSON answer of the API: success flag and a message; the payload is `data` (and `meta` for pages).",
                "required": [
                    "success"
                ],
                "properties": {
                    "success": {
                        "description": "Response schemas of the operations the CLI generates noun commands for (plan docs/plans/cli.md 6.7, S5).\nEvery JSON answer is the envelope `ApiEnvelope` plus `data` (and `meta` for a page); the `*Response`\nschemas combine it with the resource the controller returns. Generated by hand from the controllers and\ntheir Resource classes: when a resource changes, change its schema here.",
                        "type": "boolean"
                    },
                    "message": {
                        "type": "string"
                    },
                    "data": {
                        "description": "The payload: an object, a list or a scalar, depending on the operation (typed in the operations that have a resource schema)"
                    },
                    "meta": {
                        "$ref": "#/components/schemas/ApiPage"
                    }
                },
                "type": "object"
            },
            "ApiJson": {
                "description": "A JSON answer whose body is not described yet (it does not follow the ApiEnvelope, or the controller builds it by hand). Replace with a precise schema when the endpoint gets one.",
                "type": "object",
                "additionalProperties": true
            },
            "ApiPage": {
                "description": "Pagination meta of a page of results. Controllers that build it by hand send only current_page, last_page and total.",
                "properties": {
                    "current_page": {
                        "type": "integer"
                    },
                    "last_page": {
                        "type": "integer"
                    },
                    "per_page": {
                        "type": "integer"
                    },
                    "total": {
                        "type": "integer"
                    },
                    "from": {
                        "type": "integer",
                        "nullable": true
                    },
                    "to": {
                        "type": "integer",
                        "nullable": true
                    },
                    "path": {
                        "type": "string"
                    },
                    "first_page_url": {
                        "type": "string"
                    },
                    "last_page_url": {
                        "type": "string"
                    },
                    "next_page_url": {
                        "type": "string",
                        "nullable": true
                    },
                    "prev_page_url": {
                        "type": "string",
                        "nullable": true
                    }
                },
                "type": "object"
            },
            "TemplateData": {
                "description": "TemplateResource",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "event": {
                        "type": "string"
                    },
                    "channel": {
                        "type": "string"
                    },
                    "default": {
                        "type": "boolean"
                    },
                    "sections": {
                        "type": "object",
                        "additionalProperties": true
                    },
                    "variable_class": {
                        "type": "string"
                    },
                    "assignable_class": {
                        "type": "string",
                        "nullable": true
                    },
                    "is_assignable": {
                        "type": "boolean"
                    },
                    "assignables": {
                        "type": "array",
                        "items": {
                            "type": "object"
                        }
                    },
                    "created_at": {
                        "type": "string"
                    },
                    "updated_at": {
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "TemplateRecord": {
                "description": "A template as stored (the update answer is the model, more attributes may follow)",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "event": {
                        "type": "string"
                    },
                    "channel": {
                        "type": "string"
                    },
                    "created_at": {
                        "type": "string"
                    },
                    "updated_at": {
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "PageData": {
                "description": "PageResource",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "title": {
                        "type": "string"
                    },
                    "slug": {
                        "type": "string"
                    },
                    "author_id": {
                        "type": "integer"
                    },
                    "content": {
                        "type": "string"
                    },
                    "active": {
                        "type": "boolean"
                    }
                },
                "type": "object"
            },
            "RoleData": {
                "description": "RoleResource",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "guard_name": {
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "PermissionData": {
                "description": "PermissionResource",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "guard_name": {
                        "type": "string"
                    },
                    "assigned": {
                        "type": "boolean"
                    }
                },
                "type": "object"
            },
            "ModelFieldMetadata": {
                "description": "MetadataResource",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "type": {
                        "type": "string"
                    },
                    "rules": {
                        "type": "object",
                        "additionalProperties": true
                    },
                    "extra": {
                        "type": "object",
                        "additionalProperties": true
                    },
                    "default": {
                        "type": "string",
                        "nullable": true
                    },
                    "class_type": {
                        "type": "string"
                    },
                    "created_at": {
                        "type": "string"
                    },
                    "updated_at": {
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "UserSubmissionData": {
                "description": "UserSubmissionResource",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "email": {
                        "type": "string"
                    },
                    "status": {
                        "type": "string"
                    },
                    "morphable_id": {
                        "type": "integer"
                    },
                    "morphable_type": {
                        "type": "string"
                    },
                    "created_at": {
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "Cmi5AuData": {
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "iri": {
                        "type": "string"
                    },
                    "title": {
                        "type": "string"
                    },
                    "url": {
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "Cmi5Data": {
                "description": "Cmi5Resource",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "iri": {
                        "type": "string"
                    },
                    "title": {
                        "type": "string"
                    },
                    "au": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Cmi5AuData"
                        }
                    }
                },
                "type": "object"
            },
            "LrsStatementData": {
                "description": "A stored xAPI statement; `data` is the statement itself.",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "uuid": {
                        "type": "string"
                    },
                    "data": {
                        "type": "object",
                        "additionalProperties": true
                    },
                    "voided": {
                        "type": "boolean"
                    },
                    "owner_id": {
                        "type": "integer",
                        "nullable": true
                    },
                    "entity_id": {
                        "type": "integer",
                        "nullable": true
                    },
                    "client_id": {
                        "type": "integer",
                        "nullable": true
                    },
                    "access_id": {
                        "type": "integer",
                        "nullable": true
                    },
                    "pending": {
                        "type": "boolean"
                    },
                    "validation": {
                        "type": "object",
                        "additionalProperties": true
                    }
                },
                "type": "object"
            },
            "ScormPackageData": {
                "description": "A SCORM package row (more attributes may follow)",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "version": {
                        "type": "string",
                        "nullable": true
                    },
                    "hash_name": {
                        "type": "string",
                        "nullable": true
                    },
                    "origin_file": {
                        "type": "string",
                        "nullable": true
                    },
                    "origin_file_mime": {
                        "type": "string",
                        "nullable": true
                    },
                    "ratio": {
                        "type": "number",
                        "nullable": true
                    },
                    "uuid": {
                        "type": "string",
                        "nullable": true
                    },
                    "user_id": {
                        "type": "integer",
                        "nullable": true
                    },
                    "source_format": {
                        "type": "string",
                        "nullable": true
                    }
                },
                "type": "object"
            },
            "ScormScoData": {
                "description": "A SCO of a package",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "scorm_id": {
                        "type": "integer",
                        "nullable": true
                    },
                    "uuid": {
                        "type": "string",
                        "nullable": true
                    },
                    "entry_url": {
                        "type": "string",
                        "nullable": true
                    },
                    "identifier": {
                        "type": "string",
                        "nullable": true
                    },
                    "title": {
                        "type": "string",
                        "nullable": true
                    },
                    "sco_parameters": {
                        "type": "string",
                        "nullable": true
                    }
                },
                "type": "object"
            },
            "ScormPackagePage": {
                "description": "A page of packages (the laravel paginator); with per_page=0 only `data` is present",
                "required": [
                    "data"
                ],
                "properties": {
                    "data": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/ScormPackageData"
                        }
                    },
                    "current_page": {
                        "type": "integer"
                    },
                    "last_page": {
                        "type": "integer"
                    },
                    "per_page": {
                        "type": "integer"
                    },
                    "total": {
                        "type": "integer"
                    }
                },
                "type": "object"
            },
            "ScormUploadData": {
                "description": "The parsed manifest (`version`, `hashName`, `name`, `type`, `scos`) and the saved package",
                "properties": {
                    "scormData": {
                        "type": "object",
                        "additionalProperties": true
                    },
                    "model": {
                        "nullable": true,
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/ScormPackageData"
                            }
                        ]
                    }
                },
                "type": "object"
            },
            "ScormParseData": {
                "description": "The manifest of the archive; nothing is saved",
                "properties": {
                    "version": {
                        "type": "string"
                    },
                    "scos": {
                        "type": "array",
                        "items": {
                            "type": "object"
                        }
                    }
                },
                "type": "object"
            },
            "AdaptSourceData": {
                "description": "status: draft, building, built or failed",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "title": {
                        "type": "string"
                    },
                    "current_version": {
                        "type": "integer"
                    },
                    "status": {
                        "type": "string"
                    },
                    "built_version": {
                        "type": "integer",
                        "nullable": true
                    },
                    "scorm_id": {
                        "type": "integer",
                        "nullable": true
                    },
                    "last_error": {
                        "type": "string",
                        "nullable": true
                    },
                    "author_id": {
                        "type": "integer",
                        "nullable": true
                    },
                    "created_at": {
                        "type": "string"
                    },
                    "updated_at": {
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "AdaptVersionSummary": {
                "properties": {
                    "version": {
                        "type": "integer"
                    },
                    "change_note": {
                        "type": "string",
                        "nullable": true
                    },
                    "author_id": {
                        "type": "integer",
                        "nullable": true
                    },
                    "created_at": {
                        "type": "string",
                        "nullable": true
                    }
                },
                "type": "object"
            },
            "InteractivePackageData": {
                "description": "InteractivePackageResource",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "title": {
                        "type": "string"
                    },
                    "current_version": {
                        "type": "integer"
                    },
                    "versions_count": {
                        "type": "integer"
                    },
                    "topics_count": {
                        "type": "integer"
                    },
                    "licence": {
                        "type": "string",
                        "nullable": true
                    },
                    "author_id": {
                        "type": "integer",
                        "nullable": true
                    },
                    "updated_at": {
                        "type": "string",
                        "nullable": true
                    }
                },
                "type": "object"
            },
            "InteractivePackageDetail": {
                "description": "The package with its current manifest; `files` maps a file path to its size in bytes",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "title": {
                        "type": "string"
                    },
                    "current_version": {
                        "type": "integer"
                    },
                    "versions_count": {
                        "type": "integer"
                    },
                    "topics_count": {
                        "type": "integer"
                    },
                    "licence": {
                        "type": "string",
                        "nullable": true
                    },
                    "author_id": {
                        "type": "integer",
                        "nullable": true
                    },
                    "updated_at": {
                        "type": "string",
                        "nullable": true
                    },
                    "manifest": {
                        "type": "object",
                        "additionalProperties": true
                    },
                    "network": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "network_allowed": {
                        "type": "boolean"
                    },
                    "files": {
                        "type": "object",
                        "additionalProperties": {
                            "type": "integer"
                        }
                    }
                },
                "type": "object"
            },
            "InteractiveVersionSummary": {
                "properties": {
                    "version": {
                        "type": "integer"
                    },
                    "manifest_version": {
                        "type": "string",
                        "nullable": true
                    },
                    "licence": {
                        "type": "string",
                        "nullable": true
                    },
                    "change_note": {
                        "type": "string",
                        "nullable": true
                    },
                    "author_id": {
                        "type": "integer",
                        "nullable": true
                    },
                    "files": {
                        "type": "integer"
                    },
                    "total_bytes": {
                        "type": "integer",
                        "nullable": true
                    },
                    "steps": {
                        "type": "integer"
                    },
                    "network": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "created_at": {
                        "type": "string",
                        "nullable": true
                    }
                },
                "type": "object"
            },
            "InteractivePreviewData": {
                "properties": {
                    "url": {
                        "type": "string"
                    },
                    "nonce": {
                        "type": "string"
                    },
                    "version": {
                        "type": "integer"
                    },
                    "manifest": {
                        "type": "object",
                        "additionalProperties": true
                    }
                },
                "type": "object"
            },
            "LiaScriptDocumentListItem": {
                "description": "A document row with its version count",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "title": {
                        "type": "string"
                    },
                    "current_version": {
                        "type": "integer"
                    },
                    "versions_count": {
                        "type": "integer"
                    },
                    "author_id": {
                        "type": "integer",
                        "nullable": true
                    },
                    "created_at": {
                        "type": "string"
                    },
                    "updated_at": {
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "LiaScriptDocumentData": {
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "title": {
                        "type": "string"
                    },
                    "current_version": {
                        "type": "integer"
                    },
                    "versions_count": {
                        "type": "integer"
                    },
                    "assets": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "warnings": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "author_id": {
                        "type": "integer",
                        "nullable": true
                    },
                    "updated_at": {
                        "type": "string",
                        "nullable": true
                    }
                },
                "type": "object"
            },
            "LiaScriptVersionSummary": {
                "properties": {
                    "version": {
                        "type": "integer"
                    },
                    "change_note": {
                        "type": "string",
                        "nullable": true
                    },
                    "author_id": {
                        "type": "integer",
                        "nullable": true
                    },
                    "restored_from": {
                        "type": "integer",
                        "nullable": true
                    },
                    "size": {
                        "type": "integer"
                    },
                    "assets": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "created_at": {
                        "type": "string",
                        "nullable": true
                    }
                },
                "type": "object"
            },
            "LiaScriptPreviewData": {
                "properties": {
                    "url": {
                        "type": "string"
                    },
                    "sections": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "warnings": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                },
                "type": "object"
            },
            "TemplateResponse": {
                "type": "object",
                "allOf": [
                    {
                        "$ref": "#/components/schemas/ApiEnvelope"
                    },
                    {
                        "properties": {
                            "data": {
                                "$ref": "#/components/schemas/TemplateData"
                            }
                        },
                        "type": "object"
                    }
                ]
            },
            "TemplateRecordResponse": {
                "type": "object",
                "allOf": [
                    {
                        "$ref": "#/components/schemas/ApiEnvelope"
                    },
                    {
                        "properties": {
                            "data": {
                                "$ref": "#/components/schemas/TemplateRecord"
                            }
                        },
                        "type": "object"
                    }
                ]
            },
            "TemplateListResponse": {
                "type": "object",
                "allOf": [
                    {
                        "$ref": "#/components/schemas/ApiEnvelope"
                    },
                    {
                        "properties": {
                            "data": {
                                "type": "array",
                                "items": {
                                    "$ref": "#/components/schemas/TemplateData"
                                }
                            }
                        },
                        "type": "object"
                    }
                ]
            },
            "TemplateVariablesResponse": {
                "type": "object",
                "allOf": [
                    {
                        "$ref": "#/components/schemas/ApiEnvelope"
                    },
                    {
                        "properties": {
                            "data": {
                                "description": "Map of event class to channels with their sections and required variables",
                                "type": "object",
                                "additionalProperties": true
                            }
                        },
                        "type": "object"
                    }
                ]
            },
            "TemplatePreviewResponse": {
                "type": "object",
                "allOf": [
                    {
                        "$ref": "#/components/schemas/ApiEnvelope"
                    },
                    {
                        "properties": {
                            "data": {
                                "description": "The rendered sections of the template and whether the preview was sent",
                                "type": "object",
                                "additionalProperties": true
                            }
                        },
                        "type": "object"
                    }
                ]
            },
            "ApiBooleanResponse": {
                "type": "object",
                "allOf": [
                    {
                        "$ref": "#/components/schemas/ApiEnvelope"
                    },
                    {
                        "properties": {
                            "data": {
                                "type": "boolean",
                                "example": true
                            }
                        },
                        "type": "object"
                    }
                ]
            },
            "PageResponse": {
                "type": "object",
                "allOf": [
                    {
                        "$ref": "#/components/schemas/ApiEnvelope"
                    },
                    {
                        "properties": {
                            "data": {
                                "$ref": "#/components/schemas/PageData"
                            }
                        },
                        "type": "object"
                    }
                ]
            },
            "RoleResponse": {
                "type": "object",
                "allOf": [
                    {
                        "$ref": "#/components/schemas/ApiEnvelope"
                    },
                    {
                        "properties": {
                            "data": {
                                "$ref": "#/components/schemas/RoleData"
                            }
                        },
                        "type": "object"
                    }
                ]
            },
            "PermissionListResponse": {
                "type": "object",
                "allOf": [
                    {
                        "$ref": "#/components/schemas/ApiEnvelope"
                    },
                    {
                        "properties": {
                            "data": {
                                "type": "array",
                                "items": {
                                    "$ref": "#/components/schemas/PermissionData"
                                }
                            }
                        },
                        "type": "object"
                    }
                ]
            },
            "ModelFieldMetadataResponse": {
                "type": "object",
                "allOf": [
                    {
                        "$ref": "#/components/schemas/ApiEnvelope"
                    },
                    {
                        "properties": {
                            "data": {
                                "$ref": "#/components/schemas/ModelFieldMetadata"
                            }
                        },
                        "type": "object"
                    }
                ]
            },
            "UserSubmissionPageResponse": {
                "type": "object",
                "allOf": [
                    {
                        "$ref": "#/components/schemas/ApiEnvelope"
                    },
                    {
                        "properties": {
                            "data": {
                                "type": "array",
                                "items": {
                                    "$ref": "#/components/schemas/UserSubmissionData"
                                }
                            },
                            "meta": {
                                "$ref": "#/components/schemas/ApiPage"
                            }
                        },
                        "type": "object"
                    }
                ]
            },
            "UserSubmissionResponse": {
                "type": "object",
                "allOf": [
                    {
                        "$ref": "#/components/schemas/ApiEnvelope"
                    },
                    {
                        "properties": {
                            "data": {
                                "$ref": "#/components/schemas/UserSubmissionData"
                            }
                        },
                        "type": "object"
                    }
                ]
            },
            "Cmi5Response": {
                "type": "object",
                "allOf": [
                    {
                        "$ref": "#/components/schemas/ApiEnvelope"
                    },
                    {
                        "properties": {
                            "data": {
                                "$ref": "#/components/schemas/Cmi5Data"
                            }
                        },
                        "type": "object"
                    }
                ]
            },
            "Cmi5PageResponse": {
                "type": "object",
                "allOf": [
                    {
                        "$ref": "#/components/schemas/ApiEnvelope"
                    },
                    {
                        "properties": {
                            "data": {
                                "type": "array",
                                "items": {
                                    "$ref": "#/components/schemas/Cmi5Data"
                                }
                            },
                            "meta": {
                                "$ref": "#/components/schemas/ApiPage"
                            }
                        },
                        "type": "object"
                    }
                ]
            },
            "LrsStatementPageResponse": {
                "type": "object",
                "allOf": [
                    {
                        "$ref": "#/components/schemas/ApiEnvelope"
                    },
                    {
                        "properties": {
                            "data": {
                                "type": "array",
                                "items": {
                                    "$ref": "#/components/schemas/LrsStatementData"
                                }
                            },
                            "meta": {
                                "$ref": "#/components/schemas/ApiPage"
                            }
                        },
                        "type": "object"
                    }
                ]
            },
            "ScormPackagePageResponse": {
                "type": "object",
                "allOf": [
                    {
                        "$ref": "#/components/schemas/ApiEnvelope"
                    },
                    {
                        "properties": {
                            "data": {
                                "$ref": "#/components/schemas/ScormPackagePage"
                            }
                        },
                        "type": "object"
                    }
                ]
            },
            "ScormScoListResponse": {
                "type": "object",
                "allOf": [
                    {
                        "$ref": "#/components/schemas/ApiEnvelope"
                    },
                    {
                        "properties": {
                            "data": {
                                "type": "array",
                                "items": {
                                    "$ref": "#/components/schemas/ScormScoData"
                                }
                            }
                        },
                        "type": "object"
                    }
                ]
            },
            "ScormUploadResponse": {
                "type": "object",
                "allOf": [
                    {
                        "$ref": "#/components/schemas/ApiEnvelope"
                    },
                    {
                        "properties": {
                            "data": {
                                "$ref": "#/components/schemas/ScormUploadData"
                            }
                        },
                        "type": "object"
                    }
                ]
            },
            "ScormParseResponse": {
                "type": "object",
                "allOf": [
                    {
                        "$ref": "#/components/schemas/ApiEnvelope"
                    },
                    {
                        "properties": {
                            "data": {
                                "$ref": "#/components/schemas/ScormParseData"
                            }
                        },
                        "type": "object"
                    }
                ]
            },
            "AdaptSourceResponse": {
                "type": "object",
                "allOf": [
                    {
                        "$ref": "#/components/schemas/ApiEnvelope"
                    },
                    {
                        "properties": {
                            "data": {
                                "$ref": "#/components/schemas/AdaptSourceData"
                            }
                        },
                        "type": "object"
                    }
                ]
            },
            "AdaptSourceListResponse": {
                "type": "object",
                "allOf": [
                    {
                        "$ref": "#/components/schemas/ApiEnvelope"
                    },
                    {
                        "properties": {
                            "data": {
                                "type": "array",
                                "items": {
                                    "$ref": "#/components/schemas/AdaptSourceData"
                                }
                            }
                        },
                        "type": "object"
                    }
                ]
            },
            "AdaptVersionListResponse": {
                "type": "object",
                "allOf": [
                    {
                        "$ref": "#/components/schemas/ApiEnvelope"
                    },
                    {
                        "properties": {
                            "data": {
                                "type": "array",
                                "items": {
                                    "$ref": "#/components/schemas/AdaptVersionSummary"
                                }
                            }
                        },
                        "type": "object"
                    }
                ]
            },
            "InteractivePackagePageResponse": {
                "type": "object",
                "allOf": [
                    {
                        "$ref": "#/components/schemas/ApiEnvelope"
                    },
                    {
                        "properties": {
                            "data": {
                                "type": "array",
                                "items": {
                                    "$ref": "#/components/schemas/InteractivePackageData"
                                }
                            },
                            "meta": {
                                "$ref": "#/components/schemas/ApiPage"
                            }
                        },
                        "type": "object"
                    }
                ]
            },
            "InteractivePackageDetailResponse": {
                "type": "object",
                "allOf": [
                    {
                        "$ref": "#/components/schemas/ApiEnvelope"
                    },
                    {
                        "properties": {
                            "data": {
                                "$ref": "#/components/schemas/InteractivePackageDetail"
                            }
                        },
                        "type": "object"
                    }
                ]
            },
            "InteractiveVersionListResponse": {
                "type": "object",
                "allOf": [
                    {
                        "$ref": "#/components/schemas/ApiEnvelope"
                    },
                    {
                        "properties": {
                            "data": {
                                "type": "array",
                                "items": {
                                    "$ref": "#/components/schemas/InteractiveVersionSummary"
                                }
                            }
                        },
                        "type": "object"
                    }
                ]
            },
            "InteractivePreviewResponse": {
                "type": "object",
                "allOf": [
                    {
                        "$ref": "#/components/schemas/ApiEnvelope"
                    },
                    {
                        "properties": {
                            "data": {
                                "$ref": "#/components/schemas/InteractivePreviewData"
                            }
                        },
                        "type": "object"
                    }
                ]
            },
            "LiaScriptDocumentPageResponse": {
                "type": "object",
                "allOf": [
                    {
                        "$ref": "#/components/schemas/ApiEnvelope"
                    },
                    {
                        "properties": {
                            "data": {
                                "type": "array",
                                "items": {
                                    "$ref": "#/components/schemas/LiaScriptDocumentListItem"
                                }
                            },
                            "meta": {
                                "$ref": "#/components/schemas/ApiPage"
                            }
                        },
                        "type": "object"
                    }
                ]
            },
            "LiaScriptDocumentResponse": {
                "type": "object",
                "allOf": [
                    {
                        "$ref": "#/components/schemas/ApiEnvelope"
                    },
                    {
                        "properties": {
                            "data": {
                                "$ref": "#/components/schemas/LiaScriptDocumentData"
                            }
                        },
                        "type": "object"
                    }
                ]
            },
            "LiaScriptVersionListResponse": {
                "type": "object",
                "allOf": [
                    {
                        "$ref": "#/components/schemas/ApiEnvelope"
                    },
                    {
                        "properties": {
                            "data": {
                                "type": "array",
                                "items": {
                                    "$ref": "#/components/schemas/LiaScriptVersionSummary"
                                }
                            }
                        },
                        "type": "object"
                    }
                ]
            },
            "LiaScriptPreviewResponse": {
                "type": "object",
                "allOf": [
                    {
                        "$ref": "#/components/schemas/ApiEnvelope"
                    },
                    {
                        "properties": {
                            "data": {
                                "$ref": "#/components/schemas/LiaScriptPreviewData"
                            }
                        },
                        "type": "object"
                    }
                ]
            },
            "UserSubmission": {
                "properties": {
                    "id": {
                        "description": "user submission id",
                        "type": "integer"
                    },
                    "email": {
                        "description": "user email",
                        "type": "string"
                    },
                    "status": {
                        "description": "status",
                        "type": "string"
                    },
                    "morphable_id": {
                        "description": "morph id",
                        "type": "integer"
                    },
                    "morphable_type": {
                        "description": "morph type",
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "UserAvatar": {
                "properties": {
                    "avatar": {
                        "description": "avatar",
                        "type": "file",
                        "format": "binary"
                    }
                },
                "type": "object"
            },
            "DeviceCodeResponse": {
                "required": [
                    "device_code",
                    "user_code",
                    "verification_uri",
                    "verification_uri_complete",
                    "expires_in",
                    "interval"
                ],
                "properties": {
                    "device_code": {
                        "description": "Secret of the polling client; never shown to the user",
                        "type": "string"
                    },
                    "user_code": {
                        "type": "string",
                        "example": "BDWP-HQPK"
                    },
                    "verification_uri": {
                        "type": "string",
                        "example": "https://coffee.app.ulams.app/cli/authorize"
                    },
                    "verification_uri_complete": {
                        "type": "string",
                        "example": "https://coffee.app.ulams.app/cli/authorize?code=BDWP-HQPK"
                    },
                    "expires_in": {
                        "type": "integer",
                        "example": 600
                    },
                    "interval": {
                        "type": "integer",
                        "example": 5
                    }
                },
                "type": "object"
            },
            "DeviceTokenResponse": {
                "required": [
                    "access_token",
                    "token_type",
                    "scopes",
                    "token_id"
                ],
                "properties": {
                    "access_token": {
                        "description": "ulams_pat_... shown once",
                        "type": "string"
                    },
                    "token_type": {
                        "type": "string",
                        "example": "Bearer"
                    },
                    "expires_at": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                    },
                    "scopes": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "token_id": {
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "DeviceError": {
                "required": [
                    "error"
                ],
                "properties": {
                    "error": {
                        "type": "string",
                        "enum": [
                            "authorization_pending",
                            "slow_down",
                            "access_denied",
                            "expired_token",
                            "invalid_scope"
                        ]
                    },
                    "error_description": {
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "DeviceRequest": {
                "properties": {
                    "user_code": {
                        "type": "string"
                    },
                    "client_name": {
                        "type": "string"
                    },
                    "agent_name": {
                        "type": "string",
                        "nullable": true
                    },
                    "requested_scopes": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "ip": {
                        "type": "string",
                        "nullable": true
                    },
                    "user_agent": {
                        "type": "string",
                        "nullable": true
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "expires_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "expires_in": {
                        "type": "integer"
                    },
                    "expiry_options_days": {
                        "type": "array",
                        "items": {
                            "type": "integer"
                        }
                    },
                    "default_expires_in_days": {
                        "type": "integer"
                    },
                    "max_expires_in_days": {
                        "type": "integer"
                    }
                },
                "type": "object"
            },
            "ApiToken": {
                "required": [
                    "id",
                    "name",
                    "scopes",
                    "kind",
                    "expires_at",
                    "revoked"
                ],
                "properties": {
                    "id": {
                        "description": "Reusable OpenAPI schemas of the scoped token endpoints (ADR 0074).",
                        "type": "string"
                    },
                    "name": {
                        "type": "string"
                    },
                    "scopes": {
                        "type": "array",
                        "items": {
                            "type": "string",
                            "example": "courses:write"
                        }
                    },
                    "kind": {
                        "type": "string",
                        "enum": [
                            "cli",
                            "agent",
                            "ci",
                            "integration",
                            "scim"
                        ]
                    },
                    "agent_name": {
                        "type": "string",
                        "nullable": true
                    },
                    "created_via": {
                        "type": "string",
                        "enum": [
                            "admin",
                            "cli",
                            "device"
                        ]
                    },
                    "rate_limit_per_minute": {
                        "type": "integer",
                        "nullable": true
                    },
                    "user_id": {
                        "type": "integer",
                        "nullable": true
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "expires_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "last_used_at": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                    },
                    "last_used_ip": {
                        "type": "string",
                        "nullable": true
                    },
                    "resource_ids": {
                        "description": "The resources (saved report ids) the token is limited to; null: not limited",
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "nullable": true
                    },
                    "revoked": {
                        "type": "boolean"
                    }
                },
                "type": "object"
            },
            "ApiTokenCreated": {
                "type": "object",
                "allOf": [
                    {
                        "$ref": "#/components/schemas/ApiToken"
                    },
                    {
                        "properties": {
                            "token": {
                                "description": "The secret, prefixed ulams_pat_. Shown once.",
                                "type": "string",
                                "example": "ulams_pat_eyJ0eXAi..."
                            }
                        },
                        "type": "object"
                    }
                ]
            },
            "ApiTokenUsage": {
                "properties": {
                    "token_id": {
                        "type": "string"
                    },
                    "days": {
                        "type": "integer"
                    },
                    "from": {
                        "type": "string",
                        "format": "date"
                    },
                    "to": {
                        "type": "string",
                        "format": "date"
                    },
                    "rate_limit_per_minute": {
                        "type": "integer",
                        "nullable": true
                    },
                    "window": {
                        "description": "The current one-minute window; null when the token has no limit",
                        "properties": {
                            "limit": {
                                "type": "integer"
                            },
                            "used": {
                                "type": "integer"
                            },
                            "remaining": {
                                "type": "integer"
                            },
                            "resets_in_seconds": {
                                "type": "integer"
                            }
                        },
                        "type": "object",
                        "nullable": true
                    },
                    "last_used_at": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                    },
                    "totals": {
                        "properties": {
                            "requests": {
                                "type": "integer"
                            },
                            "errors": {
                                "description": "4xx and 5xx answers except 429",
                                "type": "integer"
                            },
                            "rate_limited": {
                                "type": "integer"
                            }
                        },
                        "type": "object"
                    },
                    "daily": {
                        "type": "array",
                        "items": {
                            "properties": {
                                "date": {
                                    "type": "string",
                                    "format": "date"
                                },
                                "requests": {
                                    "type": "integer"
                                },
                                "errors": {
                                    "type": "integer"
                                },
                                "rate_limited": {
                                    "type": "integer"
                                }
                            },
                            "type": "object"
                        }
                    }
                },
                "type": "object"
            },
            "ApiTokenList": {
                "properties": {
                    "success": {
                        "type": "boolean"
                    },
                    "message": {
                        "type": "string"
                    },
                    "data": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/ApiToken"
                        }
                    },
                    "meta": {
                        "type": "object"
                    }
                },
                "type": "object"
            },
            "AgentAuditEntry": {
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "token_id": {
                        "type": "string",
                        "nullable": true
                    },
                    "user_id": {
                        "type": "integer",
                        "nullable": true
                    },
                    "agent_name": {
                        "type": "string",
                        "nullable": true
                    },
                    "client": {
                        "type": "string",
                        "nullable": true
                    },
                    "user_agent": {
                        "type": "string",
                        "nullable": true
                    },
                    "method": {
                        "type": "string"
                    },
                    "route_name": {
                        "type": "string",
                        "nullable": true
                    },
                    "path": {
                        "type": "string"
                    },
                    "route_params": {
                        "type": "object",
                        "nullable": true
                    },
                    "status": {
                        "type": "integer"
                    },
                    "dry_run": {
                        "type": "boolean"
                    },
                    "idempotency_key": {
                        "type": "string",
                        "nullable": true
                    },
                    "request_id": {
                        "type": "string",
                        "nullable": true
                    },
                    "duration_ms": {
                        "type": "integer",
                        "nullable": true
                    },
                    "ip": {
                        "type": "string",
                        "nullable": true
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    }
                },
                "type": "object"
            },
            "AgentAuditList": {
                "properties": {
                    "success": {
                        "type": "boolean"
                    },
                    "message": {
                        "type": "string"
                    },
                    "data": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/AgentAuditEntry"
                        }
                    },
                    "meta": {
                        "type": "object"
                    }
                },
                "type": "object"
            },
            "ScopeError": {
                "properties": {
                    "success": {
                        "type": "boolean",
                        "example": false
                    },
                    "message": {
                        "type": "string"
                    },
                    "error": {
                        "type": "string",
                        "enum": [
                            "scope_missing",
                            "scope_forbidden",
                            "scope_unmapped",
                            "rate_limited"
                        ]
                    },
                    "required": {
                        "type": "array",
                        "items": {
                            "type": "string",
                            "example": "courses:write"
                        }
                    }
                },
                "type": "object"
            },
            "Group": {
                "title": "Group",
                "description": "Group model",
                "required": [],
                "properties": {
                    "id": {
                        "type": "integer",
                        "format": "int64"
                    },
                    "name": {
                        "type": "string"
                    },
                    "parent_id": {
                        "type": "integer",
                        "format": "int64"
                    },
                    "registerable": {
                        "type": "boolean"
                    },
                    "users": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/User"
                        }
                    }
                },
                "type": "object",
                "xml": {
                    "name": "Group"
                }
            },
            "User": {
                "title": "User",
                "description": "User model",
                "required": [],
                "properties": {
                    "id": {
                        "type": "integer",
                        "format": "int64"
                    },
                    "email": {
                        "type": "string"
                    }
                },
                "type": "object",
                "xml": {
                    "name": "User"
                }
            },
            "AdminBookmarkCreateRequest": {
                "required": [
                    "bookmarkable_id",
                    "bookmarkable_type"
                ],
                "properties": {
                    "value": {
                        "description": "value",
                        "type": "string"
                    },
                    "bookmarkable_id": {
                        "description": "bookmarkable_id",
                        "type": "integer"
                    },
                    "bookmarkable_type": {
                        "description": "bookmarkable_type",
                        "type": "string"
                    },
                    "user_id": {
                        "description": "user_id",
                        "type": "integer"
                    }
                },
                "type": "object"
            },
            "BookmarkCreateRequest": {
                "required": [
                    "bookmarkable_id",
                    "bookmarkable_type"
                ],
                "properties": {
                    "value": {
                        "description": "value",
                        "type": "string"
                    },
                    "bookmarkable_id": {
                        "description": "bookmarkable_id",
                        "type": "integer"
                    },
                    "bookmarkable_type": {
                        "description": "bookmarkable_type",
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "BookmarkResource": {
                "required": [
                    "value",
                    "bookmarkable_id",
                    "bookmarkable_type",
                    "user"
                ],
                "properties": {
                    "value": {
                        "description": "value",
                        "type": "string"
                    },
                    "bookmarkable_id": {
                        "description": "bookmarkable_id",
                        "type": "integer"
                    },
                    "bookmarkable_type": {
                        "description": "bookmarkable_type",
                        "type": "string"
                    },
                    "user": {
                        "$ref": "#/components/schemas/UserBookmarkResource"
                    }
                },
                "type": "object"
            },
            "UserBookmarkResource": {
                "required": [
                    "id",
                    "first_name",
                    "last_name"
                ],
                "properties": {
                    "id": {
                        "description": "id",
                        "type": "integer"
                    },
                    "first_name": {
                        "description": "first_name",
                        "type": "string"
                    },
                    "last_name": {
                        "description": "last_name",
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "CreateDeviceTokenRequest": {
                "required": [
                    "token"
                ],
                "properties": {
                    "token": {
                        "description": "token",
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "SendMulticastBulkNotificationRequest": {
                "required": [
                    "channel",
                    "sections"
                ],
                "properties": {
                    "channel": {
                        "description": "channel",
                        "type": "string"
                    },
                    "sections": {
                        "description": "sections",
                        "type": "array",
                        "items": {
                            "properties": {
                                "title": {
                                    "type": "string"
                                },
                                "body": {
                                    "type": "string"
                                },
                                "image_url": {
                                    "type": "string"
                                },
                                "redirect_url": {
                                    "type": "string"
                                },
                                "data": {
                                    "type": "object"
                                }
                            },
                            "type": "object"
                        }
                    }
                },
                "type": "object"
            },
            "SendUserBulkNotificationRequest": {
                "required": [
                    "channel",
                    "sections",
                    "user_ids"
                ],
                "properties": {
                    "channel": {
                        "description": "channel",
                        "type": "string"
                    },
                    "sections": {
                        "description": "sections",
                        "type": "array",
                        "items": {
                            "properties": {
                                "title": {
                                    "type": "string"
                                },
                                "body": {
                                    "type": "string"
                                },
                                "image_url": {
                                    "type": "string"
                                },
                                "redirect_url": {
                                    "type": "string"
                                },
                                "data": {
                                    "type": "object"
                                }
                            },
                            "type": "object"
                        }
                    },
                    "user_ids": {
                        "description": "user_ids",
                        "type": "array",
                        "items": {
                            "type": "integer"
                        }
                    }
                },
                "type": "object"
            },
            "BulkNotificationResource": {
                "required": [
                    "id",
                    "channel",
                    "sections",
                    "users"
                ],
                "properties": {
                    "id": {
                        "description": "id",
                        "type": "integer"
                    },
                    "channel": {
                        "description": "channel",
                        "type": "string"
                    },
                    "sections": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/BulkNotificationSectionResource"
                        }
                    },
                    "users": {
                        "description": "users",
                        "type": "array",
                        "items": {
                            "type": "integer"
                        }
                    }
                },
                "type": "object"
            },
            "BulkNotificationSectionResource": {
                "required": [
                    "id",
                    "key",
                    "value"
                ],
                "properties": {
                    "id": {
                        "description": "id",
                        "type": "integer"
                    },
                    "key": {
                        "description": "key",
                        "type": "string"
                    },
                    "value": {
                        "description": "value",
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "ProductCategorySimpleResource": {
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "name_with_breadcrumbs": {
                        "type": "string"
                    },
                    "slug": {
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "MyProductResource": {
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "type": {
                        "type": "string"
                    },
                    "name": {
                        "type": "string"
                    },
                    "is_active": {
                        "type": "boolean"
                    },
                    "end_date": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "status": {
                        "type": "string"
                    },
                    "productables": {
                        "type": "array",
                        "items": {
                            "properties": {
                                "productable_class": {
                                    "type": "string"
                                },
                                "productable_id": {
                                    "type": "string"
                                },
                                "position": {
                                    "type": "integer",
                                    "example": 1
                                }
                            },
                            "type": "object"
                        }
                    },
                    "tags": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "categories": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/ProductCategorySimpleResource"
                        }
                    },
                    "language": {
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "Order": {
                "properties": {
                    "id": {
                        "description": "id",
                        "type": "integer"
                    },
                    "user_id": {
                        "description": "user_id",
                        "type": "integer"
                    }
                },
                "type": "object"
            },
            "Product": {
                "properties": {
                    "id": {
                        "description": "id",
                        "type": "integer"
                    },
                    "name": {
                        "description": "name",
                        "type": "string"
                    },
                    "price": {
                        "description": "price",
                        "type": "integer"
                    }
                },
                "type": "object"
            },
            "AdminCategorySortRequest": {
                "properties": {
                    "orders": {
                        "description": "orders",
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/AdminSortCategories"
                        }
                    }
                },
                "type": "object"
            },
            "AdminSortCategories": {
                "properties": {
                    "id": {
                        "description": "id",
                        "type": "integer"
                    },
                    "order": {
                        "description": "order",
                        "type": "integer"
                    }
                },
                "type": "object"
            },
            "TopicCodeExercise": {
                "required": [
                    "language",
                    "files",
                    "visible_tests"
                ],
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "language": {
                        "type": "string",
                        "enum": [
                            "javascript",
                            "typescript"
                        ]
                    },
                    "files": {
                        "description": "Starter files (a JSON string is accepted in multipart requests): at most 20, 64 KB each, 256 KB together",
                        "type": "array",
                        "items": {
                            "properties": {
                                "path": {
                                    "type": "string"
                                },
                                "content": {
                                    "type": "string"
                                }
                            },
                            "type": "object"
                        }
                    },
                    "visible_tests": {
                        "description": "Test files the learner can read and run in the browser",
                        "type": "array",
                        "items": {
                            "properties": {
                                "path": {
                                    "type": "string"
                                },
                                "content": {
                                    "type": "string"
                                }
                            },
                            "type": "object"
                        }
                    },
                    "timeout_ms": {
                        "description": "A run is stopped after this long (500 to 30000)",
                        "type": "integer"
                    },
                    "completion_rule": {
                        "type": "string",
                        "enum": [
                            "on_pass",
                            "on_attempt"
                        ]
                    },
                    "pass_score": {
                        "description": "Percentage of passing tests that completes the topic (on_pass)",
                        "type": "integer"
                    },
                    "text": {
                        "description": "The task, in Markdown",
                        "type": "string",
                        "nullable": true
                    }
                },
                "type": "object"
            },
            "AdminApproveConsultationAccessEnquiryRequest": {
                "properties": {
                    "meeting_link": {
                        "description": "meeting_link",
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "AdminDisapproveConsultationAccessEnquiryRequest": {
                "properties": {
                    "message": {
                        "description": "message",
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "CreateConsultationAccessEnquiryRequest": {
                "required": [
                    "consultation_id"
                ],
                "properties": {
                    "consultation_id": {
                        "description": "consultation_id",
                        "type": "number"
                    },
                    "description": {
                        "description": "description",
                        "type": "string"
                    },
                    "title": {
                        "description": "title",
                        "type": "string"
                    },
                    "related_type": {
                        "description": "related_type",
                        "type": "string"
                    },
                    "related_id": {
                        "description": "related_id",
                        "type": "integer"
                    },
                    "proposed_terms": {
                        "type": "array",
                        "items": {
                            "type": "string",
                            "format": "date-time"
                        }
                    }
                },
                "type": "object"
            },
            "UpdateConsultationAccessEnquiryRequest": {
                "required": [
                    "proposed_terms"
                ],
                "properties": {
                    "description": {
                        "description": "description",
                        "type": "string"
                    },
                    "title": {
                        "description": "title",
                        "type": "string"
                    },
                    "related_type": {
                        "description": "related_type",
                        "type": "string"
                    },
                    "related_id": {
                        "description": "related_id",
                        "type": "integer"
                    },
                    "proposed_terms": {
                        "type": "array",
                        "items": {
                            "type": "string",
                            "format": "date-time"
                        }
                    }
                },
                "type": "object"
            },
            "ConsultationAccessEnquiryProposedTermsResource": {
                "properties": {
                    "id": {
                        "description": "id",
                        "type": "number"
                    },
                    "proposed_at": {
                        "description": "proposed_at",
                        "type": "string",
                        "format": "date-time"
                    }
                },
                "type": "object"
            },
            "ConsultationAccessEnquiryResource": {
                "properties": {
                    "id": {
                        "description": "id",
                        "type": "number"
                    },
                    "created_at": {
                        "description": "created_at",
                        "type": "string",
                        "format": "date-time"
                    },
                    "consultation": {
                        "$ref": "#/components/schemas/ConsultationShortResource"
                    },
                    "consultation_term_id": {
                        "description": "consultation_term_id",
                        "type": "integer"
                    },
                    "user": {
                        "$ref": "#/components/schemas/ConsultationUserShortResource"
                    },
                    "status": {
                        "description": "status",
                        "type": "string"
                    },
                    "description": {
                        "description": "description",
                        "type": "string"
                    },
                    "meeting_link": {
                        "description": "meeting_link",
                        "type": "string"
                    },
                    "proposed_terms": {
                        "$ref": "#/components/schemas/ConsultationAccessEnquiryProposedTermsResource"
                    },
                    "consultation_term": {},
                    "related_type": {
                        "description": "related_type",
                        "type": "string"
                    },
                    "related_id": {
                        "description": "related_id",
                        "type": "integer"
                    },
                    "title": {
                        "description": "title",
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "ConsultationShortResource": {
                "properties": {
                    "id": {
                        "description": "id",
                        "type": "number"
                    },
                    "name": {
                        "description": "name",
                        "type": "string"
                    },
                    "author": {
                        "$ref": "#/components/schemas/ConsultationUserShortResource"
                    }
                },
                "type": "object"
            },
            "JoinConsultationAccessResource": {
                "properties": {
                    "id": {
                        "description": "id",
                        "type": "number"
                    },
                    "meeting_link": {
                        "type": "string"
                    },
                    "meeting_link_type": {
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "ConsultationUserShortResource": {
                "properties": {
                    "id": {
                        "description": "id",
                        "type": "number"
                    },
                    "name": {
                        "description": "name",
                        "type": "string"
                    },
                    "email": {
                        "description": "email",
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "ConsultationTerm": {
                "properties": {
                    "status": {
                        "description": "status",
                        "type": "string"
                    },
                    "date": {
                        "description": "date",
                        "type": "string",
                        "format": "date-time",
                        "example": "2022-04-15T04:00:00.000Z"
                    },
                    "duration": {
                        "description": "duration",
                        "type": "string",
                        "example": "2 hours"
                    },
                    "user": {
                        "$ref": "#/components/schemas/User"
                    },
                    "is_ended": {
                        "description": "is_ended",
                        "type": "boolean"
                    },
                    "is_started": {
                        "description": "is_started",
                        "type": "boolean"
                    },
                    "in_coming": {
                        "description": "in_coming",
                        "type": "boolean"
                    },
                    "consultation_term_id": {
                        "description": "consultation_term_id",
                        "type": "integer"
                    },
                    "busy_terms": {
                        "description": "busy_terms",
                        "type": "array",
                        "items": {
                            "properties": {
                                "": {
                                    "type": "string",
                                    "example": "2022-05-20T10:15:20.000000Z"
                                }
                            },
                            "type": "object"
                        }
                    },
                    "finished_at": {
                        "description": "consultation term finished date",
                        "type": "string",
                        "format": "date-time",
                        "example": "2022-04-15T04:00:00.000Z"
                    },
                    "consultation_id": {
                        "description": "consultation ID",
                        "type": "integer"
                    }
                },
                "type": "object"
            },
            "ConsultationUserTerm": {
                "properties": {
                    "status": {
                        "description": "status",
                        "type": "string"
                    },
                    "date": {
                        "description": "date",
                        "type": "string",
                        "format": "date-time",
                        "example": "2022-04-15T04:00:00.000Z"
                    },
                    "duration": {
                        "description": "duration",
                        "type": "string",
                        "example": "2 hours"
                    },
                    "user": {
                        "$ref": "#/components/schemas/User"
                    },
                    "is_ended": {
                        "description": "is_ended",
                        "type": "boolean"
                    },
                    "is_started": {
                        "description": "is_started",
                        "type": "boolean"
                    },
                    "in_coming": {
                        "description": "in_coming",
                        "type": "boolean"
                    },
                    "consultation_term_id": {
                        "description": "consultation_term_id",
                        "type": "integer"
                    },
                    "busy_terms": {
                        "description": "busy_terms",
                        "type": "array",
                        "items": {
                            "properties": {
                                "": {
                                    "type": "string",
                                    "example": "2022-05-20T10:15:20.000000Z"
                                }
                            },
                            "type": "object"
                        }
                    },
                    "finished_at": {
                        "description": "consultation term finished date",
                        "type": "string",
                        "format": "date-time",
                        "example": "2022-04-15T04:00:00.000Z"
                    },
                    "consultation_id": {
                        "description": "consultation ID",
                        "type": "integer"
                    }
                },
                "type": "object"
            },
            "Consultation": {
                "required": [
                    "name",
                    "status",
                    "description",
                    "author_id"
                ],
                "properties": {
                    "id": {
                        "description": "id",
                        "type": "integer"
                    },
                    "name": {
                        "description": "name",
                        "type": "string"
                    },
                    "status": {
                        "description": "status",
                        "type": "string"
                    },
                    "description": {
                        "description": "description",
                        "type": "string"
                    },
                    "duration": {
                        "description": "duration",
                        "type": "string"
                    },
                    "author_id": {
                        "description": "author_id",
                        "type": "integer"
                    },
                    "active_to": {
                        "description": "active_to",
                        "type": "string",
                        "format": "date-time"
                    },
                    "active_from": {
                        "description": "active_from",
                        "type": "string",
                        "format": "date-time"
                    },
                    "created_at": {
                        "description": "created_at",
                        "type": "string",
                        "format": "date-time"
                    },
                    "updated_at": {
                        "description": "updated_at",
                        "type": "string",
                        "format": "date-time"
                    },
                    "consultation_user_id": {
                        "description": "consultation_user_id",
                        "type": "integer"
                    },
                    "executed_status": {
                        "description": "executed_status",
                        "type": "string"
                    },
                    "image_path": {
                        "description": "image_path",
                        "type": "string"
                    },
                    "image_url": {
                        "description": "image_url",
                        "type": "string"
                    },
                    "logotype_path": {
                        "description": "logotype_path",
                        "type": "string"
                    },
                    "logotype_url": {
                        "description": "logotype_url",
                        "type": "string"
                    },
                    "executed_at": {
                        "description": "executed_at",
                        "type": "string",
                        "format": "date-time"
                    },
                    "categories": {
                        "description": "categories",
                        "type": "array",
                        "items": {
                            "properties": {
                                "name": {
                                    "type": "string",
                                    "example": "Dokumentacja"
                                },
                                "icon_class": {
                                    "type": "string",
                                    "example": "fa-business-time"
                                },
                                "is_active": {
                                    "type": "boolean",
                                    "example": "true"
                                },
                                "parent_id": {
                                    "type": "?integer",
                                    "example": "null"
                                }
                            },
                            "type": "object"
                        }
                    },
                    "proposed_terms": {
                        "description": "proposed_terms",
                        "type": "array",
                        "items": {
                            "properties": {
                                "": {
                                    "type": "string",
                                    "example": "2022-05-20T10:15:20.000000Z"
                                }
                            },
                            "type": "object"
                        }
                    },
                    "busy_terms": {
                        "description": "busy_terms",
                        "type": "array",
                        "items": {
                            "properties": {
                                "": {
                                    "type": "string",
                                    "example": "2022-05-20T10:15:20.000000Z"
                                }
                            },
                            "type": "object"
                        }
                    },
                    "max_session_students": {
                        "description": "max_session_students",
                        "type": "integer"
                    }
                },
                "type": "object"
            },
            "ConsultationTermForUserCurrent": {
                "properties": {
                    "name": {
                        "description": "name",
                        "type": "string"
                    },
                    "image_path": {
                        "description": "image_path",
                        "type": "string"
                    },
                    "image_url": {
                        "description": "image_url",
                        "type": "string"
                    },
                    "executed_status": {
                        "description": "executed_status",
                        "type": "string"
                    },
                    "executed_at": {
                        "description": "executed_at",
                        "type": "string",
                        "format": "date-time",
                        "example": "2022-04-15T04:00:00.000Z"
                    },
                    "is_ended": {
                        "description": "is_ended",
                        "type": "boolean"
                    },
                    "is_started": {
                        "description": "is_started",
                        "type": "boolean"
                    },
                    "in_coming": {
                        "description": "in_coming",
                        "type": "boolean"
                    },
                    "consultation_term_id": {
                        "description": "consultation_term_id",
                        "type": "integer"
                    }
                },
                "type": "object"
            },
            "CreateCourseAccessEnquiryApiRequest": {
                "required": [
                    "course_id"
                ],
                "properties": {
                    "course_id": {
                        "description": "course_id",
                        "type": "number"
                    },
                    "data": {
                        "description": "data",
                        "type": "object"
                    }
                },
                "type": "object"
            },
            "CourseAccessEnquiryResource": {
                "properties": {
                    "id": {
                        "description": "id",
                        "type": "number"
                    },
                    "created_at": {
                        "description": "created_at",
                        "type": "string",
                        "format": "date-time"
                    },
                    "course": {
                        "$ref": "#/components/schemas/CourseShortResource"
                    },
                    "user": {
                        "$ref": "#/components/schemas/UserShortResource"
                    },
                    "status": {
                        "description": "status",
                        "type": "string"
                    },
                    "data": {
                        "description": "status",
                        "type": "object"
                    }
                },
                "type": "object"
            },
            "CourseShortResource": {
                "properties": {
                    "id": {
                        "description": "id",
                        "type": "number"
                    },
                    "name": {
                        "description": "name",
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "UserShortResource": {
                "properties": {
                    "id": {
                        "description": "id",
                        "type": "number"
                    },
                    "name": {
                        "description": "name",
                        "type": "string"
                    },
                    "email": {
                        "description": "email",
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "CourseBuilderRunStatus": {
                "required": [
                    "id",
                    "sessionId",
                    "kind",
                    "status",
                    "steps"
                ],
                "properties": {
                    "id": {
                        "description": "The public, stable shape of a run for pollers (CLI `--wait`, MCP, CI):\n`GET /api/admin/course-builder/runs/{run}`. Internal statuses are folded into\nqueued | running | succeeded | failed | cancelled; `needsAttention` is true while the run waits\nfor the author (an answer or an approval), so a poller can stop and ask instead of looping.",
                        "type": "string",
                        "example": "01j9z3k8m2x4q7r5t6v8w0y1ab"
                    },
                    "sessionId": {
                        "type": "string"
                    },
                    "kind": {
                        "type": "string",
                        "enum": [
                            "ingest",
                            "interview",
                            "outline",
                            "generate",
                            "patch",
                            "apply",
                            "action"
                        ]
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "queued",
                            "running",
                            "succeeded",
                            "failed",
                            "cancelled"
                        ]
                    },
                    "stage": {
                        "type": "string",
                        "nullable": true
                    },
                    "needsAttention": {
                        "type": "boolean"
                    },
                    "steps": {
                        "type": "array",
                        "items": {
                            "properties": {
                                "id": {
                                    "type": "string"
                                },
                                "name": {
                                    "type": "string",
                                    "example": "lesson:el_8f2c"
                                },
                                "status": {
                                    "type": "string",
                                    "enum": [
                                        "queued",
                                        "running",
                                        "succeeded",
                                        "failed"
                                    ]
                                },
                                "error": {
                                    "type": "string",
                                    "nullable": true
                                }
                            },
                            "type": "object"
                        }
                    },
                    "startedAt": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                    },
                    "finishedAt": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                    },
                    "error": {
                        "type": "string",
                        "nullable": true
                    }
                },
                "type": "object"
            },
            "Course": {
                "required": [
                    "title"
                ],
                "properties": {
                    "id": {
                        "description": "id",
                        "type": "integer"
                    },
                    "title": {
                        "description": "title",
                        "type": "string"
                    },
                    "summary": {
                        "description": "summary",
                        "type": "string"
                    },
                    "image_path": {
                        "description": "image_path",
                        "type": "string"
                    },
                    "video_path": {
                        "description": "video_path",
                        "type": "string"
                    },
                    "image_url": {
                        "description": "image_url",
                        "type": "string"
                    },
                    "video_url": {
                        "description": "video_url",
                        "type": "string"
                    },
                    "duration": {
                        "description": "duration",
                        "type": "string"
                    },
                    "scorm_sco_id": {
                        "description": "scorm_sco_id",
                        "type": "integer"
                    },
                    "image": {
                        "description": "image",
                        "type": "file"
                    },
                    "video": {
                        "description": "video",
                        "type": "file"
                    },
                    "status": {
                        "description": "status",
                        "type": "string"
                    },
                    "subtitle": {
                        "description": "subtitle",
                        "type": "string"
                    },
                    "language": {
                        "description": "language",
                        "type": "string"
                    },
                    "description": {
                        "description": "description",
                        "type": "string"
                    },
                    "level": {
                        "description": "level",
                        "type": "string"
                    },
                    "poster": {
                        "description": "poster",
                        "type": "file"
                    },
                    "poster_path": {
                        "description": "poster_path",
                        "type": "string"
                    },
                    "poster_url": {
                        "description": "poster_url",
                        "type": "string"
                    },
                    "active_from": {
                        "description": "active_from",
                        "type": "string",
                        "format": "date-time"
                    },
                    "active_to": {
                        "description": "active_to",
                        "type": "string",
                        "format": "date-time"
                    },
                    "hours_to_complete": {
                        "description": "hours_to_complete",
                        "type": "integer"
                    },
                    "findable": {
                        "description": "findable",
                        "type": "boolean"
                    },
                    "target_group": {
                        "description": "target group",
                        "type": "string"
                    },
                    "teaser_url": {
                        "description": "teaser url",
                        "type": "string"
                    },
                    "public": {
                        "description": "free access, public audience ",
                        "type": "boolean"
                    },
                    "fields": {
                        "description": "additional fields",
                        "type": "json"
                    }
                },
                "type": "object"
            },
            "Lesson": {
                "required": [
                    "title",
                    "order",
                    "course_id"
                ],
                "properties": {
                    "id": {
                        "description": "id",
                        "type": "integer"
                    },
                    "title": {
                        "description": "title",
                        "type": "string"
                    },
                    "duration": {
                        "description": "duration",
                        "type": "string"
                    },
                    "summary": {
                        "description": "summary",
                        "type": "string"
                    },
                    "order": {
                        "description": "order",
                        "type": "integer"
                    },
                    "course_id": {
                        "description": "course_id",
                        "type": "integer"
                    },
                    "parent_lesson_id": {
                        "description": "parent_lesson_id",
                        "type": "integer"
                    },
                    "active_from": {
                        "description": "active_from",
                        "type": "string",
                        "format": "date-time"
                    },
                    "active_to": {
                        "description": "active_to",
                        "type": "string",
                        "format": "date-time"
                    }
                },
                "type": "object"
            },
            "Topic": {
                "required": [
                    "lesson_id",
                    "order"
                ],
                "properties": {
                    "id": {
                        "description": "id",
                        "type": "integer"
                    },
                    "title": {
                        "description": "title",
                        "type": "string"
                    },
                    "active": {
                        "description": "active",
                        "type": "boolean"
                    },
                    "can_skip": {
                        "description": "can skip",
                        "type": "boolean"
                    },
                    "preview": {
                        "description": "preview",
                        "type": "boolean"
                    },
                    "lesson_id": {
                        "description": "lesson_id",
                        "type": "integer"
                    },
                    "topicable_id": {
                        "description": "topicable_id",
                        "type": "integer"
                    },
                    "topicable_type": {
                        "description": "topicable_type",
                        "type": "string"
                    },
                    "value": {
                        "description": "value",
                        "type": "string"
                    },
                    "summary": {
                        "description": "summary",
                        "type": "string"
                    },
                    "introduction": {
                        "description": "introduction",
                        "type": "string"
                    },
                    "description": {
                        "description": "description",
                        "type": "string"
                    },
                    "order": {
                        "description": "order",
                        "type": "integer"
                    },
                    "json": {
                        "description": "json",
                        "type": "object"
                    },
                    "duration": {
                        "description": "duration",
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "TopicResource": {
                "required": [
                    "topic_id",
                    "path",
                    "name"
                ],
                "properties": {
                    "id": {
                        "description": "id",
                        "type": "integer"
                    },
                    "topic_id": {
                        "description": "topic_id",
                        "type": "integer"
                    },
                    "path": {
                        "description": "path",
                        "type": "string"
                    },
                    "name": {
                        "description": "name",
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "CreateDictionaryRequest": {
                "required": [
                    "name"
                ],
                "properties": {
                    "name": {
                        "type": "string"
                    },
                    "free_views_count": {
                        "type": "integer"
                    }
                },
                "type": "object"
            },
            "UpdateDictionaryRequest": {
                "required": [
                    "name"
                ],
                "properties": {
                    "name": {
                        "type": "string"
                    },
                    "free_views_count": {
                        "type": "integer"
                    }
                },
                "type": "object"
            },
            "SetDictionaryAccessRequest": {
                "required": [
                    "users"
                ],
                "properties": {
                    "users": {
                        "type": "array",
                        "items": {
                            "properties": {
                                "user_id": {
                                    "type": "integer"
                                },
                                "end_date": {
                                    "type": "string",
                                    "format": "date-time"
                                }
                            },
                            "type": "object"
                        }
                    }
                },
                "type": "object"
            },
            "CreateDictionaryWordRequest": {
                "required": [
                    "word",
                    "dictionary_id"
                ],
                "properties": {
                    "word": {
                        "type": "string"
                    },
                    "dictionary_id": {
                        "type": "integer"
                    },
                    "description": {
                        "type": "string"
                    },
                    "data": {
                        "type": "object"
                    },
                    "categories": {
                        "description": "categories",
                        "type": "array",
                        "items": {
                            "type": "integer"
                        }
                    }
                },
                "type": "object"
            },
            "ImportDictionaryWordRequest": {
                "required": [
                    "dictionary_id",
                    "file"
                ],
                "properties": {
                    "dictionary_id": {
                        "type": "integer"
                    },
                    "file": {
                        "type": "file"
                    }
                },
                "type": "object"
            },
            "DictionaryWordCategorySimpleResource": {
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "name_with_breadcrumbs": {
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "DictionaryAccessAdminResource": {
                "properties": {
                    "end_date": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "is_active": {
                        "type": "boolean"
                    },
                    "user": {
                        "type": "object"
                    }
                },
                "type": "object"
            },
            "DictionaryAccessResource": {
                "properties": {
                    "dictionary_id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "slug": {
                        "type": "string"
                    },
                    "end_date": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "is_active": {
                        "type": "boolean"
                    }
                },
                "type": "object"
            },
            "DictionaryResource": {
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "slug": {
                        "type": "string"
                    },
                    "free_views_count": {
                        "type": "integer"
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time"
                    }
                },
                "type": "object"
            },
            "DictionaryWordResource": {
                "type": "object",
                "allOf": [
                    {
                        "$ref": "#/components/schemas/DictionaryWordSimpleResource"
                    },
                    {
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "word": {
                                "type": "string"
                            },
                            "dictionary_id": {
                                "type": "integer"
                            },
                            "description": {
                                "type": "string"
                            },
                            "data": {
                                "type": "object"
                            },
                            "categories": {
                                "type": "array",
                                "items": {
                                    "$ref": "#/components/schemas/DictionaryWordCategorySimpleResource"
                                }
                            },
                            "created_at": {
                                "type": "string",
                                "format": "date-time"
                            },
                            "updated_at": {
                                "type": "string",
                                "format": "date-time"
                            }
                        },
                        "type": "object"
                    }
                ]
            },
            "DictionaryWordSimpleResource": {
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "word": {
                        "type": "string"
                    },
                    "dictionary_id": {
                        "type": "integer"
                    },
                    "categories": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/DictionaryWordCategorySimpleResource"
                        }
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time"
                    }
                },
                "type": "object"
            },
            "ExamplePluginSendGreetingRequest": {
                "required": [
                    "user_id"
                ],
                "properties": {
                    "user_id": {
                        "description": "Recipient",
                        "type": "integer"
                    }
                },
                "type": "object"
            },
            "ExamplePluginGreetingResource": {
                "properties": {
                    "greeting": {
                        "type": "string",
                        "example": "Hello from the example plugin, Ada"
                    },
                    "user_id": {
                        "type": "integer",
                        "nullable": true
                    }
                },
                "type": "object"
            },
            "H5PContentListRequest": {
                "properties": {
                    "title": {
                        "type": "string"
                    },
                    "main_library": {
                        "type": "string"
                    },
                    "author_id": {
                        "type": "integer"
                    },
                    "per_page": {
                        "type": "integer"
                    },
                    "order_by": {
                        "type": "string"
                    },
                    "order": {
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "H5PContentListItem": {
                "properties": {
                    "id": {
                        "type": "integer",
                        "example": 12
                    },
                    "title": {
                        "type": "string",
                        "example": "Capitals of Europe"
                    },
                    "library": {
                        "type": "string",
                        "example": "H5P.MultiChoice 1.16"
                    },
                    "main_library": {
                        "type": "string",
                        "example": "H5P.MultiChoice"
                    },
                    "library_version": {
                        "type": "string",
                        "example": "1.16"
                    },
                    "user_id": {
                        "description": "LMS user id of the creator (string for non-numeric ids)",
                        "type": "integer",
                        "example": 1,
                        "nullable": true
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "count_h5p": {
                        "description": "Number of H5P topics using this content",
                        "type": "integer",
                        "example": 1
                    }
                },
                "type": "object"
            },
            "H5PContentSummary": {
                "properties": {
                    "id": {
                        "description": "Read-only view of the H5P service's content table (`h5p.contents`, PostgreSQL).\n\nThe H5P service (api/h5p) owns the `h5p` schema. Laravel only reads it; every\nwrite (create, upload, update, delete) goes through\n{@see \\Ulams\\H5P\\Services\\Contracts\\H5PServiceClientContract}.",
                        "type": "integer",
                        "example": 12
                    },
                    "title": {
                        "type": "string",
                        "example": "Capitals of Europe"
                    },
                    "library": {
                        "type": "string",
                        "example": "H5P.MultiChoice 1.16"
                    },
                    "main_library": {
                        "type": "string",
                        "example": "H5P.MultiChoice"
                    }
                },
                "type": "object"
            },
            "IdentityAuditEntry": {
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "actor": {
                        "type": "string",
                        "enum": [
                            "user",
                            "scim",
                            "hris",
                            "system",
                            "idp"
                        ]
                    },
                    "actor_id": {
                        "type": "integer",
                        "nullable": true
                    },
                    "provider_id": {
                        "type": "string",
                        "format": "uuid",
                        "nullable": true
                    },
                    "action": {
                        "type": "string",
                        "example": "sso.login"
                    },
                    "subject_type": {
                        "type": "string",
                        "nullable": true
                    },
                    "subject_id": {
                        "type": "string",
                        "nullable": true
                    },
                    "data": {
                        "description": "Reason codes and ids only",
                        "type": "object",
                        "nullable": true
                    },
                    "ip": {
                        "type": "string",
                        "nullable": true
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "hash": {
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "IdentityProvider": {
                "properties": {
                    "id": {
                        "type": "string",
                        "format": "uuid"
                    },
                    "slug": {
                        "description": "Used in the sign-in URLs; fixed after creation",
                        "type": "string"
                    },
                    "name": {
                        "description": "Shown on the sign-in button",
                        "type": "string"
                    },
                    "protocol": {
                        "type": "string",
                        "enum": [
                            "oidc",
                            "saml"
                        ]
                    },
                    "enabled": {
                        "type": "boolean"
                    },
                    "email_domains": {
                        "description": "Domains of the organisation",
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "trust_email": {
                        "description": "The provider is authoritative for e-mail addresses of email_domains: an existing non-privileged account with a verified address there is linked on first sign-in",
                        "type": "boolean"
                    },
                    "jit_enabled": {
                        "description": "Create an account on first sign-in",
                        "type": "boolean"
                    },
                    "default_role": {
                        "type": "string",
                        "enum": [
                            "student",
                            "tutor"
                        ]
                    },
                    "oidc": {
                        "description": "OpenID Connect providers only",
                        "properties": {
                            "issuer": {
                                "type": "string",
                                "format": "uri"
                            },
                            "client_id": {
                                "type": "string"
                            },
                            "scopes": {
                                "type": "array",
                                "items": {
                                    "type": "string"
                                }
                            },
                            "token_auth": {
                                "type": "string",
                                "enum": [
                                    "client_secret_basic",
                                    "client_secret_post"
                                ]
                            },
                            "userinfo": {
                                "type": "boolean"
                            }
                        },
                        "type": "object",
                        "nullable": true
                    },
                    "saml": {
                        "description": "SAML providers only. Private keys never leave the API",
                        "properties": {
                            "entity_id": {
                                "description": "The identity provider's entity id",
                                "type": "string",
                                "nullable": true
                            },
                            "sso_url": {
                                "type": "string",
                                "format": "uri",
                                "nullable": true
                            },
                            "slo_url": {
                                "type": "string",
                                "format": "uri",
                                "nullable": true
                            },
                            "metadata_url": {
                                "description": "Refreshed daily; new signing certificates are added automatically",
                                "type": "string",
                                "format": "uri",
                                "nullable": true
                            },
                            "name_id_format": {
                                "type": "string",
                                "nullable": true
                            },
                            "want_encrypted_assertions": {
                                "type": "boolean"
                            },
                            "allow_sha1": {
                                "description": "Accept SHA-1 signatures (legacy). Weak: every such sign-in is audited",
                                "type": "boolean"
                            },
                            "attribute_map": {
                                "description": "Attribute names for email, first_name, last_name, name and subject",
                                "type": "object"
                            },
                            "idp_certificates": {
                                "description": "Signing certificates trusted for this provider",
                                "type": "array",
                                "items": {
                                    "properties": {
                                        "fingerprint": {
                                            "description": "SHA-256 of the certificate",
                                            "type": "string"
                                        },
                                        "not_before": {
                                            "type": "string",
                                            "format": "date-time",
                                            "nullable": true
                                        },
                                        "not_after": {
                                            "type": "string",
                                            "format": "date-time",
                                            "nullable": true
                                        },
                                        "added_at": {
                                            "type": "string",
                                            "format": "date-time"
                                        },
                                        "source": {
                                            "type": "string",
                                            "enum": [
                                                "metadata",
                                                "admin"
                                            ]
                                        }
                                    },
                                    "type": "object"
                                }
                            },
                            "sp": {
                                "description": "What to give the identity provider",
                                "properties": {
                                    "entity_id": {
                                        "type": "string",
                                        "format": "uri"
                                    },
                                    "metadata_url": {
                                        "type": "string",
                                        "format": "uri"
                                    },
                                    "acs_url": {
                                        "type": "string",
                                        "format": "uri"
                                    },
                                    "slo_url": {
                                        "type": "string",
                                        "format": "uri"
                                    },
                                    "certificate_fingerprint": {
                                        "type": "string",
                                        "nullable": true
                                    },
                                    "next_certificate_fingerprint": {
                                        "description": "A prepared key pair, already published in the metadata",
                                        "type": "string",
                                        "nullable": true
                                    }
                                },
                                "type": "object"
                            }
                        },
                        "type": "object",
                        "nullable": true
                    },
                    "scim": {
                        "description": "SCIM 2.0 provisioning with this provider",
                        "properties": {
                            "base_url": {
                                "description": "Tenant URL to enter in the identity provider's SCIM settings",
                                "type": "string",
                                "format": "uri"
                            },
                            "group_roles": {
                                "description": "Display name of a SCIM group (lower case) to the role its members get",
                                "type": "object",
                                "additionalProperties": {
                                    "type": "string",
                                    "enum": [
                                        "student",
                                        "tutor"
                                    ]
                                }
                            },
                            "active_tokens": {
                                "description": "Active SCIM tokens (at most two)",
                                "type": "integer"
                            }
                        },
                        "type": "object"
                    },
                    "metadata_refreshed_at": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                    },
                    "client_secret_set": {
                        "type": "boolean"
                    },
                    "client_secret_hint": {
                        "type": "string",
                        "nullable": true
                    },
                    "redirect_uri": {
                        "description": "Register this redirect URI at the provider",
                        "type": "string",
                        "format": "uri"
                    },
                    "last_login_at": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                    },
                    "last_error": {
                        "description": "Reason code of the last failed sign-in",
                        "type": "string",
                        "nullable": true
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time"
                    }
                },
                "type": "object"
            },
            "IdentityProviderInput": {
                "properties": {
                    "protocol": {
                        "description": "Fixed at creation (default oidc); ignored on update",
                        "type": "string",
                        "enum": [
                            "oidc",
                            "saml"
                        ]
                    },
                    "slug": {
                        "description": "Lowercase letters, digits and hyphens; required on create, ignored on update",
                        "type": "string"
                    },
                    "name": {
                        "type": "string"
                    },
                    "enabled": {
                        "type": "boolean"
                    },
                    "email_domains": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "trust_email": {
                        "type": "boolean"
                    },
                    "jit_enabled": {
                        "type": "boolean"
                    },
                    "default_role": {
                        "type": "string",
                        "enum": [
                            "student",
                            "tutor"
                        ]
                    },
                    "scim": {
                        "properties": {
                            "group_roles": {
                                "description": "Display name of a SCIM group to student or tutor: members of such a group get the role while they are members (replaces the whole mapping; admin cannot be mapped)",
                                "type": "object",
                                "nullable": true,
                                "additionalProperties": {
                                    "type": "string",
                                    "enum": [
                                        "student",
                                        "tutor"
                                    ]
                                }
                            }
                        },
                        "type": "object"
                    },
                    "oidc": {
                        "properties": {
                            "issuer": {
                                "type": "string",
                                "format": "uri"
                            },
                            "client_id": {
                                "type": "string"
                            },
                            "scopes": {
                                "type": "array",
                                "items": {
                                    "type": "string"
                                }
                            },
                            "token_auth": {
                                "type": "string",
                                "enum": [
                                    "client_secret_basic",
                                    "client_secret_post"
                                ]
                            },
                            "userinfo": {
                                "type": "boolean"
                            }
                        },
                        "type": "object"
                    },
                    "client_secret": {
                        "description": "Write-only; stored encrypted",
                        "type": "string"
                    },
                    "saml": {
                        "description": "SAML providers: give metadata_url or metadata_xml (entity id, endpoints and certificates are read from it), or the fields by hand",
                        "properties": {
                            "metadata_url": {
                                "type": "string",
                                "format": "uri"
                            },
                            "metadata_xml": {
                                "description": "Uploaded IdP metadata (at most 2 MB)",
                                "type": "string"
                            },
                            "entity_id": {
                                "type": "string"
                            },
                            "sso_url": {
                                "type": "string",
                                "format": "uri"
                            },
                            "slo_url": {
                                "type": "string",
                                "format": "uri"
                            },
                            "name_id_format": {
                                "type": "string"
                            },
                            "want_encrypted_assertions": {
                                "type": "boolean"
                            },
                            "allow_sha1": {
                                "type": "boolean"
                            },
                            "idp_certificates": {
                                "description": "Replaces the trusted signing certificates (PEM or base64)",
                                "type": "array",
                                "items": {
                                    "type": "string"
                                }
                            },
                            "attribute_map": {
                                "properties": {
                                    "email": {
                                        "type": "string"
                                    },
                                    "first_name": {
                                        "type": "string"
                                    },
                                    "last_name": {
                                        "type": "string"
                                    },
                                    "name": {
                                        "type": "string"
                                    },
                                    "subject": {
                                        "type": "string"
                                    }
                                },
                                "type": "object"
                            }
                        },
                        "type": "object"
                    }
                },
                "type": "object"
            },
            "IdentityMetadataRefresh": {
                "properties": {
                    "status": {
                        "description": "attention: a change needs an administrator (another entity id, certificates unrelated to the trusted ones)",
                        "type": "string",
                        "enum": [
                            "unchanged",
                            "updated",
                            "attention",
                            "failed"
                        ]
                    },
                    "added": {
                        "description": "SHA-256 fingerprints of certificates added",
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "removed": {
                        "description": "SHA-256 fingerprints of certificates removed",
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "reason": {
                        "type": "string",
                        "nullable": true
                    }
                },
                "type": "object"
            },
            "ScimError": {
                "required": [
                    "schemas",
                    "status"
                ],
                "properties": {
                    "schemas": {
                        "type": "array",
                        "items": {
                            "type": "string",
                            "example": "urn:ietf:params:scim:api:messages:2.0:Error"
                        }
                    },
                    "status": {
                        "type": "string",
                        "example": "409"
                    },
                    "scimType": {
                        "type": "string",
                        "enum": [
                            "invalidFilter",
                            "tooMany",
                            "uniqueness",
                            "mutability",
                            "invalidSyntax",
                            "invalidPath",
                            "noTarget",
                            "invalidValue",
                            "invalidVers",
                            "sensitive"
                        ]
                    },
                    "detail": {
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "ScimResource": {
                "description": "A SCIM discovery document (ServiceProviderConfig, ResourceType or Schema)",
                "type": "object",
                "additionalProperties": true
            },
            "ScimListResponse": {
                "required": [
                    "schemas",
                    "totalResults",
                    "Resources"
                ],
                "properties": {
                    "schemas": {
                        "type": "array",
                        "items": {
                            "type": "string",
                            "example": "urn:ietf:params:scim:api:messages:2.0:ListResponse"
                        }
                    },
                    "totalResults": {
                        "type": "integer"
                    },
                    "startIndex": {
                        "type": "integer"
                    },
                    "itemsPerPage": {
                        "type": "integer"
                    },
                    "Resources": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                },
                "type": "object"
            },
            "ScimUser": {
                "required": [
                    "schemas",
                    "userName"
                ],
                "properties": {
                    "schemas": {
                        "type": "array",
                        "items": {
                            "type": "string",
                            "example": "urn:ietf:params:scim:schemas:core:2.0:User"
                        }
                    },
                    "id": {
                        "description": "The id of the user in this academy",
                        "type": "string",
                        "readOnly": true
                    },
                    "externalId": {
                        "description": "The client's own id, unique per provider",
                        "type": "string"
                    },
                    "userName": {
                        "description": "Unique in the academy, case-insensitive; usually the e-mail address",
                        "type": "string"
                    },
                    "name": {
                        "properties": {
                            "givenName": {
                                "type": "string"
                            },
                            "familyName": {
                                "type": "string"
                            },
                            "formatted": {
                                "type": "string",
                                "readOnly": true
                            }
                        },
                        "type": "object"
                    },
                    "displayName": {
                        "type": "string"
                    },
                    "title": {
                        "type": "string"
                    },
                    "emails": {
                        "description": "The address of the account; one is kept (primary, else the first, else the userName)",
                        "type": "array",
                        "items": {
                            "properties": {
                                "value": {
                                    "type": "string"
                                },
                                "type": {
                                    "type": "string",
                                    "example": "work"
                                },
                                "primary": {
                                    "type": "boolean"
                                }
                            },
                            "type": "object"
                        }
                    },
                    "active": {
                        "description": "false blocks sign-in and revokes every session and token; true restores access",
                        "type": "boolean"
                    },
                    "groups": {
                        "type": "array",
                        "items": {
                            "properties": {
                                "value": {
                                    "type": "string"
                                },
                                "$ref": {
                                    "type": "string"
                                },
                                "display": {
                                    "type": "string"
                                }
                            },
                            "type": "object"
                        },
                        "readOnly": true
                    },
                    "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User": {
                        "properties": {
                            "employeeNumber": {
                                "type": "string"
                            },
                            "costCenter": {
                                "type": "string"
                            },
                            "organization": {
                                "type": "string"
                            },
                            "division": {
                                "type": "string"
                            },
                            "department": {
                                "type": "string"
                            },
                            "manager": {
                                "properties": {
                                    "value": {
                                        "description": "Id of a user of this provider",
                                        "type": "string"
                                    },
                                    "$ref": {
                                        "type": "string",
                                        "readOnly": true
                                    },
                                    "displayName": {
                                        "type": "string",
                                        "readOnly": true
                                    }
                                },
                                "type": "object"
                            }
                        },
                        "type": "object"
                    },
                    "meta": {
                        "properties": {
                            "resourceType": {
                                "type": "string"
                            },
                            "created": {
                                "type": "string",
                                "format": "date-time"
                            },
                            "lastModified": {
                                "type": "string",
                                "format": "date-time"
                            },
                            "location": {
                                "type": "string",
                                "format": "uri"
                            },
                            "version": {
                                "description": "Weak ETag of the representation",
                                "type": "string"
                            }
                        },
                        "type": "object",
                        "readOnly": true
                    }
                },
                "type": "object"
            },
            "ScimUserList": {
                "type": "object",
                "allOf": [
                    {
                        "$ref": "#/components/schemas/ScimListResponse"
                    },
                    {
                        "properties": {
                            "Resources": {
                                "type": "array",
                                "items": {
                                    "$ref": "#/components/schemas/ScimUser"
                                }
                            }
                        },
                        "type": "object"
                    }
                ]
            },
            "ScimGroup": {
                "required": [
                    "schemas",
                    "displayName"
                ],
                "properties": {
                    "schemas": {
                        "type": "array",
                        "items": {
                            "type": "string",
                            "example": "urn:ietf:params:scim:schemas:core:2.0:Group"
                        }
                    },
                    "id": {
                        "type": "string",
                        "readOnly": true
                    },
                    "externalId": {
                        "description": "The client's own id, unique per provider",
                        "type": "string"
                    },
                    "displayName": {
                        "description": "Name of the group; case-insensitively unique among all groups of the academy",
                        "type": "string"
                    },
                    "members": {
                        "description": "Users of this provider (nested groups are not supported). Only members this provider provisioned are shown and changed",
                        "type": "array",
                        "items": {
                            "properties": {
                                "value": {
                                    "description": "Id of the user",
                                    "type": "string"
                                },
                                "$ref": {
                                    "type": "string",
                                    "readOnly": true
                                },
                                "type": {
                                    "type": "string",
                                    "example": "User"
                                },
                                "display": {
                                    "type": "string",
                                    "readOnly": true
                                }
                            },
                            "type": "object"
                        }
                    },
                    "meta": {
                        "properties": {
                            "resourceType": {
                                "type": "string"
                            },
                            "created": {
                                "type": "string",
                                "format": "date-time"
                            },
                            "lastModified": {
                                "type": "string",
                                "format": "date-time"
                            },
                            "location": {
                                "type": "string",
                                "format": "uri"
                            },
                            "version": {
                                "description": "Weak ETag of the representation",
                                "type": "string"
                            }
                        },
                        "type": "object",
                        "readOnly": true
                    }
                },
                "type": "object"
            },
            "ScimGroupList": {
                "type": "object",
                "allOf": [
                    {
                        "$ref": "#/components/schemas/ScimListResponse"
                    },
                    {
                        "properties": {
                            "Resources": {
                                "type": "array",
                                "items": {
                                    "$ref": "#/components/schemas/ScimGroup"
                                }
                            }
                        },
                        "type": "object"
                    }
                ]
            },
            "ScimPatchOp": {
                "required": [
                    "schemas",
                    "Operations"
                ],
                "properties": {
                    "schemas": {
                        "type": "array",
                        "items": {
                            "type": "string",
                            "example": "urn:ietf:params:scim:api:messages:2.0:PatchOp"
                        }
                    },
                    "Operations": {
                        "type": "array",
                        "items": {
                            "required": [
                                "op"
                            ],
                            "properties": {
                                "op": {
                                    "description": "add, replace or remove, in any letter case",
                                    "type": "string"
                                },
                                "path": {
                                    "description": "Attribute path, with sub-attribute, value path or schema URN prefix; required for remove",
                                    "type": "string"
                                },
                                "value": {}
                            },
                            "type": "object"
                        }
                    }
                },
                "type": "object"
            },
            "ScimSearchRequest": {
                "required": [
                    "schemas"
                ],
                "properties": {
                    "schemas": {
                        "type": "array",
                        "items": {
                            "type": "string",
                            "example": "urn:ietf:params:scim:api:messages:2.0:SearchRequest"
                        }
                    },
                    "filter": {
                        "type": "string"
                    },
                    "startIndex": {
                        "type": "integer"
                    },
                    "count": {
                        "type": "integer"
                    },
                    "attributes": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "excludedAttributes": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                },
                "type": "object"
            },
            "TopicInteractive": {
                "required": [
                    "value"
                ],
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "value": {
                        "description": "Interactive package id",
                        "type": "integer"
                    },
                    "version": {
                        "description": "Pinned package version; set to the current one when omitted",
                        "type": "integer",
                        "nullable": true
                    },
                    "follow_latest": {
                        "description": "Play the package's current version instead of a pinned one",
                        "type": "boolean"
                    },
                    "start_step": {
                        "type": "string",
                        "nullable": true
                    },
                    "end_step": {
                        "type": "string",
                        "nullable": true
                    },
                    "completion_rule": {
                        "type": "string",
                        "enum": [
                            "on_open",
                            "on_range_end",
                            "on_complete",
                            "on_score"
                        ]
                    },
                    "pass_score": {
                        "description": "Percentage, for on_score",
                        "type": "integer",
                        "nullable": true
                    },
                    "display": {
                        "type": "string",
                        "enum": [
                            "inline",
                            "background"
                        ]
                    },
                    "height": {
                        "type": "integer"
                    },
                    "text": {
                        "description": "Markdown shown beside the frame or over the background",
                        "type": "string",
                        "nullable": true
                    }
                },
                "type": "object"
            },
            "KnowledgeExport": {
                "properties": {
                    "id": {
                        "type": "string",
                        "example": "01j9z8x3v7c5qk2m4n6p8r0t1w"
                    },
                    "scope": {
                        "type": "string",
                        "enum": [
                            "course",
                            "tenant"
                        ]
                    },
                    "course_id": {
                        "type": "integer",
                        "nullable": true
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "queued",
                            "running",
                            "ready",
                            "failed"
                        ]
                    },
                    "trigger": {
                        "type": "string",
                        "enum": [
                            "manual",
                            "auto"
                        ]
                    },
                    "pack_hash": {
                        "description": "SHA-256 over the chunk ids, text hashes and citations; unchanged content gives the same hash",
                        "type": "string",
                        "nullable": true
                    },
                    "courses": {
                        "type": "integer"
                    },
                    "chunks": {
                        "type": "integer"
                    },
                    "uncited_chunks": {
                        "description": "Chunks without source citations (hand-written or edited text)",
                        "type": "integer"
                    },
                    "error": {
                        "type": "string",
                        "nullable": true
                    },
                    "files": {
                        "description": "Names for the download endpoint",
                        "type": "array",
                        "items": {
                            "type": "string",
                            "enum": [
                                "manifest",
                                "chunks",
                                "index"
                            ]
                        }
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "finished_at": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                    }
                },
                "type": "object"
            },
            "TopicLiaScript": {
                "required": [
                    "value"
                ],
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "value": {
                        "description": "LiaScript document id (its current version is played)",
                        "type": "integer"
                    }
                },
                "type": "object"
            },
            "TopicLtiLink": {
                "required": [
                    "lti_tool_id"
                ],
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "lti_tool_id": {
                        "description": "registered LTI tool",
                        "type": "integer"
                    },
                    "url": {
                        "description": "target link URI; the tool's launch URL when empty",
                        "type": "string"
                    },
                    "custom": {
                        "description": "custom parameters sent with the launch",
                        "type": "object"
                    },
                    "presentation": {
                        "type": "string",
                        "enum": [
                            "iframe",
                            "window"
                        ]
                    },
                    "score_maximum": {
                        "type": "number"
                    }
                },
                "type": "object"
            },
            "ModelField": {
                "properties": {
                    "id": {
                        "description": "template id",
                        "type": "integer"
                    },
                    "name": {
                        "description": "template name",
                        "type": "string"
                    },
                    "value": {
                        "description": "",
                        "type": "string"
                    },
                    "class_type": {
                        "description": "",
                        "type": "string"
                    },
                    "class_id": {
                        "description": "",
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "Metadata": {
                "properties": {
                    "id": {
                        "description": "id",
                        "type": "integer"
                    },
                    "name": {
                        "description": "name",
                        "type": "string"
                    },
                    "value": {
                        "description": "value",
                        "type": "string"
                    },
                    "default": {
                        "description": "default",
                        "type": "string"
                    },
                    "rules": {
                        "description": "rules",
                        "type": "object"
                    },
                    "extra": {
                        "description": "extra",
                        "type": "object"
                    },
                    "visibility": {
                        "description": "visibility",
                        "type": "object"
                    },
                    "class_type": {
                        "description": "class_type",
                        "type": "string"
                    },
                    "class_id": {
                        "description": "class_id",
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "Notification": {
                "properties": {
                    "id": {
                        "description": "notification uuid",
                        "type": "integer"
                    },
                    "type": {
                        "description": "notification full classname",
                        "type": "string"
                    },
                    "event": {
                        "description": "event full classname",
                        "type": "string"
                    },
                    "notifiable_type": {
                        "description": "class representing User that got the notification",
                        "type": "string"
                    },
                    "notifiable_id": {
                        "description": "id of User that got the notification",
                        "type": "string"
                    },
                    "data": {
                        "description": "all notification data",
                        "type": "object"
                    },
                    "read_at": {
                        "description": "timestamp when notification was marked as read",
                        "type": "string",
                        "format": "date-time"
                    }
                },
                "type": "object"
            },
            "Page": {
                "required": [
                    "title",
                    "author_id",
                    "content"
                ],
                "properties": {
                    "title": {
                        "description": "page title",
                        "type": "string"
                    },
                    "author_id": {
                        "description": "identifier of the user object who owns a page",
                        "type": "integer"
                    },
                    "content": {
                        "description": "page content",
                        "type": "string"
                    },
                    "active": {
                        "description": "page is active",
                        "type": "boolean"
                    }
                },
                "type": "object"
            },
            "Payment": {
                "required": [
                    "amount",
                    "currency",
                    "description"
                ],
                "properties": {
                    "id": {
                        "description": "id",
                        "type": "integer"
                    },
                    "amount": {
                        "description": "amount",
                        "type": "integer"
                    },
                    "currency": {
                        "description": "currency",
                        "type": "string"
                    },
                    "description": {
                        "description": "description",
                        "type": "string"
                    },
                    "order_id": {
                        "description": "order_id",
                        "type": "string"
                    },
                    "payable_id": {
                        "description": "payable_id",
                        "type": "integer"
                    },
                    "payable_type": {
                        "description": "payable_type",
                        "type": "string"
                    },
                    "user_id": {
                        "description": "user_id",
                        "type": "integer"
                    }
                },
                "type": "object"
            },
            "LoginPencilSpaceRequest": {
                "required": [
                    "redirect_url"
                ],
                "properties": {
                    "redirect_url": {
                        "type": "string",
                        "example": "https://my.pencilapp.com"
                    }
                },
                "type": "object"
            },
            "Role": {
                "required": [
                    "name"
                ],
                "properties": {
                    "id": {
                        "description": "id ",
                        "type": "integer"
                    },
                    "name": {
                        "description": "name ",
                        "type": "string"
                    },
                    "guard_name": {
                        "description": "Guard Name",
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "Permission": {
                "required": [
                    "id",
                    "name",
                    "guard_name",
                    "assigned"
                ],
                "properties": {
                    "id": {
                        "description": "id ",
                        "type": "integer"
                    },
                    "name": {
                        "description": "name ",
                        "type": "string"
                    },
                    "guard_name": {
                        "description": "Guard Name",
                        "type": "string"
                    },
                    "assigned": {
                        "description": "Is permission assigned to current role",
                        "type": "boolean"
                    }
                },
                "type": "object"
            },
            "QuestionnaireAnswerChangeVisibility": {
                "properties": {
                    "visible_on_front": {
                        "description": "visible on front",
                        "type": "boolean"
                    }
                },
                "type": "object"
            },
            "QuestionnaireAnswerRequest": {
                "properties": {
                    "question_id": {
                        "description": "question identified by id",
                        "type": "integer"
                    },
                    "rate": {
                        "description": "rate from 1 to 5",
                        "type": "integer"
                    },
                    "note": {
                        "description": "anser of text type",
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "ModelStarsResponse": {
                "properties": {
                    "avg_rate": {
                        "description": "average rate",
                        "type": "string"
                    },
                    "count_answers": {
                        "description": "count all answers for this question",
                        "type": "integer"
                    },
                    "count_public_answers": {
                        "description": "count all public answers for this question",
                        "type": "integer"
                    },
                    "question_id": {
                        "description": "question identifier",
                        "type": "integer"
                    }
                },
                "type": "object"
            },
            "QuestionnaireReportResource": {
                "properties": {
                    "sum_rate": {
                        "description": "sum of rates for this question",
                        "type": "string"
                    },
                    "count_answers": {
                        "description": "count all answers for this question",
                        "type": "integer"
                    },
                    "avg_rate": {
                        "description": "average rate",
                        "type": "string"
                    },
                    "question_id": {
                        "description": "question identifier",
                        "type": "integer"
                    },
                    "title": {
                        "description": "question title",
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "QuestionnaireStarsResource": {
                "properties": {
                    "sum_rate": {
                        "description": "sum of rates for this question",
                        "type": "string"
                    },
                    "count_answers": {
                        "description": "count all answers for this question",
                        "type": "integer"
                    },
                    "avg_rate": {
                        "description": "average rate",
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "Question": {
                "required": [
                    "title",
                    "questionnaire_id"
                ],
                "properties": {
                    "title": {
                        "description": "question title",
                        "type": "string"
                    },
                    "questionnaire_id": {
                        "description": "identifier of the questionnaire object",
                        "type": "integer"
                    },
                    "description": {
                        "description": "question description",
                        "type": "string"
                    },
                    "position": {
                        "description": "question position",
                        "type": "integer"
                    },
                    "active": {
                        "description": "question is active",
                        "type": "boolean"
                    },
                    "type": {
                        "description": "type: rate, text",
                        "type": "string"
                    },
                    "public_answers": {
                        "description": "whether answers to questions are public",
                        "type": "boolean"
                    },
                    "max_score": {
                        "description": "maximum score for question",
                        "type": "integer"
                    }
                },
                "type": "object"
            },
            "QuestionAnswer": {
                "required": [
                    "rate",
                    "question_id",
                    "user_id",
                    "questionnaire_model_id"
                ],
                "properties": {
                    "rate": {
                        "description": "question rate",
                        "type": "integer"
                    },
                    "question_id": {
                        "description": "identifier of the question object",
                        "type": "integer"
                    },
                    "user_id": {
                        "description": "identifier of the user object",
                        "type": "integer"
                    },
                    "questionnaire_model_id": {
                        "description": "identifier of the questionnaire model object",
                        "type": "integer"
                    },
                    "note": {
                        "description": "text answer",
                        "type": "string"
                    },
                    "visible_on_front": {
                        "description": "whether answers is visible on front",
                        "type": "boolean"
                    }
                },
                "type": "object"
            },
            "Questionnaire": {
                "required": [
                    "title"
                ],
                "properties": {
                    "title": {
                        "description": "questionnaire title",
                        "type": "string"
                    },
                    "active": {
                        "description": "Questionnaire is active",
                        "type": "boolean"
                    },
                    "questions": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Question"
                        }
                    },
                    "models": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/QuestionnaireModel"
                        }
                    }
                },
                "type": "object"
            },
            "QuestionnaireModel": {
                "required": [
                    "questionnaire_id",
                    "model_type_id",
                    "model_id"
                ],
                "properties": {
                    "questionnaire_id": {
                        "description": "identifier of the questionnaire object",
                        "type": "integer"
                    },
                    "model_id": {
                        "description": "identifier of the model object who is asigne to questionnaire",
                        "type": "integer"
                    },
                    "model_type_id": {
                        "description": "model_type_id",
                        "type": "integer"
                    },
                    "model_title": {
                        "description": "model_title",
                        "type": "integer"
                    },
                    "target_group": {
                        "description": "Targer group user/author",
                        "type": "string",
                        "example": "author"
                    },
                    "display_frequency_minutes": {
                        "description": "Time in minutes after which the questionnaire should be displayed",
                        "type": "integer",
                        "example": "5"
                    }
                },
                "type": "object"
            },
            "QuestionnaireModelType": {
                "required": [
                    "title",
                    "model_class"
                ],
                "properties": {
                    "title": {
                        "description": "title",
                        "type": "string"
                    },
                    "model_class": {
                        "description": "model_class",
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "Setting": {
                "required": [
                    "title"
                ],
                "properties": {
                    "id": {
                        "description": "id",
                        "type": "integer"
                    },
                    "key": {
                        "description": "key",
                        "type": "string"
                    },
                    "group": {
                        "description": "group",
                        "type": "string"
                    },
                    "value": {
                        "description": "value",
                        "type": "string"
                    },
                    "type": {
                        "description": "type",
                        "type": "string"
                    },
                    "public": {
                        "description": "public",
                        "type": "boolean"
                    },
                    "enumerable": {
                        "description": "enumerable",
                        "type": "boolean"
                    },
                    "sort": {
                        "description": "sort",
                        "type": "integer"
                    }
                },
                "type": "object"
            },
            "stationary-event-create-request": {
                "required": [
                    "name",
                    "status",
                    "description",
                    "started_at",
                    "finished_at"
                ],
                "properties": {
                    "name": {
                        "description": "name",
                        "type": "string"
                    },
                    "status": {
                        "description": "status",
                        "type": "string"
                    },
                    "description": {
                        "description": "description",
                        "type": "string"
                    },
                    "short_desc": {
                        "description": "short description",
                        "type": "string"
                    },
                    "started_at": {
                        "description": "started_at",
                        "type": "string",
                        "format": "date-time"
                    },
                    "finished_at": {
                        "description": "finished_at",
                        "type": "string",
                        "format": "date-time"
                    },
                    "max_participants": {
                        "description": "max_participants",
                        "type": "integer"
                    },
                    "place": {
                        "description": "place",
                        "type": "string"
                    },
                    "program": {
                        "description": "program",
                        "type": "string"
                    },
                    "authors": {
                        "description": "authors",
                        "type": "array",
                        "items": {
                            "type": "integer"
                        }
                    },
                    "categories": {
                        "description": "categories",
                        "type": "array",
                        "items": {
                            "type": "integer"
                        }
                    },
                    "image": {
                        "description": "image",
                        "type": "file"
                    },
                    "agenda": {
                        "description": "agenda",
                        "type": "object"
                    }
                },
                "type": "object"
            },
            "stationary-event-update-request": {
                "properties": {
                    "name": {
                        "description": "name",
                        "type": "string"
                    },
                    "status": {
                        "description": "status",
                        "type": "string"
                    },
                    "description": {
                        "description": "description",
                        "type": "string"
                    },
                    "short_desc": {
                        "description": "short description",
                        "type": "string"
                    },
                    "started_at": {
                        "description": "started_at",
                        "type": "string",
                        "format": "date-time"
                    },
                    "finished_at": {
                        "description": "finished_at",
                        "type": "string",
                        "format": "date-time"
                    },
                    "max_participants": {
                        "description": "max_participants",
                        "type": "integer"
                    },
                    "place": {
                        "description": "place",
                        "type": "string"
                    },
                    "program": {
                        "description": "program",
                        "type": "string"
                    },
                    "authors": {
                        "description": "authors",
                        "type": "array",
                        "items": {
                            "type": "integer"
                        }
                    },
                    "categories": {
                        "description": "categories",
                        "type": "array",
                        "items": {
                            "type": "integer"
                        }
                    },
                    "image": {
                        "description": "image",
                        "type": "file"
                    },
                    "image_path": {
                        "description": "image_path",
                        "type": "string"
                    },
                    "agenda": {
                        "description": "agenda",
                        "type": "object"
                    }
                },
                "type": "object"
            },
            "stationary-event": {
                "required": [
                    "name",
                    "description",
                    "started_at",
                    "finished_at"
                ],
                "properties": {
                    "id": {
                        "description": "id",
                        "type": "integer"
                    },
                    "name": {
                        "description": "name",
                        "type": "string"
                    },
                    "description": {
                        "description": "description",
                        "type": "string"
                    },
                    "short_desc": {
                        "description": "short description",
                        "type": "string"
                    },
                    "started_at": {
                        "description": "started_at",
                        "type": "string",
                        "format": "date-time"
                    },
                    "finished_at": {
                        "description": "finished_at",
                        "type": "string",
                        "format": "date-time"
                    },
                    "max_participants": {
                        "description": "max_participants",
                        "type": "integer"
                    },
                    "place": {
                        "description": "place",
                        "type": "string"
                    },
                    "program": {
                        "description": "program",
                        "type": "string"
                    },
                    "image_path": {
                        "description": "image_path",
                        "type": "string"
                    },
                    "created_at": {
                        "description": "created_at",
                        "type": "string",
                        "format": "date-time"
                    },
                    "updated_at": {
                        "description": "updated_at",
                        "type": "string",
                        "format": "date-time"
                    },
                    "status": {
                        "description": "status",
                        "type": "string"
                    },
                    "agenda": {
                        "description": "agenda",
                        "type": "object"
                    }
                },
                "type": "object"
            },
            "AdminTaskCreateRequest": {
                "required": [
                    "title",
                    "user_id"
                ],
                "properties": {
                    "title": {
                        "description": "title",
                        "type": "string"
                    },
                    "description": {
                        "description": "description",
                        "type": "string"
                    },
                    "type": {
                        "description": "type",
                        "type": "string"
                    },
                    "related_type": {
                        "description": "related_type",
                        "type": "string"
                    },
                    "related_id": {
                        "description": "related_id",
                        "type": "integer"
                    },
                    "user_id": {
                        "description": "user_id",
                        "type": "integer"
                    },
                    "due_date": {
                        "description": "due_date",
                        "type": "string",
                        "format": "date-time"
                    }
                },
                "type": "object"
            },
            "TaskNoteCreateRequest": {
                "required": [
                    "note",
                    "task_id"
                ],
                "properties": {
                    "note": {
                        "description": "note",
                        "type": "string"
                    },
                    "task_id": {
                        "description": "task_id",
                        "type": "integer"
                    }
                },
                "type": "object"
            },
            "TaskCreateRequest": {
                "required": [
                    "title"
                ],
                "properties": {
                    "title": {
                        "description": "title",
                        "type": "string"
                    },
                    "description": {
                        "description": "description",
                        "type": "string"
                    },
                    "type": {
                        "description": "type",
                        "type": "string"
                    },
                    "related_type": {
                        "description": "related_type",
                        "type": "string"
                    },
                    "related_id": {
                        "description": "related_id",
                        "type": "integer"
                    },
                    "due_date": {
                        "description": "due_date",
                        "type": "string",
                        "format": "date-time"
                    }
                },
                "type": "object"
            },
            "TaskDetailsResource": {
                "required": [
                    "title",
                    "user",
                    "created_by"
                ],
                "properties": {
                    "title": {
                        "description": "title",
                        "type": "string"
                    },
                    "description": {
                        "description": "description",
                        "type": "string"
                    },
                    "type": {
                        "description": "type",
                        "type": "string"
                    },
                    "related_type": {
                        "description": "related_type",
                        "type": "string"
                    },
                    "related_id": {
                        "description": "related_id",
                        "type": "integer"
                    },
                    "related": {
                        "description": "realted",
                        "type": "object"
                    },
                    "user": {
                        "$ref": "#/components/schemas/UserResource"
                    },
                    "created_by": {
                        "$ref": "#/components/schemas/UserResource"
                    },
                    "due_date": {
                        "description": "due_date",
                        "type": "string",
                        "format": "date-time"
                    },
                    "completed_at": {
                        "description": "completed_at",
                        "type": "string",
                        "format": "date-time"
                    },
                    "notes": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/TaskNoteResource"
                        }
                    }
                },
                "type": "object"
            },
            "TaskNoteResource": {
                "required": [
                    "id",
                    "note",
                    "user",
                    "task_id"
                ],
                "properties": {
                    "id": {
                        "description": "id",
                        "type": "integer"
                    },
                    "note": {
                        "description": "note",
                        "type": "string"
                    },
                    "created_at": {
                        "description": "created_at",
                        "type": "string",
                        "format": "date-time"
                    },
                    "user": {
                        "$ref": "#/components/schemas/UserResource"
                    },
                    "task_id": {
                        "description": "task_id",
                        "type": "integer"
                    }
                },
                "type": "object"
            },
            "TaskResource": {
                "required": [
                    "title",
                    "user",
                    "created_by"
                ],
                "properties": {
                    "title": {
                        "description": "title",
                        "type": "string"
                    },
                    "description": {
                        "description": "description",
                        "type": "string"
                    },
                    "type": {
                        "description": "type",
                        "type": "string"
                    },
                    "related_type": {
                        "description": "related_type",
                        "type": "string"
                    },
                    "related_id": {
                        "description": "related_id",
                        "type": "integer"
                    },
                    "related": {
                        "description": "realted",
                        "type": "object"
                    },
                    "user": {
                        "$ref": "#/components/schemas/UserResource"
                    },
                    "created_by": {
                        "$ref": "#/components/schemas/UserResource"
                    },
                    "due_date": {
                        "description": "due_date",
                        "type": "string",
                        "format": "date-time"
                    },
                    "completed_at": {
                        "description": "completed_at",
                        "type": "string",
                        "format": "date-time"
                    },
                    "has_notes": {
                        "description": "has_notes",
                        "type": "boolean"
                    }
                },
                "type": "object"
            },
            "UserResource": {
                "required": [
                    "id",
                    "first_name",
                    "last_name"
                ],
                "properties": {
                    "id": {
                        "description": "id",
                        "type": "integer"
                    },
                    "first_name": {
                        "description": "first_name",
                        "type": "string"
                    },
                    "last_name": {
                        "description": "last_name",
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "EmailTemplateDraft": {
                "properties": {
                    "title": {
                        "description": "subject with the sample values",
                        "type": "string"
                    },
                    "html": {
                        "description": "rendered e-mail HTML with the sample values",
                        "type": "string"
                    },
                    "errors": {
                        "description": "MJML errors reported by the renderer",
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "missing_variables": {
                        "description": "variables required by the event that the draft does not use",
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "warnings": {
                        "description": "accessibility warnings of the generated e-mail",
                        "type": "array",
                        "items": {
                            "properties": {
                                "code": {
                                    "type": "string"
                                },
                                "message": {
                                    "type": "string"
                                },
                                "count": {
                                    "type": "integer"
                                }
                            },
                            "type": "object"
                        }
                    },
                    "locale": {
                        "description": "the language the draft was rendered in, as requested",
                        "type": "string",
                        "nullable": true
                    },
                    "sent": {
                        "description": "only in the test-send response",
                        "type": "boolean"
                    },
                    "recipient": {
                        "description": "only in the test-send response: the address of the signed-in admin",
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "FabricPDF": {
                "properties": {
                    "id": {
                        "description": "template id",
                        "type": "integer"
                    },
                    "title": {
                        "description": "title",
                        "type": "string"
                    },
                    "content": {
                        "description": "pdfme template (JSON) the PDF is rendered from",
                        "type": "object"
                    },
                    "path": {
                        "description": "path to rendered PDF binary file",
                        "type": "string"
                    },
                    "assignable_type": {
                        "type": "string"
                    },
                    "assignable_id": {
                        "type": "integer"
                    },
                    "status": {
                        "description": "valid, expired or revoked",
                        "type": "string"
                    },
                    "expires_at": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                    }
                },
                "type": "object"
            },
            "Template": {
                "properties": {
                    "id": {
                        "description": "template id",
                        "type": "integer"
                    },
                    "name": {
                        "description": "template name",
                        "type": "string"
                    },
                    "event": {
                        "description": "event full classname",
                        "type": "string"
                    },
                    "channel": {
                        "description": "channel full classname",
                        "type": "string"
                    },
                    "locale": {
                        "description": "language code the template is written for (en, pl, zh); null for a template of no particular language, the last fallback",
                        "type": "string",
                        "nullable": true
                    },
                    "default": {
                        "description": "this template is default template for given channel and event pair",
                        "type": "boolean"
                    }
                },
                "type": "object"
            },
            "PlatformTemplate": {
                "properties": {
                    "slug": {
                        "description": "Tenant templates (ADR 0141, amendment): named starting points for new tenants, applied when a tenant is created\n(`template` of `POST /api/platform/tenants`, `--template` of `ulams:tenant:create`). Same access as the platform tenant API.",
                        "type": "string",
                        "example": "policy-academy"
                    },
                    "name": {
                        "type": "string"
                    },
                    "theme": {
                        "type": "string",
                        "nullable": true
                    },
                    "accent": {
                        "type": "string",
                        "nullable": true
                    },
                    "demo": {
                        "type": "boolean"
                    },
                    "users": {
                        "description": "Demo students created with a tenant made from it",
                        "type": "integer"
                    },
                    "env_override_keys": {
                        "description": "Names only, never values",
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time"
                    }
                },
                "type": "object"
            },
            "PlatformTenant": {
                "properties": {
                    "slug": {
                        "description": "The platform tenant API (ADR 0078): only on a platform host with TENANCY_PLATFORM_API=true (404\notherwise), for users with the `platform_admin` permission; scoped tokens need `platform:read|write`.",
                        "type": "string",
                        "example": "coffee"
                    },
                    "name": {
                        "type": "string"
                    },
                    "theme": {
                        "type": "string",
                        "nullable": true
                    },
                    "accent": {
                        "type": "string",
                        "nullable": true
                    },
                    "demo": {
                        "type": "boolean"
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "provisioning",
                            "active",
                            "failed"
                        ]
                    },
                    "urls": {
                        "properties": {
                            "api": {
                                "type": "string"
                            },
                            "front": {
                                "type": "string"
                            },
                            "admin": {
                                "type": "string"
                            }
                        },
                        "type": "object"
                    },
                    "steps": {
                        "description": "Finished provisioning steps with their time",
                        "type": "object"
                    },
                    "env_override_keys": {
                        "description": "Names only, never values",
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "last_error": {
                        "type": "string",
                        "nullable": true
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time"
                    }
                },
                "type": "object"
            },
            "PlatformOperation": {
                "properties": {
                    "id": {
                        "type": "string",
                        "example": "01j9z3k8m2x4q7r5t6v8w0y1ab"
                    },
                    "kind": {
                        "type": "string",
                        "enum": [
                            "create",
                            "delete"
                        ]
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "queued",
                            "running",
                            "succeeded",
                            "failed"
                        ]
                    },
                    "tenant": {
                        "type": "string"
                    },
                    "steps": {
                        "type": "array",
                        "items": {
                            "properties": {
                                "name": {
                                    "type": "string"
                                },
                                "status": {
                                    "type": "string",
                                    "enum": [
                                        "pending",
                                        "running",
                                        "succeeded",
                                        "skipped",
                                        "failed"
                                    ]
                                },
                                "startedAt": {
                                    "type": "string",
                                    "nullable": true
                                },
                                "finishedAt": {
                                    "type": "string",
                                    "nullable": true
                                },
                                "error": {
                                    "type": "string",
                                    "nullable": true
                                }
                            },
                            "type": "object"
                        }
                    },
                    "error": {
                        "type": "string",
                        "nullable": true
                    },
                    "requested_by": {
                        "type": "integer",
                        "nullable": true
                    },
                    "created_at": {
                        "type": "string"
                    },
                    "started_at": {
                        "type": "string",
                        "nullable": true
                    },
                    "finished_at": {
                        "type": "string",
                        "nullable": true
                    }
                },
                "type": "object"
            },
            "AdminGiftQuestionRequest": {
                "required": [
                    "topic_gift_quiz_id",
                    "value",
                    "score"
                ],
                "properties": {
                    "topic_gift_quiz_id": {
                        "description": "topic_gift_quiz_id",
                        "type": "number"
                    },
                    "value": {
                        "description": "value",
                        "type": "string"
                    },
                    "score": {
                        "description": "max score",
                        "type": "number",
                        "example": "1"
                    },
                    "order": {
                        "description": "order",
                        "type": "integer",
                        "example": "1"
                    },
                    "category_id": {
                        "description": "category_id",
                        "type": "integer",
                        "example": "1"
                    }
                },
                "type": "object"
            },
            "AdminImportGiftQuestionsRequest": {
                "required": [
                    "topic_gift_quiz_id",
                    "file"
                ],
                "properties": {
                    "topic_gift_quiz_id": {
                        "description": "topic_gift_quiz_id",
                        "type": "number"
                    },
                    "file": {
                        "description": "file",
                        "type": "file"
                    }
                },
                "type": "object"
            },
            "AdminSortGiftQuestionRequest": {
                "properties": {
                    "orders": {
                        "description": "orders",
                        "type": "array",
                        "items": {}
                    }
                },
                "type": "object"
            },
            "AdminUpdateAttemptAnswerRequest": {
                "required": [
                    "score"
                ],
                "properties": {
                    "score": {
                        "description": "score",
                        "type": "number"
                    },
                    "feedback": {
                        "description": "feedback",
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "AdminUpdateGiftQuizRequest": {
                "required": [
                    "value"
                ],
                "properties": {
                    "value": {
                        "type": "string"
                    },
                    "max_attempts": {
                        "type": "integer"
                    },
                    "max_execution_time": {
                        "type": "integer"
                    },
                    "min_pass_score": {
                        "type": "number"
                    },
                    "counts_to_grade": {
                        "type": "boolean"
                    },
                    "weight": {
                        "type": "integer"
                    },
                    "randomize_order": {
                        "type": "boolean"
                    }
                },
                "type": "object"
            },
            "AdminUpdateQuizAttemptFeedbackRequest": {
                "properties": {
                    "feedback": {
                        "description": "Tutor feedback (light rich text or video link). Send null or empty to remove it.",
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "GetActiveAttemptRequest": {
                "required": [
                    "topic_gift_quiz_id"
                ],
                "properties": {
                    "topic_gift_quiz_id": {
                        "description": "topic_gift_quiz_id",
                        "type": "number"
                    }
                },
                "type": "object"
            },
            "SaveAllAttemptAnswerRequest": {
                "required": [
                    "topic_gift_quiz_attempt_id",
                    "answers"
                ],
                "properties": {
                    "topic_gift_quiz_attempt_id": {
                        "description": "attempt id",
                        "type": "number"
                    },
                    "answers": {
                        "description": "answers",
                        "type": "array",
                        "items": {
                            "properties": {
                                "topic_gift_question_id": {
                                    "description": "topic_gift_question_id",
                                    "type": "number"
                                },
                                "answer": {
                                    "description": "answer",
                                    "type": "object"
                                }
                            },
                            "type": "object"
                        }
                    }
                },
                "type": "object"
            },
            "SaveAttemptAnswerRequest": {
                "required": [
                    "topic_gift_question_id",
                    "answer"
                ],
                "properties": {
                    "topic_gift_question_id": {
                        "description": "question id",
                        "type": "number"
                    },
                    "topic_gift_quiz_attempt_id": {
                        "description": "attempt id",
                        "type": "number"
                    },
                    "answer": {
                        "description": "answer",
                        "type": "object"
                    }
                },
                "type": "object"
            },
            "GiftCourseSimpleResource": {
                "properties": {
                    "id": {
                        "type": "number"
                    },
                    "title": {
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "GiftQuizSimpleResource": {
                "properties": {
                    "id": {
                        "description": "topic_gift_quiz_id (value used to filter quiz reports)",
                        "type": "number"
                    },
                    "title": {
                        "description": "quiz title taken from its topic",
                        "type": "string"
                    },
                    "topic_id": {
                        "type": "number"
                    }
                },
                "type": "object"
            },
            "GiftTopicSimpleResource": {
                "properties": {
                    "id": {
                        "type": "number"
                    },
                    "title": {
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "GiftUserSimpleResource": {
                "properties": {
                    "id": {
                        "description": "id",
                        "type": "number"
                    },
                    "first_name": {
                        "type": "string"
                    },
                    "last_name": {
                        "type": "string"
                    },
                    "email": {
                        "description": "email",
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "TopicLayout": {
                "required": [
                    "document",
                    "markdown_fallback"
                ],
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "document": {
                        "description": "Layout document (a JSON string is accepted in multipart requests): a list of {component, props, id?} nodes using only the approved learner layout components (Callout, Steps, ComparisonTable, H5PFrame, LiaScriptLesson, Timeline, FlipCards, CodeBlock, PracticeActivity), validated against the learner layout manifest",
                        "type": "array",
                        "items": {
                            "type": "object"
                        }
                    },
                    "schema_version": {
                        "type": "string",
                        "enum": [
                            "1"
                        ]
                    },
                    "markdown_fallback": {
                        "description": "Markdown shown by clients that do not render layouts, and when the document cannot be rendered",
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "AdminGradeProjectSolutionRequest": {
                "required": [
                    "score"
                ],
                "properties": {
                    "score": {
                        "type": "number"
                    }
                },
                "type": "object"
            },
            "AdminUpdateProjectSolutionFeedbackRequest": {
                "properties": {
                    "feedback": {
                        "description": "Tutor feedback (rich text). Send null or empty to remove it.",
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "CreateProjectSolutionRequest": {
                "required": [
                    "topic_id",
                    "file"
                ],
                "properties": {
                    "topic_id": {
                        "description": "topic_id",
                        "type": "number"
                    },
                    "file": {
                        "description": "file",
                        "type": "file"
                    }
                },
                "type": "object"
            },
            "ProjectSolutionResource": {
                "properties": {
                    "id": {
                        "description": "id",
                        "type": "number"
                    },
                    "created_at": {
                        "description": "created_at",
                        "type": "string",
                        "format": "date-time"
                    },
                    "file_url": {
                        "description": "file_url",
                        "type": "string"
                    },
                    "topic_id": {
                        "description": "topic_id",
                        "type": "number"
                    },
                    "user_id": {
                        "description": "user_id",
                        "type": "number"
                    },
                    "tutor_feedback": {
                        "description": "tutor feedback (rich text or video link)",
                        "type": "string"
                    },
                    "score": {
                        "description": "score",
                        "type": "number"
                    },
                    "max_score": {
                        "description": "max_score",
                        "type": "number"
                    },
                    "graded_at": {
                        "description": "graded_at",
                        "type": "string",
                        "format": "date-time"
                    }
                },
                "type": "object"
            },
            "TopicAudio": {
                "required": [
                    "value"
                ],
                "properties": {
                    "id": {
                        "description": "id"
                    },
                    "value": {
                        "description": "value",
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "TopicCmi5Au": {
                "required": [
                    "value"
                ],
                "properties": {
                    "id": {
                        "description": "id"
                    },
                    "value": {
                        "description": "value",
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "TopicH5P": {
                "required": [
                    "value"
                ],
                "properties": {
                    "id": {
                        "description": "id"
                    },
                    "value": {
                        "description": "H5P content id (h5p.contents.id, H5P service)",
                        "type": "integer"
                    },
                    "content": {
                        "$ref": "#/components/schemas/H5PContentSummary"
                    }
                },
                "type": "object"
            },
            "TopicImage": {
                "required": [
                    "value"
                ],
                "properties": {
                    "id": {
                        "description": "id"
                    },
                    "value": {
                        "description": "value",
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "TopicOEmbed": {
                "required": [
                    "value"
                ],
                "properties": {
                    "id": {
                        "description": "id"
                    },
                    "value": {
                        "description": "value",
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "TopicPDF": {
                "required": [
                    "value"
                ],
                "properties": {
                    "id": {
                        "description": "id"
                    },
                    "value": {
                        "description": "value",
                        "type": "string"
                    },
                    "length": {
                        "description": "length",
                        "type": "integer"
                    },
                    "page_count": {
                        "description": "page_count",
                        "type": "integer"
                    }
                },
                "type": "object"
            },
            "TopicRichText": {
                "required": [
                    "value"
                ],
                "properties": {
                    "id": {
                        "description": "id"
                    },
                    "value": {
                        "description": "value",
                        "type": "string"
                    },
                    "length": {
                        "description": "length",
                        "type": "integer"
                    }
                },
                "type": "object"
            },
            "TopicScormSco": {
                "required": [
                    "value"
                ],
                "properties": {
                    "id": {
                        "description": "id"
                    },
                    "value": {
                        "description": "value",
                        "type": "string"
                    },
                    "uuid": {
                        "description": "uuid"
                    }
                },
                "type": "object"
            },
            "language-line-save-request": {
                "required": [
                    "text"
                ],
                "properties": {
                    "group": {
                        "description": "group",
                        "type": "string"
                    },
                    "key": {
                        "description": "key",
                        "type": "string"
                    },
                    "text": {
                        "description": "text",
                        "type": "object"
                    }
                },
                "type": "object"
            },
            "retrieve-translation-request": {
                "required": [
                    "key"
                ],
                "properties": {
                    "key": {
                        "description": "key",
                        "type": "string"
                    },
                    "replace": {
                        "description": "replace",
                        "type": "object"
                    }
                },
                "type": "object"
            },
            "TopicVideo": {
                "required": [
                    "value"
                ],
                "properties": {
                    "id": {
                        "description": "id"
                    },
                    "value": {
                        "description": "value",
                        "type": "string"
                    },
                    "poster": {
                        "description": "poster",
                        "type": "string"
                    },
                    "hls": {
                        "description": "hls",
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "Coupon": {
                "required": [
                    "code",
                    "type",
                    "amount"
                ],
                "properties": {
                    "id": {
                        "description": "id",
                        "type": "integer"
                    },
                    "name": {
                        "description": "name",
                        "type": "string"
                    },
                    "code": {
                        "description": "code",
                        "type": "string"
                    },
                    "type": {
                        "description": "type",
                        "type": "string"
                    },
                    "active_from": {
                        "description": "active_from",
                        "type": "data"
                    },
                    "active_to": {
                        "description": "active_to",
                        "type": "data"
                    },
                    "limit_usage": {
                        "description": "limit_usage",
                        "type": "integer"
                    },
                    "limit_per_user": {
                        "description": "limit_per_user",
                        "type": "integer"
                    },
                    "min_cart_price": {
                        "description": "min_cart_price",
                        "type": "integer"
                    },
                    "max_cart_price": {
                        "description": "max_cart_price",
                        "type": "integer"
                    },
                    "amount": {
                        "description": "amount",
                        "type": "integer"
                    },
                    "users": {
                        "type": "array",
                        "items": {
                            "type": "integer"
                        }
                    },
                    "included_products": {
                        "type": "array",
                        "items": {
                            "type": "integer"
                        }
                    },
                    "excluded_products": {
                        "type": "array",
                        "items": {
                            "type": "integer"
                        }
                    },
                    "included_categories": {
                        "type": "array",
                        "items": {
                            "type": "integer"
                        }
                    },
                    "excluded_categories": {
                        "type": "array",
                        "items": {
                            "type": "integer"
                        }
                    },
                    "active": {
                        "type": "array",
                        "items": {
                            "type": "boolean"
                        }
                    },
                    "exclude_promotions": {
                        "type": "array",
                        "items": {
                            "type": "boolean"
                        }
                    }
                },
                "type": "object"
            },
            "WebhookEndpoint": {
                "properties": {
                    "id": {
                        "type": "string",
                        "example": "01j9z8x3v7c5qk2m4n6p8r0t1w"
                    },
                    "url": {
                        "type": "string",
                        "example": "https://example.com/hooks/ulams"
                    },
                    "description": {
                        "type": "string",
                        "nullable": true
                    },
                    "events": {
                        "description": "Event types, or [*] for every available event",
                        "type": "array",
                        "items": {
                            "type": "string",
                            "example": "course.completed"
                        }
                    },
                    "api_version": {
                        "type": "string",
                        "example": "2026-10-20"
                    },
                    "enabled": {
                        "type": "boolean"
                    },
                    "disabled_reason": {
                        "type": "string",
                        "nullable": true
                    },
                    "consecutive_failures": {
                        "type": "integer"
                    },
                    "secret_hint": {
                        "description": "Last characters of the signing secret",
                        "type": "string"
                    },
                    "secret": {
                        "description": "The signing secret; only in the response that creates the endpoint or rotates its secret",
                        "type": "string"
                    },
                    "last_delivery_at": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    }
                },
                "type": "object"
            },
            "WebhookDelivery": {
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "endpoint_id": {
                        "type": "string"
                    },
                    "event_id": {
                        "type": "string",
                        "example": "evt_01j9z8x3v7c5qk2m4n6p8r0t1w"
                    },
                    "event_type": {
                        "type": "string",
                        "example": "course.completed"
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "pending",
                            "retrying",
                            "succeeded",
                            "failed",
                            "cancelled"
                        ]
                    },
                    "attempts": {
                        "type": "integer"
                    },
                    "last_status_code": {
                        "type": "integer",
                        "nullable": true
                    },
                    "is_test": {
                        "type": "boolean"
                    },
                    "replay_of": {
                        "type": "string",
                        "nullable": true
                    },
                    "next_attempt_at": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                    },
                    "delivered_at": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "payload": {
                        "description": "The event that was signed and sent (delivery detail only)",
                        "type": "object"
                    },
                    "attempt_log": {
                        "description": "One entry per HTTP attempt (delivery detail only)",
                        "type": "array",
                        "items": {
                            "properties": {
                                "number": {
                                    "type": "integer"
                                },
                                "status_code": {
                                    "type": "integer",
                                    "nullable": true
                                },
                                "response_body": {
                                    "type": "string",
                                    "nullable": true
                                },
                                "error": {
                                    "type": "string",
                                    "nullable": true
                                },
                                "duration_ms": {
                                    "type": "integer"
                                },
                                "created_at": {
                                    "type": "string",
                                    "format": "date-time"
                                }
                            },
                            "type": "object"
                        }
                    }
                },
                "type": "object"
            },
            "WebhookEventType": {
                "properties": {
                    "type": {
                        "type": "string",
                        "example": "course.completed"
                    },
                    "description": {
                        "type": "string"
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "available",
                            "planned",
                            "test"
                        ]
                    }
                },
                "type": "object"
            },
            "Webinar": {
                "required": [
                    "name",
                    "status",
                    "description"
                ],
                "properties": {
                    "id": {
                        "description": "id",
                        "type": "integer"
                    },
                    "name": {
                        "description": "name",
                        "type": "string"
                    },
                    "status": {
                        "description": "status",
                        "type": "string"
                    },
                    "description": {
                        "description": "description",
                        "type": "string"
                    },
                    "short_desc": {
                        "description": "short_desc",
                        "type": "string"
                    },
                    "agenda": {
                        "description": "agenda",
                        "type": "string"
                    },
                    "duration": {
                        "description": "duration",
                        "type": "string"
                    },
                    "active_to": {
                        "description": "active_to",
                        "type": "string",
                        "format": "date-time"
                    },
                    "active_from": {
                        "description": "active_from",
                        "type": "string",
                        "format": "date-time"
                    },
                    "image_path": {
                        "description": "image_path",
                        "type": "string"
                    },
                    "image_url": {
                        "description": "image_url",
                        "type": "string"
                    },
                    "logotype_path": {
                        "description": "logotype_path",
                        "type": "string"
                    },
                    "logotype_url": {
                        "description": "logotype_url",
                        "type": "string"
                    },
                    "created_at": {
                        "description": "created_at",
                        "type": "string",
                        "format": "date-time"
                    },
                    "updated_at": {
                        "description": "updated_at",
                        "type": "string",
                        "format": "date-time"
                    },
                    "yt_url": {
                        "description": "yt_url",
                        "type": "string"
                    },
                    "yt_stream_url": {
                        "description": "yt_stream_url",
                        "type": "string"
                    },
                    "yt_stream_key": {
                        "description": "yt_stream_key",
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "Jitsi": {
                "properties": {
                    "data": {
                        "type": "object"
                    },
                    "domain": {
                        "type": "string",
                        "example": "meet-stage.ulams.app"
                    },
                    "url": {
                        "type": "string",
                        "example": "https://meet-stage.ulams.app/asdhuasd.?jwt=token"
                    },
                    "yt_url": {
                        "type": "string",
                        "example": "https://youtube.pl/"
                    },
                    "yt_stream_url": {
                        "type": "string",
                        "example": "rtmp://a.rtmp.youtube.com/xyz"
                    },
                    "yt_stream_key": {
                        "type": "string",
                        "example": "asdqdfas123asdqwe"
                    }
                },
                "type": "object"
            }
        },
        "securitySchemes": {
            "passport": {
                "type": "http",
                "name": "bearerAuth",
                "in": "header",
                "bearerFormat": "JWT",
                "scheme": "bearer"
            },
            "scim": {
                "type": "http",
                "description": "A SCIM token of one identity provider (POST /api/admin/identity/providers/{provider}/scim-tokens)",
                "scheme": "bearer"
            }
        }
    },
    "tags": [
        {
            "name": "Contact",
            "description": "Contact"
        },
        {
            "name": "Events",
            "description": "Events"
        },
        {
            "name": "Admin Adapt",
            "description": "Admin Adapt"
        },
        {
            "name": "Assign Without Account",
            "description": "Assign Without Account"
        },
        {
            "name": "Admin Tokens",
            "description": "Admin Tokens"
        },
        {
            "name": "Admin User Groups",
            "description": "Admin User Groups"
        },
        {
            "name": "Admin User Interests",
            "description": "Admin User Interests"
        },
        {
            "name": "Admin User Settings",
            "description": "Admin User Settings"
        },
        {
            "name": "Admin Users",
            "description": "Admin Users"
        },
        {
            "name": "Auth",
            "description": "Auth"
        },
        {
            "name": "Profile",
            "description": "Profile"
        },
        {
            "name": "Authoring metrics",
            "description": "Authoring metrics"
        },
        {
            "name": "Admin Bookmarks",
            "description": "Admin Bookmarks"
        },
        {
            "name": "Bookmarks",
            "description": "Bookmarks"
        },
        {
            "name": "Admin Bulk Notifications",
            "description": "Admin Bulk Notifications"
        },
        {
            "name": "Notification Device Tokens",
            "description": "Notification Device Tokens"
        },
        {
            "name": "Admin Orders",
            "description": "Admin Orders"
        },
        {
            "name": "Admin Products",
            "description": "Admin Products"
        },
        {
            "name": "Admin Product",
            "description": "Admin Product"
        },
        {
            "name": "Cart",
            "description": "Cart"
        },
        {
            "name": "Orders",
            "description": "Orders"
        },
        {
            "name": "Products",
            "description": "Products"
        },
        {
            "name": "Categories",
            "description": "Categories"
        },
        {
            "name": "cmi5",
            "description": "cmi5"
        },
        {
            "name": "Code exercises",
            "description": "Code exercises"
        },
        {
            "name": "Commerce",
            "description": "Commerce"
        },
        {
            "name": "Commerce webhooks",
            "description": "Commerce webhooks"
        },
        {
            "name": "Compliance",
            "description": "Compliance"
        },
        {
            "name": "Admin Consultation Access",
            "description": "Admin Consultation Access"
        },
        {
            "name": "Consultation Access",
            "description": "Consultation Access"
        },
        {
            "name": "Consultations",
            "description": "Consultations"
        },
        {
            "name": "Admin Consultations",
            "description": "Admin Consultations"
        },
        {
            "name": "Core Admin",
            "description": "Core Admin"
        },
        {
            "name": "Core",
            "description": "Core"
        },
        {
            "name": "Api",
            "description": "Api"
        },
        {
            "name": "Admin Course Access",
            "description": "Admin Course Access"
        },
        {
            "name": "Admin Courses",
            "description": "Admin Courses"
        },
        {
            "name": "Courses",
            "description": "Courses"
        },
        {
            "name": "Course Access",
            "description": "Course Access"
        },
        {
            "name": "Admin Course Versions",
            "description": "Admin Course Versions"
        },
        {
            "name": "Admin Course-as-code",
            "description": "Admin Course-as-code"
        },
        {
            "name": "Admin Course Builder",
            "description": "Admin Course Builder"
        },
        {
            "name": "Course Variants",
            "description": "Course Variants"
        },
        {
            "name": "Admin CSV",
            "description": "Admin CSV"
        },
        {
            "name": "Demo",
            "description": "Demo"
        },
        {
            "name": "Admin Dictionaries",
            "description": "Admin Dictionaries"
        },
        {
            "name": "Dictionaries",
            "description": "Dictionaries"
        },
        {
            "name": "Admin Dictionary Words",
            "description": "Admin Dictionary Words"
        },
        {
            "name": "Admin Example plugin",
            "description": "Admin Example plugin"
        },
        {
            "name": "Example plugin",
            "description": "Example plugin"
        },
        {
            "name": "Files",
            "description": "Files"
        },
        {
            "name": "Admin H5P",
            "description": "Admin H5P"
        },
        {
            "name": "Admin Identity",
            "description": "Admin Identity"
        },
        {
            "name": "Identity",
            "description": "Identity"
        },
        {
            "name": "SCIM",
            "description": "SCIM"
        },
        {
            "name": "Images",
            "description": "Images"
        },
        {
            "name": "Interactive",
            "description": "Interactive"
        },
        {
            "name": "Admin Interactive",
            "description": "Admin Interactive"
        },
        {
            "name": "Invoices",
            "description": "Invoices"
        },
        {
            "name": "Admin Knowledge",
            "description": "Admin Knowledge"
        },
        {
            "name": "Learner insights",
            "description": "Learner insights"
        },
        {
            "name": "Learner insights admin",
            "description": "Learner insights admin"
        },
        {
            "name": "Admin LiaScript",
            "description": "Admin LiaScript"
        },
        {
            "name": "LiaScript",
            "description": "LiaScript"
        },
        {
            "name": "Admin Living Course",
            "description": "Admin Living Course"
        },
        {
            "name": "Living Course learner",
            "description": "Living Course learner"
        },
        {
            "name": "Living Course",
            "description": "Living Course"
        },
        {
            "name": "Living Course webhooks",
            "description": "Living Course webhooks"
        },
        {
            "name": "Admin LTI",
            "description": "Admin LTI"
        },
        {
            "name": "LTI",
            "description": "LTI"
        },
        {
            "name": "Mattermost",
            "description": "Mattermost"
        },
        {
            "name": "Model Fields",
            "description": "Model Fields"
        },
        {
            "name": "Admin Model Fields",
            "description": "Admin Model Fields"
        },
        {
            "name": "Notifications Admin",
            "description": "Notifications Admin"
        },
        {
            "name": "Notifications",
            "description": "Notifications"
        },
        {
            "name": "Pages",
            "description": "Pages"
        },
        {
            "name": "Admin Payments",
            "description": "Admin Payments"
        },
        {
            "name": "Payments",
            "description": "Payments"
        },
        {
            "name": "Pencil Spaces",
            "description": "Pencil Spaces"
        },
        {
            "name": "Admin Permissions",
            "description": "Admin Permissions"
        },
        {
            "name": "Policies",
            "description": "Policies"
        },
        {
            "name": "Question",
            "description": "Question"
        },
        {
            "name": "QuestionAnswersForQuestionaire",
            "description": "QuestionAnswersForQuestionaire"
        },
        {
            "name": "Questionnaire",
            "description": "Questionnaire"
        },
        {
            "name": "QuestionnaireModelType",
            "description": "QuestionnaireModelType"
        },
        {
            "name": "QuestionnaireReportForModel",
            "description": "QuestionnaireReportForModel"
        },
        {
            "name": "QuestionnaireStars",
            "description": "QuestionnaireStars"
        },
        {
            "name": "Reporting",
            "description": "Reporting"
        },
        {
            "name": "Admin Reports",
            "description": "Admin Reports"
        },
        {
            "name": "SCORM",
            "description": "SCORM"
        },
        {
            "name": "Admin Settings",
            "description": "Admin Settings"
        },
        {
            "name": "Settings",
            "description": "Settings"
        },
        {
            "name": "Admin Stationary Events",
            "description": "Admin Stationary Events"
        },
        {
            "name": "Stationary Events",
            "description": "Stationary Events"
        },
        {
            "name": "Tags",
            "description": "Tags"
        },
        {
            "name": "Admin Tasks",
            "description": "Admin Tasks"
        },
        {
            "name": "Admin Tasks Notes",
            "description": "Admin Tasks Notes"
        },
        {
            "name": "Tasks",
            "description": "Tasks"
        },
        {
            "name": "Tasks Notes",
            "description": "Tasks Notes"
        },
        {
            "name": "Templates",
            "description": "Templates"
        },
        {
            "name": "Template PDFs",
            "description": "Template PDFs"
        },
        {
            "name": "Admin Template PDFs",
            "description": "Admin Template PDFs"
        },
        {
            "name": "Platform",
            "description": "Platform"
        },
        {
            "name": "Admin Gift Quiz Attempt",
            "description": "Admin Gift Quiz Attempt"
        },
        {
            "name": "Gift Quiz Attempt",
            "description": "Gift Quiz Attempt"
        },
        {
            "name": "Admin Gift Question",
            "description": "Admin Gift Question"
        },
        {
            "name": "Gift Quiz",
            "description": "Gift Quiz"
        },
        {
            "name": "Admin Project Solution",
            "description": "Admin Project Solution"
        },
        {
            "name": "Project Solution",
            "description": "Project Solution"
        },
        {
            "name": "Admin Translations",
            "description": "Admin Translations"
        },
        {
            "name": "Translations",
            "description": "Translations"
        },
        {
            "name": "Tutor",
            "description": "Tutor"
        },
        {
            "name": "Video",
            "description": "Video"
        },
        {
            "name": "Admin Vouchers",
            "description": "Admin Vouchers"
        },
        {
            "name": "Vouchers",
            "description": "Vouchers"
        },
        {
            "name": "Admin Webhooks",
            "description": "Admin Webhooks"
        },
        {
            "name": "Webinars",
            "description": "Webinars"
        },
        {
            "name": "Admin Webinars",
            "description": "Admin Webinars"
        }
    ]
}