// Package docs Code generated by swaggo/swag. DO NOT EDIT package docs import "github.com/swaggo/swag" const docTemplate = `{ "schemes": {{ marshal .Schemes }}, "swagger": "2.0", "info": { "description": "{{escape .Description}}", "title": "{{.Title}}", "contact": { "name": "API Support" }, "version": "{{.Version}}" }, "host": "{{.Host}}", "basePath": "{{.BasePath}}", "paths": { "/": { "get": { "produces": [ "application/json" ], "tags": [ "discovery" ], "summary": "Service welcome and version", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.serviceInfoResponse" } } } } }, "/api/v1/": { "get": { "produces": [ "application/json" ], "tags": [ "discovery" ], "summary": "Discover the admin and customer API roots", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.apiIndexResponse" } } } } }, "/api/v1/admin/activity-logs": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns a filtered, paginated list of activity logs", "produces": [ "application/json" ], "tags": [ "activity-logs" ], "summary": "Get activity logs", "parameters": [ { "type": "integer", "description": "Filter by actor ID", "name": "actor_id", "in": "query" }, { "type": "string", "description": "Filter by action", "name": "action", "in": "query" }, { "type": "string", "description": "Filter by resource type", "name": "resource_type", "in": "query" }, { "type": "integer", "description": "Filter by resource ID", "name": "resource_id", "in": "query" }, { "type": "string", "description": "Filter logs after this RFC3339 timestamp", "name": "after", "in": "query" }, { "type": "string", "description": "Filter logs before this RFC3339 timestamp", "name": "before", "in": "query" }, { "type": "integer", "default": 20, "description": "Limit", "name": "limit", "in": "query" }, { "type": "integer", "default": 0, "description": "Offset", "name": "offset", "in": "query" }, { "type": "string", "description": "Search", "name": "search", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.activityLogListRes" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/activity-logs/export": { "get": { "security": [ { "Bearer": [] } ], "produces": [ "text/csv", "text/csv" ], "tags": [ "activity-logs" ], "summary": "Export activity logs as CSV (admin)", "responses": { "200": { "description": "CSV export; filename is supplied in Content-Disposition", "schema": { "type": "file" }, "headers": { "Content-Disposition": { "type": "string", "description": "attachment; filename=export.csv" } } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } } } } }, "/api/v1/admin/activity-logs/{id}": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns a single activity log entry by its ID", "produces": [ "application/json" ], "tags": [ "activity-logs" ], "summary": "Get activity log by ID", "parameters": [ { "type": "integer", "description": "Activity Log ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.activityLogRes" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/admins": { "get": { "security": [ { "Bearer": [] } ], "description": "Get all Admins", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admins" ], "summary": "Get all Admins", "parameters": [ { "type": "integer", "description": "Page number", "name": "page", "in": "query" }, { "type": "integer", "description": "Page size", "name": "page_size", "in": "query" }, { "type": "string", "description": "Query", "name": "query", "in": "query" }, { "type": "string", "description": "Created before", "name": "created_before", "in": "query" }, { "type": "string", "description": "Created after", "name": "created_after", "in": "query" }, { "type": "integer", "description": "Company id", "name": "company_id", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/response.APIResponse" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/handlers.AdminRes" } } } } ] } }, "400": { "description": "Plain-text error returned by the handler or authentication middleware", "schema": { "type": "string" } }, "401": { "description": "Plain-text error returned by the handler or authentication middleware", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Plain-text error returned by the handler or authentication middleware", "schema": { "type": "string" } } } }, "post": { "security": [ { "Bearer": [] } ], "description": "Create Admin", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admins" ], "summary": "Create Admin", "parameters": [ { "description": "Create admin", "name": "manger", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.CreateAdminReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageAPIResponse" } }, "400": { "description": "Plain-text error returned by the handler or authentication middleware", "schema": { "type": "string" } }, "401": { "description": "Plain-text error returned by the handler or authentication middleware", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Plain-text error returned by the handler or authentication middleware", "schema": { "type": "string" } } } } }, "/api/v1/admin/admins/roles/{role}/bulk-deactivate": { "post": { "security": [ { "Bearer": [] } ], "description": "Sets all platform users with the given users.role to DEACTIVATED (except the caller) and all team_members with the given team_role to inactive. Path :role may be a role key (e.g. INSTRUCTOR, ADMIN) or a decimal RBAC roles.id from GET /api/v1/rbac/roles (resolved to RoleRecord.name uppercased). SUPER_ADMIN cannot be bulk-deactivated. ADMIN platform users must use SUPER_ADMIN to bulk change other platform ADMIN users (team_members with team_role ADMIN under path ADMIN remain allowed). Empty body allowed; optionally pass exclude_team_member_id to skip one team_members row (e.g. yourself).", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admins" ], "summary": "Bulk deactivate accounts by role (SUPER_ADMIN or ADMIN platform users only)", "parameters": [ { "type": "string", "description": "Role key (INSTRUCTOR etc.) or RBAC roles.id (integer string)", "name": "role", "in": "path", "required": true }, { "description": "Optional exclusions", "name": "body", "in": "body", "schema": { "$ref": "#/definitions/domain.BulkAccountsByRoleRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.BulkDeactivateAccountsByRoleResult" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/admins/roles/{role}/bulk-reactivate": { "post": { "security": [ { "Bearer": [] } ], "description": "Sets all platform users with the given role from DEACTIVATED to ACTIVE (except the caller) and all team_members with the given team_role from inactive to active. Path :role may be a role key or decimal RBAC roles.id (see bulk-deactivate). Path role must correspond to valid platform users.role or team_members.team_role (after resolving id → name). SUPER_ADMIN cannot be bulk changed. ADMIN callers cannot bulk change other platform ADMIN users (team_members ADMIN under path ADMIN is allowed). Matches only users currently DEACTIVATED and team rows currently inactive.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admins" ], "summary": "Bulk reactivate accounts by role (SUPER_ADMIN or ADMIN platform users only)", "parameters": [ { "type": "string", "description": "Role key (INSTRUCTOR etc.) or RBAC roles.id (integer string)", "name": "role", "in": "path", "required": true }, { "description": "Optional exclusions", "name": "body", "in": "body", "schema": { "$ref": "#/definitions/domain.BulkAccountsByRoleRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.BulkReactivateAccountsByRoleResult" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/admins/{id}": { "get": { "security": [ { "Bearer": [] } ], "description": "Get a single admin by id", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admins" ], "summary": "Get admin by id", "parameters": [ { "type": "integer", "description": "User ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/response.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.AdminRes" } } } ] } }, "400": { "description": "Plain-text error returned by the handler or authentication middleware", "schema": { "type": "string" } }, "401": { "description": "Plain-text error returned by the handler or authentication middleware", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Plain-text error returned by the handler or authentication middleware", "schema": { "type": "string" } } } }, "put": { "security": [ { "Bearer": [] } ], "description": "Update Admin", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "admins" ], "summary": "Update Admin", "parameters": [ { "description": "Update Admin", "name": "admin", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.updateAdminReq" } }, { "type": "integer", "format": "int64", "description": "Id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageAPIResponse" } }, "400": { "description": "Plain-text error returned by the handler or authentication middleware", "schema": { "type": "string" } }, "401": { "description": "Plain-text error returned by the handler or authentication middleware", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Plain-text error returned by the handler or authentication middleware", "schema": { "type": "string" } } } } }, "/api/v1/admin/affiliates": { "get": { "security": [ { "Bearer": [] } ], "description": "ADMIN and SUPER_ADMIN only. Returns applications and learner contact details. Optional status is PENDING, APPROVED, REJECTED, or SUSPENDED. Lists return items, total_count, limit, and offset.", "produces": [ "application/json" ], "tags": [ "affiliates" ], "summary": "List affiliate applications", "parameters": [ { "type": "integer", "description": "Page size (1-100)", "name": "limit", "in": "query" }, { "type": "integer", "description": "Offset", "name": "offset", "in": "query" }, { "type": "string", "description": "Status filter", "name": "status", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.AffiliateListData" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "409": { "description": "Conflict", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/affiliates/commissions": { "get": { "security": [ { "Bearer": [] } ], "description": "ADMIN and SUPER_ADMIN only. Lists the course commission ledger across affiliates or for a positive user_id filter. Amount and commission_percent are decimal strings. Includes maturity, payout association, and reversal information.", "produces": [ "application/json" ], "tags": [ "affiliates" ], "summary": "List affiliate course commissions", "parameters": [ { "type": "integer", "description": "Page size (1-100)", "name": "limit", "in": "query" }, { "type": "integer", "description": "Offset", "name": "offset", "in": "query" }, { "type": "integer", "description": "Affiliate user ID", "name": "user_id", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.AffiliateCommissionData" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "409": { "description": "Conflict", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/affiliates/commissions/{id}/reverse": { "post": { "security": [ { "Bearer": [] } ], "description": "ADMIN and SUPER_ADMIN only. The path id is the commission ID. Requires a 3-2000 character reason. Reversing an earning rejects any pending payout in the same affiliate/currency and releases reservations. Already-paid earnings become recovery debt deducted from future payouts. Repeated reversal is idempotent. This does not refund the learner or revoke course access.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "affiliates" ], "summary": "Reverse an affiliate commission", "parameters": [ { "type": "integer", "description": "Record ID", "name": "id", "in": "path", "required": true }, { "description": "Request", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.AffiliateReversalInput" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.AffiliateMutationData" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "404": { "description": "Record not found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "409": { "description": "Conflict", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/affiliates/events": { "get": { "security": [ { "Bearer": [] } ], "description": "ADMIN and SUPER_ADMIN only. Returns newest-first application, settings, payout, and commission reversal audit events. Details contain event-specific fields without beneficiary account details. Optional positive user_id filters an affiliate. This list returns items, limit, and offset without a total_count.", "produces": [ "application/json" ], "tags": [ "affiliates" ], "summary": "List affiliate audit events", "parameters": [ { "type": "integer", "description": "Page size (1-100)", "name": "limit", "in": "query" }, { "type": "integer", "description": "Offset", "name": "offset", "in": "query" }, { "type": "integer", "description": "Affiliate user ID", "name": "user_id", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.AffiliateEventData" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "409": { "description": "Conflict", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/affiliates/payouts": { "get": { "security": [ { "Bearer": [] } ], "description": "ADMIN and SUPER_ADMIN only. Lists payout requests and beneficiary details. Optional status is REQUESTED, PAID, or REJECTED. Optional positive user_id filters one affiliate. These sensitive records must only be shown to authorized administrators.", "produces": [ "application/json" ], "tags": [ "affiliates" ], "summary": "List affiliate payout requests", "parameters": [ { "type": "integer", "description": "Page size (1-100)", "name": "limit", "in": "query" }, { "type": "integer", "description": "Offset", "name": "offset", "in": "query" }, { "type": "integer", "description": "Affiliate user ID", "name": "user_id", "in": "query" }, { "type": "string", "description": "Status filter", "name": "status", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.AffiliatePayoutData" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "409": { "description": "Conflict", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/affiliates/payouts/{id}/review": { "put": { "security": [ { "Bearer": [] } ], "description": "ADMIN and SUPER_ADMIN only. The path id is the payout request ID. Review a REQUESTED payout as PAID or REJECTED with a 3-2000 character note. PAID requires an already completed external transfer and a unique 3-120 character payment_reference; this API never sends money. Affiliate must still be approved and active. REJECTED releases reservations. Matching repeated reviews are idempotent; conflicting final-state reviews return 409.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "affiliates" ], "summary": "Record an externally paid payout or reject a request", "parameters": [ { "type": "integer", "description": "Record ID", "name": "id", "in": "path", "required": true }, { "description": "Request", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.AffiliatePayoutReviewInput" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.AffiliateMutationData" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "404": { "description": "Record not found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "409": { "description": "Conflict", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/affiliates/settings": { "get": { "security": [ { "Bearer": [] } ], "description": "ADMIN and SUPER_ADMIN only. Returns the commission percentage, FIRST_PURCHASE or EVERY_COURSE policy, attribution window, earning hold, and learner share URL base. Initial defaults are 0 percent, FIRST_PURCHASE, 30 attribution days, and 14 holding days.", "produces": [ "application/json" ], "tags": [ "affiliates" ], "summary": "Get affiliate program settings", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.AffiliateSettings" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "409": { "description": "Conflict", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "put": { "security": [ { "Bearer": [] } ], "description": "ADMIN and SUPER_ADMIN only. Commission percentage is 0-100 with at most two decimals; zero disables future earnings. Attribution is 1-365 days and holding is 0-365 days. FIRST_PURCHASE rewards the first paid purchase; EVERY_COURSE rewards each distinct eligible course. Rates and holds are snapshotted on successful payment; attribution expiry is snapshotted when the code is applied. Changes are audited. Optional share_base_url must be an absolute HTTP(S) learner URL; share links append ref=CODE.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "affiliates" ], "summary": "Update affiliate program settings", "parameters": [ { "description": "Request", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.AffiliateSettingsInput" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.AffiliateSettings" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "409": { "description": "Conflict", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/affiliates/{id}/review": { "put": { "security": [ { "Bearer": [] } ], "description": "ADMIN and SUPER_ADMIN only. The path id is the affiliate learner user ID. Allowed transitions: PENDING to APPROVED or REJECTED, APPROVED to SUSPENDED, and SUSPENDED to APPROVED. A 3-2000 character review note is required. Changes are audited.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "affiliates" ], "summary": "Approve, reject, or suspend an affiliate", "parameters": [ { "type": "integer", "description": "Record ID", "name": "id", "in": "path", "required": true }, { "description": "Request", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.AffiliateReviewInput" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.AffiliateMutationData" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "404": { "description": "Record not found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "409": { "description": "Conflict", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/analytics/dashboard": { "get": { "security": [ { "Bearer": [] } ], "description": "Platform analytics with optional date filters in Africa/Addis_Ababa (EAT): all-time (default), year, year+month, or custom from/to range. When year is set, payments.revenue_monthly returns Jan–Dec SUCCESS revenue totals (EAT) per currency for that calendar year. Optional payment_method filters payment/revenue metrics (exact or METHOD:% variants). Daily series remains in revenue_last_30_days (see date_filter.series_*). Courses section counts LMS + exam_prep inventory.", "produces": [ "application/json" ], "tags": [ "analytics" ], "summary": "Analytics dashboard", "parameters": [ { "type": "integer", "description": "EAT calendar year (e.g. 2025)", "name": "year", "in": "query" }, { "type": "integer", "description": "EAT calendar month 1-12 (requires year)", "name": "month", "in": "query" }, { "type": "string", "description": "Custom EAT range start (YYYY-MM-DD or RFC3339)", "name": "from", "in": "query" }, { "type": "string", "description": "Custom EAT range end (YYYY-MM-DD or RFC3339, inclusive)", "name": "to", "in": "query" }, { "type": "string", "description": "Filter payment/revenue metrics (e.g. CHAPA, ARIFPAY, ADMIN_GRANT)", "name": "payment_method", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/domain.AnalyticsDashboard" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/app-versions": { "get": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "app-versions" ], "summary": "List mobile app versions (admin)", "parameters": [ { "type": "string", "description": "Filter by ANDROID or IOS", "name": "platform", "in": "query" }, { "type": "string", "description": "Filter by ACTIVE or INACTIVE", "name": "status", "in": "query" }, { "type": "integer", "description": "Limit (default 20)", "name": "limit", "in": "query" }, { "type": "integer", "description": "Offset (default 0)", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.listMobileAppVersionsRes" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "post": { "security": [ { "Bearer": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "app-versions" ], "summary": "Create mobile app version (admin)", "parameters": [ { "description": "App version payload", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.createMobileAppVersionReq" } } ], "responses": { "201": { "description": "Created", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.mobileAppVersionRes" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/app-versions/{id}": { "get": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "app-versions" ], "summary": "Get mobile app version by ID (admin)", "parameters": [ { "type": "integer", "description": "App version ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.mobileAppVersionRes" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "put": { "security": [ { "Bearer": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "app-versions" ], "summary": "Update mobile app version (admin)", "parameters": [ { "type": "integer", "description": "App version ID", "name": "id", "in": "path", "required": true }, { "description": "App version payload", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.updateMobileAppVersionReq" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.mobileAppVersionRes" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "delete": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "app-versions" ], "summary": "Delete mobile app version (admin)", "parameters": [ { "type": "integer", "description": "App version ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/assessments": { "get": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "learning" ], "summary": "List Exam Prep Assessments", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.ListExamPrepAssessmentsData" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } } } }, "post": { "security": [ { "Bearer": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "learning" ], "summary": "Link Exam Prep Assessment", "parameters": [ { "description": "Request payload", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.LinkExamPrepAssessmentInput" } } ], "responses": { "201": { "description": "Created", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.LinkExamPrepAssessmentData" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } } } } }, "/api/v1/admin/assessments/{questionSetId}/parents/{parentKind}/{parentId}": { "delete": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "learning" ], "summary": "Unlink Exam Prep Assessment", "parameters": [ { "type": "integer", "format": "int64", "description": "Parent id", "name": "parentId", "in": "path", "required": true }, { "type": "string", "description": "Parent kind", "name": "parentKind", "in": "path", "required": true }, { "type": "integer", "format": "int64", "description": "Question set id", "name": "questionSetId", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Resource not found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/auth/admin-login": { "post": { "description": "Login user", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "auth" ], "summary": "Login user", "parameters": [ { "description": "Login admin", "name": "login", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.LoginRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/response.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.loginUserRes" } } } ] } }, "400": { "description": "Plain-text error returned by the handler or authentication middleware", "schema": { "type": "string" } }, "401": { "description": "Plain-text error returned by the handler or authentication middleware", "schema": { "type": "string" } }, "403": { "description": "Access denied", "schema": { "type": "string" } }, "500": { "description": "Plain-text error returned by the handler or authentication middleware", "schema": { "type": "string" } } } } }, "/api/v1/admin/auth/super-login": { "post": { "description": "Login super-admin", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "auth" ], "summary": "Login super-admin", "parameters": [ { "description": "Login super-admin", "name": "login", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.LoginRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/response.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.loginUserRes" } } } ] } }, "400": { "description": "Plain-text error returned by the handler or authentication middleware", "schema": { "type": "string" } }, "401": { "description": "Plain-text error returned by the handler or authentication middleware", "schema": { "type": "string" } }, "403": { "description": "Access denied", "schema": { "type": "string" } }, "500": { "description": "Plain-text error returned by the handler or authentication middleware", "schema": { "type": "string" } } } } }, "/api/v1/admin/chapters/{chapterId}/lessons": { "get": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "learning" ], "summary": "List lessons for a chapter", "parameters": [ { "type": "integer", "description": "Chapter ID", "name": "chapterId", "in": "path", "required": true }, { "type": "integer", "default": 20, "description": "Page size", "name": "limit", "in": "query" }, { "type": "integer", "default": 0, "description": "Offset", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.lessonListData" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Resource not found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "post": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "learning" ], "summary": "Create a lesson in a chapter", "parameters": [ { "type": "integer", "description": "Chapter ID", "name": "chapterId", "in": "path", "required": true }, { "description": "Lesson", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.CreateExamPrepLessonInput" } } ], "responses": { "201": { "description": "Created", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.ExamPrepLesson" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Resource not found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/chapters/{chapterId}/lessons/reorder": { "put": { "security": [ { "Bearer": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "learning" ], "summary": "Reorder lessons within a chapter", "parameters": [ { "type": "integer", "format": "int64", "description": "Chapter id", "name": "chapterId", "in": "path", "required": true }, { "description": "Request payload", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.ReorderIDsRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Resource not found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/chapters/{chapterId}/practices": { "get": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "learning" ], "summary": "List practices for a unit", "parameters": [ { "type": "integer", "description": "Exam prep unit ID", "name": "chapterId", "in": "path", "required": true }, { "type": "integer", "description": "Page size. Omit to return all practices for the unit.", "name": "limit", "in": "query" }, { "type": "integer", "description": "Offset (used when limit is provided)", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.ListExamPrepPracticesByUnitData" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "post": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "learning" ], "summary": "Create practice under a unit", "parameters": [ { "type": "integer", "description": "Exam prep unit ID", "name": "chapterId", "in": "path", "required": true }, { "description": "Practice", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.CreateExamPrepPracticeInput" } } ], "responses": { "201": { "description": "Created", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.ExamPrepPractice" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/chapters/{chapterId}/quizzes": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns quizzes and pagination. Admins see drafts; learners see published quizzes with published question sets in published chapters and courses.", "produces": [ "application/json" ], "tags": [ "quizzes" ], "summary": "List quizzes in a chapter", "parameters": [ { "type": "integer", "description": "Chapter ID", "name": "chapterId", "in": "path", "required": true }, { "type": "integer", "default": 20, "description": "Page size", "name": "limit", "in": "query" }, { "type": "integer", "default": 0, "description": "Offset", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.quizListData" } } } ] } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "post": { "security": [ { "Bearer": [] } ], "description": "First create a question set with set_type QUIZ. The chapter URL determines placement; omit all parent fields. Defaults to DRAFT. Learners require both the quiz and its question set to be published.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "quizzes" ], "summary": "Create a chapter quiz", "parameters": [ { "type": "integer", "description": "Chapter ID", "name": "chapterId", "in": "path", "required": true }, { "description": "Quiz shell", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.createChapterQuizRequest" } } ], "responses": { "201": { "description": "Created", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.ExamPrepPractice" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/chapters/{id}": { "get": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "learning" ], "summary": "Get chapter by ID", "parameters": [ { "type": "integer", "description": "Chapter ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.ExamPrepUnit" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Resource not found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "put": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "learning" ], "summary": "Update chapter", "parameters": [ { "type": "integer", "description": "Chapter ID", "name": "id", "in": "path", "required": true }, { "description": "Fields to update", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.UpdateExamPrepUnitInput" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.ExamPrepUnit" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Resource not found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "delete": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "learning" ], "summary": "Delete chapter", "parameters": [ { "type": "integer", "description": "Chapter ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Resource not found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/courses": { "get": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "learning" ], "summary": "List courses", "parameters": [ { "type": "integer", "default": 20, "description": "Page size", "name": "limit", "in": "query" }, { "type": "integer", "default": 0, "description": "Offset", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.courseListData" } } } ] } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "post": { "security": [ { "Bearer": [] } ], "description": "Top-level exam track (DET, IELTS, …) in schema exam_prep — separate from LMS programs/courses", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "learning" ], "summary": "Create course", "parameters": [ { "description": "Course", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.CreateExamPrepCatalogCourseInput" } } ], "responses": { "201": { "description": "Created", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.ExamPrepCatalogCourse" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/courses/reorder": { "put": { "security": [ { "Bearer": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "learning" ], "summary": "Reorder all courses", "parameters": [ { "description": "ordered_ids: every course id exactly once", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.ReorderIDsRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/courses/{courseId}/chapters": { "get": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "learning" ], "summary": "List chapters for a course", "parameters": [ { "type": "integer", "description": "Course ID", "name": "courseId", "in": "path", "required": true }, { "type": "integer", "default": 20, "description": "Page size", "name": "limit", "in": "query" }, { "type": "integer", "default": 0, "description": "Offset", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.chapterListData" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Resource not found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "post": { "security": [ { "Bearer": [] } ], "description": "Chapter under a course (e.g. chapter title). Optional sort_order assigns position within that course (siblings at or after that index are shifted); omit to append after the current highest sort_order in the course.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "learning" ], "summary": "Create chapter", "parameters": [ { "type": "integer", "description": "Course ID", "name": "courseId", "in": "path", "required": true }, { "description": "Chapter", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.CreateExamPrepUnitInput" } } ], "responses": { "201": { "description": "Created", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.ExamPrepUnit" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Resource not found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/courses/{courseId}/chapters/reorder": { "put": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "learning" ], "summary": "Reorder chapters within a course", "parameters": [ { "type": "integer", "description": "Course ID", "name": "courseId", "in": "path", "required": true }, { "description": "ordered_ids: every chapter id in this course, new order", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.ReorderIDsRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Resource not found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/courses/{courseId}/practices": { "get": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "learning" ], "summary": "List practices for a course", "parameters": [ { "type": "integer", "description": "Exam prep course ID", "name": "courseId", "in": "path", "required": true }, { "type": "integer", "description": "Page size. Omit to return all practices for the course.", "name": "limit", "in": "query" }, { "type": "integer", "description": "Offset (used when limit is provided)", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.ListExamPrepPracticesByCatalogCourseData" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "post": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "learning" ], "summary": "Create practice under a course", "parameters": [ { "type": "integer", "description": "Exam prep course ID", "name": "courseId", "in": "path", "required": true }, { "description": "Practice", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.CreateExamPrepPracticeInput" } } ], "responses": { "201": { "description": "Created", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.ExamPrepPractice" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/courses/{id}": { "get": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "learning" ], "summary": "Get course by ID", "parameters": [ { "type": "integer", "description": "Course ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.ExamPrepCatalogCourse" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Resource not found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "put": { "security": [ { "Bearer": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "learning" ], "summary": "Update course", "parameters": [ { "type": "integer", "description": "Course ID", "name": "id", "in": "path", "required": true }, { "description": "Fields to update", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.UpdateExamPrepCatalogCourseInput" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.ExamPrepCatalogCourse" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Resource not found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "delete": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "learning" ], "summary": "Delete course", "parameters": [ { "type": "integer", "description": "Course ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Resource not found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/devices/register": { "post": { "security": [ { "Bearer": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "devices" ], "summary": "Register Device Token", "parameters": [ { "description": "Device token and platform", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.RegisterDeviceToken.Request" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "type": "string" } } } } }, "/api/v1/admin/devices/unregister": { "post": { "security": [ { "Bearer": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "devices" ], "summary": "Unregister Device Token", "parameters": [ { "description": "Device token to unregister", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.UnregisterDeviceToken.Request" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { "description": "Invalid request", "schema": { "type": "string" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "type": "string" } } } } }, "/api/v1/admin/email-templates": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns email templates for admin management", "produces": [ "application/json" ], "tags": [ "email-templates" ], "summary": "List email templates (admin)", "parameters": [ { "type": "string", "description": "ACTIVE or INACTIVE", "name": "status", "in": "query" }, { "type": "string", "description": "Search by slug, name, or subject", "name": "query", "in": "query" }, { "type": "integer", "description": "Limit (default 20)", "name": "limit", "in": "query" }, { "type": "integer", "description": "Offset (default 0)", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.listEmailTemplatesRes" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "post": { "security": [ { "Bearer": [] } ], "description": "Creates a new custom email template", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "email-templates" ], "summary": "Create email template", "parameters": [ { "description": "Create email template payload", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.createEmailTemplateReq" } } ], "responses": { "201": { "description": "Created", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.emailTemplateRes" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/email-templates/slug/{slug}": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns one email template by slug regardless of status", "produces": [ "application/json" ], "tags": [ "email-templates" ], "summary": "Get email template by slug (admin)", "parameters": [ { "type": "string", "description": "Email template slug", "name": "slug", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.emailTemplateRes" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/email-templates/slug/{slug}/preview": { "post": { "security": [ { "Bearer": [] } ], "description": "Renders an email template with sample variables without sending", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "email-templates" ], "summary": "Preview email template by slug", "parameters": [ { "type": "string", "description": "Email template slug", "name": "slug", "in": "path", "required": true }, { "description": "Preview variables", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.previewEmailTemplateReq" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.RenderedEmail" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/email-templates/{id}": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns one email template regardless of status", "produces": [ "application/json" ], "tags": [ "email-templates" ], "summary": "Get email template by ID (admin)", "parameters": [ { "type": "integer", "description": "Email template ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.emailTemplateRes" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "put": { "security": [ { "Bearer": [] } ], "description": "Updates an existing email template", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "email-templates" ], "summary": "Update email template", "parameters": [ { "type": "integer", "description": "Email template ID", "name": "id", "in": "path", "required": true }, { "description": "Update email template payload", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.updateEmailTemplateReq" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.emailTemplateRes" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "delete": { "security": [ { "Bearer": [] } ], "description": "Deletes a custom email template", "produces": [ "application/json" ], "tags": [ "email-templates" ], "summary": "Delete email template", "parameters": [ { "type": "integer", "description": "Email template ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.DeleteEmailTemplateData" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/email-templates/{id}/preview": { "post": { "security": [ { "Bearer": [] } ], "description": "Renders an email template with sample variables without sending", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "email-templates" ], "summary": "Preview email template by ID", "parameters": [ { "type": "integer", "description": "Email template ID", "name": "id", "in": "path", "required": true }, { "description": "Preview variables", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.previewEmailTemplateReq" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.RenderedEmail" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/faqs": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns FAQs for admin management with status/category filtering", "produces": [ "application/json" ], "tags": [ "faqs" ], "summary": "List FAQs (admin)", "parameters": [ { "type": "string", "description": "ACTIVE or INACTIVE", "name": "status", "in": "query" }, { "type": "string", "description": "Filter by category", "name": "category", "in": "query" }, { "type": "integer", "description": "Limit (default 20)", "name": "limit", "in": "query" }, { "type": "integer", "description": "Offset (default 0)", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.listFAQsRes" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "post": { "security": [ { "Bearer": [] } ], "description": "Creates a new FAQ item", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "faqs" ], "summary": "Create FAQ", "parameters": [ { "description": "Create FAQ payload", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.createFAQReq" } } ], "responses": { "201": { "description": "Created", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.faqRes" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/faqs/{id}": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns one FAQ regardless of status", "produces": [ "application/json" ], "tags": [ "faqs" ], "summary": "Get FAQ by ID (admin)", "parameters": [ { "type": "integer", "description": "FAQ ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.faqRes" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "put": { "security": [ { "Bearer": [] } ], "description": "Updates an existing FAQ item", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "faqs" ], "summary": "Update FAQ", "parameters": [ { "type": "integer", "description": "FAQ ID", "name": "id", "in": "path", "required": true }, { "description": "Update FAQ payload", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.updateFAQReq" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.faqRes" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "delete": { "security": [ { "Bearer": [] } ], "description": "Deletes an FAQ item", "produces": [ "application/json" ], "tags": [ "faqs" ], "summary": "Delete FAQ", "parameters": [ { "type": "integer", "description": "FAQ ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.DeleteFAQData" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/field-options": { "get": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "field-options" ], "summary": "List field options (admin)", "parameters": [ { "type": "string", "description": "Filter by field key", "name": "field_key", "in": "query" }, { "type": "string", "description": "ACTIVE or INACTIVE", "name": "status", "in": "query" }, { "type": "integer", "description": "Limit", "name": "limit", "in": "query" }, { "type": "integer", "description": "Offset", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.listFieldOptionsRes" } } } ] } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } } } }, "post": { "security": [ { "Bearer": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "field-options" ], "summary": "Create field option (admin)", "parameters": [ { "description": "Create option", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.createFieldOptionReq" } } ], "responses": { "201": { "description": "Created", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.fieldOptionRes" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } } } } }, "/api/v1/admin/field-options/{id}": { "get": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "field-options" ], "summary": "Get field option by ID (admin)", "parameters": [ { "type": "integer", "description": "Option ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.fieldOptionRes" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } } } }, "put": { "security": [ { "Bearer": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "field-options" ], "summary": "Update field option (admin)", "parameters": [ { "type": "integer", "description": "Option ID", "name": "id", "in": "path", "required": true }, { "description": "Update option", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.updateFieldOptionReq" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.fieldOptionRes" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } } } }, "delete": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "field-options" ], "summary": "Delete field option (admin)", "parameters": [ { "type": "integer", "description": "Option ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Resource not found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/files/audio": { "post": { "security": [ { "Bearer": [] } ], "consumes": [ "multipart/form-data" ], "produces": [ "application/json" ], "tags": [ "files" ], "summary": "Upload an audio file", "parameters": [ { "type": "file", "description": "Audio file (mp3, wav, ogg, m4a, aac, webm)", "name": "file", "in": "formData", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.UploadAudioData" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "503": { "description": "Service unavailable", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/files/complete-upload": { "post": { "security": [ { "Bearer": [] } ], "description": "Call after PUT upload to upload_url. Returns the same file metadata shape as POST /files/upload.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "files" ], "summary": "Complete presigned MinIO upload", "parameters": [ { "description": "Complete upload request", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.completePresignedUploadReq" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.uploadMediaRes" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Resource not found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "503": { "description": "Service unavailable", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/files/presign-upload": { "post": { "security": [ { "Bearer": [] } ], "description": "Returns a short-lived PUT URL and object key. Upload the file with HTTP PUT to upload_url using the same Content-Type, then call POST /files/complete-upload.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "files" ], "summary": "Create presigned MinIO upload URL", "parameters": [ { "description": "Presigned upload request", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.presignedUploadReq" } } ], "responses": { "201": { "description": "Created", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.presignedUploadRes" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "503": { "description": "Service unavailable", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/files/refresh-url": { "post": { "security": [ { "Bearer": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "files" ], "summary": "Refresh presigned URL for a file", "parameters": [ { "description": "reference (object key, minio://..., or existing presigned URL)", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.refreshFileURLReq" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.RefreshFileURLData" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "503": { "description": "Service unavailable", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/files/upload": { "post": { "security": [ { "Bearer": [] } ], "consumes": [ "multipart/form-data" ], "produces": [ "application/json" ], "tags": [ "files" ], "summary": "Upload media file", "parameters": [ { "type": "string", "description": "Media type: image|audio|video|pdf", "name": "media_type", "in": "formData", "required": true }, { "type": "file", "description": "Media file", "name": "file", "in": "formData", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.uploadMediaRes" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "503": { "description": "Service unavailable", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/files/url": { "get": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "files" ], "summary": "Get presigned URL for a file", "parameters": [ { "type": "string", "description": "MinIO object key (e.g. profile_pictures/uuid.jpg)", "name": "key", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.GetFileURLData" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "503": { "description": "Service unavailable", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/internal/users/purge-due-deletions": { "post": { "security": [ { "Bearer": [] } ], "description": "Worker-safe purge for due self-deletion requests", "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Purge due account deletions", "parameters": [ { "type": "integer", "description": "Max users to purge in one run (default 100, max 1000)", "name": "limit", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/response.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.PurgeDueDeletedUsersData" } } } ] } }, "400": { "description": "Plain-text error returned by the handler or authentication middleware", "schema": { "type": "string" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Plain-text error returned by the handler or authentication middleware", "schema": { "type": "string" } } } } }, "/api/v1/admin/issues": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns all reported issues with pagination (admin only)", "produces": [ "application/json" ], "tags": [ "issues" ], "summary": "Get all issues", "parameters": [ { "type": "integer", "default": 20, "description": "Limit", "name": "limit", "in": "query" }, { "type": "integer", "default": 0, "description": "Offset", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.issueListRes" } } } ] } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/issues/user/{user_id}": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns paginated issues reported by a specific user (admin only)", "produces": [ "application/json" ], "tags": [ "issues" ], "summary": "Get issues for a specific user", "parameters": [ { "type": "integer", "description": "User ID", "name": "user_id", "in": "path", "required": true }, { "type": "integer", "default": 20, "description": "Limit", "name": "limit", "in": "query" }, { "type": "integer", "default": 0, "description": "Offset", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.issueListRes" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/issues/{id}": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns a single issue report by its ID (admin only)", "produces": [ "application/json" ], "tags": [ "issues" ], "summary": "Get issue by ID", "parameters": [ { "type": "integer", "description": "Issue ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.issueRes" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "delete": { "security": [ { "Bearer": [] } ], "description": "Deletes an issue report (admin only)", "produces": [ "application/json" ], "tags": [ "issues" ], "summary": "Delete an issue", "parameters": [ { "type": "integer", "description": "Issue ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/issues/{id}/status": { "patch": { "security": [ { "Bearer": [] } ], "description": "Updates the status of an issue (admin only)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "issues" ], "summary": "Update issue status", "parameters": [ { "type": "integer", "description": "Issue ID", "name": "id", "in": "path", "required": true }, { "description": "Status update payload", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.updateIssueStatusReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/lessons/{id}": { "get": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "learning" ], "summary": "Get lesson by ID", "parameters": [ { "type": "integer", "format": "int64", "description": "Id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.ExamPrepLesson" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Resource not found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "put": { "security": [ { "Bearer": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "learning" ], "summary": "Update lesson", "parameters": [ { "type": "integer", "format": "int64", "description": "Id", "name": "id", "in": "path", "required": true }, { "description": "Request payload", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.UpdateExamPrepLessonInput" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.ExamPrepLesson" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Resource not found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "delete": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "learning" ], "summary": "Delete lesson", "parameters": [ { "type": "integer", "format": "int64", "description": "Id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Resource not found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/lessons/{lessonId}/practices": { "get": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "learning" ], "summary": "List practices for a lesson", "parameters": [ { "type": "integer", "description": "Exam prep lesson ID", "name": "lessonId", "in": "path", "required": true }, { "type": "integer", "description": "Page size. Omit to return all practices for the lesson.", "name": "limit", "in": "query" }, { "type": "integer", "description": "Offset (used when limit is provided)", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.ListExamPrepPracticesByLessonData" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/logs": { "get": { "security": [ { "Bearer": [] } ], "description": "Fetches application logs from MongoDB with pagination, level filtering, and search", "produces": [ "application/json" ], "tags": [ "Logs" ], "summary": "Retrieve application logs with filtering and pagination", "parameters": [ { "type": "string", "description": "Filter logs by level (debug, info, warn, error, dpanic, panic, fatal)", "name": "level", "in": "query" }, { "type": "string", "description": "Search term to match against message or fields", "name": "search", "in": "query" }, { "type": "integer", "default": 1, "description": "Page number for pagination (default: 1)", "name": "page", "in": "query" }, { "type": "integer", "default": 50, "description": "Number of items per page (default: 50, max: 100)", "name": "limit", "in": "query" } ], "responses": { "200": { "description": "Paginated list of application logs", "schema": { "$ref": "#/definitions/domain.LogResponse" } }, "400": { "description": "Invalid request parameters", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Staff account and logs.list permission required", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/notifications": { "get": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "notifications" ], "summary": "Get User Notification", "parameters": [ { "type": "integer", "default": 10, "description": "Limit", "name": "limit", "in": "query" }, { "minimum": 0, "type": "integer", "default": 0, "description": "Offset", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.GetUserNotificationResponse" } }, "400": { "description": "Invalid request", "schema": { "type": "string" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "type": "string" } } } }, "delete": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "notifications" ], "summary": "Delete User Notifications", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/notifications/all": { "get": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "notifications" ], "summary": "Get All Notifications", "parameters": [ { "type": "integer", "default": 10, "description": "Limit", "name": "limit", "in": "query" }, { "type": "integer", "default": 1, "description": "Page", "name": "page", "in": "query" }, { "type": "string", "description": "Channel", "name": "channel", "in": "query" }, { "type": "string", "description": "Type", "name": "type", "in": "query" }, { "type": "integer", "description": "User id", "name": "user_id", "in": "query" }, { "type": "boolean", "description": "Is read", "name": "is_read", "in": "query" }, { "type": "string", "description": "After", "name": "after", "in": "query" }, { "type": "string", "description": "Before", "name": "before", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.GetAllNotificationsResponse" } }, "400": { "description": "Invalid request", "schema": { "type": "string" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "type": "string" } } } } }, "/api/v1/admin/notifications/bulk-email": { "post": { "security": [ { "Bearer": [] } ], "description": "Sends an email to specified user IDs, users of a platform role, team member IDs, team members of a team_role, or direct email addresses with optional image attachment. Optionally schedule for later with scheduled_at (RFC3339).", "consumes": [ "multipart/form-data" ], "produces": [ "application/json" ], "tags": [ "notifications" ], "summary": "Send bulk email", "parameters": [ { "type": "string", "description": "Saved template slug; otherwise subject and message or html are required", "name": "email_template_slug", "in": "formData" }, { "type": "string", "description": "JSON object of template variables", "name": "template_variables", "in": "formData" }, { "type": "string", "description": "Subject, required when no template is selected", "name": "subject", "in": "formData" }, { "type": "string", "description": "Plain-text body, required without a template unless html is supplied", "name": "message", "in": "formData" }, { "type": "string", "description": "HTML body alternative to message", "name": "html", "in": "formData" }, { "type": "file", "description": "Optional attachment", "name": "file", "in": "formData" }, { "type": "string", "description": "Comma-separated direct email addresses", "name": "emails", "in": "formData" }, { "type": "string", "description": "Comma-separated customer IDs", "name": "user_ids", "in": "formData" }, { "type": "string", "description": "Customer role used to select recipients", "name": "role", "in": "formData" }, { "type": "string", "description": "Comma-separated team-member IDs", "name": "team_member_ids", "in": "formData" }, { "type": "string", "description": "Team role used to select recipients", "name": "team_role", "in": "formData" }, { "type": "string", "description": "Optional future delivery time in RFC3339 format", "name": "scheduled_at", "in": "formData" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.SendBulkEmailData" } } } ] } }, "201": { "description": "Scheduled notification created when scheduled_at is provided", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.ScheduledNotification" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/notifications/bulk-in-app": { "post": { "security": [ { "Bearer": [] } ], "description": "Creates in-app notifications for specified platform user IDs, users matching a platform role, team member IDs, or team members matching a team_role. Optionally schedule for later with scheduled_at (RFC3339).", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "notifications" ], "summary": "Send bulk in-app notification", "parameters": [ { "description": "Bulk in-app content", "name": "body", "in": "body", "required": true, "schema": { "type": "object", "properties": { "level": { "type": "string" }, "message": { "type": "string" }, "role": { "type": "string" }, "scheduled_at": { "type": "string" }, "team_member_ids": { "type": "array", "items": { "type": "integer", "format": "int64" } }, "team_role": { "type": "string" }, "title": { "type": "string" }, "type": { "type": "string" }, "user_ids": { "type": "array", "items": { "type": "integer", "format": "int64" } } } } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.SendBulkInAppNotificationData" } } } ] } }, "201": { "description": "Scheduled notification created when scheduled_at is provided", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.ScheduledNotification" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/notifications/bulk-push": { "post": { "security": [ { "Bearer": [] } ], "description": "Sends a push notification to specified user IDs or all users matching a role. Optionally schedule for later with scheduled_at (RFC3339).", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "notifications" ], "summary": "Send bulk push notification", "parameters": [ { "description": "Bulk push content", "name": "body", "in": "body", "required": true, "schema": { "type": "object", "properties": { "image": { "type": "string" }, "message": { "type": "string" }, "role": { "type": "string" }, "scheduled_at": { "type": "string" }, "title": { "type": "string" }, "user_ids": { "type": "array", "items": { "type": "integer", "format": "int64" } } } } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.SendBulkPushNotificationData" } } } ] } }, "201": { "description": "Scheduled notification created when scheduled_at is provided", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.ScheduledNotification" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/notifications/bulk-sms": { "post": { "security": [ { "Bearer": [] } ], "description": "Sends an SMS to specified user IDs, all users of a role, or direct phone numbers. Optionally schedule for later with scheduled_at (RFC3339).", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "notifications" ], "summary": "Send bulk SMS", "parameters": [ { "description": "Bulk SMS content", "name": "body", "in": "body", "required": true, "schema": { "type": "object", "properties": { "message": { "type": "string" }, "phone_numbers": { "type": "array", "items": { "type": "string" } }, "role": { "type": "string" }, "scheduled_at": { "type": "string" }, "user_ids": { "type": "array", "items": { "type": "integer", "format": "int64" } } } } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.SendBulkSMSData" } } } ] } }, "201": { "description": "Scheduled notification created when scheduled_at is provided", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.ScheduledNotification" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/notifications/create": { "post": { "security": [ { "Bearer": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "notifications" ], "summary": "Create And Send Notification", "parameters": [ { "description": "Notification recipient and delivery settings", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.CreateAndSendNotification.Request" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/handlers.NotificationDispatchResponse" } }, "400": { "description": "Invalid request", "schema": { "type": "string" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "type": "string" } } } } }, "/api/v1/admin/notifications/delete-in-app": { "post": { "security": [ { "Bearer": [] } ], "description": "Deletes in-app notifications by ID for the authenticated user. Non-matching IDs are ignored.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "notifications" ], "summary": "Delete multiple in-app notifications", "parameters": [ { "description": "Notification IDs", "name": "body", "in": "body", "required": true, "schema": { "type": "object" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.DeleteInAppNotificationsData" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/notifications/mark-all-read": { "post": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "notifications" ], "summary": "Mark All Notifications As Read", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/notifications/mark-all-unread": { "post": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "notifications" ], "summary": "Mark All Notifications As Unread", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/notifications/scheduled": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns paginated scheduled notifications with optional status, channel, and date filters", "produces": [ "application/json" ], "tags": [ "notifications" ], "summary": "List scheduled notifications", "parameters": [ { "type": "string", "description": "Filter by status", "name": "status", "in": "query" }, { "type": "string", "description": "Filter by channel", "name": "channel", "in": "query" }, { "type": "string", "description": "Filter after date (RFC3339)", "name": "after", "in": "query" }, { "type": "string", "description": "Filter before date (RFC3339)", "name": "before", "in": "query" }, { "type": "integer", "default": 20, "description": "Page size", "name": "limit", "in": "query" }, { "type": "integer", "default": 1, "description": "Page number", "name": "page", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.ListScheduledNotificationsResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/notifications/scheduled/{id}": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns a single scheduled notification by its ID", "produces": [ "application/json" ], "tags": [ "notifications" ], "summary": "Get scheduled notification", "parameters": [ { "type": "integer", "description": "Scheduled Notification ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.ScheduledNotification" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/notifications/scheduled/{id}/cancel": { "post": { "security": [ { "Bearer": [] } ], "description": "Cancels a scheduled notification if it is still pending or processing", "produces": [ "application/json" ], "tags": [ "notifications" ], "summary": "Cancel scheduled notification", "parameters": [ { "type": "integer", "description": "Scheduled Notification ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.ScheduledNotification" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/notifications/send-email": { "post": { "security": [ { "Bearer": [] } ], "description": "Sends an email to a single email address with optional image attachment", "consumes": [ "multipart/form-data" ], "produces": [ "application/json" ], "tags": [ "notifications" ], "summary": "Send single email", "parameters": [ { "type": "string", "description": "Saved template slug; otherwise subject and message or html are required", "name": "email_template_slug", "in": "formData" }, { "type": "string", "description": "JSON object of template variables", "name": "template_variables", "in": "formData" }, { "type": "string", "description": "Subject, required when no template is selected", "name": "subject", "in": "formData" }, { "type": "string", "description": "Plain-text body, required without a template unless html is supplied", "name": "message", "in": "formData" }, { "type": "string", "description": "HTML body alternative to message", "name": "html", "in": "formData" }, { "type": "file", "description": "Optional attachment", "name": "file", "in": "formData" }, { "type": "string", "description": "Recipient email address", "name": "recipient", "in": "formData", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/notifications/test-push": { "post": { "security": [ { "Bearer": [] } ], "description": "Sends a test push notification to all registered devices of the current user", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "notifications" ], "summary": "Send test push notification", "parameters": [ { "description": "Test notification content", "name": "body", "in": "body", "required": true, "schema": { "type": "object", "properties": { "message": { "type": "string" }, "title": { "type": "string" } } } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.SendTestPushNotificationData" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/notifications/unread": { "get": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "notifications" ], "summary": "Count Unread Notifications", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.CountUnreadNotificationsResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "type": "string" } } } } }, "/api/v1/admin/notifications/{id}": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns a single in-app notification. Users may only fetch their own notifications unless they have list-all access.", "produces": [ "application/json" ], "tags": [ "notifications" ], "summary": "Get in-app notification by ID", "parameters": [ { "type": "integer", "description": "Notification ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.Notification" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "delete": { "security": [ { "Bearer": [] } ], "description": "Deletes one in-app notification owned by the authenticated user.", "produces": [ "application/json" ], "tags": [ "notifications" ], "summary": "Delete a single in-app notification", "parameters": [ { "type": "integer", "description": "Notification ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/notifications/{id}/read": { "patch": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "notifications" ], "summary": "Mark Notification As Read", "parameters": [ { "type": "integer", "format": "int64", "description": "Id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.Notification" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/notifications/{id}/unread": { "patch": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "notifications" ], "summary": "Mark Notification As Unread", "parameters": [ { "type": "integer", "format": "int64", "description": "Id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.Notification" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/payments": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns paginated payments across Chapa and ArifPay with optional filters", "produces": [ "application/json" ], "tags": [ "payments" ], "summary": "List all payments (admin)", "parameters": [ { "type": "integer", "description": "Filter by learner user ID", "name": "user_id", "in": "query" }, { "type": "integer", "description": "Filter by subscription plan ID", "name": "plan_id", "in": "query" }, { "type": "integer", "description": "Filter by user subscription ID", "name": "subscription_id", "in": "query" }, { "type": "string", "description": "Payment status (PENDING, PROCESSING, SUCCESS, FAILED, CANCELLED, EXPIRED)", "name": "status", "in": "query" }, { "type": "string", "description": "Payment provider (CHAPA, ARIFPAY)", "name": "provider", "in": "query" }, { "type": "string", "description": "Alias for provider", "name": "payment_method", "in": "query" }, { "type": "string", "description": "Currency code (e.g. ETB)", "name": "currency", "in": "query" }, { "type": "string", "description": "Plan category (EDUCATION)", "name": "plan_category", "in": "query" }, { "type": "string", "description": "Search session_id, nonce, or transaction_id", "name": "reference", "in": "query" }, { "type": "string", "description": "Created at from (RFC3339 or YYYY-MM-DD)", "name": "created_from", "in": "query" }, { "type": "string", "description": "Created at to (exclusive, RFC3339 or YYYY-MM-DD)", "name": "created_to", "in": "query" }, { "type": "string", "description": "Paid at from (RFC3339 or YYYY-MM-DD)", "name": "paid_from", "in": "query" }, { "type": "string", "description": "Paid at to (exclusive, RFC3339 or YYYY-MM-DD)", "name": "paid_to", "in": "query" }, { "type": "number", "description": "Minimum amount", "name": "min_amount", "in": "query" }, { "type": "number", "description": "Maximum amount", "name": "max_amount", "in": "query" }, { "type": "integer", "default": 20, "description": "Page size", "name": "limit", "in": "query" }, { "type": "integer", "default": 0, "description": "Page offset", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.listAdminPaymentsRes" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/payments/export": { "get": { "security": [ { "Bearer": [] } ], "produces": [ "text/csv", "text/csv" ], "tags": [ "payments" ], "summary": "Export payments as CSV (admin)", "responses": { "200": { "description": "CSV export; filename is supplied in Content-Disposition", "schema": { "type": "file" }, "headers": { "Content-Disposition": { "type": "string", "description": "attachment; filename=export.csv" } } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } } } } }, "/api/v1/admin/payments/{id}": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns any payment record by ID without learner ownership restriction", "produces": [ "application/json" ], "tags": [ "payments" ], "summary": "Get payment by ID (admin)", "parameters": [ { "type": "integer", "description": "Payment ID", "name": "id", "in": "path", "required": true }, { "type": "integer", "default": 20, "description": "Limit", "name": "limit", "in": "query" }, { "minimum": 0, "type": "integer", "default": 0, "description": "Offset", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.adminPaymentRes" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/personas": { "get": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "personas" ], "summary": "List LMS personas (catalog for practice assignment)", "parameters": [ { "type": "boolean", "default": true, "description": "When true (default), return only active personas", "name": "active_only", "in": "query" }, { "type": "integer", "description": "Page size", "name": "limit", "in": "query" }, { "type": "integer", "description": "Offset", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.listPersonasData" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "post": { "security": [ { "Bearer": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "personas" ], "summary": "Create LMS persona catalog entry", "parameters": [ { "description": "Persona", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.CreateLmsPersonaInput" } } ], "responses": { "201": { "description": "Created", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.LmsPersona" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/personas/{id}": { "get": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "personas" ], "summary": "Get LMS persona by ID", "parameters": [ { "type": "integer", "description": "Persona ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.LmsPersona" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Resource not found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "put": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "personas" ], "summary": "Update LMS persona", "parameters": [ { "type": "integer", "description": "Persona ID", "name": "id", "in": "path", "required": true }, { "description": "Fields to update", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.UpdateLmsPersonaInput" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.LmsPersona" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Resource not found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "delete": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "personas" ], "summary": "Delete LMS persona (practices referencing it will have persona_id cleared)", "parameters": [ { "type": "integer", "description": "Persona ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/practices": { "get": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "learning" ], "summary": "List practices globally", "parameters": [ { "type": "integer", "description": "Page size. Omit (with offset) to return all practices.", "name": "limit", "in": "query" }, { "type": "integer", "description": "Offset. Defaults to 0 when limit is provided; ignored semantics when both omitted (all rows).", "name": "offset", "in": "query" }, { "type": "boolean", "description": "When true, return only practices with no parent links (admin)", "name": "unlinked_only", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.ListAllExamPrepPracticesData" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "post": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "learning" ], "summary": "Create practice (optional parents; link later via PUT /practices/:id/parents)", "parameters": [ { "description": "Practice", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.CreateExamPrepPracticeInput" } } ], "responses": { "201": { "description": "Created", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.ExamPrepPractice" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/practices/{id}": { "get": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "learning" ], "summary": "Get practice by ID", "parameters": [ { "type": "integer", "description": "Exam prep practice ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.ExamPrepPractice" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Resource not found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "put": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "learning" ], "summary": "Update practice", "parameters": [ { "type": "integer", "description": "Exam prep practice ID", "name": "id", "in": "path", "required": true }, { "description": "Fields to update", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.UpdateExamPrepPracticeInput" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.ExamPrepPractice" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Resource not found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "delete": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "learning" ], "summary": "Delete practice", "parameters": [ { "type": "integer", "description": "Exam prep practice ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Resource not found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/practices/{id}/full": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns practice metadata, linked question set settings, and all questions in the set.", "produces": [ "application/json" ], "tags": [ "learning" ], "summary": "Get practice with question set and questions", "parameters": [ { "type": "integer", "description": "Exam prep practice ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.quizFullData" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "put": { "security": [ { "Bearer": [] } ], "description": "Updates practice metadata, linked question set settings, and syncs questions in one request.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "learning" ], "summary": "Full update practice with question set and questions", "parameters": [ { "type": "integer", "description": "Exam prep practice ID", "name": "id", "in": "path", "required": true }, { "description": "Full practice update payload", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.FullUpdatePracticeInput" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.quizFullData" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/practices/{id}/parents": { "put": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "learning" ], "summary": "Replace practice parent links", "parameters": [ { "type": "integer", "description": "Exam prep practice ID", "name": "id", "in": "path", "required": true }, { "description": "Parent links (replaces all; use empty array to detach)", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.UpdateExamPrepPracticeParentsInput" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.ExamPrepPractice" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Resource not found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/practices/{id}/parents/{parentKind}/{parentId}": { "delete": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "learning" ], "summary": "Unlink one practice parent", "parameters": [ { "type": "integer", "description": "Exam prep practice ID", "name": "id", "in": "path", "required": true }, { "type": "string", "description": "Parent kind (CATALOG_COURSE, UNIT, LESSON)", "name": "parentKind", "in": "path", "required": true }, { "type": "integer", "description": "Parent entity ID", "name": "parentId", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.ExamPrepPractice" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Resource not found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/question-sets": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns a paginated list of question sets filtered by type", "produces": [ "application/json" ], "tags": [ "question-sets" ], "summary": "Get question sets by type", "parameters": [ { "type": "string", "description": "Set type (PRACTICE, QUIZ, EXAM, SURVEY, CAPSTONE)", "name": "set_type", "in": "query", "required": true }, { "type": "integer", "default": 10, "description": "Limit", "name": "limit", "in": "query" }, { "type": "integer", "default": 0, "description": "Offset", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.listQuestionSetsRes" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "post": { "security": [ { "Bearer": [] } ], "description": "Creates a new question set (practice, assessment, quiz, exam, or survey)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "question-sets" ], "summary": "Create a new question set", "parameters": [ { "description": "Create question set payload", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.createQuestionSetReq" } } ], "responses": { "201": { "description": "Created", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.questionSetRes" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/question-sets/by-owner": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns question sets for a specific owner (e.g., sub-course)", "produces": [ "application/json" ], "tags": [ "question-sets" ], "summary": "Get question sets by owner", "parameters": [ { "type": "string", "description": "Owner type (SUB_COURSE, COURSE, CATEGORY, STANDALONE)", "name": "owner_type", "in": "query", "required": true }, { "type": "integer", "description": "Owner ID", "name": "owner_id", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/handlers.questionSetRes" } } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/question-sets/{id}": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns a question set with question count", "produces": [ "application/json" ], "tags": [ "question-sets" ], "summary": "Get question set by ID", "parameters": [ { "type": "integer", "description": "Question Set ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.questionSetRes" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "put": { "security": [ { "Bearer": [] } ], "description": "Updates a question set's properties", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "question-sets" ], "summary": "Update a question set", "parameters": [ { "type": "integer", "description": "Question Set ID", "name": "id", "in": "path", "required": true }, { "description": "Update question set payload", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.updateQuestionSetReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Resource not found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "delete": { "security": [ { "Bearer": [] } ], "description": "Archives a question set (soft delete)", "produces": [ "application/json" ], "tags": [ "question-sets" ], "summary": "Delete a question set", "parameters": [ { "type": "integer", "description": "Question Set ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/question-sets/{setId}/personas": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns all users assigned as personas to a question set (practice)", "produces": [ "application/json" ], "tags": [ "question-sets" ], "summary": "Get user personas for a question set", "parameters": [ { "type": "integer", "description": "Question Set ID", "name": "setId", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/handlers.userPersonaRes" } } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "post": { "security": [ { "Bearer": [] } ], "description": "Links a user as a persona to a question set (practice)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "question-sets" ], "summary": "Add a user as persona to a question set", "parameters": [ { "type": "integer", "description": "Question Set ID", "name": "setId", "in": "path", "required": true }, { "description": "Add user persona payload", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.addUserPersonaReq" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/question-sets/{setId}/personas/{userId}": { "delete": { "security": [ { "Bearer": [] } ], "description": "Unlinks a user as persona from a question set (practice)", "produces": [ "application/json" ], "tags": [ "question-sets" ], "summary": "Remove a user persona from a question set", "parameters": [ { "type": "integer", "description": "Question Set ID", "name": "setId", "in": "path", "required": true }, { "type": "integer", "description": "User ID", "name": "userId", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/question-sets/{setId}/question-types": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns distinct question type definitions (key, display_name, counts) for non-archived questions in the set. Legacy stored question_type values (e.g. AUDIO) are resolved to builder definitions when possible.", "produces": [ "application/json" ], "tags": [ "question-set-items" ], "summary": "List question types in a question set", "parameters": [ { "type": "integer", "description": "Question Set ID", "name": "setId", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.QuestionSetQuestionTypesSummary" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/question-sets/{setId}/questions": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns all questions as the data array (not a paginated object). Use this admin endpoint to author quiz questions; learner quiz reads are paginated. Includes contextual shared stimulus data.", "produces": [ "application/json" ], "tags": [ "question-set-items" ], "summary": "Get questions in set", "parameters": [ { "type": "integer", "description": "Question Set ID", "name": "setId", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/handlers.questionRes" } } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Resource not found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "post": { "security": [ { "Bearer": [] } ], "description": "Links a question to a question set. Omit display_order to append after the current max; the assigned value is returned in the response.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "question-set-items" ], "summary": "Add question to set", "parameters": [ { "type": "integer", "description": "Question Set ID", "name": "setId", "in": "path", "required": true }, { "description": "Add question to set payload", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.addQuestionToSetReq" } } ], "responses": { "201": { "description": "Created", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.AddQuestionToSetData" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/question-sets/{setId}/questions/{questionId}": { "delete": { "security": [ { "Bearer": [] } ], "description": "Unlinks a question from a question set", "produces": [ "application/json" ], "tags": [ "question-set-items" ], "summary": "Remove question from set", "parameters": [ { "type": "integer", "description": "Question Set ID", "name": "setId", "in": "path", "required": true }, { "type": "integer", "description": "Question ID", "name": "questionId", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/question-sets/{setId}/questions/{questionId}/order": { "put": { "security": [ { "Bearer": [] } ], "description": "Updates the display order of a question in a set", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "question-set-items" ], "summary": "Update question order in set", "parameters": [ { "type": "integer", "description": "Question Set ID", "name": "setId", "in": "path", "required": true }, { "type": "integer", "description": "Question ID", "name": "questionId", "in": "path", "required": true }, { "description": "Update order payload", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.updateQuestionOrderReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/questions": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns a paginated list of questions with optional filters", "produces": [ "application/json" ], "tags": [ "questions" ], "summary": "List questions", "parameters": [ { "type": "string", "description": "Question type filter (MCQ, TRUE_FALSE, SHORT_ANSWER)", "name": "question_type", "in": "query" }, { "type": "string", "description": "Difficulty level filter (EASY, MEDIUM, HARD)", "name": "difficulty", "in": "query" }, { "type": "string", "description": "Status filter (DRAFT, PUBLISHED, INACTIVE)", "name": "status", "in": "query" }, { "type": "integer", "default": 10, "description": "Limit", "name": "limit", "in": "query" }, { "type": "integer", "default": 0, "description": "Offset", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.listQuestionsRes" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "post": { "security": [ { "Bearer": [] } ], "description": "Creates a new question with options (for MCQ/TRUE_FALSE) or short answers (for SHORT_ANSWER). DYNAMIC questions must not send question_text; use dynamic_payload stimulus instead. Legacy types require question_text.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "questions" ], "summary": "Create a new question", "parameters": [ { "description": "Create question payload", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.createQuestionReq" } } ], "responses": { "201": { "description": "Created", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.questionRes" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/questions/component-catalog": { "get": { "security": [ { "Bearer": [] } ], "description": "Valid stimulus and response component kind codes for dynamic question-type definitions", "produces": [ "application/json" ], "tags": [ "questions" ], "summary": "Question-type builder component catalog", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.componentCatalogRes" } } } ] } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } } } } }, "/api/v1/admin/questions/search": { "get": { "security": [ { "Bearer": [] } ], "description": "Search questions by text", "produces": [ "application/json" ], "tags": [ "questions" ], "summary": "Search questions", "parameters": [ { "type": "string", "description": "Search query", "name": "q", "in": "query", "required": true }, { "type": "integer", "default": 10, "description": "Limit", "name": "limit", "in": "query" }, { "type": "integer", "default": 0, "description": "Offset", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.listQuestionsRes" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/questions/type-definition-groups": { "get": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "questions" ], "summary": "List question type definition groups", "parameters": [ { "type": "string", "description": "Filter by status (ACTIVE, INACTIVE)", "name": "status", "in": "query" }, { "type": "integer", "default": 20, "description": "Page size (default 20, max 200)", "name": "limit", "in": "query" }, { "type": "integer", "default": 0, "description": "Page offset", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.listQuestionTypeDefinitionGroupsData" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "post": { "security": [ { "Bearer": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "questions" ], "summary": "Create question type definition group", "parameters": [ { "description": "Group payload", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.createQuestionTypeDefinitionGroupReq" } } ], "responses": { "201": { "description": "Created", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.QuestionTypeDefinitionGroup" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } } } } }, "/api/v1/admin/questions/type-definition-groups/{id}": { "get": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "questions" ], "summary": "Get question type definition group with definitions", "parameters": [ { "type": "integer", "description": "Group id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.QuestionTypeDefinitionGroupDetail" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "put": { "security": [ { "Bearer": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "questions" ], "summary": "Update question type definition group", "parameters": [ { "type": "integer", "description": "Group id", "name": "id", "in": "path", "required": true }, { "description": "Update group payload", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.updateQuestionTypeDefinitionGroupReq" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.QuestionTypeDefinitionGroup" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Resource not found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "delete": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "questions" ], "summary": "Delete question type definition group", "parameters": [ { "type": "integer", "description": "Group id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.DeleteQuestionTypeDefinitionGroupData" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Resource not found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/questions/type-definitions": { "get": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "questions" ], "summary": "List reusable question-type definitions", "parameters": [ { "type": "string", "description": "Filter by status (ACTIVE, INACTIVE)", "name": "status", "in": "query" }, { "type": "boolean", "default": true, "description": "Include system seeded definitions", "name": "include_system", "in": "query" }, { "type": "integer", "default": 20, "description": "Page size (default 20, max 200)", "name": "limit", "in": "query" }, { "type": "integer", "default": 0, "description": "Page offset", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.listQuestionTypeDefinitionsData" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Resource not found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "post": { "security": [ { "Bearer": [] } ], "description": "Stores a reusable dynamic question-type definition for future question construction. Only runtime-mappable definitions are persisted.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "questions" ], "summary": "Create reusable question-type definition", "parameters": [ { "description": "Question type definition payload", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.createQuestionTypeDefinitionReq" } } ], "responses": { "201": { "description": "Created", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.QuestionTypeDefinition" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Resource not found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/questions/type-definitions/{id}": { "get": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "questions" ], "summary": "Get reusable question-type definition by id", "parameters": [ { "type": "integer", "description": "Question type definition id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.QuestionTypeDefinition" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "put": { "security": [ { "Bearer": [] } ], "description": "Updates a reusable dynamic question-type definition. Updated definitions must remain runtime-mappable.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "questions" ], "summary": "Update reusable question-type definition", "parameters": [ { "type": "integer", "description": "Question type definition id", "name": "id", "in": "path", "required": true }, { "description": "Update question type definition payload", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.updateQuestionTypeDefinitionReq" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.UpdateQuestionTypeDefinitionData" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Resource not found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "delete": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "questions" ], "summary": "Delete reusable question-type definition", "parameters": [ { "type": "integer", "description": "Question type definition id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.DeleteQuestionTypeDefinitionData" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/questions/type-definitions/{id}/practices": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns LMS and exam-prep practices whose linked question set contains at least one non-archived question matching the definition (by question_type_definition_id or legacy question_type).", "produces": [ "application/json" ], "tags": [ "questions" ], "summary": "List practices globally by question type definition", "parameters": [ { "type": "integer", "description": "Question type definition id", "name": "id", "in": "path", "required": true }, { "type": "integer", "default": 20, "description": "Limit", "name": "limit", "in": "query" }, { "type": "integer", "default": 0, "description": "Offset", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.PracticesByQuestionTypeDefinitionSummary" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/questions/validate-question-type-definition": { "post": { "security": [ { "Bearer": [] } ], "description": "Validates selected stimulus and response component kinds for temporary question-type definitions (component-level validation only)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "questions" ], "summary": "Validate dynamic question-type definition", "parameters": [ { "description": "Stimulus and response component kinds", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.validateQuestionTypeDefinitionReq" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.ValidateQuestionTypeDefinitionData" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } } } } }, "/api/v1/admin/questions/{id}": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns a question with its options/short answers", "produces": [ "application/json" ], "tags": [ "questions" ], "summary": "Get question by ID", "parameters": [ { "type": "integer", "description": "Question ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.questionRes" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "put": { "security": [ { "Bearer": [] } ], "description": "Updates a question and optionally replaces its options/short answers. Supports question_type_definition_id for dynamic builder-linked questions.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "questions" ], "summary": "Update a question", "parameters": [ { "type": "integer", "description": "Question ID", "name": "id", "in": "path", "required": true }, { "description": "Update question payload", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.updateQuestionReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Resource not found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "delete": { "security": [ { "Bearer": [] } ], "description": "Archives a question (soft delete)", "produces": [ "application/json" ], "tags": [ "questions" ], "summary": "Delete a question", "parameters": [ { "type": "integer", "description": "Question ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/quizzes/{id}": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns a quiz shell. Learners only see published quizzes with a published question set in a published chapter and course.", "produces": [ "application/json" ], "tags": [ "quizzes" ], "summary": "Get a chapter quiz", "parameters": [ { "type": "integer", "description": "Quiz shell ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.ExamPrepPractice" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing or invalid access token", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "403": { "description": "Permission, subscription, or sequence access denied", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "404": { "description": "Quiz or published parent not found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "put": { "security": [ { "Bearer": [] } ], "description": "Updates quiz metadata. A replacement question_set_id must refer to another QUIZ set. Chapter placement is immutable through this endpoint.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "quizzes" ], "summary": "Update a chapter quiz", "parameters": [ { "type": "integer", "description": "Quiz shell ID", "name": "id", "in": "path", "required": true }, { "description": "Quiz update", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.UpdateExamPrepPracticeInput" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.ExamPrepPractice" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing or invalid access token", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "403": { "description": "Permission, subscription, or sequence access denied", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "404": { "description": "Quiz or published parent not found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "delete": { "security": [ { "Bearer": [] } ], "description": "Deletes the quiz shell and chapter attachment. The question set and bank questions remain independently managed.", "produces": [ "application/json" ], "tags": [ "quizzes" ], "summary": "Delete a chapter quiz", "parameters": [ { "type": "integer", "description": "Quiz shell ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing or invalid access token", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "403": { "description": "Permission, subscription, or sequence access denied", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "404": { "description": "Quiz or published parent not found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/quizzes/{id}/full": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns quiz metadata in practice, question_set settings, stimulus_blocks, and questions.", "produces": [ "application/json" ], "tags": [ "quizzes" ], "summary": "Get a chapter quiz with questions", "parameters": [ { "type": "integer", "description": "Quiz shell ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.quizFullData" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing or invalid access token", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "403": { "description": "Permission, subscription, or sequence access denied", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "404": { "description": "Quiz or published parent not found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "put": { "security": [ { "Bearer": [] } ], "description": "Updates quiz metadata and question set settings. Omit questions to preserve memberships; an explicit empty array removes all memberships. Publish practice.publish_status and question_set.status together.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "quizzes" ], "summary": "Update a chapter quiz and its question set", "parameters": [ { "type": "integer", "description": "Quiz shell ID", "name": "id", "in": "path", "required": true }, { "description": "Quiz update", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.FullUpdatePracticeInput" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.quizFullData" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing or invalid access token", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "403": { "description": "Permission, subscription, or sequence access denied", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "404": { "description": "Quiz or published parent not found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/ratings": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns paginated ratings for a specific target", "produces": [ "application/json" ], "tags": [ "ratings" ], "summary": "Get ratings for a target", "parameters": [ { "type": "string", "description": "Target type (app, course, sub_course)", "name": "target_type", "in": "query", "required": true }, { "type": "integer", "description": "Target ID (0 for app)", "name": "target_id", "in": "query", "required": true }, { "type": "integer", "description": "Limit (default 20)", "name": "limit", "in": "query" }, { "type": "integer", "description": "Offset (default 0)", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/handlers.ratingRes" } } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/ratings/summary": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns the total count and average stars for a specific target", "produces": [ "application/json" ], "tags": [ "ratings" ], "summary": "Get rating summary for a target", "parameters": [ { "type": "string", "description": "Target type (app, course, sub_course)", "name": "target_type", "in": "query", "required": true }, { "type": "integer", "description": "Target ID (0 for app)", "name": "target_id", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.ratingSummaryRes" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/ratings/{id}": { "delete": { "security": [ { "Bearer": [] } ], "description": "Deletes a rating by ID for the current user", "produces": [ "application/json" ], "tags": [ "ratings" ], "summary": "Delete a rating", "parameters": [ { "type": "integer", "description": "Rating ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/rbac/permissions": { "get": { "security": [ { "Bearer": [] } ], "description": "Get all permissions in the system grouped by group name", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "rbac" ], "summary": "List all permissions", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/domain.Permission" } } } } ] } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/rbac/permissions/groups": { "get": { "security": [ { "Bearer": [] } ], "description": "Get all distinct permission group names", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "rbac" ], "summary": "List permission groups", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "string" } } } } ] } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/rbac/permissions/sync": { "post": { "security": [ { "Bearer": [] } ], "description": "Re-seed permissions from code and reload the RBAC cache", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "rbac" ], "summary": "Sync permissions", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/rbac/roles": { "get": { "security": [ { "Bearer": [] } ], "description": "Get all roles with optional filters", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "rbac" ], "summary": "List all roles", "parameters": [ { "type": "string", "description": "Search by role name", "name": "query", "in": "query" }, { "type": "boolean", "description": "Filter by system role (true/false)", "name": "is_system", "in": "query" }, { "type": "integer", "description": "Page number (default: 1)", "name": "page", "in": "query" }, { "type": "integer", "description": "Page size (default: 20)", "name": "page_size", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.ListRolesData" } } } ] } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "post": { "security": [ { "Bearer": [] } ], "description": "Create a new role with a name and description", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "rbac" ], "summary": "Create a new role", "parameters": [ { "description": "Role creation payload", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.CreateRoleReq" } } ], "responses": { "201": { "description": "Created", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.RoleRecord" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/rbac/roles/{id}": { "get": { "security": [ { "Bearer": [] } ], "description": "Get a role and its permissions by ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "rbac" ], "summary": "Get a role by ID", "parameters": [ { "type": "integer", "description": "Role ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.RoleWithPermissions" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "put": { "security": [ { "Bearer": [] } ], "description": "Update an existing role's name and description", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "rbac" ], "summary": "Update a role", "parameters": [ { "type": "integer", "description": "Role ID", "name": "id", "in": "path", "required": true }, { "description": "Role update payload", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.UpdateRoleReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "delete": { "security": [ { "Bearer": [] } ], "description": "Delete a non-system role by ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "rbac" ], "summary": "Delete a role", "parameters": [ { "type": "integer", "description": "Role ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/rbac/roles/{id}/permissions": { "get": { "security": [ { "Bearer": [] } ], "description": "Get all permissions assigned to a role", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "rbac" ], "summary": "Get permissions for a role", "parameters": [ { "type": "integer", "description": "Role ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/domain.Permission" } } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "put": { "security": [ { "Bearer": [] } ], "description": "Replace all permissions for a role with the given permission IDs", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "rbac" ], "summary": "Set permissions for a role", "parameters": [ { "type": "integer", "description": "Role ID", "name": "id", "in": "path", "required": true }, { "description": "Permission IDs payload", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.SetRolePermissionsReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/referrals/settings": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns the saved referral commission percentage. Restricted to ADMIN and SUPER_ADMIN. The initial percentage is 0, which disables new credits.", "produces": [ "application/json" ], "tags": [ "referrals" ], "summary": "Get Referral Settings", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.ReferralSettingsData" } } } ] } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Unable to process referral request", "schema": { "type": "string" } } } }, "put": { "security": [ { "Bearer": [] } ], "description": "Sets the percentage credited on a referred learner's qualifying course payment. Accepts 0 through 100 with at most two decimal places. Zero disables new credits. Changes affect future conversions only; existing credits retain their rate. Restricted to ADMIN and SUPER_ADMIN; changes are audited.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "referrals" ], "summary": "Update Referral Settings", "parameters": [ { "description": "Commission percentage configuration", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.updateReferralSettingsReq" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.ReferralSettingsData" } } } ] } }, "400": { "description": "Missing or invalid commission_percent; use 0 through 100 with at most two decimal places", "schema": { "type": "string" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Unable to process referral request", "schema": { "type": "string" } } } } }, "/api/v1/admin/sendSMS": { "post": { "security": [ { "Bearer": [] } ], "description": "Sends an SMS message to a single phone number using AfroMessage", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Send single SMS via AfroMessage", "parameters": [ { "description": "Send SMS request", "name": "sendSMS", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.SendSingleAfroSMSReq" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.SendSingleAfroSMSReq" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/settings": { "get": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "settings" ], "summary": "Get Global Setting List", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/response.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.SettingListRes" } } } ] } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "type": "string" } } } }, "put": { "security": [ { "Bearer": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "settings" ], "summary": "Update Global Setting List", "parameters": [ { "description": "Request payload", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.SaveSettingListReq" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/response.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.SettingListRes" } } } ] } }, "400": { "description": "Invalid request", "schema": { "type": "string" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "type": "string" } } } } }, "/api/v1/admin/settings/{key}": { "get": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "settings" ], "summary": "Get Global Setting By Key", "parameters": [ { "type": "string", "description": "Key", "name": "key", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/response.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.SettingRes" } } } ] } }, "400": { "description": "Invalid request", "schema": { "type": "string" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } } } } }, "/api/v1/admin/subscription-plans": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns subscription plans. Optional category filter: EDUCATION.", "produces": [ "application/json" ], "tags": [ "subscriptions" ], "summary": "List subscription plans", "parameters": [ { "type": "boolean", "description": "Return only active plans (default true)", "name": "active_only", "in": "query" }, { "type": "string", "description": "Filter by plan category (EDUCATION)", "name": "category", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/handlers.planRes" } } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "post": { "security": [ { "Bearer": [] } ], "description": "Creates a new subscription plan (admin only)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "subscriptions" ], "summary": "Create a subscription plan", "parameters": [ { "description": "Create plan payload", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.createPlanReq" } } ], "responses": { "201": { "description": "Created", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.planRes" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "409": { "description": "Resource conflict", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/subscription-plans/{id}": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns a single subscription plan by ID", "produces": [ "application/json" ], "tags": [ "subscriptions" ], "summary": "Get a subscription plan", "parameters": [ { "type": "integer", "description": "Plan ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.planRes" } } } ] } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "put": { "security": [ { "Bearer": [] } ], "description": "Updates a subscription plan (admin only)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "subscriptions" ], "summary": "Update a subscription plan", "parameters": [ { "type": "integer", "description": "Plan ID", "name": "id", "in": "path", "required": true }, { "description": "Update plan payload", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.updatePlanReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Resource not found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "409": { "description": "Resource conflict", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "delete": { "security": [ { "Bearer": [] } ], "description": "Deletes a subscription plan (admin only)", "produces": [ "application/json" ], "tags": [ "subscriptions" ], "summary": "Delete a subscription plan", "parameters": [ { "type": "integer", "description": "Plan ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Resource not found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "409": { "description": "Resource conflict", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/subscriptions/export": { "get": { "security": [ { "Bearer": [] } ], "produces": [ "text/csv", "text/csv" ], "tags": [ "subscriptions" ], "summary": "Export user subscriptions as CSV (admin)", "responses": { "200": { "description": "CSV export; filename is supplied in Content-Disposition", "schema": { "type": "file" }, "headers": { "Content-Disposition": { "type": "string", "description": "attachment; filename=export.csv" } } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } } } } }, "/api/v1/admin/subscriptions/{id}/cancel": { "post": { "security": [ { "Bearer": [] } ], "description": "Cancels any user_subscriptions row by ID. Does not require ownership by the caller.", "produces": [ "application/json" ], "tags": [ "subscriptions" ], "summary": "Cancel a learner subscription (admin)", "parameters": [ { "type": "integer", "description": "Subscription ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.subscriptionRes" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/team/invitations": { "get": { "security": [ { "Bearer": [] } ], "description": "Lists team member invitations with optional status filter", "produces": [ "application/json" ], "tags": [ "team" ], "summary": "List team invitations", "parameters": [ { "type": "string", "description": "pending, accepted, expired, or revoked", "name": "status", "in": "query" }, { "type": "integer", "description": "Limit (default 20)", "name": "limit", "in": "query" }, { "type": "integer", "description": "Offset (default 0)", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.listTeamInvitationsRes" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } } } } }, "/api/v1/admin/team/invitations/accept": { "post": { "description": "Public endpoint to set password and profile details after following the invite link", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "team" ], "summary": "Accept team invitation and complete account setup", "parameters": [ { "description": "Accept invitation payload", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.AcceptTeamInvitationReq" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.TeamMemberResponse" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/team/invitations/verify": { "get": { "description": "Public endpoint used by the admin panel accept-invite page", "produces": [ "application/json" ], "tags": [ "team" ], "summary": "Verify team invitation token", "parameters": [ { "type": "string", "description": "Invitation token", "name": "token", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.VerifyTeamInvitationRes" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/team/invitations/{id}/revoke": { "post": { "security": [ { "Bearer": [] } ], "description": "Revokes the invitation and removes the pending team member if not yet accepted", "produces": [ "application/json" ], "tags": [ "team" ], "summary": "Revoke a pending team invitation", "parameters": [ { "type": "integer", "description": "Invitation ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.RevokeTeamInvitationData" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } } } } }, "/api/v1/admin/team/login": { "post": { "description": "Authenticate a team member (internal staff) with email and password", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "team" ], "summary": "Login team member", "parameters": [ { "description": "Team member login credentials", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.TeamMemberLoginReq" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.teamMemberLoginRes" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/team/me": { "get": { "security": [ { "Bearer": [] } ], "description": "Get the authenticated team member's own profile", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "team" ], "summary": "Get my team profile", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.TeamMemberResponse" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "put": { "security": [ { "Bearer": [] } ], "description": "Update the authenticated team member's own profile fields", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "team" ], "summary": "Update my team profile", "parameters": [ { "description": "Profile update payload", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.UpdateMyTeamProfileReq" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.TeamMemberResponse" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/team/members": { "get": { "security": [ { "Bearer": [] } ], "description": "Get a paginated list of team members with optional filtering", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "team" ], "summary": "List all team members", "parameters": [ { "type": "string", "description": "Filter by team role (super_admin, admin, content_manager, support_agent, instructor, finance, hr, analyst)", "name": "team_role", "in": "query" }, { "type": "string", "description": "Filter by department", "name": "department", "in": "query" }, { "type": "string", "description": "Filter by status (active, inactive, suspended, terminated)", "name": "status", "in": "query" }, { "type": "string", "description": "Search by name, email, or phone number", "name": "search", "in": "query" }, { "type": "integer", "description": "Page number (default: 1)", "name": "page", "in": "query" }, { "type": "integer", "description": "Items per page (default: 10, max: 100)", "name": "page_size", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/domain.TeamMemberResponse" } }, "metadata": { "$ref": "#/definitions/domain.Pagination" } } } ] } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "post": { "security": [ { "Bearer": [] } ], "description": "Create a new internal team member (admin only)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "team" ], "summary": "Create a new team member", "parameters": [ { "description": "Team member creation payload", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.CreateTeamMemberReq" } } ], "responses": { "201": { "description": "Created", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.TeamMemberResponse" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/team/members/export": { "get": { "security": [ { "Bearer": [] } ], "produces": [ "text/csv", "text/csv" ], "tags": [ "team" ], "summary": "Export team members as CSV (admin)", "responses": { "200": { "description": "CSV export; filename is supplied in Content-Disposition", "schema": { "type": "file" }, "headers": { "Content-Disposition": { "type": "string", "description": "attachment; filename=export.csv" } } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/team/members/invite": { "post": { "security": [ { "Bearer": [] } ], "description": "Creates a pending team member (email + team_role only) and sends an invitation email; profile is completed on accept", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "team" ], "summary": "Invite a team member by email", "parameters": [ { "description": "Invite payload", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.InviteTeamMemberReq" } } ], "responses": { "201": { "description": "Created", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.InviteTeamMemberRes" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/team/members/{id}": { "get": { "security": [ { "Bearer": [] } ], "description": "Retrieve a team member's details by their ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "team" ], "summary": "Get team member by ID", "parameters": [ { "type": "integer", "description": "Team Member ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.TeamMemberResponse" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "put": { "security": [ { "Bearer": [] } ], "description": "Update an existing team member's details (admin only)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "team" ], "summary": "Update team member", "parameters": [ { "type": "integer", "description": "Team Member ID", "name": "id", "in": "path", "required": true }, { "description": "Team member update payload", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.UpdateTeamMemberReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "delete": { "security": [ { "Bearer": [] } ], "description": "Delete a team member (super admin only)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "team" ], "summary": "Delete team member", "parameters": [ { "type": "integer", "description": "Team Member ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/team/members/{id}/change-password": { "post": { "security": [ { "Bearer": [] } ], "description": "Change a team member's password (requires current password)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "team" ], "summary": "Change team member password", "parameters": [ { "type": "integer", "description": "Team Member ID", "name": "id", "in": "path", "required": true }, { "description": "Password change payload", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.changePasswordReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/team/members/{id}/resend-invite": { "post": { "security": [ { "Bearer": [] } ], "description": "Revokes the current pending invite and sends a new invitation email", "produces": [ "application/json" ], "tags": [ "team" ], "summary": "Resend team invitation", "parameters": [ { "type": "integer", "description": "Team member ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.InviteTeamMemberRes" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/team/members/{id}/status": { "patch": { "security": [ { "Bearer": [] } ], "description": "Update a team member's status (active, inactive, suspended, terminated)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "team" ], "summary": "Update team member status", "parameters": [ { "type": "integer", "description": "Team Member ID", "name": "id", "in": "path", "required": true }, { "description": "Status update payload", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.UpdateTeamMemberStatusReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/team/refresh": { "post": { "description": "Exchanges a valid team refresh token for a new access JWT and a rotated refresh token (use only tokens from POST /team/login or this endpoint).", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "team" ], "summary": "Refresh team member tokens", "parameters": [ { "description": "Current refresh token", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.teamMemberRefreshReq" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.teamMemberLoginRes" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "403": { "description": "Access denied", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/team/resetPassword": { "post": { "description": "Completes team password reset using email + OTP from the reset link. Public.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "team" ], "summary": "Reset team member password", "parameters": [ { "description": "Reset payload", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.TeamResetPasswordReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/team/sendResetCode": { "post": { "description": "Sends a password-reset email with a link to the team member (admin panel). Public.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "team" ], "summary": "Send team password reset link", "parameters": [ { "description": "Email", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.TeamSendPasswordResetReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/team/stats": { "get": { "security": [ { "Bearer": [] } ], "description": "Get statistics about team members by status", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "team" ], "summary": "Get team member statistics", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.TeamMemberStats" } } } ] } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/team/verifyResetCode": { "get": { "description": "Checks whether email+otp from a reset link are still valid without consuming the OTP. Public.", "produces": [ "application/json" ], "tags": [ "team" ], "summary": "Verify team password reset link", "parameters": [ { "type": "string", "description": "Team member email", "name": "email", "in": "query", "required": true }, { "type": "string", "description": "Reset OTP from the email link", "name": "otp", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.TeamVerifyPasswordResetRes" } } } ] } } } } }, "/api/v1/admin/user/admin-profile": { "get": { "security": [ { "Bearer": [] } ], "description": "Get user profile", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Get user profile", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/response.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.UserProfileResponse" } } } ] } }, "400": { "description": "Plain-text error returned by the handler or authentication middleware", "schema": { "type": "string" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Plain-text error returned by the handler or authentication middleware", "schema": { "type": "string" } } } } }, "/api/v1/admin/user/delete/{id}": { "delete": { "security": [ { "Bearer": [] } ], "description": "Delete a user by their ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Delete user by ID", "parameters": [ { "type": "integer", "description": "User ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageAPIResponse" } }, "400": { "description": "Plain-text error returned by the handler or authentication middleware", "schema": { "type": "string" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Plain-text error returned by the handler or authentication middleware", "schema": { "type": "string" } } } } }, "/api/v1/admin/user/search": { "post": { "security": [ { "Bearer": [] } ], "description": "Search for user using name or phone", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Search for user using name or phone", "parameters": [ { "description": "Search for using his name or phone", "name": "searchUserByNameOrPhone", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.SearchUserByNameOrPhoneReq" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/response.APIResponse" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/domain.UserProfileResponse" } } } } ] } }, "400": { "description": "Plain-text error returned by the handler or authentication middleware", "schema": { "type": "string" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Plain-text error returned by the handler or authentication middleware", "schema": { "type": "string" } } } } }, "/api/v1/admin/user/single/{id}": { "get": { "security": [ { "Bearer": [] } ], "description": "Get a single user by id", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Get user by id", "parameters": [ { "type": "integer", "description": "User ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/response.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.UserProfileResponse" } } } ] } }, "400": { "description": "Plain-text error returned by the handler or authentication middleware", "schema": { "type": "string" } }, "401": { "description": "Plain-text error returned by the handler or authentication middleware", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Plain-text error returned by the handler or authentication middleware", "schema": { "type": "string" } } } } }, "/api/v1/admin/user/status": { "patch": { "security": [ { "Bearer": [] } ], "description": "Activates, deactivates, or suspends a user account", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Update user status", "parameters": [ { "description": "Status update payload", "name": "body", "in": "body", "required": true, "schema": { "type": "object" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { "description": "Plain-text error returned by the handler or authentication middleware", "schema": { "type": "string" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Plain-text error returned by the handler or authentication middleware", "schema": { "type": "string" } } } } }, "/api/v1/admin/user/{id}/profile-picture": { "post": { "security": [ { "Bearer": [] } ], "description": "Uploads a profile picture for the specified user", "consumes": [ "multipart/form-data" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Upload profile picture", "parameters": [ { "type": "integer", "description": "User ID", "name": "id", "in": "path", "required": true }, { "type": "file", "description": "Image file (jpg|png|webp)", "name": "file", "in": "formData", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.UploadProfilePictureData" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/users": { "get": { "security": [ { "Bearer": [] } ], "description": "Get users with optional filters. Each user includes subscription_status: ACTIVE, PENDING, or Unsubscribed.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Get all users", "parameters": [ { "type": "string", "description": "Role filter", "name": "role", "in": "query" }, { "type": "string", "description": "Search query", "name": "query", "in": "query" }, { "type": "integer", "description": "Page number", "name": "page", "in": "query" }, { "type": "integer", "description": "Page size", "name": "page_size", "in": "query" }, { "type": "string", "description": "Created before (RFC3339)", "name": "created_before", "in": "query" }, { "type": "string", "description": "Created after (RFC3339)", "name": "created_after", "in": "query" }, { "type": "string", "description": "User account status filter (ACTIVE, PENDING, SUSPENDED, DEACTIVATED, or INACTIVE for all non-ACTIVE statuses)", "name": "status", "in": "query" }, { "type": "string", "description": "Country filter (case-insensitive match on stored value)", "name": "country", "in": "query" }, { "type": "string", "description": "Region filter (case-insensitive match on stored value)", "name": "region", "in": "query" }, { "type": "string", "description": "Derived subscription filter: ACTIVE, PENDING, or Unsubscribed (matches response subscription_status semantics)", "name": "subscription_status", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/response.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.GetAllUsersData" } } } ] } }, "400": { "description": "Plain-text error returned by the handler or authentication middleware", "schema": { "type": "string" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Plain-text error returned by the handler or authentication middleware", "schema": { "type": "string" } } } } }, "/api/v1/admin/users/deletion-requests": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns account deletion requests for admin panel tracking with filtering and pagination", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "List account deletion requests", "parameters": [ { "type": "string", "description": "Search in first_name, last_name, email, phone_number", "name": "query", "in": "query" }, { "type": "string", "description": "Role filter", "name": "role", "in": "query" }, { "type": "string", "description": "User status filter (ACTIVE, PENDING, SUSPENDED, DEACTIVATED)", "name": "status", "in": "query" }, { "type": "string", "description": "Deletion state filter (PENDING, DUE, CANCELLED)", "name": "state", "in": "query" }, { "type": "string", "description": "Requested before (RFC3339)", "name": "requested_before", "in": "query" }, { "type": "string", "description": "Requested after (RFC3339)", "name": "requested_after", "in": "query" }, { "type": "string", "description": "Scheduled before (RFC3339)", "name": "scheduled_before", "in": "query" }, { "type": "string", "description": "Scheduled after (RFC3339)", "name": "scheduled_after", "in": "query" }, { "type": "integer", "description": "Page number (default 1)", "name": "page", "in": "query" }, { "type": "integer", "description": "Page size (default 10, max 100)", "name": "page_size", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/response.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.ListAccountDeletionRequestsData" } } } ] } }, "400": { "description": "Plain-text error returned by the handler or authentication middleware", "schema": { "type": "string" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Plain-text error returned by the handler or authentication middleware", "schema": { "type": "string" } } } } }, "/api/v1/admin/users/export": { "get": { "security": [ { "Bearer": [] } ], "produces": [ "text/csv", "text/csv" ], "tags": [ "user" ], "summary": "Export users as CSV (admin)", "responses": { "200": { "description": "CSV export; filename is supplied in Content-Disposition", "schema": { "type": "file" }, "headers": { "Content-Disposition": { "type": "string", "description": "attachment; filename=export.csv" } } }, "400": { "description": "Invalid request", "schema": { "type": "string" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } } } } }, "/api/v1/admin/users/summary": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns total users, active users, and users who joined this month", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Get user summary statistics", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.UserSummary" } } } ] } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/users/{user_id}/learning-activity": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns the unified catalog-course learning tree, progress summary, and recent activity timeline", "produces": [ "application/json" ], "tags": [ "learning" ], "summary": "Get full learning activity for a user (admin)", "parameters": [ { "type": "integer", "description": "Target user ID", "name": "user_id", "in": "path", "required": true }, { "type": "integer", "description": "Max recent-activity items (default 40, max 120)", "name": "limit", "in": "query" }, { "type": "boolean", "description": "Include practice completions in recent-activity feed", "name": "include_practices", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.AdminUserLearningActivityDetails" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/users/{user_id}/recent-activity": { "get": { "security": [ { "Bearer": [] } ], "description": "Reverse-chronological feed for profile UI: account joined plus LMS completion milestones (lessons/modules/courses/programs). Optional practice completions via include_practices. Does not include \"started learning path\" unless you add persisted engagement events—the schema stores completions only.", "produces": [ "application/json" ], "tags": [ "lms" ], "summary": "Recent activity timeline for a user (admin)", "parameters": [ { "type": "integer", "description": "Target user ID", "name": "user_id", "in": "path", "required": true }, { "type": "integer", "description": "Max items after merge (default 40, max 120)", "name": "limit", "in": "query" }, { "type": "boolean", "description": "Include completed LMS practices (more verbose)", "name": "include_practices", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.UserRecentActivityFeed" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/users/{user_id}/sessions": { "get": { "tags": ["admin"], "summary": "List a user's active device sessions", "parameters": [{"type": "integer", "description": "User ID", "name": "user_id", "in": "path", "required": true}], "responses": {"200": {"description": "OK", "schema": {"type": "object", "properties": {"message": {"type": "string"}, "data": {"type": "array", "items": {"type": "object", "properties": {"id": {"type": "string"}, "label": {"type": "string"}, "platform": {"type": "string"}, "last_seen_at": {"type": "string"}}}}}}}}, "security": [{"Bearer": []}] } }, "/api/v1/admin/users/{user_id}/sessions/{id}": { "delete": { "tags": ["admin"], "summary": "Remove a user's active device session", "parameters": [ {"type": "integer", "description": "User ID", "name": "user_id", "in": "path", "required": true}, {"type": "string", "description": "Session UUID", "name": "id", "in": "path", "required": true} ], "responses": {"200": {"description": "OK", "schema": {"type": "object", "properties": {"message": {"type": "string"}}}}, "404": {"description": "Not Found", "schema": {"$ref": "#/definitions/domain.ErrorResponse"}}}, "security": [{"Bearer": []}] } }, "/api/v1/admin/users/{user_id}/subscriptions": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns display status, active plans by category, full subscription history, and related payments", "produces": [ "application/json" ], "tags": [ "subscriptions" ], "summary": "Get all subscription details for a user (admin)", "parameters": [ { "type": "integer", "description": "Target user ID", "name": "user_id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.AdminUserSubscriptionDetails" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/users/{user_id}/subscriptions/extend": { "post": { "security": [ { "Bearer": [] } ], "description": "Unified admin action: if the learner has no active subscription in the plan's category, creates one (grant). If they already have an active subscription in that category, extends it by one period of the selected plan (and switches plan_id when different). Optionally records a SUCCESS payment at the plan price (record_payment, default true).", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "subscriptions" ], "summary": "Grant or extend a learner subscription (admin)", "parameters": [ { "type": "integer", "description": "Target learner user ID", "name": "user_id", "in": "path", "required": true }, { "description": "Plan to grant or extend", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.adminApplySubscriptionReq" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.subscriptionRes" } } } ] } }, "201": { "description": "Created", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.subscriptionRes" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/vimeo/oembed": { "get": { "security": [ { "Bearer": [] } ], "description": "Fetches oEmbed metadata for a Vimeo video URL", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Vimeo" ], "summary": "Get oEmbed data for a Vimeo URL", "parameters": [ { "type": "string", "description": "Vimeo video URL", "name": "url", "in": "query", "required": true }, { "type": "integer", "description": "Desired width", "name": "width", "in": "query" }, { "type": "integer", "description": "Desired height", "name": "height", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/vimeo.OEmbedResponse" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/vimeo/sample": { "get": { "security": [ { "Bearer": [] } ], "description": "Fetches a sample video from Vimeo and returns video details along with an embeddable iframe for client-side integration", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Vimeo" ], "summary": "Get a sample Vimeo video with iframe embed", "parameters": [ { "type": "string", "default": "76979871", "description": "Vimeo Video ID to use as sample", "name": "video_id", "in": "query" }, { "type": "integer", "default": 640, "description": "Player width", "name": "width", "in": "query" }, { "type": "integer", "default": 360, "description": "Player height", "name": "height", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.documentAdminGetSampleVideoData" } } } ] } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/vimeo/uploads/pull": { "post": { "security": [ { "Bearer": [] } ], "description": "Initiates a pull upload where Vimeo fetches the video from a URL", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Vimeo" ], "summary": "Create a pull upload to Vimeo", "parameters": [ { "description": "Pull Upload Request", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.CreatePullUploadRequest" } } ], "responses": { "201": { "description": "Created", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.VimeoUploadResultData" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "503": { "description": "Service unavailable", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/vimeo/uploads/tus": { "post": { "security": [ { "Bearer": [] } ], "description": "Initiates a TUS resumable upload and returns the upload link", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Vimeo" ], "summary": "Create a TUS resumable upload to Vimeo", "parameters": [ { "description": "TUS Upload Request", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.CreateTusUploadRequest" } } ], "responses": { "201": { "description": "Created", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.VimeoUploadResultData" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "503": { "description": "Service unavailable", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/vimeo/videos": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns a paginated list of videos for the Vimeo API token (GET https://api.vimeo.com/me/videos)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Vimeo" ], "summary": "List videos stored in the Vimeo account", "parameters": [ { "type": "integer", "default": 1, "description": "Page number (starts at 1)", "name": "page", "in": "query" }, { "type": "integer", "default": 25, "description": "Page size (Vimeo max 100)", "name": "per_page", "in": "query" }, { "type": "string", "description": "Search query", "name": "query", "in": "query" }, { "type": "string", "description": "Sort field (e.g. date, alphabetical, plays, likes, comments, duration, relevance)", "name": "sort", "in": "query" }, { "type": "string", "description": "asc or desc", "name": "direction", "in": "query" }, { "type": "string", "description": "Vimeo filter (e.g. embeddable, playable)", "name": "filter", "in": "query" }, { "type": "string", "description": "Vimeo filter_type when using filter", "name": "filter_type", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/handlers.VimeoVideoResponse" } }, "metadata": { "$ref": "#/definitions/handlers.VimeoVideosListMetadata" } } } ] } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "503": { "description": "Service Unavailable", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/vimeo/videos/{video_id}": { "get": { "security": [ { "Bearer": [] } ], "description": "Retrieves video details from Vimeo by video ID", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Vimeo" ], "summary": "Get video information from Vimeo", "parameters": [ { "type": "string", "description": "Vimeo Video ID", "name": "video_id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.VimeoVideoResponse" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "503": { "description": "Service unavailable", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "delete": { "security": [ { "Bearer": [] } ], "description": "Deletes a video from the Vimeo account", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Vimeo" ], "summary": "Delete a video from Vimeo", "parameters": [ { "type": "string", "description": "Vimeo Video ID", "name": "video_id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "503": { "description": "Service unavailable", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/vimeo/videos/{video_id}/embed": { "get": { "security": [ { "Bearer": [] } ], "description": "Generates an embeddable player iframe for the video", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Vimeo" ], "summary": "Get embed code for a Vimeo video", "parameters": [ { "type": "string", "description": "Vimeo Video ID", "name": "video_id", "in": "path", "required": true }, { "type": "integer", "default": 640, "description": "Player width", "name": "width", "in": "query" }, { "type": "integer", "default": 360, "description": "Player height", "name": "height", "in": "query" }, { "type": "boolean", "description": "Autoplay video", "name": "autoplay", "in": "query" }, { "type": "boolean", "description": "Loop video", "name": "loop", "in": "query" }, { "type": "boolean", "description": "Mute video", "name": "muted", "in": "query" }, { "type": "boolean", "description": "Background mode (no controls)", "name": "background", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.VimeoEmbedResponse" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "503": { "description": "Service unavailable", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/vimeo/videos/{video_id}/status": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns the current transcoding status of a video", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Vimeo" ], "summary": "Get transcode status of a Vimeo video", "parameters": [ { "type": "string", "description": "Vimeo Video ID", "name": "video_id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.VimeoTranscodeStatusData" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "503": { "description": "Service unavailable", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/admin/ws/connect": { "get": { "tags": [ "ws" ], "summary": "Connect Socket", "parameters": [ { "type": "string", "description": "Access token", "name": "token", "in": "query", "required": true } ], "responses": { "101": { "description": "WebSocket protocol upgrade; subsequent messages are notification events", "schema": { "type": "string" } }, "401": { "description": "Authentication failed", "schema": { "type": "string" } } } } }, "/api/v1/affiliates/apply": { "post": { "security": [ { "Bearer": [] } ], "description": "Requires an active learner, accept_terms=true, the current terms_version from GET /affiliates/me, and a 10-2000 character application. New applications are PENDING. Rejected applicants may reapply; pending, approved, or suspended accounts cannot replace their application.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "affiliates" ], "summary": "Apply to the affiliate program", "parameters": [ { "description": "Request", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.AffiliateApplicationInput" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.AffiliateMutationData" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "409": { "description": "Conflict", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/affiliates/commissions": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns only the authenticated learner earnings. Status is PENDING during the holding period, AVAILABLE after maturity, RESERVED for a requested payout, PAID after payout settlement, or REVERSED. Monetary values are decimal strings and never combined across currencies.", "produces": [ "application/json" ], "tags": [ "affiliates" ], "summary": "List my affiliate commissions", "parameters": [ { "type": "integer", "description": "Page size (1-100)", "name": "limit", "in": "query" }, { "type": "integer", "description": "Offset", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.AffiliateCommissionData" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "409": { "description": "Conflict", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/affiliates/me": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns the authenticated learner application (null before applying), versioned program rules, current settings, referral counts, and separate currency balances. Approved affiliates receive a share code and, when configured, a share URL. No referred-user personal data is exposed.", "produces": [ "application/json" ], "tags": [ "affiliates" ], "summary": "Get my affiliate dashboard and program rules", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.AffiliateDashboard" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "409": { "description": "Conflict", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/affiliates/payouts": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns only the authenticated learner payout requests, including snapshotted beneficiary details and external transfer references. Optional status is REQUESTED, PAID, or REJECTED.", "produces": [ "application/json" ], "tags": [ "affiliates" ], "summary": "List my affiliate payouts", "parameters": [ { "type": "integer", "description": "Page size (1-100)", "name": "limit", "in": "query" }, { "type": "integer", "description": "Offset", "name": "offset", "in": "query" }, { "type": "string", "description": "Status filter", "name": "status", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.AffiliatePayoutData" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "409": { "description": "Conflict", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "post": { "security": [ { "Bearer": [] } ], "description": "Requires an approved active affiliate. Reserves all matured available earnings in the requested currency after outstanding recovery debt. The server calculates the amount; clients cannot select an amount. One REQUESTED payout per currency is allowed. This endpoint does not transfer money.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "affiliates" ], "summary": "Request payout of available affiliate earnings", "parameters": [ { "description": "Request", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.AffiliatePayoutInput" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.AffiliateMutationData" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "409": { "description": "Conflict", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/app/version/check": { "get": { "description": "Public endpoint for mobile clients to determine if an app update is available (force or optional)", "produces": [ "application/json" ], "tags": [ "app-versions" ], "summary": "Check mobile app version", "parameters": [ { "type": "string", "description": "Platform: ANDROID or IOS", "name": "platform", "in": "query", "required": true }, { "type": "integer", "description": "Client build number (Android versionCode / iOS build number)", "name": "version_code", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.MobileAppVersionCheckResult" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/assessments": { "get": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "learning" ], "summary": "List Exam Prep Assessments", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.ListExamPrepAssessmentsData" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } } } } }, "/api/v1/auth/apple": { "post": { "description": "Validates an Apple identity token (iOS, Android, or web). On first sign-in, include email and name if Apple only returns them to the client once.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "auth" ], "summary": "Login via Sign in with Apple identity token", "parameters": [ { "description": "Apple login payload", "name": "body", "in": "body", "required": true, "schema": { "type": "object" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.loginUserRes" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Authentication failed", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "503": { "description": "Service unavailable", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/auth/sessions/replace": { "post": { "consumes": ["application/json"], "produces": ["application/json"], "tags": ["auth"], "summary": "Replace an active learner device session", "parameters": [{ "description": "Session replacement challenge and active session ID", "name": "body", "in": "body", "required": true, "schema": {"type": "object", "required": ["challenge_token", "session_id"], "properties": {"challenge_token": {"type": "string"}, "session_id": {"type": "string"}}} }], "responses": {"200": {"description": "OK", "schema": {"type": "object", "properties": {"message": {"type": "string"}, "data": {"$ref": "#/definitions/handlers.loginUserRes"}}}}, "401": {"description": "Unauthorized", "schema": {"$ref": "#/definitions/domain.ErrorResponse"}}} } }, "/api/v1/auth/customer-login": { "post": { "description": "Login user", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "auth" ], "summary": "Login user", "parameters": [ { "description": "Login user", "name": "login", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.LoginRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.loginUserRes" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "403": { "description": "Access denied", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/auth/google/android": { "post": { "produces": [ "application/json" ], "tags": [ "auth" ], "summary": "Login via Google Android ID Token", "parameters": [ { "description": "Google ID Token from Android", "name": "idToken", "in": "body", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.loginUserRes" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Authentication failed", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/auth/google/callback": { "get": { "produces": [ "application/json" ], "tags": [ "auth" ], "summary": "Google login callback", "parameters": [ { "type": "string", "description": "Code", "name": "code", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.loginUserRes" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Authentication failed", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/auth/google/login": { "get": { "produces": [ "text/plain" ], "tags": [ "auth" ], "summary": "Google login redirect", "responses": { "302": { "description": "Redirect to Google authorization URL; see Location header", "schema": { "type": "string" }, "headers": { "Location": { "type": "string", "description": "Google authorization URL" } } }, "503": { "description": "Google OAuth is not configured", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/auth/logout": { "post": { "security": [ { "Bearer": [] } ], "description": "Logout user", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "auth" ], "summary": "Logout user", "parameters": [ { "description": "Logout user", "name": "logout", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.logoutReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageAPIResponse" } }, "400": { "description": "Plain-text error returned by the handler or authentication middleware", "schema": { "type": "string" } }, "401": { "description": "Plain-text error returned by the handler or authentication middleware", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Plain-text error returned by the handler or authentication middleware", "schema": { "type": "string" } } } } }, "/api/v1/auth/refresh": { "post": { "description": "Refresh token", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "auth" ], "summary": "Refresh token", "parameters": [ { "description": "tokens", "name": "refresh", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.refreshToken" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.loginUserRes" } } } ] } }, "400": { "description": "Plain-text error returned by the handler or authentication middleware", "schema": { "type": "string" } }, "401": { "description": "Plain-text error returned by the handler or authentication middleware", "schema": { "type": "string" } }, "403": { "description": "Access denied", "schema": { "type": "string" } }, "500": { "description": "Plain-text error returned by the handler or authentication middleware", "schema": { "type": "string" } } } } }, "/api/v1/catalog/courses": { "get": { "description": "Public discovery only: titles, descriptions, thumbnails, access tiers and published content counts. Draft courses are excluded. Playback, quiz questions and progress use authenticated learning endpoints.", "produces": [ "application/json" ], "tags": [ "public-catalog" ], "summary": "Browse published course highlights without signing in", "parameters": [ { "type": "string", "description": "Search course name or description (maximum 200 characters)", "name": "q", "in": "query" }, { "type": "integer", "default": 20, "description": "Page size (1-100)", "name": "limit", "in": "query" }, { "type": "integer", "default": 0, "description": "Non-negative offset", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.PublicCatalogPage" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/catalog/courses/{id}": { "get": { "description": "Returns published chapters, lesson highlights and quiz titles/counts. No video URLs, questions, answers or learner information are included. Unpublished courses return 404, even for staff tokens.", "produces": [ "application/json" ], "tags": [ "public-catalog" ], "summary": "Preview a published course outline without signing in", "parameters": [ { "type": "integer", "description": "Published course ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.PublicCourseOutline" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/chapters/{chapterId}/lessons": { "get": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "learning" ], "summary": "List lessons for a chapter", "parameters": [ { "type": "integer", "description": "Chapter ID", "name": "chapterId", "in": "path", "required": true }, { "type": "integer", "default": 20, "description": "Page size", "name": "limit", "in": "query" }, { "type": "integer", "default": 0, "description": "Offset", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.lessonListData" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Resource not found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/chapters/{chapterId}/practices": { "get": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "learning" ], "summary": "List practices for a unit", "parameters": [ { "type": "integer", "description": "Exam prep unit ID", "name": "chapterId", "in": "path", "required": true }, { "type": "integer", "description": "Page size. Omit to return all practices for the unit.", "name": "limit", "in": "query" }, { "type": "integer", "description": "Offset (used when limit is provided)", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.ListExamPrepPracticesByUnitData" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/chapters/{chapterId}/quizzes": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns quizzes and pagination. Admins see drafts; learners see published quizzes with published question sets in published chapters and courses.", "produces": [ "application/json" ], "tags": [ "quizzes" ], "summary": "List quizzes in a chapter", "parameters": [ { "type": "integer", "description": "Chapter ID", "name": "chapterId", "in": "path", "required": true }, { "type": "integer", "default": 20, "description": "Page size", "name": "limit", "in": "query" }, { "type": "integer", "default": 0, "description": "Offset", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.quizListData" } } } ] } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/chapters/{id}": { "get": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "learning" ], "summary": "Get chapter by ID", "parameters": [ { "type": "integer", "description": "Chapter ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.ExamPrepUnit" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Resource not found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/courses": { "get": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "learning" ], "summary": "List courses", "parameters": [ { "type": "integer", "default": 20, "description": "Page size", "name": "limit", "in": "query" }, { "type": "integer", "default": 0, "description": "Offset", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.courseListData" } } } ] } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/courses/{courseId}/chapters": { "get": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "learning" ], "summary": "List chapters for a course", "parameters": [ { "type": "integer", "description": "Course ID", "name": "courseId", "in": "path", "required": true }, { "type": "integer", "default": 20, "description": "Page size", "name": "limit", "in": "query" }, { "type": "integer", "default": 0, "description": "Offset", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.chapterListData" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Resource not found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/courses/{courseId}/checkout": { "post": { "security": [ { "Bearer": [] } ], "description": "Creates a one-time Chapa checkout at the course's server-configured price. Verified payment grants permanent access to this course only. Optional referral_code applies first-touch affiliate attribution before checkout; same-code retries preserve the original expiry. Invalid or conflicting codes return 400.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "learning" ], "summary": "Purchase a course", "parameters": [ { "type": "integer", "description": "Course ID", "name": "courseId", "in": "path", "required": true }, { "description": "Optional checkout phone", "name": "body", "in": "body", "schema": { "$ref": "#/definitions/domain.CourseCheckoutRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.CourseCheckoutResponse" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "409": { "description": "Conflict", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/courses/{courseId}/practices": { "get": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "learning" ], "summary": "List practices for a course", "parameters": [ { "type": "integer", "description": "Exam prep course ID", "name": "courseId", "in": "path", "required": true }, { "type": "integer", "description": "Page size. Omit to return all practices for the course.", "name": "limit", "in": "query" }, { "type": "integer", "description": "Offset (used when limit is provided)", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.ListExamPrepPracticesByCatalogCourseData" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/courses/{id}": { "get": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "learning" ], "summary": "Get course by ID", "parameters": [ { "type": "integer", "description": "Course ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.ExamPrepCatalogCourse" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Resource not found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/devices/register": { "post": { "security": [ { "Bearer": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "devices" ], "summary": "Register Device Token", "parameters": [ { "description": "Device token and platform", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.RegisterDeviceToken.Request" } } ], "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "type": "string" } } } } }, "/api/v1/devices/unregister": { "post": { "security": [ { "Bearer": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "devices" ], "summary": "Unregister Device Token", "parameters": [ { "description": "Device token to unregister", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.UnregisterDeviceToken.Request" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { "description": "Invalid request", "schema": { "type": "string" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "type": "string" } } } } }, "/api/v1/faqs": { "get": { "description": "Returns active FAQs for public/help center usage", "produces": [ "application/json" ], "tags": [ "faqs" ], "summary": "List published FAQs", "parameters": [ { "type": "string", "description": "Filter by category", "name": "category", "in": "query" }, { "type": "integer", "description": "Limit (default 50)", "name": "limit", "in": "query" }, { "type": "integer", "description": "Offset (default 0)", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.listFAQsRes" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/faqs/{id}": { "get": { "description": "Returns one active FAQ item", "produces": [ "application/json" ], "tags": [ "faqs" ], "summary": "Get published FAQ by ID", "parameters": [ { "type": "integer", "description": "FAQ ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.faqRes" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/field-options": { "get": { "description": "Returns active options grouped by field_key (e.g. education_level, country)", "produces": [ "application/json" ], "tags": [ "field-options" ], "summary": "List field options for client dropdowns", "parameters": [ { "type": "string", "description": "Filter by field key", "name": "field_key", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.ProfileFieldOptionsGrouped" } } } ] } } } } }, "/api/v1/field-options/fields": { "get": { "description": "Returns field_key values that have options (e.g. education_level, country)", "produces": [ "application/json" ], "tags": [ "field-options" ], "summary": "List distinct field keys", "parameters": [ { "type": "boolean", "description": "If true, only keys with active options", "name": "active_only", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.ListFieldKeysData" } } } ] } } } } }, "/api/v1/files/audio": { "post": { "security": [ { "Bearer": [] } ], "consumes": [ "multipart/form-data" ], "produces": [ "application/json" ], "tags": [ "files" ], "summary": "Upload an audio file", "parameters": [ { "type": "file", "description": "Audio file (mp3, wav, ogg, m4a, aac, webm)", "name": "file", "in": "formData", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.UploadAudioData" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "503": { "description": "Service unavailable", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/files/complete-upload": { "post": { "security": [ { "Bearer": [] } ], "description": "Call after PUT upload to upload_url. Returns the same file metadata shape as POST /files/upload.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "files" ], "summary": "Complete presigned MinIO upload", "parameters": [ { "description": "Complete upload request", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.completePresignedUploadReq" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.uploadMediaRes" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Resource not found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "503": { "description": "Service unavailable", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/files/presign-upload": { "post": { "security": [ { "Bearer": [] } ], "description": "Returns a short-lived PUT URL and object key. Upload the file with HTTP PUT to upload_url using the same Content-Type, then call POST /files/complete-upload.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "files" ], "summary": "Create presigned MinIO upload URL", "parameters": [ { "description": "Presigned upload request", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.presignedUploadReq" } } ], "responses": { "201": { "description": "Created", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.presignedUploadRes" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "503": { "description": "Service unavailable", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/files/refresh-url": { "post": { "security": [ { "Bearer": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "files" ], "summary": "Refresh presigned URL for a file", "parameters": [ { "description": "reference (object key, minio://..., or existing presigned URL)", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.refreshFileURLReq" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.RefreshFileURLData" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "503": { "description": "Service unavailable", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/files/upload": { "post": { "security": [ { "Bearer": [] } ], "consumes": [ "multipart/form-data" ], "produces": [ "application/json" ], "tags": [ "files" ], "summary": "Upload media file", "parameters": [ { "type": "string", "description": "Media type: image|audio|video|pdf", "name": "media_type", "in": "formData", "required": true }, { "type": "file", "description": "Media file", "name": "file", "in": "formData", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.uploadMediaRes" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "503": { "description": "Service unavailable", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/files/url": { "get": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "files" ], "summary": "Get presigned URL for a file", "parameters": [ { "type": "string", "description": "MinIO object key (e.g. profile_pictures/uuid.jpg)", "name": "key", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.GetFileURLData" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "503": { "description": "Service unavailable", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/issues": { "post": { "security": [ { "Bearer": [] } ], "description": "Allows any authenticated user to report an issue they encountered", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "issues" ], "summary": "Report an issue", "parameters": [ { "description": "Issue report payload", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.createIssueReq" } } ], "responses": { "201": { "description": "Created", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.issueRes" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/issues/me": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns paginated issues reported by the authenticated user", "produces": [ "application/json" ], "tags": [ "issues" ], "summary": "Get my reported issues", "parameters": [ { "type": "integer", "default": 20, "description": "Limit", "name": "limit", "in": "query" }, { "type": "integer", "default": 0, "description": "Offset", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.issueListRes" } } } ] } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/lessons/{id}": { "get": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "learning" ], "summary": "Get lesson by ID", "parameters": [ { "type": "integer", "format": "int64", "description": "Id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.ExamPrepLesson" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Resource not found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/lessons/{lessonId}/practices": { "get": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "learning" ], "summary": "List practices for a lesson", "parameters": [ { "type": "integer", "description": "Exam prep lesson ID", "name": "lessonId", "in": "path", "required": true }, { "type": "integer", "description": "Page size. Omit to return all practices for the lesson.", "name": "limit", "in": "query" }, { "type": "integer", "description": "Offset (used when limit is provided)", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.ListExamPrepPracticesByLessonData" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/notifications": { "get": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "notifications" ], "summary": "Get User Notification", "parameters": [ { "type": "integer", "default": 10, "description": "Limit", "name": "limit", "in": "query" }, { "minimum": 0, "type": "integer", "default": 0, "description": "Offset", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.GetUserNotificationResponse" } }, "400": { "description": "Invalid request", "schema": { "type": "string" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "type": "string" } } } }, "delete": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "notifications" ], "summary": "Delete User Notifications", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/notifications/delete-in-app": { "post": { "security": [ { "Bearer": [] } ], "description": "Deletes in-app notifications by ID for the authenticated user. Non-matching IDs are ignored.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "notifications" ], "summary": "Delete multiple in-app notifications", "parameters": [ { "description": "Notification IDs", "name": "body", "in": "body", "required": true, "schema": { "type": "object" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.DeleteInAppNotificationsData" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/notifications/mark-all-read": { "post": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "notifications" ], "summary": "Mark All Notifications As Read", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/notifications/mark-all-unread": { "post": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "notifications" ], "summary": "Mark All Notifications As Unread", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/notifications/unread": { "get": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "notifications" ], "summary": "Count Unread Notifications", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.CountUnreadNotificationsResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "type": "string" } } } } }, "/api/v1/notifications/{id}": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns a single in-app notification. Users may only fetch their own notifications unless they have list-all access.", "produces": [ "application/json" ], "tags": [ "notifications" ], "summary": "Get in-app notification by ID", "parameters": [ { "type": "integer", "description": "Notification ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.Notification" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "delete": { "security": [ { "Bearer": [] } ], "description": "Deletes one in-app notification owned by the authenticated user.", "produces": [ "application/json" ], "tags": [ "notifications" ], "summary": "Delete a single in-app notification", "parameters": [ { "type": "integer", "description": "Notification ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/notifications/{id}/read": { "patch": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "notifications" ], "summary": "Mark Notification As Read", "parameters": [ { "type": "integer", "format": "int64", "description": "Id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.Notification" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/notifications/{id}/unread": { "patch": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "notifications" ], "summary": "Mark Notification As Unread", "parameters": [ { "type": "integer", "format": "int64", "description": "Id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.Notification" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/payments": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns the authenticated user's payment history", "produces": [ "application/json" ], "tags": [ "payments" ], "summary": "Get payment history", "parameters": [ { "type": "integer", "default": 20, "description": "Limit", "name": "limit", "in": "query" }, { "type": "integer", "default": 0, "description": "Offset", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/handlers.paymentRes" } } } } ] } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/payments/arifpay/success": { "get": { "description": "Displays the Rezina success page after ArifPay redirects the learner back to the backend.", "produces": [ "text/html" ], "tags": [ "payments" ], "summary": "ArifPay payment success page", "parameters": [ { "type": "string", "description": "ArifPay session identifier", "name": "session_id", "in": "query" }, { "type": "string", "description": "ArifPay session identifier", "name": "sessionId", "in": "query" }, { "type": "string", "description": "Fallback payment nonce", "name": "nonce", "in": "query" }, { "type": "string", "description": "Sessionid", "name": "sessionID", "in": "query" } ], "responses": { "200": { "description": "HTML success page", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/payments/chapa/callback": { "get": { "description": "Verifies payment after Chapa redirects to callback_url", "produces": [ "application/json" ], "tags": [ "payments" ], "summary": "Chapa payment callback", "parameters": [ { "type": "string", "description": "Transaction reference", "name": "trx_ref", "in": "query" }, { "type": "string", "description": "Chapa reference ID", "name": "ref_id", "in": "query" }, { "type": "string", "description": "Payment status", "name": "status", "in": "query" }, { "type": "string", "description": "Tx ref", "name": "tx_ref", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/payments/chapa/direct": { "post": { "security": [ { "Bearer": [] } ], "description": "Learner endpoint retired: returns 410 Gone. Purchase a course using POST /api/v1/courses/{courseId}/checkout. Administrative subscription history remains available.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "payments" ], "summary": "Initiate Chapa direct charge subscription payment", "parameters": [ { "description": "Chapa direct charge request", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.initiateChapaDirectPaymentReq" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.InitiateChapaDirectChargeResponse" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "410": { "description": "Gone", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/payments/chapa/direct/authorize": { "post": { "security": [ { "Bearer": [] } ], "description": "Completes OTP authorization for Chapa direct charge methods that require it.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "payments" ], "summary": "Authorize Chapa direct charge with OTP", "parameters": [ { "description": "Chapa direct charge authorization request", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.authorizeChapaDirectPaymentReq" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.AuthorizeChapaDirectChargeResponse" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/payments/chapa/direct/methods": { "get": { "description": "Returns wallet methods supported by Chapa Direct Charge API (USSD push and OTP flows).", "produces": [ "application/json" ], "tags": [ "payments" ], "summary": "Get Chapa direct charge payment methods", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/domain.ChapaDirectChargeMethod" } } } } ] } } } } }, "/api/v1/payments/chapa/success": { "get": { "description": "Displays the Rezina success page after Chapa redirects the learner to return_url", "produces": [ "text/html" ], "tags": [ "payments" ], "summary": "Chapa payment success page", "parameters": [ { "type": "string", "description": "Chapa transaction reference (tx_ref)", "name": "trx_ref", "in": "query" }, { "type": "string", "description": "Chapa transaction reference", "name": "tx_ref", "in": "query" }, { "type": "string", "description": "Chapa reference ID", "name": "ref_id", "in": "query" }, { "type": "string", "description": "Payment status from Chapa redirect", "name": "status", "in": "query" } ], "responses": { "200": { "description": "HTML success page", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/payments/direct": { "post": { "security": [ { "Bearer": [] } ], "description": "Learner endpoint retired: returns 410 Gone. Purchase a course using POST /api/v1/courses/{courseId}/checkout. Administrative subscription history remains available.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "payments" ], "summary": "Initiate direct payment", "parameters": [ { "description": "Direct payment request", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.initiateDirectPaymentReq" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.InitiateDirectPaymentResponse" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "410": { "description": "Gone", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/payments/direct/methods": { "get": { "description": "Returns list of payment methods that support direct payment (OTP-based)", "produces": [ "application/json" ], "tags": [ "payments" ], "summary": "Get direct payment methods", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/domain.ARIFPAYPaymentMethod" } } } } ] } } } } }, "/api/v1/payments/direct/verify-otp": { "post": { "security": [ { "Bearer": [] } ], "description": "Verifies the OTP sent for direct payment methods (Amole, HelloCash, etc.)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "payments" ], "summary": "Verify OTP for direct payment", "parameters": [ { "description": "OTP verification request", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.verifyOTPReq" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.VerifyOTPResponse" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/payments/methods": { "get": { "description": "Returns payment methods available on Chapa checkout", "produces": [ "application/json" ], "tags": [ "payments" ], "summary": "Get Chapa payment methods", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/domain.ChapaPaymentMethod" } } } } ] } } } } }, "/api/v1/payments/subscribe": { "post": { "security": [ { "Bearer": [] } ], "description": "Learner endpoint retired: returns 410 Gone. Purchase a course using POST /api/v1/courses/{courseId}/checkout. Administrative subscription history remains available.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "payments" ], "summary": "Initiate subscription payment", "parameters": [ { "description": "Payment request", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.initiatePaymentReq" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.InitiateSubscriptionPaymentResponse" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "410": { "description": "Gone", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/payments/verify/{session_id}": { "get": { "security": [ { "Bearer": [] } ], "description": "Checks the payment status with the payment provider", "produces": [ "application/json" ], "tags": [ "payments" ], "summary": "Verify payment status", "parameters": [ { "type": "string", "description": "Session ID", "name": "session_id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.paymentRes" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/payments/webhook": { "post": { "description": "Processes payment notifications from Chapa (charge.success, etc.)", "consumes": [ "application/json", "application/json" ], "produces": [ "application/json" ], "tags": [ "payments" ], "summary": "Handle Chapa webhook", "parameters": [ { "description": "Exact signed Chapa webhook payload", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.ChapaWebhookPayload" } }, { "type": "string", "description": "Webhook HMAC signature. Alternatively send chapa-signature; one of these headers is required.", "name": "x-chapa-signature", "in": "header" }, { "type": "string", "description": "Alternative signature header", "name": "chapa-signature", "in": "header" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Authentication failed", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/payments/{id}": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns details of a specific payment", "produces": [ "application/json" ], "tags": [ "payments" ], "summary": "Get payment details", "parameters": [ { "type": "integer", "description": "Payment ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.paymentRes" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/payments/{id}/cancel": { "post": { "security": [ { "Bearer": [] } ], "description": "Cancels a payment that is still pending", "produces": [ "application/json" ], "tags": [ "payments" ], "summary": "Cancel a pending payment", "parameters": [ { "type": "integer", "description": "Payment ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } } } } }, "/api/v1/personas": { "get": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "personas" ], "summary": "List LMS personas (catalog for practice assignment)", "parameters": [ { "type": "boolean", "default": true, "description": "When true (default), return only active personas", "name": "active_only", "in": "query" }, { "type": "integer", "description": "Page size", "name": "limit", "in": "query" }, { "type": "integer", "description": "Offset", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.listPersonasData" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/personas/{id}": { "get": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "personas" ], "summary": "Get LMS persona by ID", "parameters": [ { "type": "integer", "description": "Persona ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.LmsPersona" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Resource not found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/practices": { "get": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "learning" ], "summary": "List practices globally", "parameters": [ { "type": "integer", "description": "Page size. Omit (with offset) to return all practices.", "name": "limit", "in": "query" }, { "type": "integer", "description": "Offset. Defaults to 0 when limit is provided; ignored semantics when both omitted (all rows).", "name": "offset", "in": "query" }, { "type": "boolean", "description": "When true, return only practices with no parent links (admin)", "name": "unlinked_only", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.ListAllExamPrepPracticesData" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/practices/{id}": { "get": { "security": [ { "Bearer": [] } ], "produces": [ "application/json" ], "tags": [ "learning" ], "summary": "Get practice by ID", "parameters": [ { "type": "integer", "description": "Exam prep practice ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.ExamPrepPractice" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Resource not found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/practices/{practiceId}/questions": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns paginated questions for an practice, including shared stimulus blocks and each question's effective dynamic payload", "produces": [ "application/json" ], "tags": [ "question-set-items" ], "summary": "Get questions by practice", "parameters": [ { "type": "integer", "description": "Exam-prep practice ID", "name": "practiceId", "in": "path", "required": true }, { "type": "string", "description": "Question type filter (e.g. AUDIO)", "name": "question_type", "in": "query" }, { "type": "integer", "default": 10, "description": "Limit", "name": "limit", "in": "query" }, { "type": "integer", "default": 0, "description": "Offset", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.paginatedQuestionSetItemsRes" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/progress-summary": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns progress for the course → unit → module → lesson learning hierarchy.", "produces": [ "application/json" ], "tags": [ "learning" ], "summary": "Get my learning progress summary", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.ExamPrepProgressSummary" } } } ] } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/progress/practices/{id}/complete": { "post": { "security": [ { "Bearer": [] } ], "description": "Marks a practice question set as completed for the authenticated learner in its exam-prep parent scope", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "progression" ], "summary": "Mark practice as completed", "parameters": [ { "type": "integer", "description": "Practice Question Set ID", "name": "id", "in": "path", "required": true }, { "description": "Optional practice parent scope", "name": "body", "in": "body", "schema": { "$ref": "#/definitions/domain.CompletePracticeInput" } }, { "type": "string", "description": "Parent kind", "name": "parent_kind", "in": "query" }, { "type": "integer", "description": "Parent id", "name": "parent_id", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/progress/quizzes/{id}/complete": { "post": { "security": [ { "Bearer": [] } ], "description": "The id is the quiz shell ID, not question_set_id. The single chapter scope is inferred; optional scope must use CHAPTER and that chapter ID. Records completion for the authenticated learner.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "quizzes" ], "summary": "Complete a chapter quiz", "parameters": [ { "type": "integer", "description": "Quiz shell ID", "name": "id", "in": "path", "required": true }, { "description": "Optional chapter scope", "name": "body", "in": "body", "schema": { "$ref": "#/definitions/domain.CompletePracticeInput" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing or invalid access token", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "403": { "description": "Permission, subscription, or sequence access denied", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "404": { "description": "Quiz or published parent not found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/questions/audio-answer": { "post": { "security": [ { "Bearer": [] } ], "consumes": [ "multipart/form-data" ], "produces": [ "application/json" ], "tags": [ "questions" ], "summary": "Submit audio answer for a question", "parameters": [ { "type": "integer", "description": "Question ID", "name": "question_id", "in": "formData", "required": true }, { "type": "integer", "description": "Question Set ID", "name": "question_set_id", "in": "formData", "required": true }, { "type": "file", "description": "Audio recording", "name": "file", "in": "formData", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.SubmitAudioAnswerData" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "503": { "description": "Service unavailable", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/quizzes/{id}": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns a quiz shell. Learners only see published quizzes with a published question set in a published chapter and course.", "produces": [ "application/json" ], "tags": [ "quizzes" ], "summary": "Get a chapter quiz", "parameters": [ { "type": "integer", "description": "Quiz shell ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.ExamPrepPractice" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing or invalid access token", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "403": { "description": "Permission, subscription, or sequence access denied", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "404": { "description": "Quiz or published parent not found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/quizzes/{practiceId}/questions": { "get": { "security": [ { "Bearer": [] } ], "description": "Learner endpoint. Requires a published quiz and question set, accessible chapter, subscription eligibility, and learning sequence access.", "produces": [ "application/json" ], "tags": [ "quizzes" ], "summary": "List questions in a chapter quiz", "parameters": [ { "type": "integer", "description": "Quiz shell ID", "name": "practiceId", "in": "path", "required": true }, { "type": "string", "description": "Question type filter", "name": "question_type", "in": "query" }, { "type": "integer", "default": 10, "description": "Page size (1-200)", "name": "limit", "in": "query" }, { "type": "integer", "default": 0, "description": "Non-negative offset", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.paginatedQuestionSetItemsRes" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing or invalid access token", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "403": { "description": "Permission, subscription, or sequence access denied", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "404": { "description": "Quiz or published parent not found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/ratings": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns paginated ratings for a specific target", "produces": [ "application/json" ], "tags": [ "ratings" ], "summary": "Get ratings for a target", "parameters": [ { "type": "string", "description": "Target type (app, course, sub_course)", "name": "target_type", "in": "query", "required": true }, { "type": "integer", "description": "Target ID (0 for app)", "name": "target_id", "in": "query", "required": true }, { "type": "integer", "description": "Limit (default 20)", "name": "limit", "in": "query" }, { "type": "integer", "description": "Offset (default 0)", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/handlers.ratingRes" } } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } }, "post": { "security": [ { "Bearer": [] } ], "description": "Submit a rating for an app, course, or sub-course", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "ratings" ], "summary": "Submit a rating", "parameters": [ { "description": "Submit rating payload", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.submitRatingReq" } } ], "responses": { "201": { "description": "Created", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.ratingRes" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/ratings/me": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns the current user's rating for a specific target", "produces": [ "application/json" ], "tags": [ "ratings" ], "summary": "Get my rating for a target", "parameters": [ { "type": "string", "description": "Target type (app, course, sub_course)", "name": "target_type", "in": "query", "required": true }, { "type": "integer", "description": "Target ID (0 for app)", "name": "target_id", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.ratingRes" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/ratings/me/all": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns all ratings submitted by the current user", "produces": [ "application/json" ], "tags": [ "ratings" ], "summary": "Get all my ratings", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/handlers.ratingRes" } } } } ] } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/ratings/summary": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns the total count and average stars for a specific target", "produces": [ "application/json" ], "tags": [ "ratings" ], "summary": "Get rating summary for a target", "parameters": [ { "type": "string", "description": "Target type (app, course, sub_course)", "name": "target_type", "in": "query", "required": true }, { "type": "integer", "description": "Target ID (0 for app)", "name": "target_id", "in": "query", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.ratingSummaryRes" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/ratings/{id}": { "delete": { "security": [ { "Bearer": [] } ], "description": "Deletes a rating by ID for the current user", "produces": [ "application/json" ], "tags": [ "ratings" ], "summary": "Delete a rating", "parameters": [ { "type": "integer", "description": "Rating ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/referrals": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns only the authenticated learner's referral history and conversion flags. Referred learners' names, emails, and phone numbers are not exposed.", "produces": [ "application/json" ], "tags": [ "referrals" ], "summary": "List My Referrals", "parameters": [ { "maximum": 100, "minimum": 1, "type": "integer", "default": 20, "description": "Page size", "name": "limit", "in": "query" }, { "minimum": 0, "type": "integer", "default": 0, "description": "Number of entries to skip", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.ReferralHistoryData" } } } ] } }, "400": { "description": "Invalid pagination", "schema": { "type": "string" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Unable to process referral request", "schema": { "type": "string" } } } } }, "/api/v1/referrals/apply": { "post": { "security": [ { "Bearer": [] } ], "description": "Attributes the authenticated learner to one referrer. Apply within seven days of account creation and before any successful positive payment. Codes are case-insensitive and surrounding whitespace is ignored. Self referral, reassignment, inactive referrers, and invalid codes are rejected.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "referrals" ], "summary": "Apply Referral Code", "parameters": [ { "description": "Referral share code", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.applyReferralReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { "description": "Invalid request or ineligible referral", "schema": { "type": "string" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Unable to process referral request", "schema": { "type": "string" } } } } }, "/api/v1/referrals/code": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns the authenticated learner's stable share code, creating it when necessary. Codes are case-insensitive.", "produces": [ "application/json" ], "tags": [ "referrals" ], "summary": "Get Referral Code", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.ReferralCodeData" } } } ] } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Unable to process referral request", "schema": { "type": "string" } } } }, "post": { "security": [ { "Bearer": [] } ], "description": "Creates or returns the authenticated learner's stable share code. Requires an approved affiliate with an active STUDENT or OPEN_LEARNER account.", "produces": [ "application/json" ], "tags": [ "referrals" ], "summary": "Create Referral Code", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.ReferralCodeData" } } } ] } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Unable to process referral request", "schema": { "type": "string" } } } } }, "/api/v1/referrals/me": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns the learner's code, current commission percentage, referral/conversion counts, and commission-wallet balances by currency.", "produces": [ "application/json" ], "tags": [ "referrals" ], "summary": "Get My Referrals", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.ReferralOverviewData" } } } ] } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Unable to process referral request", "schema": { "type": "string" } } } } }, "/api/v1/referrals/wallet": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns wallet balances separately by currency and a paginated commission ledger. Decimal amounts and percentages are strings. Only the qualifying course payment earns a commission; duplicate callbacks and renewals do not. Reversed credits are excluded from balances. This endpoint does not initiate cash payouts.", "produces": [ "application/json" ], "tags": [ "referrals" ], "summary": "Get Referral Wallet", "parameters": [ { "maximum": 100, "minimum": 1, "type": "integer", "default": 20, "description": "Page size", "name": "limit", "in": "query" }, { "minimum": 0, "type": "integer", "default": 0, "description": "Number of entries to skip", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.ReferralWalletData" } } } ] } }, "400": { "description": "Invalid pagination", "schema": { "type": "string" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Unable to process referral request", "schema": { "type": "string" } } } } }, "/api/v1/subscription-plans": { "get": { "description": "Learner endpoint retired: returns 410 Gone. Purchase a course using POST /api/v1/courses/{courseId}/checkout. Administrative subscription history remains available.", "produces": [ "application/json" ], "tags": [ "subscriptions" ], "summary": "List subscription plans", "parameters": [ { "type": "boolean", "default": true, "description": "Customer requests always return active plans; false is honored only by the admin endpoint", "name": "active_only", "in": "query" }, { "type": "string", "description": "Filter by plan category (EDUCATION)", "name": "category", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/handlers.planRes" } } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "410": { "description": "Gone", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/subscription-plans/{id}": { "get": { "description": "Learner endpoint retired: returns 410 Gone. Purchase a course using POST /api/v1/courses/{courseId}/checkout. Administrative subscription history remains available.", "produces": [ "application/json" ], "tags": [ "subscriptions" ], "summary": "Get a subscription plan", "parameters": [ { "type": "integer", "description": "Plan ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.planRes" } } } ] } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "410": { "description": "Gone", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/subscriptions": { "post": { "security": [ { "Bearer": [] } ], "description": "Learner endpoint retired: returns 410 Gone. Purchase a course using POST /api/v1/courses/{courseId}/checkout. Administrative subscription history remains available.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "subscriptions" ], "summary": "Subscribe to a plan (Admin only - bypasses payment)", "deprecated": true, "parameters": [ { "description": "Subscribe payload", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.subscribeReq" } } ], "responses": { "201": { "description": "Created", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.subscriptionRes" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "410": { "description": "Gone", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/subscriptions/checkout": { "post": { "security": [ { "Bearer": [] } ], "description": "Learner endpoint retired: returns 410 Gone. Purchase a course using POST /api/v1/courses/{courseId}/checkout. Administrative subscription history remains available.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "subscriptions" ], "summary": "Subscribe to a plan with payment", "parameters": [ { "description": "Subscribe with payment payload", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.subscribeWithPaymentReq" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.subscriptionCheckoutRes" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Resource not found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "409": { "description": "User already has active subscription", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "410": { "description": "Gone", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/subscriptions/history": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns the authenticated user's subscription history", "produces": [ "application/json" ], "tags": [ "subscriptions" ], "summary": "Get subscription history", "parameters": [ { "type": "integer", "default": 20, "description": "Limit", "name": "limit", "in": "query" }, { "type": "integer", "default": 0, "description": "Offset", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/handlers.subscriptionRes" } } } } ] } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/subscriptions/me": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns all active subscriptions for the authenticated user (one per plan category)", "produces": [ "application/json" ], "tags": [ "subscriptions" ], "summary": "Get active subscriptions", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/handlers.subscriptionRes" } } } } ] } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/subscriptions/request-checkout-link": { "post": { "security": [ { "Bearer": [] } ], "description": "Learner endpoint retired: returns 410 Gone. Purchase a course using POST /api/v1/courses/{courseId}/checkout. Administrative subscription history remains available.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "subscriptions" ], "summary": "Send web checkout link to learner", "parameters": [ { "description": "Optional plan or category for deep link", "name": "body", "in": "body", "schema": { "$ref": "#/definitions/handlers.requestCheckoutLinkReq" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.requestCheckoutLinkRes" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "409": { "description": "Conflict", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "410": { "description": "Gone", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "429": { "description": "Too Many Requests", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "503": { "description": "Service Unavailable", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/subscriptions/status": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns whether the authenticated user has an active subscription", "produces": [ "application/json" ], "tags": [ "subscriptions" ], "summary": "Check subscription status", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.CheckSubscriptionStatusData" } } } ] } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/subscriptions/{id}/auto-renew": { "put": { "security": [ { "Bearer": [] } ], "description": "Enables or disables auto-renewal for a subscription", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "subscriptions" ], "summary": "Set auto-renew", "parameters": [ { "type": "integer", "description": "Subscription ID", "name": "id", "in": "path", "required": true }, { "description": "Auto-renew payload", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.autoRenewReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Resource not found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/subscriptions/{id}/cancel": { "post": { "security": [ { "Bearer": [] } ], "description": "Cancels the user's subscription", "produces": [ "application/json" ], "tags": [ "subscriptions" ], "summary": "Cancel subscription", "parameters": [ { "type": "integer", "description": "Subscription ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { "description": "Invalid request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Resource not found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/user": { "put": { "security": [ { "Bearer": [] } ], "description": "Updates user profile information (partial updates supported)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Update user profile", "parameters": [ { "description": "Update user payload", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.UpdateUserReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/user/checkPhoneEmailExist": { "post": { "description": "Check if phone number or email exist", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Check if phone number or email exist", "parameters": [ { "description": "Check phone number or email exist", "name": "checkPhoneEmailExist", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.CheckPhoneEmailExistReq" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/response.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.CheckPhoneEmailExistRes" } } } ] } }, "400": { "description": "Plain-text error returned by the handler or authentication middleware", "schema": { "type": "string" } }, "500": { "description": "Plain-text error returned by the handler or authentication middleware", "schema": { "type": "string" } } } } }, "/api/v1/user/knowledge-level": { "put": { "security": [ { "Bearer": [] } ], "description": "Updates the authenticated learner's self-reported knowledge level.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Update user's knowledge level", "parameters": [ { "description": "Knowledge level", "name": "knowledge_level", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.UpdateKnowledgeLevelReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Unauthorized", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/user/me": { "delete": { "security": [ { "Bearer": [] } ], "description": "Starts account deletion with grace period before permanent purge", "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Request deletion of my account", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/response.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.DeleteMyUserAccountData" } } } ] } }, "401": { "description": "Plain-text error returned by the handler or authentication middleware", "schema": { "type": "string" } }, "403": { "description": "Plain-text error returned by the handler or authentication middleware", "schema": { "type": "string" } }, "500": { "description": "Plain-text error returned by the handler or authentication middleware", "schema": { "type": "string" } } } } }, "/api/v1/user/me/deletion/cancel": { "post": { "security": [ { "Bearer": [] } ], "description": "Cancels a pending self-deletion request during grace period", "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Cancel my account deletion request", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageAPIResponse" } }, "401": { "description": "Plain-text error returned by the handler or authentication middleware", "schema": { "type": "string" } }, "403": { "description": "Plain-text error returned by the handler or authentication middleware", "schema": { "type": "string" } }, "500": { "description": "Plain-text error returned by the handler or authentication middleware", "schema": { "type": "string" } } } } }, "/api/v1/user/register": { "post": { "description": "Registers a learner with email or phone and password. The server assigns the learner role and selects the OTP medium from the contact method. An optional referral_code attributes the new account atomically; invalid or ineligible codes reject registration.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Register user", "parameters": [ { "description": "Register user", "name": "registerUser", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.RegisterUserReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/user/resend-otp": { "post": { "description": "Resend OTP if the previous one is expired", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "otp" ], "summary": "Resend OTP", "parameters": [ { "description": "Resend OTP", "name": "resendOtp", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.ResendOtpReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageResponse" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/user/resetPassword": { "post": { "description": "Reset password", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Reset password", "parameters": [ { "description": "Reset password", "name": "resetPassword", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.ResetPasswordReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageAPIResponse" } }, "400": { "description": "Plain-text error returned by the handler or authentication middleware", "schema": { "type": "string" } }, "500": { "description": "Plain-text error returned by the handler or authentication middleware", "schema": { "type": "string" } } } } }, "/api/v1/user/sendRegisterCode": { "post": { "description": "Send register code", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Send register code", "parameters": [ { "description": "Send register code", "name": "registerCode", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.RegisterCodeReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageAPIResponse" } }, "400": { "description": "Plain-text error returned by the handler or authentication middleware", "schema": { "type": "string" } }, "500": { "description": "Plain-text error returned by the handler or authentication middleware", "schema": { "type": "string" } } } } }, "/api/v1/user/sendResetCode": { "post": { "description": "Sends a password-reset OTP code by email or SMS for learner (mobile) accounts. Email delivers the numeric code (not a link).", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Send reset code", "parameters": [ { "description": "Send reset code", "name": "resetCode", "in": "body", "required": true, "schema": { "$ref": "#/definitions/handlers.ResetCodeReq" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/handlers.MessageAPIResponse" } }, "400": { "description": "Plain-text error returned by the handler or authentication middleware", "schema": { "type": "string" } }, "500": { "description": "Plain-text error returned by the handler or authentication middleware", "schema": { "type": "string" } } } } }, "/api/v1/user/me/sessions": { "get": { "produces": ["application/json"], "tags": ["user"], "summary": "List the current learner's active device sessions", "responses": {"200": {"description": "OK", "schema": {"type": "object", "properties": {"message": {"type": "string"}, "data": {"type": "array", "items": {"type": "object", "properties": {"id": {"type": "string"}, "label": {"type": "string"}, "platform": {"type": "string"}, "last_seen_at": {"type": "string"}, "is_current": {"type": "boolean"}}}}}}}}, "security": [{"Bearer": []}] } }, "/api/v1/user/me/sessions/{id}": { "delete": { "tags": ["user"], "summary": "Remove one of the current learner's device sessions", "parameters": [{"type": "string", "description": "Session UUID", "name": "id", "in": "path", "required": true}], "responses": {"200": {"description": "OK", "schema": {"type": "object", "properties": {"message": {"type": "string"}}}}, "404": {"description": "Not Found", "schema": {"$ref": "#/definitions/domain.ErrorResponse"}}}, "security": [{"Bearer": []}] } }, "/api/v1/user/user-profile": { "get": { "security": [ { "Bearer": [] } ], "description": "Get user profile", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Get user profile", "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/response.APIResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.UserProfileResponse" } } } ] } }, "400": { "description": "Plain-text error returned by the handler or authentication middleware", "schema": { "type": "string" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Plain-text error returned by the handler or authentication middleware", "schema": { "type": "string" } } } } }, "/api/v1/user/verify-otp": { "post": { "description": "Verify OTP for registration or other actions", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Verify OTP", "parameters": [ { "description": "Verify OTP", "name": "verifyOtp", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.VerifyOtpReq" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.loginUserRes" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/user/{id}/profile-picture": { "post": { "security": [ { "Bearer": [] } ], "description": "Uploads a profile picture for the specified user", "consumes": [ "multipart/form-data" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Upload profile picture", "parameters": [ { "type": "integer", "description": "User ID", "name": "id", "in": "path", "required": true }, { "type": "file", "description": "Image file (jpg|png|webp)", "name": "file", "in": "formData", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.UploadProfilePictureData" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/user/{user_id}/is-profile-completed": { "get": { "security": [ { "Bearer": [] } ], "description": "Returns the profile completion status and percentage for the specified user", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Check if user profile is completed", "parameters": [ { "type": "integer", "description": "User ID", "name": "user_id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.CheckProfileCompletedData" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Account audience, status, permission, or subscription does not allow this operation", "schema": { "type": "string" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/user/{user_name}/is-pending": { "get": { "description": "Returns whether the specified user has a status of \"pending\"", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "user" ], "summary": "Check if user status is pending", "parameters": [ { "type": "string", "description": "User name", "name": "user_name", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.CheckUserPendingData" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/videos/engagement/heartbeat": { "post": { "security": [ { "Bearer": [] } ], "description": "Records playback position for analytics (completion, replay, and drop-off). Send periodic heartbeats while watching; set ended=true when the viewer leaves. A new session starts after 30 minutes of inactivity or when ended=true on the prior session.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "videos" ], "summary": "Report video playback progress", "parameters": [ { "description": "Playback heartbeat", "name": "body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/domain.VideoEngagementHeartbeatInput" } } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/domain.VideoWatchSessionResponse" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "401": { "description": "Missing, invalid, or expired Bearer token", "schema": { "type": "string" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/vimeo/oembed": { "get": { "description": "Fetches oEmbed metadata for a Vimeo video URL", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Vimeo" ], "summary": "Get oEmbed data for a Vimeo URL", "parameters": [ { "type": "string", "description": "Vimeo video URL", "name": "url", "in": "query", "required": true }, { "type": "integer", "description": "Desired width", "name": "width", "in": "query" }, { "type": "integer", "description": "Desired height", "name": "height", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/vimeo.OEmbedResponse" } } } ] } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "503": { "description": "Service unavailable", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/vimeo/sample": { "get": { "description": "Fetches a sample video from Vimeo and returns video details along with an embeddable iframe for client-side integration", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Vimeo" ], "summary": "Get a sample Vimeo video with iframe embed", "parameters": [ { "type": "string", "default": "76979871", "description": "Vimeo Video ID to use as sample", "name": "video_id", "in": "query" }, { "type": "integer", "default": 640, "description": "Player width", "name": "width", "in": "query" }, { "type": "integer", "default": 360, "description": "Player height", "name": "height", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/domain.Response" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/handlers.GetSampleVideoData" } } } ] } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } }, "503": { "description": "Service unavailable", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } }, "/api/v1/ws/connect": { "get": { "tags": [ "ws" ], "summary": "Connect Socket", "parameters": [ { "type": "string", "description": "Access token", "name": "token", "in": "query", "required": true } ], "responses": { "101": { "description": "WebSocket protocol upgrade; subsequent messages are notification events", "schema": { "type": "string" } }, "401": { "description": "Authentication failed", "schema": { "type": "string" } } } } }, "/payment/success": { "get": { "description": "Displays the Rezina success page after Chapa redirects the learner to return_url", "produces": [ "text/html" ], "tags": [ "payments" ], "summary": "Chapa payment success page", "parameters": [ { "type": "string", "description": "Chapa transaction reference (tx_ref)", "name": "trx_ref", "in": "query" }, { "type": "string", "description": "Chapa transaction reference", "name": "tx_ref", "in": "query" }, { "type": "string", "description": "Chapa reference ID", "name": "ref_id", "in": "query" }, { "type": "string", "description": "Payment status from Chapa redirect", "name": "status", "in": "query" } ], "responses": { "200": { "description": "HTML success page", "schema": { "type": "string" } }, "500": { "description": "Internal server error", "schema": { "$ref": "#/definitions/domain.ErrorResponse" } } } } } }, "definitions": { "domain.ARIFPAYPaymentMethod": { "type": "object", "properties": { "ID": { "type": "integer" }, "Name": { "type": "string" } } }, "domain.AcceptTeamInvitationReq": { "type": "object", "required": [ "first_name", "last_name", "password", "token" ], "properties": { "bio": { "type": "string" }, "department": { "type": "string" }, "emergency_contact": { "type": "string" }, "employment_type": { "type": "string" }, "first_name": { "type": "string" }, "hire_date": { "description": "YYYY-MM-DD", "type": "string" }, "job_title": { "type": "string" }, "last_name": { "type": "string" }, "password": { "type": "string", "minLength": 8 }, "phone_number": { "type": "string" }, "profile_picture_url": { "type": "string" }, "token": { "type": "string" }, "work_phone": { "type": "string" } } }, "domain.AccountDeletionRequest": { "type": "object", "properties": { "DeletionCancelledAt": { "type": "string" }, "DeletionRequestedAt": { "type": "string" }, "DeletionScheduledAt": { "type": "string" }, "DeletionState": { "$ref": "#/definitions/domain.AccountDeletionState" }, "Email": { "type": "string" }, "FirstName": { "type": "string" }, "LastName": { "type": "string" }, "PhoneNumber": { "type": "string" }, "Role": { "$ref": "#/definitions/domain.Role" }, "Status": { "$ref": "#/definitions/domain.UserStatus" }, "UserID": { "type": "integer" } } }, "domain.AccountDeletionState": { "type": "string", "enum": [ "PENDING", "DUE", "CANCELLED" ], "x-enum-varnames": [ "AccountDeletionStatePending", "AccountDeletionStateDue", "AccountDeletionStateCancelled" ] }, "domain.AdminExamPrepCatalogCourseLearningEntry": { "type": "object", "properties": { "chapters": { "type": "array", "items": { "$ref": "#/definitions/domain.AdminExamPrepUnitLearningEntry" } }, "id": { "type": "integer" }, "name": { "type": "string" }, "practices": { "type": "array", "items": { "$ref": "#/definitions/domain.AdminExamPrepPracticeLearningEntry" } }, "sort_order": { "type": "integer" } } }, "domain.AdminExamPrepLessonLearningEntry": { "type": "object", "properties": { "id": { "type": "integer" }, "practices": { "type": "array", "items": { "$ref": "#/definitions/domain.AdminExamPrepPracticeLearningEntry" } }, "sort_order": { "type": "integer" }, "title": { "type": "string" } } }, "domain.AdminExamPrepPracticeLearningEntry": { "type": "object", "properties": { "completed_at": { "type": "string" }, "practice_id": { "type": "integer" }, "title": { "type": "string" } } }, "domain.AdminExamPrepUnitLearningEntry": { "type": "object", "properties": { "id": { "type": "integer" }, "lessons": { "type": "array", "items": { "$ref": "#/definitions/domain.AdminExamPrepLessonLearningEntry" } }, "name": { "type": "string" }, "practices": { "type": "array", "items": { "$ref": "#/definitions/domain.AdminExamPrepPracticeLearningEntry" } }, "sort_order": { "type": "integer" } } }, "domain.AdminExamPrepUserLearningActivityTree": { "type": "object", "properties": { "courses": { "type": "array", "items": { "$ref": "#/definitions/domain.AdminExamPrepCatalogCourseLearningEntry" } }, "user_id": { "type": "integer" } } }, "domain.AdminUserExamPrepLearningSection": { "type": "object", "properties": { "completions": { "$ref": "#/definitions/domain.AdminExamPrepUserLearningActivityTree" }, "progress": { "$ref": "#/definitions/domain.ExamPrepProgressSummary" } } }, "domain.AdminUserLearningActivityDetails": { "type": "object", "properties": { "learning": { "$ref": "#/definitions/domain.AdminUserExamPrepLearningSection" }, "recent_activity": { "$ref": "#/definitions/domain.UserRecentActivityFeed" }, "user_id": { "type": "integer" } } }, "domain.AdminUserSubscriptionDetails": { "type": "object", "properties": { "active_by_category": { "type": "object", "additionalProperties": { "type": "boolean" } }, "active_subscriptions": { "type": "array", "items": { "$ref": "#/definitions/domain.AdminUserSubscriptionRecord" } }, "display_status": { "type": "string" }, "has_active_subscription": { "type": "boolean" }, "payments": { "type": "array", "items": { "$ref": "#/definitions/domain.AdminUserSubscriptionPayment" } }, "subscriptions": { "type": "array", "items": { "$ref": "#/definitions/domain.AdminUserSubscriptionRecord" } }, "user_id": { "type": "integer" } } }, "domain.AdminUserSubscriptionPayment": { "type": "object", "properties": { "amount": { "type": "number" }, "created_at": { "type": "string" }, "currency": { "type": "string" }, "expires_at": { "type": "string" }, "id": { "type": "integer" }, "paid_at": { "type": "string" }, "payment_method": { "type": "string" }, "plan_id": { "type": "integer" }, "plan_name": { "type": "string" }, "status": { "type": "string" }, "subscription_id": { "type": "integer" } } }, "domain.AdminUserSubscriptionRecord": { "type": "object", "properties": { "auto_renew": { "type": "boolean" }, "cancelled_at": { "type": "string" }, "created_at": { "type": "string" }, "currency": { "type": "string" }, "duration_unit": { "type": "string" }, "duration_value": { "type": "integer" }, "expires_at": { "type": "string" }, "id": { "type": "integer" }, "is_currently_active": { "type": "boolean" }, "is_lifetime": { "type": "boolean" }, "payment_method": { "type": "string" }, "payment_reference": { "type": "string" }, "plan_category": { "type": "string" }, "plan_id": { "type": "integer" }, "plan_name": { "type": "string" }, "price": { "type": "number" }, "starts_at": { "type": "string" }, "status": { "type": "string" }, "updated_at": { "type": "string" }, "user_id": { "type": "integer" } } }, "domain.AffiliateApplicationInput": { "type": "object", "properties": { "accept_terms": { "type": "boolean" }, "application": { "type": "string" }, "terms_version": { "type": "string" } } }, "domain.AffiliateBalance": { "type": "object", "properties": { "available": { "type": "string" }, "currency": { "type": "string" }, "paid": { "type": "string" }, "pending": { "type": "string" }, "recovery_due": { "type": "string" }, "reserved": { "type": "string" }, "reversed": { "type": "string" } } }, "domain.AffiliateCommission": { "type": "object", "properties": { "amount": { "type": "string" }, "available_at": { "type": "string" }, "commission_percent": { "type": "string" }, "course_id": { "type": "integer" }, "created_at": { "type": "string" }, "currency": { "type": "string" }, "id": { "type": "integer" }, "payment_id": { "type": "integer" }, "payout_id": { "type": "integer" }, "referrer_id": { "type": "integer" }, "reversal_reason": { "type": "string" }, "reversed_at": { "type": "string" }, "status": { "type": "string" } } }, "domain.AffiliateCommissionData": { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/definitions/domain.AffiliateCommission" } }, "limit": { "type": "integer" }, "offset": { "type": "integer" }, "total_count": { "type": "integer" } } }, "domain.AffiliateDashboard": { "type": "object", "properties": { "balances": { "type": "array", "items": { "$ref": "#/definitions/domain.AffiliateBalance" } }, "converted_referrals": { "type": "integer" }, "profile": { "$ref": "#/definitions/domain.AffiliateProfile" }, "settings": { "$ref": "#/definitions/domain.AffiliateSettings" }, "share_url": { "type": "string" }, "terms": { "$ref": "#/definitions/domain.AffiliateTerms" }, "total_referrals": { "type": "integer" } } }, "domain.AffiliateEvent": { "type": "object", "properties": { "actor_id": { "type": "integer" }, "affiliate_user_id": { "type": "integer" }, "created_at": { "type": "string" }, "details": { "description": "Event-specific audit fields, such as from/to status, note, payout_id, commission_id, and rate snapshots.", "type": "object" }, "event": { "type": "string" }, "id": { "type": "integer" } } }, "domain.AffiliateEventData": { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/definitions/domain.AffiliateEvent" } }, "limit": { "type": "integer" }, "offset": { "type": "integer" } } }, "domain.AffiliateListData": { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/definitions/domain.AffiliateProfile" } }, "limit": { "type": "integer" }, "offset": { "type": "integer" }, "total_count": { "type": "integer" } } }, "domain.AffiliateMutationData": { "type": "object", "properties": { "id": { "type": "integer" } } }, "domain.AffiliatePayout": { "type": "object", "properties": { "account_name": { "type": "string" }, "account_reference": { "type": "string" }, "amount": { "type": "string" }, "created_at": { "type": "string" }, "currency": { "type": "string" }, "id": { "type": "integer" }, "method": { "type": "string" }, "payment_reference": { "type": "string" }, "review_note": { "type": "string" }, "reviewed_at": { "type": "string" }, "status": { "type": "string" }, "user_id": { "type": "integer" } } }, "domain.AffiliatePayoutData": { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/definitions/domain.AffiliatePayout" } }, "limit": { "type": "integer" }, "offset": { "type": "integer" }, "total_count": { "type": "integer" } } }, "domain.AffiliatePayoutInput": { "type": "object", "properties": { "account_name": { "type": "string" }, "account_reference": { "type": "string" }, "currency": { "type": "string" }, "method": { "type": "string", "enum": [ "BANK", "MOBILE_MONEY" ] } } }, "domain.AffiliatePayoutReviewInput": { "type": "object", "properties": { "note": { "type": "string" }, "payment_reference": { "type": "string" }, "status": { "type": "string", "enum": [ "PAID", "REJECTED" ] } } }, "domain.AffiliateProfile": { "type": "object", "properties": { "application": { "type": "string" }, "code": { "type": "string" }, "created_at": { "type": "string" }, "email": { "type": "string" }, "first_name": { "type": "string" }, "last_name": { "type": "string" }, "review_note": { "type": "string" }, "status": { "type": "string" }, "terms_accepted_at": { "type": "string" }, "terms_version": { "type": "string" }, "updated_at": { "type": "string" }, "user_id": { "type": "integer" } } }, "domain.AffiliateReversalInput": { "type": "object", "properties": { "reason": { "type": "string" } } }, "domain.AffiliateReviewInput": { "type": "object", "properties": { "note": { "type": "string" }, "status": { "type": "string", "enum": [ "APPROVED", "REJECTED", "SUSPENDED" ] } } }, "domain.AffiliateSettings": { "type": "object", "properties": { "attribution_days": { "type": "integer" }, "commission_mode": { "type": "string" }, "commission_percent": { "type": "string" }, "holding_days": { "type": "integer" }, "share_base_url": { "type": "string" }, "updated_at": { "type": "string" } } }, "domain.AffiliateSettingsInput": { "type": "object", "properties": { "attribution_days": { "type": "integer", "maximum": 365, "minimum": 1 }, "commission_mode": { "type": "string", "enum": [ "FIRST_PURCHASE", "EVERY_COURSE" ] }, "commission_percent": { "type": "number", "maximum": 100, "minimum": 0 }, "holding_days": { "type": "integer", "maximum": 365, "minimum": 0 }, "share_base_url": { "type": "string" } } }, "domain.AffiliateTerms": { "type": "object", "properties": { "rules": { "type": "array", "items": { "type": "string" } }, "version": { "type": "string" } } }, "domain.AgeGroup": { "type": "string", "enum": [ "UNDER_13", "13_17", "18_24", "25_34", "35_44", "45_54", "55_PLUS" ], "x-enum-varnames": [ "AgeUnder13", "Age13To17", "Age18To24", "Age25To34", "Age35To44", "Age45To54", "Age55Plus" ] }, "domain.AnalyticsContentSection": { "type": "object", "properties": { "question_sets_by_type": { "type": "array", "items": { "$ref": "#/definitions/domain.AnalyticsLabelCount" } }, "questions_by_type": { "type": "array", "items": { "$ref": "#/definitions/domain.AnalyticsLabelCount" } }, "total_question_sets": { "type": "integer" }, "total_questions": { "type": "integer" } } }, "domain.AnalyticsCoursesSection": { "type": "object", "properties": { "exam_prep": { "$ref": "#/definitions/domain.AnalyticsExamPrepContentCounts" }, "total_categories": { "description": "Top-level summary fields preserve the dashboard contract using the unified hierarchy.", "type": "integer" }, "total_courses": { "type": "integer" }, "total_sub_courses": { "type": "integer" }, "total_videos": { "type": "integer" } } }, "domain.AnalyticsDashboard": { "type": "object", "properties": { "content": { "$ref": "#/definitions/domain.AnalyticsContentSection" }, "courses": { "$ref": "#/definitions/domain.AnalyticsCoursesSection" }, "date_filter": { "$ref": "#/definitions/domain.AnalyticsDateFilter" }, "generated_at": { "type": "string" }, "issues": { "$ref": "#/definitions/domain.AnalyticsIssuesSection" }, "notifications": { "$ref": "#/definitions/domain.AnalyticsNotificationsSection" }, "payments": { "$ref": "#/definitions/domain.AnalyticsPaymentsSection" }, "subscriptions": { "$ref": "#/definitions/domain.AnalyticsSubscriptionsSection" }, "team": { "$ref": "#/definitions/domain.AnalyticsTeamSection" }, "users": { "$ref": "#/definitions/domain.AnalyticsUsersSection" }, "videos": { "$ref": "#/definitions/domain.AnalyticsVideosSection" } } }, "domain.AnalyticsDateFilter": { "type": "object", "properties": { "from": { "type": "string" }, "mode": { "type": "string" }, "month": { "type": "integer" }, "payment_method": { "type": "string" }, "range_end": { "type": "string" }, "range_start": { "type": "string" }, "ref_date": { "type": "string" }, "series_end": { "type": "string" }, "series_start": { "type": "string" }, "timezone": { "type": "string" }, "to": { "type": "string" }, "year": { "type": "integer" } } }, "domain.AnalyticsExamPrepContentCounts": { "type": "object", "properties": { "catalog_courses": { "type": "integer" }, "lesson_practices": { "type": "integer" }, "lessons": { "type": "integer" }, "lessons_with_video": { "type": "integer" }, "unit_modules": { "type": "integer" }, "units": { "type": "integer" } } }, "domain.AnalyticsIssuesSection": { "type": "object", "properties": { "by_status": { "type": "array", "items": { "$ref": "#/definitions/domain.AnalyticsLabelCount" } }, "by_type": { "type": "array", "items": { "$ref": "#/definitions/domain.AnalyticsLabelCount" } }, "resolution_rate": { "type": "number" }, "resolved_issues": { "type": "integer" }, "total_issues": { "type": "integer" } } }, "domain.AnalyticsLabelAmount": { "type": "object", "properties": { "amount": { "type": "number" }, "count": { "type": "integer" }, "label": { "type": "string" } } }, "domain.AnalyticsLabelCount": { "type": "object", "properties": { "count": { "type": "integer" }, "label": { "type": "string" } } }, "domain.AnalyticsMonthlyRevenuePoint": { "type": "object", "properties": { "currency": { "type": "string" }, "label": { "description": "Short English month label, e.g. Jan", "type": "string" }, "month": { "description": "1–12", "type": "integer" }, "month_start": { "description": "UTC date of month start (for sorting / tooltips)", "type": "string" }, "revenue": { "description": "SUCCESS payments aggregate for that bucket", "type": "number" } } }, "domain.AnalyticsNotificationsSection": { "type": "object", "properties": { "by_channel": { "type": "array", "items": { "$ref": "#/definitions/domain.AnalyticsLabelCount" } }, "by_type": { "type": "array", "items": { "$ref": "#/definitions/domain.AnalyticsLabelCount" } }, "read_count": { "type": "integer" }, "total_sent": { "type": "integer" }, "unread_count": { "type": "integer" } } }, "domain.AnalyticsPaymentsSection": { "type": "object", "properties": { "avg_transaction_value": { "type": "number" }, "by_method": { "type": "array", "items": { "$ref": "#/definitions/domain.AnalyticsLabelAmount" } }, "by_status": { "type": "array", "items": { "$ref": "#/definitions/domain.AnalyticsLabelAmount" } }, "monthly_revenue_year": { "description": "MonthlyRevenueYear is set when RevenueMonthly is non-empty (the calendar year of those buckets).", "type": "integer" }, "revenue_last_30_days": { "type": "array", "items": { "$ref": "#/definitions/domain.AnalyticsRevenueTimePoint" } }, "revenue_monthly": { "description": "RevenueMonthly is populated only when the request includes year=..., with 12 months (possibly multiple currencies per month).", "type": "array", "items": { "$ref": "#/definitions/domain.AnalyticsMonthlyRevenuePoint" } }, "successful_payments": { "type": "integer" }, "total_payments": { "type": "integer" }, "total_revenue": { "type": "number" } } }, "domain.AnalyticsRevenueByPlan": { "type": "object", "properties": { "currency": { "type": "string" }, "plan_name": { "type": "string" }, "revenue": { "type": "number" } } }, "domain.AnalyticsRevenueTimePoint": { "type": "object", "properties": { "date": { "type": "string" }, "revenue": { "type": "number" } } }, "domain.AnalyticsSubscriptionRenewal": { "type": "object", "properties": { "avg_days_to_resubscribe": { "type": "number" }, "expired_in_period": { "type": "integer" }, "first_time_subscriptions": { "type": "integer" }, "median_days_to_resubscribe": { "type": "number" }, "renewal_rate": { "description": "0–1; renewed_after_expiry / expired_in_period", "type": "number" }, "renewed_after_expiry": { "type": "integer" }, "resubscribe_after_expiry": { "type": "integer" }, "returning_subscriptions": { "type": "integer" } } }, "domain.AnalyticsSubscriptionSnapshot": { "type": "object", "properties": { "active_learners": { "type": "integer" }, "active_now": { "type": "integer" }, "auto_renew_enabled": { "type": "integer" }, "cancelled_now": { "type": "integer" }, "expired_now": { "type": "integer" }, "expiring_within_30_days": { "type": "integer" }, "expiring_within_7_days": { "type": "integer" }, "lifetime_active": { "type": "integer" }, "pending_now": { "type": "integer" }, "term_active": { "type": "integer" } } }, "domain.AnalyticsSubscriptionsSection": { "type": "object", "properties": { "acquisition_by_source": { "type": "array", "items": { "$ref": "#/definitions/domain.AnalyticsLabelCount" } }, "active_by_category": { "type": "array", "items": { "$ref": "#/definitions/domain.AnalyticsLabelCount" } }, "active_by_lifetime": { "type": "array", "items": { "$ref": "#/definitions/domain.AnalyticsLabelCount" } }, "active_by_plan": { "type": "array", "items": { "$ref": "#/definitions/domain.AnalyticsLabelCount" } }, "active_subscriptions": { "type": "integer" }, "by_status": { "type": "array", "items": { "$ref": "#/definitions/domain.AnalyticsLabelCount" } }, "cancellations_last_30_days": { "type": "array", "items": { "$ref": "#/definitions/domain.AnalyticsTimePoint" } }, "expirations_last_30_days": { "type": "array", "items": { "$ref": "#/definitions/domain.AnalyticsTimePoint" } }, "new_by_cohort": { "type": "array", "items": { "$ref": "#/definitions/domain.AnalyticsLabelCount" } }, "new_month": { "type": "integer" }, "new_subscriptions_last_30_days": { "type": "array", "items": { "$ref": "#/definitions/domain.AnalyticsTimePoint" } }, "new_today": { "type": "integer" }, "new_week": { "type": "integer" }, "renewal": { "description": "Resubscribe / renewal behaviour", "allOf": [ { "$ref": "#/definitions/domain.AnalyticsSubscriptionRenewal" } ] }, "resubscriptions_last_30_days": { "type": "array", "items": { "$ref": "#/definitions/domain.AnalyticsTimePoint" } }, "revenue_by_category": { "type": "array", "items": { "$ref": "#/definitions/domain.AnalyticsLabelAmount" } }, "revenue_by_plan": { "type": "array", "items": { "$ref": "#/definitions/domain.AnalyticsRevenueByPlan" } }, "snapshot": { "description": "Learner subscription behaviour", "allOf": [ { "$ref": "#/definitions/domain.AnalyticsSubscriptionSnapshot" } ] }, "total_subscriptions": { "type": "integer" } } }, "domain.AnalyticsTeamSection": { "type": "object", "properties": { "by_role": { "type": "array", "items": { "$ref": "#/definitions/domain.AnalyticsLabelCount" } }, "by_status": { "type": "array", "items": { "$ref": "#/definitions/domain.AnalyticsLabelCount" } }, "total_members": { "type": "integer" } } }, "domain.AnalyticsTimePoint": { "type": "object", "properties": { "count": { "type": "integer" }, "date": { "type": "string" } } }, "domain.AnalyticsUsersSection": { "type": "object", "properties": { "by_age_group": { "type": "array", "items": { "$ref": "#/definitions/domain.AnalyticsLabelCount" } }, "by_country": { "type": "array", "items": { "$ref": "#/definitions/domain.AnalyticsLabelCount" } }, "by_education_level": { "type": "array", "items": { "$ref": "#/definitions/domain.AnalyticsLabelCount" } }, "by_gender": { "type": "array", "items": { "$ref": "#/definitions/domain.AnalyticsLabelCount" } }, "by_knowledge_level": { "type": "array", "items": { "$ref": "#/definitions/domain.AnalyticsLabelCount" } }, "by_language_challange": { "type": "array", "items": { "$ref": "#/definitions/domain.AnalyticsLabelCount" } }, "by_learning_goal": { "type": "array", "items": { "$ref": "#/definitions/domain.AnalyticsLabelCount" } }, "by_occupation": { "type": "array", "items": { "$ref": "#/definitions/domain.AnalyticsLabelCount" } }, "by_region": { "type": "array", "items": { "$ref": "#/definitions/domain.AnalyticsLabelCount" } }, "by_role": { "type": "array", "items": { "$ref": "#/definitions/domain.AnalyticsLabelCount" } }, "by_status": { "type": "array", "items": { "$ref": "#/definitions/domain.AnalyticsLabelCount" } }, "new_month": { "type": "integer" }, "new_today": { "type": "integer" }, "new_week": { "type": "integer" }, "registrations_last_30_days": { "type": "array", "items": { "$ref": "#/definitions/domain.AnalyticsTimePoint" } }, "total_users": { "type": "integer" } } }, "domain.AnalyticsVideoDropOffPoint": { "type": "object", "properties": { "checkpoint_percent": { "type": "integer" }, "drop_off_rate": { "type": "number" }, "total_sessions": { "type": "integer" }, "viewers_reached": { "type": "integer" } } }, "domain.AnalyticsVideosSection": { "type": "object", "properties": { "completed_sessions": { "type": "integer" }, "completion_rate": { "type": "number" }, "drop_off_by_checkpoint": { "type": "array", "items": { "$ref": "#/definitions/domain.AnalyticsVideoDropOffPoint" } }, "replay_rate": { "type": "number" }, "replay_sessions": { "type": "integer" }, "total_watch_sessions": { "type": "integer" }, "unique_video_starts": { "type": "integer" }, "users_who_replayed": { "type": "integer" } } }, "domain.AuthorizeChapaDirectChargeResponse": { "type": "object", "properties": { "message": { "type": "string" }, "payment_id": { "type": "integer" }, "success": { "type": "boolean" } } }, "domain.BulkAccountsByRoleRequest": { "type": "object", "properties": { "exclude_team_member_id": { "type": "integer" } } }, "domain.BulkDeactivateAccountsByRoleResult": { "type": "object", "properties": { "role": { "type": "string" }, "team_members_deactivated": { "type": "integer" }, "users_deactivated": { "type": "integer" } } }, "domain.BulkReactivateAccountsByRoleResult": { "type": "object", "properties": { "role": { "type": "string" }, "team_members_reactivated": { "type": "integer" }, "users_reactivated": { "type": "integer" } } }, "domain.ChapaDirectChargeMethod": { "type": "object", "properties": { "auth_type": { "description": "\"ussd\" or \"otp\"", "type": "string" }, "display_name": { "type": "string" }, "name": { "type": "string" } } }, "domain.ChapaPaymentMethod": { "type": "object", "properties": { "display_name": { "type": "string" }, "name": { "type": "string" } } }, "domain.ChapaWebhookPayload": { "type": "object", "properties": { "amount": { "type": "string" }, "currency": { "type": "string" }, "event": { "type": "string" }, "mode": { "type": "string" }, "payment_method": { "type": "string" }, "reference": { "type": "string" }, "status": { "type": "string" }, "tx_ref": { "type": "string" }, "type": { "type": "string" } } }, "domain.CompletePracticeInput": { "type": "object", "properties": { "parent_id": { "type": "integer" }, "parent_kind": { "type": "string" } } }, "domain.ContentAccessTier": { "type": "string", "enum": [ "INHERIT", "FREE", "PREMIUM" ], "x-enum-varnames": [ "ContentAccessInherit", "ContentAccessFree", "ContentAccessPremium" ] }, "domain.ContentPublishStatus": { "type": "string", "enum": [ "DRAFT", "PUBLISHED" ], "x-enum-varnames": [ "ContentPublishDraft", "ContentPublishPublished" ] }, "domain.CourseCheckoutRequest": { "type": "object", "properties": { "phone": { "type": "string" }, "referral_code": { "type": "string" } } }, "domain.CourseCheckoutResponse": { "type": "object", "properties": { "amount": { "type": "number" }, "course_id": { "type": "integer" }, "currency": { "type": "string" }, "payment_id": { "type": "integer" }, "payment_url": { "type": "string" }, "session_id": { "type": "string" } } }, "domain.CreateCourseInput": { "type": "object", "required": [ "name" ], "properties": { "access_tier": { "type": "string", "enum": [ "FREE", "free", "PREMIUM", "premium" ] }, "description": { "type": "string" }, "name": { "type": "string" }, "publish_status": { "description": "Omit or empty defaults to DRAFT; set PUBLISHED to make visible to learners immediately.", "type": "string", "enum": [ "DRAFT", "draft", "PUBLISHED", "published" ] }, "sort_order": { "description": "SortOrder within the program when set; omit to append after current max within program_id (uniqueness is per-program).", "type": "integer", "minimum": 0 }, "thumbnail": { "type": "string" } } }, "domain.CreateExamPrepCatalogCourseInput": { "type": "object", "required": [ "name" ], "properties": { "access_tier": { "type": "string", "enum": [ "FREE", "free", "PREMIUM", "premium" ] }, "currency": { "type": "string" }, "description": { "type": "string" }, "name": { "type": "string" }, "price": { "type": "number", "maximum": 9999999999.99, "minimum": 0 }, "publish_status": { "description": "Omit or empty defaults to DRAFT; set PUBLISHED to make visible to learners immediately.", "type": "string", "enum": [ "DRAFT", "draft", "PUBLISHED", "published" ] }, "thumbnail": { "type": "string" } } }, "domain.CreateExamPrepLessonInput": { "type": "object", "required": [ "title" ], "properties": { "access_tier": { "type": "string", "enum": [ "FREE", "free", "PREMIUM", "premium", "INHERIT", "inherit" ] }, "description": { "type": "string" }, "publish_status": { "description": "Omit or empty defaults to DRAFT; set PUBLISHED to make visible to learners immediately.", "type": "string", "enum": [ "DRAFT", "draft", "PUBLISHED", "published" ] }, "thumbnail": { "type": "string" }, "title": { "type": "string" }, "video_url": { "type": "string" } } }, "domain.CreateExamPrepModuleInput": { "type": "object", "required": [ "name" ], "properties": { "access_tier": { "type": "string", "enum": [ "FREE", "free", "PREMIUM", "premium", "INHERIT", "inherit" ] }, "description": { "type": "string" }, "icon": { "type": "string" }, "name": { "type": "string" }, "publish_status": { "description": "Omit or empty defaults to DRAFT; set PUBLISHED to make visible to learners immediately.", "type": "string", "enum": [ "DRAFT", "draft", "PUBLISHED", "published" ] }, "thumbnail": { "type": "string" } } }, "domain.CreateExamPrepPracticeInput": { "type": "object", "required": [ "question_set_id" ], "properties": { "parent_id": { "type": "integer" }, "parent_kind": { "description": "ParentKind and ParentID are accepted for backward compatibility when parents is omitted.", "type": "string", "enum": [ "COURSE", "CHAPTER", "LESSON" ] }, "parents": { "description": "Parents optionally attaches the practice to catalog course, unit, or lesson. Omit or null to create unlinked.", "type": "array", "items": { "$ref": "#/definitions/domain.ExamPrepPracticeParent" } }, "persona_id": { "type": "integer" }, "publish_status": { "type": "string", "enum": [ "DRAFT", "draft", "PUBLISHED", "published" ] }, "question_set_id": { "type": "integer" }, "quick_tips": { "type": "string" }, "story_description": { "type": "string" }, "story_image": { "type": "string" }, "title": { "type": "string" } } }, "domain.CreateExamPrepUnitInput": { "type": "object", "required": [ "name" ], "properties": { "access_tier": { "type": "string", "enum": [ "FREE", "free", "PREMIUM", "premium", "INHERIT", "inherit" ] }, "description": { "type": "string" }, "name": { "type": "string" }, "publish_status": { "description": "Omit or empty defaults to DRAFT; set PUBLISHED to make visible to learners immediately.", "type": "string", "enum": [ "DRAFT", "draft", "PUBLISHED", "published" ] }, "sort_order": { "description": "SortOrder within the catalog course when set; omit to append after current max sort_order within catalog_course_id.", "type": "integer", "minimum": 0 }, "thumbnail": { "type": "string" } } }, "domain.CreateLessonInput": { "type": "object", "required": [ "title" ], "properties": { "access_tier": { "type": "string", "enum": [ "FREE", "free", "PREMIUM", "premium" ] }, "description": { "type": "string" }, "publish_status": { "description": "Omit or empty defaults to DRAFT; set PUBLISHED to make visible to learners immediately.", "type": "string", "enum": [ "DRAFT", "draft", "PUBLISHED", "published" ] }, "sort_order": { "description": "SortOrder within the module when set; omit to append after current max within module_id.", "type": "integer", "minimum": 0 }, "thumbnail": { "type": "string" }, "title": { "type": "string" }, "video_url": { "type": "string" } } }, "domain.CreateLmsPersonaInput": { "type": "object", "required": [ "name" ], "properties": { "description": { "type": "string" }, "gender": { "type": "string" }, "is_active": { "type": "boolean" }, "name": { "type": "string" }, "profile_picture": { "type": "string" } } }, "domain.CreateModuleInput": { "type": "object", "required": [ "name" ], "properties": { "access_tier": { "type": "string", "enum": [ "FREE", "free", "PREMIUM", "premium" ] }, "description": { "type": "string" }, "icon": { "type": "string" }, "name": { "type": "string" }, "publish_status": { "description": "Omit or empty defaults to DRAFT; set PUBLISHED to make visible to learners immediately.", "type": "string", "enum": [ "DRAFT", "draft", "PUBLISHED", "published" ] }, "sort_order": { "description": "SortOrder within the course when set; omit to append after current max within course_id (uniqueness is per-course).", "type": "integer", "minimum": 0 } } }, "domain.CreatePracticeInput": { "type": "object", "required": [ "question_set_id" ], "properties": { "parent_id": { "type": "integer" }, "parent_kind": { "description": "ParentKind and ParentID are accepted for backward compatibility when parents is omitted.", "enum": [ "COURSE", "MODULE", "LESSON" ], "allOf": [ { "$ref": "#/definitions/domain.ParentKind" } ] }, "parents": { "description": "Parents optionally attaches the practice to hierarchy entities. Omit or null to create unlinked.", "type": "array", "items": { "$ref": "#/definitions/domain.PracticeParent" } }, "persona_id": { "type": "integer" }, "publish_status": { "description": "Omit or empty for backward compatibility defaults to PUBLISHED; set DRAFT to save hidden from learners until published.", "type": "string", "enum": [ "DRAFT", "draft", "PUBLISHED", "published" ] }, "question_set_id": { "type": "integer" }, "quick_tips": { "type": "string" }, "story_description": { "type": "string" }, "story_image": { "type": "string" }, "title": { "type": "string" } } }, "domain.CreateProgramInput": { "type": "object", "required": [ "category", "name" ], "properties": { "access_tier": { "type": "string", "enum": [ "FREE", "free", "PREMIUM", "premium" ] }, "category": { "type": "string", "enum": [ "EDUCATION" ] }, "description": { "type": "string" }, "name": { "type": "string" }, "publish_status": { "description": "Omit or empty defaults to DRAFT; set PUBLISHED to make visible to learners immediately.", "type": "string", "enum": [ "DRAFT", "draft", "PUBLISHED", "published" ] }, "sort_order": { "description": "SortOrder inserts at this global program order when set; omit to append after current max (sort_order uniqueness is enforced).", "type": "integer", "minimum": 0 }, "thumbnail": { "type": "string" } } }, "domain.CreateQuestionOptionInput": { "type": "object", "properties": { "isCorrect": { "type": "boolean" }, "optionOrder": { "type": "integer", "format": "int32" }, "optionText": { "type": "string" } } }, "domain.CreateRoleReq": { "type": "object", "required": [ "name" ], "properties": { "description": { "type": "string" }, "name": { "type": "string", "maxLength": 100, "minLength": 2 } } }, "domain.CreateShortAnswerInput": { "type": "object", "properties": { "acceptableAnswer": { "type": "string" }, "matchType": { "type": "string" } } }, "domain.CreateTeamMemberReq": { "type": "object", "required": [ "email", "first_name", "last_name", "password", "team_role" ], "properties": { "bio": { "type": "string" }, "department": { "type": "string" }, "email": { "type": "string" }, "emergency_contact": { "type": "string" }, "employment_type": { "type": "string" }, "first_name": { "type": "string" }, "hire_date": { "description": "YYYY-MM-DD", "type": "string" }, "job_title": { "type": "string" }, "last_name": { "type": "string" }, "password": { "type": "string", "minLength": 8 }, "permissions": { "type": "array", "items": { "type": "string" } }, "phone_number": { "type": "string" }, "profile_picture_url": { "type": "string" }, "team_role": { "type": "string" }, "work_phone": { "type": "string" } } }, "domain.DeliveryChannel": { "type": "string", "enum": [ "email", "sms", "push", "in_app" ], "x-enum-varnames": [ "DeliveryChannelEmail", "DeliveryChannelSMS", "DeliveryChannelPush", "DeliveryChannelInApp" ] }, "domain.DynamicElementDefinition": { "type": "object", "properties": { "config": { "type": "object", "additionalProperties": true }, "id": { "type": "string" }, "kind": { "type": "string" }, "label": { "type": "string" }, "required": { "type": "boolean" } } }, "domain.DynamicElementInstance": { "type": "object", "properties": { "id": { "type": "string" }, "kind": { "type": "string" }, "meta": { "type": "object", "additionalProperties": true }, "value": { "description": "Component-specific JSON value selected by kind: string, number, boolean, object, array, or null. Use the component catalog and definition schema to interpret it.", "x-json-types": "string|number|boolean|object|array|null" } } }, "domain.DynamicQuestionPayload": { "type": "object", "properties": { "response": { "type": "array", "items": { "$ref": "#/definitions/domain.DynamicElementInstance" } }, "stimulus": { "type": "array", "items": { "$ref": "#/definitions/domain.DynamicElementInstance" } } } }, "domain.EmploymentType": { "type": "string", "enum": [ "full_time", "part_time", "contract", "intern" ], "x-enum-varnames": [ "EmploymentTypeFullTime", "EmploymentTypePartTime", "EmploymentTypeContract", "EmploymentTypeIntern" ] }, "domain.ErrorResponse": { "type": "object", "properties": { "error": { "type": "string" }, "message": { "type": "string" } } }, "domain.ExamPrepCatalogCourse": { "type": "object", "properties": { "access": { "$ref": "#/definitions/domain.LMSEntityAccess" }, "access_tier": { "$ref": "#/definitions/domain.ContentAccessTier" }, "chapters_count": { "type": "integer" }, "created_at": { "type": "string" }, "currency": { "type": "string" }, "description": { "type": "string" }, "effective_access_tier": { "$ref": "#/definitions/domain.ContentAccessTier" }, "has_practice": { "type": "boolean" }, "id": { "type": "integer" }, "is_archived": { "type": "boolean" }, "lessons_count": { "type": "integer" }, "name": { "type": "string" }, "price": { "type": "number" }, "publish_status": { "$ref": "#/definitions/domain.ContentPublishStatus" }, "sort_order": { "type": "integer" }, "thumbnail": { "type": "string" }, "updated_at": { "type": "string" } } }, "domain.ExamPrepLesson": { "type": "object", "properties": { "access": { "$ref": "#/definitions/domain.LMSEntityAccess" }, "access_tier": { "$ref": "#/definitions/domain.ContentAccessTier" }, "chapter_id": { "type": "integer" }, "created_at": { "type": "string" }, "description": { "type": "string" }, "effective_access_tier": { "$ref": "#/definitions/domain.ContentAccessTier" }, "has_practice": { "type": "boolean" }, "id": { "type": "integer" }, "publish_status": { "$ref": "#/definitions/domain.ContentPublishStatus" }, "sort_order": { "type": "integer" }, "thumbnail": { "type": "string" }, "title": { "type": "string" }, "updated_at": { "type": "string" }, "video_url": { "type": "string" } } }, "domain.ExamPrepPractice": { "type": "object", "properties": { "authoring_profile": { "$ref": "#/definitions/domain.PracticeAuthoringProfile" }, "created_at": { "type": "string" }, "id": { "type": "integer" }, "lesson_id": { "type": "integer" }, "parents": { "type": "array", "items": { "$ref": "#/definitions/domain.ExamPrepPracticeParent" } }, "persona_id": { "type": "integer" }, "publish_status": { "$ref": "#/definitions/domain.PracticePublishStatus" }, "question_set_id": { "type": "integer" }, "quick_tips": { "type": "string" }, "story_description": { "type": "string" }, "story_image": { "type": "string" }, "title": { "type": "string" }, "updated_at": { "type": "string" } } }, "domain.ExamPrepPracticeParent": { "type": "object", "properties": { "parent_id": { "type": "integer" }, "parent_kind": { "type": "string", "enum": [ "COURSE", "CHAPTER", "LESSON" ] } } }, "domain.ExamPrepProgressSummary": { "type": "object", "properties": { "courses": { "type": "array", "items": { "$ref": "#/definitions/domain.ExamPrepProgressSummaryCatalogCourse" } } } }, "domain.ExamPrepProgressSummaryCatalogCourse": { "type": "object", "properties": { "access": { "$ref": "#/definitions/domain.LMSEntityAccess" }, "chapters": { "type": "array", "items": { "$ref": "#/definitions/domain.ExamPrepProgressSummaryUnit" } }, "id": { "type": "integer" }, "name": { "type": "string" } } }, "domain.ExamPrepProgressSummaryLesson": { "type": "object", "properties": { "access": { "$ref": "#/definitions/domain.LMSEntityAccess" }, "chapter_id": { "type": "integer" }, "id": { "type": "integer" }, "title": { "type": "string" } } }, "domain.ExamPrepProgressSummaryUnit": { "type": "object", "properties": { "access": { "$ref": "#/definitions/domain.LMSEntityAccess" }, "course_id": { "type": "integer" }, "id": { "type": "integer" }, "lessons": { "type": "array", "items": { "$ref": "#/definitions/domain.ExamPrepProgressSummaryLesson" } }, "name": { "type": "string" } } }, "domain.ExamPrepUnit": { "type": "object", "properties": { "access": { "$ref": "#/definitions/domain.LMSEntityAccess" }, "access_tier": { "$ref": "#/definitions/domain.ContentAccessTier" }, "course_id": { "type": "integer" }, "created_at": { "type": "string" }, "description": { "type": "string" }, "effective_access_tier": { "$ref": "#/definitions/domain.ContentAccessTier" }, "has_practice": { "type": "boolean" }, "id": { "type": "integer" }, "lessons_count": { "type": "integer" }, "name": { "type": "string" }, "practices_count": { "type": "integer" }, "publish_status": { "$ref": "#/definitions/domain.ContentPublishStatus" }, "sort_order": { "type": "integer" }, "thumbnail": { "type": "string" }, "updated_at": { "type": "string" } } }, "domain.FullUpdatePracticeInput": { "type": "object", "properties": { "practice": { "$ref": "#/definitions/domain.FullUpdatePracticeShellInput" }, "question_set": { "$ref": "#/definitions/domain.FullUpdateQuestionSetInput" }, "questions": { "type": "array", "items": { "$ref": "#/definitions/domain.FullUpdatePracticeQuestionItem" } }, "stimulus_blocks": { "type": "array", "items": { "$ref": "#/definitions/domain.FullUpdateStimulusBlockItem" } } } }, "domain.FullUpdatePracticeQuestionItem": { "type": "object", "properties": { "associated_question_id": { "type": "integer" }, "audio_correct_answer_text": { "type": "string" }, "difficulty_level": { "type": "string" }, "display_order": { "type": "integer" }, "dynamic_payload": { "$ref": "#/definitions/domain.DynamicQuestionPayload" }, "explanation": { "type": "string" }, "id": { "type": "integer" }, "image_url": { "type": "string" }, "options": { "type": "array", "items": { "$ref": "#/definitions/domain.CreateQuestionOptionInput" } }, "points": { "type": "integer" }, "question_text": { "type": "string" }, "question_type": { "type": "string" }, "question_type_definition_id": { "type": "integer" }, "sample_answer_voice_prompt": { "type": "string" }, "short_answers": { "type": "array", "items": { "$ref": "#/definitions/domain.CreateShortAnswerInput" } }, "status": { "type": "string" }, "stimulus_block_key": { "type": "string" }, "tips": { "type": "string" }, "voice_prompt": { "type": "string" } } }, "domain.FullUpdatePracticeShellInput": { "type": "object", "properties": { "authoring_profile": { "type": "string" }, "persona_id": { "type": "integer" }, "publish_status": { "type": "string" }, "question_set_id": { "type": "integer" }, "quick_tips": { "type": "string" }, "story_description": { "type": "string" }, "story_image": { "type": "string" }, "title": { "type": "string" } } }, "domain.FullUpdateQuestionSetInput": { "type": "object", "properties": { "banner_image": { "type": "string" }, "description": { "type": "string" }, "intro_video_url": { "type": "string" }, "passing_score": { "type": "integer" }, "persona": { "type": "string" }, "shuffle_questions": { "type": "boolean" }, "status": { "type": "string" }, "time_limit_minutes": { "type": "integer" }, "title": { "type": "string" } } }, "domain.FullUpdateStimulusBlockItem": { "type": "object", "properties": { "block_key": { "type": "string" }, "display_order": { "type": "integer" }, "stimulus": { "type": "array", "items": { "$ref": "#/definitions/domain.DynamicElementInstance" } } } }, "domain.InitiateChapaDirectChargeResponse": { "type": "object", "properties": { "amount": { "type": "number" }, "auth_type": { "description": "ussd | otp", "type": "string" }, "chapa_reference": { "type": "string" }, "currency": { "type": "string" }, "expires_at": { "type": "string" }, "message": { "type": "string" }, "payment_id": { "type": "integer" }, "portal_html": { "type": "string" }, "request_id": { "description": "OTP flows only", "type": "string" }, "requires_authorize": { "type": "boolean" }, "session_id": { "description": "tx_ref for verify polling", "type": "string" } } }, "domain.InitiateDirectPaymentResponse": { "type": "object", "properties": { "amount": { "type": "number" }, "currency": { "type": "string" }, "message": { "type": "string" }, "payment_id": { "type": "integer" }, "requires_otp": { "type": "boolean" }, "session_id": { "type": "string" } } }, "domain.InitiateSubscriptionPaymentResponse": { "type": "object", "properties": { "amount": { "type": "number" }, "currency": { "type": "string" }, "expires_at": { "type": "string" }, "free_enrollment": { "type": "boolean" }, "payment_id": { "type": "integer" }, "payment_url": { "type": "string" }, "session_id": { "type": "string" }, "subscription_id": { "type": "integer" } } }, "domain.InviteTeamMemberReq": { "type": "object", "required": [ "email", "team_role" ], "properties": { "email": { "type": "string" }, "team_role": { "type": "string" } } }, "domain.InviteTeamMemberRes": { "type": "object", "properties": { "email": { "type": "string" }, "expires_at": { "type": "string" }, "invitation_id": { "type": "integer" }, "team_member_id": { "type": "integer" } } }, "domain.LMSEntityAccess": { "type": "object", "properties": { "completed_count": { "type": "integer" }, "is_accessible": { "type": "boolean" }, "is_completed": { "type": "boolean" }, "progress_percent": { "type": "integer" }, "progress_percent_precise": { "type": "number" }, "reason": { "type": "string" }, "total_count": { "type": "integer" } } }, "domain.LinkExamPrepAssessmentInput": { "type": "object", "required": [ "parent_id", "parent_kind", "question_set_id" ], "properties": { "parent_id": { "type": "integer" }, "parent_kind": { "type": "string", "enum": [ "CATALOG_COURSE", "UNIT", "MODULE", "LESSON" ] }, "question_set_id": { "type": "integer" } } }, "domain.LmsPersona": { "type": "object", "properties": { "created_at": { "type": "string" }, "description": { "type": "string" }, "gender": { "description": "Gender matches learner-style free text (nullable); always present in JSON for stable list payloads.", "type": "string" }, "id": { "type": "integer" }, "is_active": { "type": "boolean" }, "name": { "type": "string" }, "profile_picture": { "description": "ProfilePicture is always serialized (null when not set); clients rely on stable keys in list payloads.", "type": "string" }, "updated_at": { "type": "string" } } }, "domain.LogEntry": { "type": "object", "properties": { "caller": { "type": "string" }, "env": { "type": "string" }, "fields": { "type": "object", "additionalProperties": true }, "level": { "type": "string" }, "message": { "type": "string" }, "service": { "type": "string" }, "stacktrace": { "type": "string" }, "timestamp": { "type": "string" } } }, "domain.LogResponse": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/domain.LogEntry" } }, "message": { "type": "string" }, "pagination": { "$ref": "#/definitions/domain.Pagination" } } }, "domain.LoginRequest": { "type": "object", "properties": { "email": { "type": "string" }, "otp_code": { "type": "string" }, "password": { "type": "string" }, "phone_number": { "type": "string" } } }, "domain.MobileAppVersionCheckResult": { "type": "object", "properties": { "client_version_code": { "type": "integer" }, "force_update": { "type": "boolean" }, "latest_version_code": { "type": "integer" }, "latest_version_name": { "type": "string" }, "platform": { "type": "string" }, "release_notes": { "type": "string" }, "store_url": { "type": "string" }, "update_available": { "type": "boolean" }, "update_type": { "type": "string" } } }, "domain.Notification": { "type": "object", "properties": { "delivery_channel": { "$ref": "#/definitions/domain.DeliveryChannel" }, "delivery_status": { "$ref": "#/definitions/domain.NotificationDeliveryStatus" }, "error_severity": { "$ref": "#/definitions/domain.NotificationErrorSeverity" }, "expires": { "type": "string" }, "id": { "type": "string" }, "image": { "type": "string" }, "is_read": { "type": "boolean" }, "level": { "$ref": "#/definitions/domain.NotificationLevel" }, "metadata": { "description": "Free-form notification metadata supplied by the sending application. Keys are application-defined.", "type": "object" }, "payload": { "$ref": "#/definitions/domain.NotificationPayload" }, "priority": { "type": "integer" }, "receiver_type": { "$ref": "#/definitions/domain.ReceiverType" }, "reciever": { "$ref": "#/definitions/domain.NotificationRecieverSide" }, "recipient_id": { "type": "integer" }, "timestamp": { "type": "string" }, "type": { "$ref": "#/definitions/domain.NotificationType" } } }, "domain.NotificationDeliveryScheme": { "type": "string", "enum": [ "bulk", "single" ], "x-enum-varnames": [ "NotificationDeliverySchemeBulk", "NotificationDeliverySchemeSingle" ] }, "domain.NotificationDeliveryStatus": { "type": "string", "enum": [ "pending", "sent", "failed" ], "x-enum-varnames": [ "DeliveryStatusPending", "DeliveryStatusSent", "DeliveryStatusFailed" ] }, "domain.NotificationErrorSeverity": { "type": "string", "enum": [ "low", "medium", "high", "critical", "fatal" ], "x-enum-varnames": [ "NotificationErrorSeverityLow", "NotificationErrorSeverityMedium", "NotificationErrorSeverityHigh", "NotificationErrorSeverityCritical", "NotificationErrorSeverityFatal" ] }, "domain.NotificationLevel": { "type": "string", "enum": [ "info", "error", "warning", "success" ], "x-enum-varnames": [ "NotificationLevelInfo", "NotificationLevelError", "NotificationLevelWarning", "NotificationLevelSuccess" ] }, "domain.NotificationPayload": { "type": "object", "properties": { "headline": { "type": "string" }, "message": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } } } }, "domain.NotificationRecieverSide": { "type": "string", "enum": [ "admin", "customer", "cashier", "branch_manager", "team_member" ], "x-enum-varnames": [ "NotificationRecieverSideAdmin", "NotificationRecieverSideCustomer", "NotificationRecieverSideCashier", "NotificationRecieverSideBranchManager", "NotificationRecieverSideTeamMember" ] }, "domain.NotificationType": { "type": "string", "enum": [ "knowledge_level_update", "payment_verified", "subscription_activated", "course_created", "sub_course_created", "video_added", "issue_status_updated", "issue_created", "admin_created", "team_member_created", "user_deleted", "system_alert", "user_welcome", "module_completed", "course_completed", "program_completed", "subscription_expiring" ], "x-enum-varnames": [ "NOTIFICATION_TYPE_KNOWLEDGE_LEVEL_UPDATE", "NOTIFICATION_TYPE_PAYMENT_VERIFIED", "NOTIFICATION_TYPE_SUBSCRIPTION_ACTIVATED", "NOTIFICATION_TYPE_COURSE_CREATED", "NOTIFICATION_TYPE_SUB_COURSE_CREATED", "NOTIFICATION_TYPE_VIDEO_ADDED", "NOTIFICATION_TYPE_ISSUE_STATUS_UPDATED", "NOTIFICATION_TYPE_ISSUE_CREATED", "NOTIFICATION_TYPE_ADMIN_CREATED", "NOTIFICATION_TYPE_TEAM_MEMBER_CREATED", "NOTIFICATION_TYPE_USER_DELETED", "NOTIFICATION_TYPE_SYSTEM_ALERT", "NOTIFICATION_TYPE_USER_WELCOME", "NOTIFICATION_TYPE_MODULE_COMPLETED", "NOTIFICATION_TYPE_COURSE_COMPLETED", "NOTIFICATION_TYPE_PROGRAM_COMPLETED", "NOTIFICATION_TYPE_SUBSCRIPTION_EXPIRING" ] }, "domain.Pagination": { "type": "object", "properties": { "current_page": { "type": "integer" }, "limit": { "type": "integer" }, "total": { "type": "integer" }, "total_pages": { "type": "integer" } } }, "domain.ParentKind": { "type": "string", "enum": [ "COURSE", "MODULE", "LESSON" ], "x-enum-varnames": [ "ParentKindCourse", "ParentKindModule", "ParentKindLesson" ] }, "domain.Permission": { "type": "object", "properties": { "created_at": { "type": "string" }, "description": { "type": "string" }, "group_name": { "type": "string" }, "id": { "type": "integer" }, "key": { "type": "string" }, "name": { "type": "string" } } }, "domain.PracticeAuthoringProfile": { "type": "string", "enum": [ "STANDALONE", "IELTS_SHARED_STIMULUS" ], "x-enum-varnames": [ "PracticeAuthoringProfileStandalone", "PracticeAuthoringProfileIELTSSharedStimulus" ] }, "domain.PracticeByQuestionTypeDefinition": { "type": "object", "properties": { "created_at": { "type": "string" }, "exam_prep_lesson_id": { "type": "integer" }, "exam_prep_parents": { "type": "array", "items": { "$ref": "#/definitions/domain.ExamPrepPracticeParent" } }, "matching_question_count": { "type": "integer" }, "parents": { "type": "array", "items": { "$ref": "#/definitions/domain.PracticeParent" } }, "persona_id": { "type": "integer" }, "practice_id": { "type": "integer" }, "practice_kind": { "type": "string" }, "publish_status": { "$ref": "#/definitions/domain.PracticePublishStatus" }, "question_set_id": { "type": "integer" }, "quick_tips": { "type": "string" }, "story_description": { "type": "string" }, "story_image": { "type": "string" }, "title": { "type": "string" }, "updated_at": { "type": "string" } } }, "domain.PracticeParent": { "type": "object", "properties": { "parent_id": { "type": "integer" }, "parent_kind": { "$ref": "#/definitions/domain.ParentKind" } } }, "domain.PracticePublishStatus": { "type": "string", "enum": [ "DRAFT", "PUBLISHED" ], "x-enum-varnames": [ "PracticePublishDraft", "PracticePublishPublished" ] }, "domain.PracticeStimulusBlock": { "type": "object", "properties": { "block_key": { "type": "string" }, "display_order": { "type": "integer" }, "id": { "type": "integer" }, "stimulus": { "type": "array", "items": { "$ref": "#/definitions/domain.DynamicElementInstance" } } } }, "domain.PracticesByQuestionTypeDefinitionSummary": { "type": "object", "properties": { "limit": { "type": "integer" }, "offset": { "type": "integer" }, "practices": { "type": "array", "items": { "$ref": "#/definitions/domain.PracticeByQuestionTypeDefinition" } }, "question_type_definition_id": { "type": "integer" }, "total_count": { "type": "integer" } } }, "domain.ProfileFieldOptionItem": { "type": "object", "properties": { "code": { "type": "string" }, "label": { "type": "string" } } }, "domain.ProfileFieldOptionsGrouped": { "type": "object", "additionalProperties": { "type": "array", "items": { "$ref": "#/definitions/domain.ProfileFieldOptionItem" } } }, "domain.PublicCatalogPage": { "type": "object", "properties": { "courses": { "type": "array", "items": { "$ref": "#/definitions/domain.PublicCourse" } }, "limit": { "type": "integer" }, "offset": { "type": "integer" }, "total_count": { "type": "integer" } } }, "domain.PublicChapter": { "type": "object", "properties": { "description": { "type": "string" }, "id": { "type": "integer" }, "lessons": { "type": "array", "items": { "$ref": "#/definitions/domain.PublicLesson" } }, "name": { "type": "string" }, "quizzes": { "type": "array", "items": { "$ref": "#/definitions/domain.PublicQuiz" } } } }, "domain.PublicCourse": { "type": "object", "properties": { "access_tier": { "type": "string", "enum": [ "FREE", "PREMIUM" ] }, "chapter_count": { "type": "integer" }, "currency": { "type": "string" }, "description": { "type": "string" }, "id": { "type": "integer" }, "lesson_count": { "type": "integer" }, "name": { "type": "string" }, "price": { "type": "number" }, "quiz_count": { "type": "integer" }, "thumbnail": { "type": "string" } } }, "domain.PublicCourseOutline": { "type": "object", "properties": { "access_tier": { "type": "string", "enum": [ "FREE", "PREMIUM" ] }, "chapter_count": { "type": "integer" }, "chapters": { "type": "array", "items": { "$ref": "#/definitions/domain.PublicChapter" } }, "currency": { "type": "string" }, "description": { "type": "string" }, "id": { "type": "integer" }, "lesson_count": { "type": "integer" }, "name": { "type": "string" }, "price": { "type": "number" }, "quiz_count": { "type": "integer" }, "thumbnail": { "type": "string" } } }, "domain.PublicLesson": { "type": "object", "properties": { "access_tier": { "type": "string", "enum": [ "FREE", "PREMIUM" ] }, "description": { "type": "string" }, "id": { "type": "integer" }, "thumbnail": { "type": "string" }, "title": { "type": "string" } } }, "domain.PublicQuiz": { "type": "object", "properties": { "id": { "type": "integer" }, "question_count": { "type": "integer" }, "title": { "type": "string" } } }, "domain.QuestionSetQuestionTypeCount": { "type": "object", "properties": { "count": { "type": "integer" }, "display_name": { "type": "string" }, "key": { "type": "string" }, "question_type_definition_id": { "type": "integer" } } }, "domain.QuestionSetQuestionTypesSummary": { "type": "object", "properties": { "question_set_id": { "type": "integer" }, "question_types": { "type": "array", "items": { "$ref": "#/definitions/domain.QuestionSetQuestionTypeCount" } }, "total_questions": { "type": "integer" } } }, "domain.QuestionTypeDefinition": { "type": "object", "properties": { "CreatedAt": { "type": "string" }, "Description": { "type": "string" }, "DisplayName": { "type": "string" }, "ID": { "type": "integer" }, "IsSystem": { "type": "boolean" }, "Key": { "type": "string" }, "ResponseComponentKinds": { "type": "array", "items": { "type": "string" } }, "ResponseSchema": { "type": "array", "items": { "$ref": "#/definitions/domain.DynamicElementDefinition" } }, "Status": { "type": "string" }, "StimulusComponentKinds": { "type": "array", "items": { "type": "string" } }, "StimulusSchema": { "type": "array", "items": { "$ref": "#/definitions/domain.DynamicElementDefinition" } }, "UpdatedAt": { "type": "string" }, "group_ids": { "type": "array", "items": { "type": "integer" } } } }, "domain.QuestionTypeDefinitionGroup": { "type": "object", "properties": { "created_at": { "type": "string" }, "description": { "type": "string" }, "display_order": { "type": "integer" }, "id": { "type": "integer" }, "name": { "type": "string" }, "status": { "type": "string" }, "updated_at": { "type": "string" } } }, "domain.QuestionTypeDefinitionGroupDetail": { "type": "object", "properties": { "created_at": { "type": "string" }, "definitions": { "type": "array", "items": { "$ref": "#/definitions/domain.QuestionTypeDefinition" } }, "description": { "type": "string" }, "display_order": { "type": "integer" }, "id": { "type": "integer" }, "name": { "type": "string" }, "status": { "type": "string" }, "updated_at": { "type": "string" } } }, "domain.ReceiverType": { "type": "string", "enum": [ "user", "team_member" ], "x-enum-varnames": [ "ReceiverTypeUser", "ReceiverTypeTeamMember" ] }, "domain.RecentActivityCourseRef": { "type": "object", "properties": { "id": { "type": "integer" }, "name": { "type": "string" } } }, "domain.RecentActivityLessonRef": { "type": "object", "properties": { "id": { "type": "integer" }, "sort_order": { "type": "integer" }, "title": { "type": "string" } } }, "domain.RecentActivityModuleRef": { "type": "object", "properties": { "id": { "type": "integer" }, "name": { "type": "string" }, "sort_order": { "type": "integer" } } }, "domain.RecentActivityPracticeRef": { "type": "object", "properties": { "lms_practice_id": { "type": "integer" }, "scope": { "description": "lesson | module | course", "type": "string" }, "title": { "type": "string" } } }, "domain.RecentActivityProgramRef": { "type": "object", "properties": { "id": { "type": "integer" }, "name": { "type": "string" } } }, "domain.RegisterUserReq": { "type": "object", "properties": { "email": { "type": "string" }, "password": { "type": "string" }, "phone_number": { "type": "string" }, "referral_code": { "type": "string", "example": "ABCDEF0123456789" } } }, "domain.RenderedEmail": { "type": "object", "properties": { "html": { "type": "string" }, "subject": { "type": "string" }, "text": { "type": "string" } } }, "domain.ReorderIDsRequest": { "type": "object", "properties": { "ordered_ids": { "type": "array", "items": { "type": "integer" } } } }, "domain.ResendOtpReq": { "type": "object", "properties": { "email": { "type": "string" }, "phone_number": { "type": "string" } } }, "domain.Response": { "type": "object", "properties": { "message": { "type": "string" }, "metadata": { "description": "Optional endpoint-specific metadata; null unless the operation documents a concrete metadata schema.", "type": "object", "x-nullable": true }, "status_code": { "type": "integer" }, "success": { "type": "boolean" } } }, "domain.Role": { "type": "string", "enum": [ "SUPER_ADMIN", "ADMIN", "CONTENT_MANAGER", "STUDENT", "OPEN_LEARNER", "INSTRUCTOR", "SUPPORT" ], "x-enum-varnames": [ "RoleSuperAdmin", "RoleAdmin", "RoleContentManager", "RoleStudent", "RoleOpenLearner", "RoleInstructor", "RoleSupport" ] }, "domain.RoleRecord": { "type": "object", "properties": { "created_at": { "type": "string" }, "description": { "type": "string" }, "id": { "type": "integer" }, "is_system": { "type": "boolean" }, "name": { "type": "string" }, "updated_at": { "type": "string" } } }, "domain.RoleWithPermissions": { "type": "object", "properties": { "created_at": { "type": "string" }, "description": { "type": "string" }, "id": { "type": "integer" }, "is_system": { "type": "boolean" }, "name": { "type": "string" }, "permissions": { "type": "array", "items": { "$ref": "#/definitions/domain.Permission" } }, "updated_at": { "type": "string" } } }, "domain.SMSProvider": { "type": "string", "enum": [ "afro_message" ], "x-enum-varnames": [ "AfroMessage" ] }, "domain.SaveSettingListReq": { "type": "object", "properties": { "amount_for_bet_referral": { "type": "number" }, "bet_amount_limit": { "type": "number" }, "bet_duplicate_limit": { "type": "integer" }, "cashback_amount_cap": { "type": "number" }, "cashback_percentage": { "type": "number" }, "daily_ticket_limit": { "type": "integer" }, "default_max_referrals": { "type": "integer" }, "default_winning_limit": { "type": "integer" }, "max_number_of_outcomes": { "type": "integer" }, "max_unsettled_bets": { "type": "integer" }, "minimum_bet_amount": { "type": "number" }, "referral_reward_amount": { "type": "number" }, "send_email_on_bet_finish": { "type": "boolean" }, "send_sms_on_bet_finish": { "type": "boolean" }, "sms_provider": { "type": "string" }, "total_winning_limit": { "type": "number" }, "total_winning_notify": { "type": "number" }, "welcome_bonus_active": { "type": "boolean" }, "welcome_bonus_cap": { "type": "number" }, "welcome_bonus_count": { "type": "integer" }, "welcome_bonus_expiry": { "type": "integer" }, "welcome_bonus_multiplier": { "type": "number" } } }, "domain.ScheduledNotification": { "type": "object", "properties": { "attempt_count": { "type": "integer" }, "cancelled_at": { "type": "string" }, "channel": { "$ref": "#/definitions/domain.DeliveryChannel" }, "created_at": { "type": "string" }, "created_by": { "description": "team_members.id of the staff actor who scheduled the job", "type": "integer" }, "email_template_slug": { "type": "string" }, "email_template_variables": { "description": "Free-form template variable object. Keys are defined by the selected email template.", "type": "object" }, "html": { "type": "string" }, "id": { "type": "integer" }, "last_error": { "type": "string" }, "message": { "type": "string" }, "processing_started_at": { "type": "string" }, "scheduled_at": { "type": "string" }, "sent_at": { "type": "string" }, "status": { "$ref": "#/definitions/domain.ScheduledNotificationStatus" }, "target_raw": { "description": "Optional extra targets: phones and emails arrays, team_member_ids array, team_role, level, and type strings.", "type": "object" }, "target_role": { "type": "string" }, "target_team_member_ids": { "type": "array", "items": { "type": "integer" } }, "target_team_role": { "type": "string" }, "target_user_ids": { "type": "array", "items": { "type": "integer" } }, "title": { "type": "string" }, "updated_at": { "type": "string" } } }, "domain.ScheduledNotificationStatus": { "type": "string", "enum": [ "pending", "processing", "sent", "failed", "cancelled" ], "x-enum-varnames": [ "ScheduledStatusPending", "ScheduledStatusProcessing", "ScheduledStatusSent", "ScheduledStatusFailed", "ScheduledStatusCancelled" ] }, "domain.SetRolePermissionsReq": { "type": "object", "required": [ "permission_ids" ], "properties": { "permission_ids": { "type": "array", "items": { "type": "integer" } } } }, "domain.SettingListRes": { "type": "object", "properties": { "amount_for_bet_referral": { "type": "number" }, "bet_amount_limit": { "type": "number" }, "bet_duplicate_limit": { "type": "integer" }, "cashback_amount_cap": { "type": "number" }, "cashback_percentage": { "type": "number" }, "daily_ticket_limit": { "type": "integer" }, "default_max_referrals": { "type": "integer" }, "default_winning_limit": { "type": "integer" }, "max_number_of_outcomes": { "type": "integer" }, "max_unsettled_bets": { "type": "integer" }, "minimum_bet_amount": { "type": "number" }, "referral_reward_amount": { "type": "number" }, "send_email_on_bet_finish": { "type": "boolean" }, "send_sms_on_bet_finish": { "type": "boolean" }, "sms_provider": { "$ref": "#/definitions/domain.SMSProvider" }, "total_winning_limit": { "type": "number" }, "total_winning_notify": { "type": "number" }, "welcome_bonus_active": { "type": "boolean" }, "welcome_bonus_cap": { "type": "number" }, "welcome_bonus_count": { "type": "integer" }, "welcome_bonus_expiry": { "type": "integer" }, "welcome_bonus_multiplier": { "type": "number" } } }, "domain.SettingRes": { "type": "object", "properties": { "key": { "type": "string" }, "updated_at": { "type": "string" }, "value": { "type": "string" } } }, "domain.TeamMemberLoginReq": { "type": "object", "required": [ "email", "password" ], "properties": { "email": { "type": "string" }, "password": { "type": "string" } } }, "domain.TeamMemberResponse": { "type": "object", "properties": { "bio": { "type": "string" }, "created_at": { "type": "string" }, "department": { "type": "string" }, "email": { "type": "string" }, "email_verified": { "type": "boolean" }, "employment_type": { "$ref": "#/definitions/domain.EmploymentType" }, "first_name": { "type": "string" }, "hire_date": { "type": "string" }, "id": { "type": "integer" }, "job_title": { "type": "string" }, "last_login": { "type": "string" }, "last_name": { "type": "string" }, "permissions": { "type": "array", "items": { "type": "string" } }, "phone_number": { "type": "string" }, "profile_picture_url": { "type": "string" }, "status": { "$ref": "#/definitions/domain.TeamMemberStatus" }, "team_role": { "$ref": "#/definitions/domain.TeamRole" }, "updated_at": { "type": "string" }, "work_phone": { "type": "string" } } }, "domain.TeamMemberStats": { "type": "object", "properties": { "active_count": { "type": "integer" }, "inactive_count": { "type": "integer" }, "suspended_count": { "type": "integer" }, "terminated_count": { "type": "integer" }, "total_count": { "type": "integer" } } }, "domain.TeamMemberStatus": { "type": "string", "enum": [ "active", "inactive", "suspended", "terminated" ], "x-enum-varnames": [ "TeamMemberStatusActive", "TeamMemberStatusInactive", "TeamMemberStatusSuspended", "TeamMemberStatusTerminated" ] }, "domain.TeamResetPasswordReq": { "type": "object", "required": [ "email", "otp", "password" ], "properties": { "email": { "type": "string" }, "otp": { "type": "string" }, "password": { "type": "string", "minLength": 8 } } }, "domain.TeamRole": { "type": "string", "enum": [ "SUPER_ADMIN", "ADMIN", "CONTENT_MANAGER", "SUPPORT_AGENT", "INSTRUCTOR", "FINANCE", "HR", "ANALYST" ], "x-enum-varnames": [ "TeamRoleSuperAdmin", "TeamRoleAdmin", "TeamRoleContentManager", "TeamRoleSupportAgent", "TeamRoleInstructor", "TeamRoleFinance", "TeamRoleHR", "TeamRoleAnalyst" ] }, "domain.TeamSendPasswordResetReq": { "type": "object", "required": [ "email" ], "properties": { "email": { "type": "string" } } }, "domain.TeamVerifyPasswordResetRes": { "type": "object", "properties": { "reason": { "description": "missing | invalid | used | expired", "type": "string" }, "valid": { "type": "boolean" } } }, "domain.UpdateCourseInput": { "type": "object", "properties": { "access_tier": { "type": "string", "enum": [ "FREE", "free", "PREMIUM", "premium" ] }, "description": { "type": "string" }, "name": { "type": "string" }, "publish_status": { "type": "string", "enum": [ "DRAFT", "draft", "PUBLISHED", "published" ] }, "sort_order": { "type": "integer" }, "thumbnail": { "type": "string" } } }, "domain.UpdateExamPrepCatalogCourseInput": { "type": "object", "properties": { "access_tier": { "type": "string", "enum": [ "FREE", "free", "PREMIUM", "premium" ] }, "currency": { "type": "string" }, "description": { "type": "string" }, "name": { "type": "string" }, "price": { "type": "number", "maximum": 9999999999.99, "minimum": 0 }, "publish_status": { "type": "string", "enum": [ "DRAFT", "draft", "PUBLISHED", "published" ] }, "sort_order": { "type": "integer" }, "thumbnail": { "type": "string" } } }, "domain.UpdateExamPrepLessonInput": { "type": "object", "properties": { "access_tier": { "type": "string", "enum": [ "FREE", "free", "PREMIUM", "premium", "INHERIT", "inherit" ] }, "description": { "type": "string" }, "publish_status": { "type": "string", "enum": [ "DRAFT", "draft", "PUBLISHED", "published" ] }, "sort_order": { "type": "integer" }, "thumbnail": { "type": "string" }, "title": { "type": "string" }, "video_url": { "type": "string" } } }, "domain.UpdateExamPrepModuleInput": { "type": "object", "properties": { "access_tier": { "type": "string", "enum": [ "FREE", "free", "PREMIUM", "premium", "INHERIT", "inherit" ] }, "description": { "type": "string" }, "icon": { "type": "string" }, "name": { "type": "string" }, "publish_status": { "type": "string", "enum": [ "DRAFT", "draft", "PUBLISHED", "published" ] }, "sort_order": { "type": "integer" }, "thumbnail": { "type": "string" } } }, "domain.UpdateExamPrepPracticeInput": { "type": "object", "properties": { "authoring_profile": { "type": "string", "enum": [ "STANDALONE", "IELTS_SHARED_STIMULUS" ] }, "persona_id": { "type": "integer" }, "publish_status": { "type": "string", "enum": [ "DRAFT", "draft", "PUBLISHED", "published" ] }, "question_set_id": { "type": "integer" }, "quick_tips": { "type": "string" }, "story_description": { "type": "string" }, "story_image": { "type": "string" }, "title": { "type": "string" } } }, "domain.UpdateExamPrepPracticeParentsInput": { "type": "object", "required": [ "parents" ], "properties": { "parents": { "type": "array", "items": { "$ref": "#/definitions/domain.ExamPrepPracticeParent" } } } }, "domain.UpdateExamPrepUnitInput": { "type": "object", "properties": { "access_tier": { "type": "string", "enum": [ "FREE", "free", "PREMIUM", "premium", "INHERIT", "inherit" ] }, "description": { "type": "string" }, "name": { "type": "string" }, "publish_status": { "type": "string", "enum": [ "DRAFT", "draft", "PUBLISHED", "published" ] }, "sort_order": { "type": "integer" }, "thumbnail": { "type": "string" } } }, "domain.UpdateKnowledgeLevelReq": { "type": "object", "properties": { "knowledge_level": { "description": "BEGINNER, INTERMEDIATE, ADVANCED", "type": "string" }, "user_id": { "type": "integer" } } }, "domain.UpdateLessonInput": { "type": "object", "properties": { "access_tier": { "type": "string", "enum": [ "FREE", "free", "PREMIUM", "premium" ] }, "description": { "type": "string" }, "publish_status": { "type": "string", "enum": [ "DRAFT", "draft", "PUBLISHED", "published" ] }, "sort_order": { "type": "integer" }, "thumbnail": { "type": "string" }, "title": { "type": "string" }, "video_url": { "type": "string" } } }, "domain.UpdateLmsPersonaInput": { "type": "object", "properties": { "description": { "type": "string" }, "gender": { "type": "string" }, "is_active": { "type": "boolean" }, "name": { "type": "string" }, "profile_picture": { "type": "string" } } }, "domain.UpdateModuleInput": { "type": "object", "properties": { "access_tier": { "type": "string", "enum": [ "FREE", "free", "PREMIUM", "premium" ] }, "description": { "type": "string" }, "icon": { "type": "string" }, "name": { "type": "string" }, "publish_status": { "type": "string", "enum": [ "DRAFT", "draft", "PUBLISHED", "published" ] }, "sort_order": { "type": "integer" } } }, "domain.UpdateMyTeamProfileReq": { "type": "object", "properties": { "bio": { "type": "string" }, "department": { "type": "string" }, "first_name": { "type": "string" }, "job_title": { "type": "string" }, "last_name": { "type": "string" }, "phone_number": { "type": "string" }, "profile_picture_url": { "type": "string" }, "work_phone": { "type": "string" } } }, "domain.UpdatePracticeInput": { "type": "object", "properties": { "authoring_profile": { "type": "string", "enum": [ "STANDALONE", "IELTS_SHARED_STIMULUS" ] }, "persona_id": { "type": "integer" }, "publish_status": { "type": "string", "enum": [ "DRAFT", "draft", "PUBLISHED", "published" ] }, "question_set_id": { "type": "integer" }, "quick_tips": { "type": "string" }, "story_description": { "type": "string" }, "story_image": { "type": "string" }, "title": { "type": "string" } } }, "domain.UpdatePracticeParentsInput": { "type": "object", "required": [ "parents" ], "properties": { "parents": { "type": "array", "items": { "$ref": "#/definitions/domain.PracticeParent" } } } }, "domain.UpdateProgramInput": { "type": "object", "properties": { "access_tier": { "type": "string", "enum": [ "FREE", "free", "PREMIUM", "premium" ] }, "category": { "type": "string", "enum": [ "EDUCATION" ] }, "description": { "type": "string" }, "name": { "type": "string" }, "publish_status": { "type": "string", "enum": [ "DRAFT", "draft", "PUBLISHED", "published" ] }, "sort_order": { "type": "integer" }, "thumbnail": { "type": "string" } } }, "domain.UpdateRoleReq": { "type": "object", "required": [ "name" ], "properties": { "description": { "type": "string" }, "name": { "type": "string", "maxLength": 100, "minLength": 2 } } }, "domain.UpdateTeamMemberReq": { "type": "object", "properties": { "bio": { "type": "string" }, "department": { "type": "string" }, "emergency_contact": { "type": "string" }, "employment_type": { "type": "string" }, "first_name": { "type": "string" }, "hire_date": { "type": "string" }, "job_title": { "type": "string" }, "last_name": { "type": "string" }, "permissions": { "type": "array", "items": { "type": "string" } }, "phone_number": { "type": "string" }, "profile_picture_url": { "type": "string" }, "team_role": { "type": "string" }, "work_phone": { "type": "string" } } }, "domain.UpdateTeamMemberStatusReq": { "type": "object", "required": [ "status" ], "properties": { "status": { "type": "string" } } }, "domain.UpdateUserReq": { "type": "object", "properties": { "age_group": { "$ref": "#/definitions/domain.AgeGroup" }, "birth_day": { "description": "YYYY-MM-DD", "type": "string" }, "country": { "type": "string" }, "education_level": { "type": "string" }, "favourite_topic": { "type": "string" }, "first_name": { "type": "string" }, "gender": { "type": "string" }, "knowledge_level": { "type": "string" }, "language_challange": { "type": "string" }, "language_goal": { "type": "string" }, "last_name": { "type": "string" }, "learning_goal": { "type": "string" }, "nick_name": { "type": "string" }, "occupation": { "type": "string" }, "preferred_language": { "type": "string" }, "profile_picture_url": { "type": "string" }, "region": { "type": "string" } } }, "domain.UserPersona": { "type": "object", "properties": { "DisplayOrder": { "type": "integer" }, "FirstName": { "type": "string" }, "ID": { "type": "integer" }, "LastName": { "type": "string" }, "NickName": { "type": "string" }, "ProfilePictureURL": { "type": "string" }, "Role": { "type": "string" } } }, "domain.UserProfileResponse": { "type": "object", "properties": { "active_subscriptions": { "type": "array", "items": { "$ref": "#/definitions/domain.UserProfileSubscription" } }, "age_group": { "type": "string" }, "birth_day": { "description": "formatted as YYYY-MM-DD", "type": "string" }, "country": { "type": "string" }, "created_at": { "type": "string" }, "education_level": { "type": "string" }, "email": { "description": "UserName string ` + "`" + `json:\"user_name,omitempty\"` + "`" + `", "type": "string" }, "email_verified": { "type": "boolean" }, "favoutite_topic": { "type": "string" }, "first_name": { "type": "string" }, "gender": { "type": "string" }, "id": { "type": "integer" }, "language_challange": { "type": "string" }, "language_goal": { "type": "string" }, "last_login": { "type": "string" }, "last_name": { "type": "string" }, "learning_goal": { "type": "string" }, "nick_name": { "description": "Profile fields", "type": "string" }, "occupation": { "type": "string" }, "phone_number": { "type": "string" }, "phone_verified": { "type": "boolean" }, "preferred_language": { "type": "string" }, "profile_completed": { "type": "boolean" }, "profile_completion_percentage": { "type": "integer" }, "profile_picture_url": { "type": "string" }, "region": { "type": "string" }, "role": { "$ref": "#/definitions/domain.Role" }, "status": { "$ref": "#/definitions/domain.UserStatus" }, "subscription_status": { "type": "string" }, "updated_at": { "type": "string" } } }, "domain.UserProfileSubscription": { "type": "object", "properties": { "auto_renew": { "type": "boolean" }, "category": { "type": "string" }, "created_at": { "type": "string" }, "currency": { "type": "string" }, "duration_unit": { "type": "string" }, "duration_value": { "type": "integer" }, "expires_at": { "type": "string" }, "id": { "type": "integer" }, "is_lifetime": { "type": "boolean" }, "plan_id": { "type": "integer" }, "plan_name": { "type": "string" }, "price": { "type": "number" }, "starts_at": { "type": "string" }, "status": { "type": "string" } } }, "domain.UserRecentActivityFeed": { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/definitions/domain.UserRecentActivityItem" } }, "user_id": { "type": "integer" } } }, "domain.UserRecentActivityItem": { "type": "object", "properties": { "course": { "$ref": "#/definitions/domain.RecentActivityCourseRef" }, "headline": { "description": "Headline is optional server-rendered primary line (client may ignore and build from refs).", "type": "string" }, "id": { "type": "string" }, "kind": { "description": "Kind drives default icon treatment on the client (e.g. joined vs completion).", "type": "string" }, "lesson": { "$ref": "#/definitions/domain.RecentActivityLessonRef" }, "module": { "$ref": "#/definitions/domain.RecentActivityModuleRef" }, "occurred_at": { "description": "OccurredAt is when the platform recorded the event (typically completion time).", "type": "string" }, "practice": { "$ref": "#/definitions/domain.RecentActivityPracticeRef" }, "program": { "$ref": "#/definitions/domain.RecentActivityProgramRef" } } }, "domain.UserStatus": { "type": "string", "enum": [ "PENDING", "ACTIVE", "SUSPENDED", "DEACTIVATED" ], "x-enum-varnames": [ "UserStatusPending", "UserStatusActive", "UserStatusSuspended", "UserStatusDeactivated" ] }, "domain.UserSummary": { "type": "object", "properties": { "active_users": { "type": "integer" }, "joined_this_month": { "type": "integer" }, "total_users": { "type": "integer" } } }, "domain.VerifyOTPResponse": { "type": "object", "properties": { "message": { "type": "string" }, "payment_id": { "type": "integer" }, "success": { "type": "boolean" }, "transaction_id": { "type": "string" } } }, "domain.VerifyOtpReq": { "type": "object", "required": [ "otp" ], "properties": { "email": { "type": "string" }, "otp": { "type": "string" }, "phone_number": { "type": "string" } } }, "domain.VerifyTeamInvitationRes": { "type": "object", "properties": { "email": { "type": "string" }, "expires_at": { "type": "string" }, "needs_profile_setup": { "type": "boolean" }, "status": { "type": "string" }, "team_role": { "type": "string" }, "valid": { "type": "boolean" } } }, "domain.VideoEngagementHeartbeatInput": { "type": "object", "required": [ "content_id", "content_kind" ], "properties": { "content_id": { "type": "integer" }, "content_kind": { "type": "string", "enum": [ "lesson" ] }, "duration_sec": { "type": "integer", "minimum": 0 }, "ended": { "type": "boolean" }, "position_sec": { "type": "integer", "minimum": 0 } } }, "domain.VideoWatchSessionResponse": { "type": "object", "properties": { "completed": { "type": "boolean" }, "max_position_sec": { "type": "integer" }, "session_id": { "type": "integer" }, "session_number": { "type": "integer" } } }, "domain.WebhookRequest": { "type": "object", "properties": { "nonce": { "type": "string" }, "notificationUrl": { "type": "string" }, "paymentMethod": { "type": "string" }, "phone": { "type": "string" }, "sessionId": { "type": "string" }, "totalAmount": { "type": "integer" }, "transaction": { "type": "object", "properties": { "transactionId": { "type": "string" }, "transactionStatus": { "type": "string" } } }, "transactionStatus": { "type": "string" }, "uuid": { "type": "string" } } }, "handlers.AddQuestionToSetData": { "type": "object", "properties": { "associated_question_id": { "type": "integer" }, "display_order": { "type": "integer" }, "id": { "type": "integer" }, "question_id": { "type": "integer" }, "set_id": { "type": "integer" } } }, "handlers.AdminRes": { "type": "object", "properties": { "created_at": { "type": "string" }, "email": { "type": "string" }, "email_verified": { "type": "boolean" }, "first_name": { "type": "string" }, "id": { "type": "integer" }, "last_login": { "type": "string" }, "last_name": { "type": "string" }, "phone_number": { "type": "string" }, "phone_verified": { "type": "boolean" }, "role": { "$ref": "#/definitions/domain.Role" }, "suspended": { "type": "boolean" }, "suspended_at": { "type": "string" }, "updated_at": { "type": "string" } } }, "handlers.CheckPhoneEmailExistReq": { "type": "object", "properties": { "email": { "type": "string", "example": "john.doe@example.com" }, "phone_number": { "type": "string", "example": "1234567890" } } }, "handlers.CheckPhoneEmailExistRes": { "type": "object", "properties": { "email_exist": { "type": "boolean" }, "phone_number_exist": { "type": "boolean" } } }, "handlers.CheckProfileCompletedData": { "type": "object", "properties": { "is_profile_completed": { "type": "boolean" }, "profile_completion_percentage": { "type": "integer" } } }, "handlers.CheckSubscriptionStatusData": { "type": "object", "properties": { "has_active_subscription": { "type": "boolean" } } }, "handlers.CheckUserPendingData": { "type": "object", "properties": { "is_pending": { "type": "boolean" } } }, "handlers.CountUnreadNotificationsResponse": { "type": "object", "properties": { "unread": { "type": "integer" } } }, "handlers.CreateAdminReq": { "type": "object", "properties": { "email": { "type": "string", "example": "john.doe@example.com" }, "first_name": { "type": "string", "example": "John" }, "last_name": { "type": "string", "example": "Doe" }, "password": { "type": "string", "example": "password123" }, "phone_number": { "type": "string", "example": "1234567890" } } }, "handlers.CreateAndSendNotification.Request": { "type": "object" }, "handlers.CreatePullUploadRequest": { "type": "object", "required": [ "file_size", "name", "source_url" ], "properties": { "description": { "type": "string" }, "file_size": { "type": "integer" }, "name": { "type": "string" }, "source_url": { "type": "string" } } }, "handlers.CreateTusUploadRequest": { "type": "object", "required": [ "file_size", "name" ], "properties": { "description": { "type": "string" }, "file_size": { "type": "integer" }, "name": { "type": "string" } } }, "handlers.DeleteEmailTemplateData": { "type": "object", "properties": { "id": { "type": "integer" } } }, "handlers.DeleteFAQData": { "type": "object", "properties": { "id": { "type": "integer" } } }, "handlers.DeleteInAppNotificationsData": { "type": "object", "properties": { "deleted_count": { "type": "integer" }, "requested_ids": { "type": "integer" } } }, "handlers.DeleteMyUserAccountData": { "type": "object", "properties": { "can_cancel_until_at": { "type": "string" }, "grace_period_days": { "type": "integer" }, "scheduled_purge_at": { "type": "string" } } }, "handlers.DeleteQuestionTypeDefinitionData": { "type": "object", "properties": { "id": { "type": "integer" } } }, "handlers.DeleteQuestionTypeDefinitionGroupData": { "type": "object", "properties": { "id": { "type": "integer" } } }, "handlers.GetAllNotificationsResponse": { "type": "object", "properties": { "limit": { "type": "integer" }, "notifications": { "type": "array", "items": { "$ref": "#/definitions/domain.Notification" } }, "page": { "type": "integer" }, "total_count": { "type": "integer" } } }, "handlers.GetAllUsersData": { "type": "object", "properties": { "total": { "type": "integer" }, "users": { "type": "array", "items": { "$ref": "#/definitions/domain.UserProfileResponse" } } } }, "handlers.GetFileURLData": { "type": "object", "properties": { "url": { "type": "string" } } }, "handlers.GetSampleVideoData": { "type": "object", "properties": { "iframe": { "type": "string" }, "video": { "$ref": "#/definitions/handlers.VimeoVideoResponse" } } }, "handlers.GetUserNotificationResponse": { "type": "object", "properties": { "limit": { "type": "integer" }, "notifications": { "type": "array", "items": { "$ref": "#/definitions/domain.Notification" } }, "offset": { "type": "integer" }, "total_count": { "type": "integer" } } }, "handlers.LinkExamPrepAssessmentData": { "type": "object", "properties": { "assessment": { "$ref": "#/definitions/handlers.RawQuestionSetResponse" }, "parent_id": { "type": "integer" }, "parent_kind": { "type": "string" } } }, "handlers.ListAccountDeletionRequestsData": { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/definitions/domain.AccountDeletionRequest" } }, "page": { "type": "integer" }, "page_size": { "type": "integer" }, "total": { "type": "integer" } } }, "handlers.ListAllExamPrepPracticesData": { "type": "object", "properties": { "limit": { "type": "integer" }, "offset": { "type": "integer" }, "practices": { "type": "array", "items": { "$ref": "#/definitions/domain.ExamPrepPractice" } }, "total_count": { "type": "integer" } } }, "handlers.ListExamPrepAssessmentsData": { "type": "object", "properties": { "assessments": { "type": "array", "items": { "$ref": "#/definitions/handlers.RawQuestionSetResponse" } } } }, "handlers.ListExamPrepPracticesByCatalogCourseData": { "type": "object", "properties": { "limit": { "type": "integer" }, "offset": { "type": "integer" }, "practices": { "type": "array", "items": { "$ref": "#/definitions/domain.ExamPrepPractice" } }, "total_count": { "type": "integer" } } }, "handlers.ListExamPrepPracticesByLessonData": { "type": "object", "properties": { "limit": { "type": "integer" }, "offset": { "type": "integer" }, "practices": { "type": "array", "items": { "$ref": "#/definitions/domain.ExamPrepPractice" } }, "total_count": { "type": "integer" } } }, "handlers.ListExamPrepPracticesByUnitData": { "type": "object", "properties": { "limit": { "type": "integer" }, "offset": { "type": "integer" }, "practices": { "type": "array", "items": { "$ref": "#/definitions/domain.ExamPrepPractice" } }, "total_count": { "type": "integer" } } }, "handlers.ListFieldKeysData": { "type": "object", "properties": { "fields": { "type": "array", "items": { "type": "string" } } } }, "handlers.ListRolesData": { "type": "object", "properties": { "page": { "type": "integer" }, "page_size": { "type": "integer" }, "roles": { "type": "array", "items": { "$ref": "#/definitions/domain.RoleRecord" } }, "total": { "type": "integer" } } }, "handlers.ListScheduledNotificationsResponse": { "type": "object", "properties": { "limit": { "type": "integer" }, "page": { "type": "integer" }, "scheduled_notifications": { "type": "array", "items": { "$ref": "#/definitions/domain.ScheduledNotification" } }, "total_count": { "type": "integer" } } }, "handlers.MessageAPIResponse": { "type": "object", "properties": { "message": { "type": "string" }, "status": { "type": "string", "enum": [ "success", "error" ] }, "timestamp": { "type": "string" } } }, "handlers.MessageResponse": { "type": "object", "properties": { "message": { "type": "string" }, "metadata": { "description": "Always null for message-only domain responses.", "allOf": [ { "$ref": "#/definitions/handlers.NullResponseValue" } ], "x-nullable": true }, "status_code": { "type": "integer" }, "success": { "type": "boolean" } } }, "handlers.NotificationDispatchResponse": { "type": "object", "properties": { "message": { "type": "string" }, "notification_id": { "type": "string" }, "notification_ids": { "type": "array", "items": { "type": "string" } }, "recipient_count": { "type": "integer" } } }, "handlers.NullResponseValue": { "description": "Reserved metadata value. Always null; no object properties are returned.", "type": "object" }, "handlers.PurgeDueDeletedUsersData": { "type": "object", "properties": { "batch_limit": { "type": "integer" }, "deleted_count": { "type": "integer" } } }, "handlers.RawQuestionSetResponse": { "type": "object", "properties": { "BannerImage": { "type": "string" }, "CreatedAt": { "type": "string" }, "Description": { "type": "string" }, "ID": { "type": "integer" }, "IntroVideoURL": { "type": "string" }, "OwnerID": { "type": "integer" }, "OwnerType": { "type": "string" }, "PassingScore": { "type": "integer" }, "Persona": { "type": "string" }, "SetType": { "type": "string" }, "ShuffleQuestions": { "type": "boolean" }, "Status": { "type": "string" }, "TimeLimitMinutes": { "type": "integer" }, "Title": { "type": "string" }, "UpdatedAt": { "type": "string" }, "UserPersonas": { "type": "array", "items": { "$ref": "#/definitions/domain.UserPersona" } } } }, "handlers.ReferralCodeData": { "type": "object", "required": [ "code" ], "properties": { "code": { "type": "string", "example": "ABCDEF0123456789" } } }, "handlers.ReferralCommissionItem": { "type": "object", "properties": { "amount": { "type": "string", "example": "51.25" }, "commission_percent": { "type": "string", "example": "10.25" }, "created_at": { "type": "string", "format": "date-time", "example": "2026-10-28T09:00:00Z" }, "currency": { "type": "string", "example": "ETB" }, "id": { "type": "integer", "example": 7 }, "payment_id": { "type": "integer", "example": 42 }, "reversed_at": { "description": "Null until the qualifying payment leaves SUCCESS; reversed credits no longer contribute to the balance.", "type": "string", "format": "date-time", "x-nullable": true } } }, "handlers.ReferralHistoryData": { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/definitions/handlers.ReferralHistoryItem" } }, "limit": { "type": "integer", "example": 20 }, "offset": { "type": "integer", "example": 0 } } }, "handlers.ReferralHistoryItem": { "type": "object", "properties": { "converted": { "type": "boolean", "example": true }, "created_at": { "type": "string", "format": "date-time", "example": "2026-10-28T09:00:00Z" }, "id": { "type": "integer", "example": 14 } } }, "handlers.ReferralOverviewData": { "type": "object", "required": [ "code" ], "properties": { "code": { "type": "string", "example": "ABCDEF0123456789" }, "commission_percent": { "type": "string", "example": "10.25" }, "converted_referrals": { "type": "integer", "example": 3 }, "total_referrals": { "type": "integer", "example": 12 }, "wallet": { "type": "array", "items": { "$ref": "#/definitions/handlers.ReferralWalletBalance" } } } }, "handlers.ReferralSettingsData": { "type": "object", "properties": { "commission_percent": { "type": "string", "example": "10.25" }, "updated_at": { "type": "string", "format": "date-time", "example": "2026-10-28T09:00:00Z" } } }, "handlers.ReferralWalletBalance": { "type": "object", "properties": { "balance": { "description": "Decimal string; balances are not combined across currencies.", "type": "string", "example": "125.50" }, "currency": { "type": "string", "example": "ETB" } } }, "handlers.ReferralWalletData": { "type": "object", "properties": { "balances": { "type": "array", "items": { "$ref": "#/definitions/handlers.ReferralWalletBalance" } }, "limit": { "type": "integer", "example": 20 }, "offset": { "type": "integer", "example": 0 }, "transactions": { "type": "array", "items": { "$ref": "#/definitions/handlers.ReferralCommissionItem" } } } }, "handlers.RefreshFileURLData": { "type": "object", "properties": { "expires_in": { "type": "integer" }, "object_key": { "type": "string" }, "url": { "type": "string" } } }, "handlers.RegisterCodeReq": { "type": "object", "properties": { "email": { "type": "string", "example": "john.doe@example.com" }, "phone_number": { "type": "string", "example": "1234567890" } } }, "handlers.RegisterDeviceToken.Request": { "type": "object", "required": [ "device_token", "platform" ], "properties": { "device_token": { "type": "string" }, "platform": { "type": "string", "enum": [ "android", "ios", "web" ] } } }, "handlers.ResetCodeReq": { "type": "object", "properties": { "email": { "type": "string", "example": "john.doe@example.com" }, "phone_number": { "type": "string", "example": "1234567890" } } }, "handlers.ResetPasswordReq": { "type": "object", "required": [ "otp", "password" ], "properties": { "email": { "type": "string", "example": "john.doe@example.com" }, "otp": { "type": "string", "example": "123456" }, "password": { "type": "string", "minLength": 8, "example": "newpassword123" }, "phone_number": { "type": "string", "example": "1234567890" } } }, "handlers.RevokeTeamInvitationData": { "type": "object", "properties": { "id": { "type": "integer" } } }, "handlers.SearchUserByNameOrPhoneReq": { "type": "object", "properties": { "query": { "type": "string" }, "role": { "$ref": "#/definitions/domain.Role" } } }, "handlers.SendBulkEmailData": { "type": "object", "properties": { "failed": { "type": "integer" }, "sent": { "type": "integer" }, "team_member_recipients": { "type": "integer" }, "total_recipients": { "type": "integer" }, "user_recipients": { "type": "integer" } } }, "handlers.SendBulkInAppNotificationData": { "type": "object", "properties": { "failed": { "type": "integer" }, "sent": { "type": "integer" }, "team_member_recipients": { "type": "integer" }, "total_recipients": { "type": "integer" }, "user_recipients": { "type": "integer" } } }, "handlers.SendBulkPushNotificationData": { "type": "object", "properties": { "devices_targeted": { "type": "integer" }, "failed": { "type": "integer" }, "image": { "type": "string" }, "sent": { "type": "integer" }, "target_users": { "type": "integer" } } }, "handlers.SendBulkSMSData": { "type": "object", "properties": { "failed": { "type": "integer" }, "sent": { "type": "integer" }, "total_recipients": { "type": "integer" } } }, "handlers.SendSingleAfroSMSReq": { "type": "object", "required": [ "message", "recipient" ], "properties": { "message": { "type": "string", "example": "Hello world" }, "recipient": { "type": "string", "example": "+251912345678" } } }, "handlers.SendTestPushNotificationData": { "type": "object", "properties": { "devices_count": { "type": "integer" }, "image": { "type": "string" }, "message": { "type": "string" }, "title": { "type": "string" } } }, "handlers.SubmitAudioAnswerData": { "type": "object", "properties": { "audio_url": { "type": "string" }, "created_at": { "type": "string" }, "id": { "type": "integer" }, "question_id": { "type": "integer" }, "question_set_id": { "type": "integer" } } }, "handlers.UnregisterDeviceToken.Request": { "type": "object", "required": [ "device_token" ], "properties": { "device_token": { "type": "string" } } }, "handlers.UpdateQuestionTypeDefinitionData": { "type": "object", "properties": { "id": { "type": "integer" } } }, "handlers.UploadAudioData": { "type": "object", "properties": { "content_type": { "type": "string" }, "object_key": { "type": "string" }, "url": { "type": "string" } } }, "handlers.UploadProfilePictureData": { "type": "object", "properties": { "profile_picture_url": { "type": "string" } } }, "handlers.ValidateQuestionTypeDefinitionData": { "type": "object", "properties": { "valid": { "type": "boolean" } } }, "handlers.VimeoEmbedResponse": { "type": "object", "properties": { "embed_html": { "type": "string" }, "embed_url": { "type": "string" }, "video_id": { "type": "string" } } }, "handlers.VimeoTranscodeStatusData": { "type": "object", "properties": { "status": { "type": "string" }, "video_id": { "type": "string" } } }, "handlers.VimeoUploadResultData": { "type": "object", "properties": { "Link": { "type": "string" }, "Status": { "type": "string" }, "URI": { "type": "string" }, "UploadLink": { "type": "string" }, "VimeoID": { "type": "string" } } }, "handlers.VimeoVideoResponse": { "type": "object", "properties": { "description": { "type": "string" }, "duration": { "type": "integer" }, "embed_html": { "type": "string" }, "embed_url": { "type": "string" }, "height": { "type": "integer" }, "link": { "type": "string" }, "name": { "type": "string" }, "status": { "type": "string" }, "thumbnail_url": { "type": "string" }, "transcode_status": { "type": "string" }, "uri": { "type": "string" }, "vimeo_id": { "type": "string" }, "width": { "type": "integer" } } }, "handlers.VimeoVideosListMetadata": { "type": "object", "properties": { "current_page": { "type": "integer" }, "first": { "type": "string" }, "last": { "type": "string" }, "limit": { "type": "integer" }, "next": { "type": "string" }, "previous": { "type": "string" }, "total": { "type": "integer" }, "total_pages": { "type": "integer" } } }, "handlers.activityLogListRes": { "type": "object", "properties": { "limit": { "type": "integer" }, "logs": { "type": "array", "items": { "$ref": "#/definitions/handlers.activityLogRes" } }, "offset": { "type": "integer" }, "total_count": { "type": "integer" } } }, "handlers.activityLogRes": { "type": "object", "properties": { "action": { "type": "string" }, "actor_email": { "type": "string" }, "actor_id": { "type": "integer" }, "actor_kind": { "type": "string" }, "actor_name": { "type": "string" }, "actor_role": { "type": "string" }, "created_at": { "type": "string" }, "id": { "type": "integer" }, "ip_address": { "type": "string" }, "message": { "type": "string" }, "metadata": { "description": "Free-form event metadata; keys depend on action and resource_type. Null when the event has no metadata.", "type": "object" }, "resource_id": { "type": "integer" }, "resource_type": { "type": "string" }, "user_agent": { "type": "string" } } }, "handlers.addQuestionToSetReq": { "type": "object", "required": [ "question_id" ], "properties": { "associated_question_id": { "description": "Section anchor question in the same set; must have a lower display_order and no association of its own.", "type": "integer", "minimum": 1 }, "display_order": { "description": "Omit to append after the current highest display_order in the set; set explicitly to insert at a position.", "type": "integer", "minimum": 0 }, "question_id": { "type": "integer" } } }, "handlers.addUserPersonaReq": { "type": "object", "required": [ "user_id" ], "properties": { "display_order": { "type": "integer" }, "user_id": { "type": "integer" } } }, "handlers.adminApplySubscriptionReq": { "type": "object", "required": [ "plan_id" ], "properties": { "plan_id": { "type": "integer", "minimum": 1 }, "record_payment": { "description": "RecordPayment when omitted defaults to true (record SUCCESS payment at plan price).", "type": "boolean" } } }, "handlers.adminPaymentListItemRes": { "type": "object", "properties": { "amount": { "type": "number" }, "course_id": { "type": "integer" }, "created_at": { "type": "string" }, "currency": { "type": "string" }, "expires_at": { "type": "string" }, "id": { "type": "integer" }, "nonce": { "type": "string" }, "paid_at": { "type": "string" }, "payment_method": { "type": "string" }, "plan_category": { "type": "string" }, "plan_id": { "type": "integer" }, "plan_name": { "type": "string" }, "session_id": { "type": "string" }, "status": { "type": "string" }, "subscription_id": { "type": "integer" }, "transaction_id": { "type": "string" }, "updated_at": { "type": "string" }, "user_email": { "type": "string" }, "user_first_name": { "type": "string" }, "user_id": { "type": "integer" }, "user_last_name": { "type": "string" } } }, "handlers.adminPaymentRes": { "type": "object", "properties": { "amount": { "type": "number" }, "course_id": { "type": "integer" }, "created_at": { "type": "string" }, "currency": { "type": "string" }, "expires_at": { "type": "string" }, "id": { "type": "integer" }, "nonce": { "type": "string" }, "paid_at": { "type": "string" }, "payment_method": { "type": "string" }, "payment_url": { "type": "string" }, "plan_category": { "type": "string" }, "plan_id": { "type": "integer" }, "plan_name": { "type": "string" }, "session_id": { "type": "string" }, "status": { "type": "string" }, "subscription_id": { "type": "integer" }, "transaction_id": { "type": "string" }, "updated_at": { "type": "string" }, "user_email": { "type": "string" }, "user_first_name": { "type": "string" }, "user_id": { "type": "integer" }, "user_last_name": { "type": "string" } } }, "handlers.apiIndexResponse": { "type": "object", "properties": { "admin_api": { "type": "string", "example": "/api/v1/admin" }, "client_api": { "type": "string", "example": "/api/v1" } } }, "handlers.applyReferralReq": { "type": "object", "required": [ "code" ], "properties": { "code": { "type": "string", "example": "ABCDEF0123456789" } } }, "handlers.authorizeChapaDirectPaymentReq": { "type": "object", "required": [ "otp", "request_id", "session_id" ], "properties": { "otp": { "type": "string" }, "request_id": { "type": "string" }, "session_id": { "type": "string" } } }, "handlers.autoRenewReq": { "type": "object", "properties": { "auto_renew": { "type": "boolean" } } }, "handlers.changePasswordReq": { "type": "object", "required": [ "current_password", "new_password" ], "properties": { "current_password": { "type": "string", "example": "oldpassword123" }, "new_password": { "type": "string", "minLength": 8, "example": "newpassword123" } } }, "handlers.chapterListData": { "type": "object", "properties": { "chapters": { "type": "array", "items": { "$ref": "#/definitions/domain.ExamPrepUnit" } }, "limit": { "type": "integer" }, "offset": { "type": "integer" }, "total_count": { "type": "integer" } } }, "handlers.completePresignedUploadReq": { "type": "object", "properties": { "file_size": { "type": "integer" }, "media_type": { "type": "string" }, "object_key": { "type": "string" } } }, "handlers.componentCatalogRes": { "type": "object", "properties": { "response_component_kinds": { "type": "array", "items": { "type": "string" } }, "stimulus_component_kinds": { "type": "array", "items": { "type": "string" } } } }, "handlers.courseListData": { "type": "object", "properties": { "courses": { "type": "array", "items": { "$ref": "#/definitions/domain.ExamPrepCatalogCourse" } }, "limit": { "type": "integer" }, "offset": { "type": "integer" }, "total_count": { "type": "integer" } } }, "handlers.createChapterQuizRequest": { "type": "object", "required": [ "question_set_id" ], "properties": { "publish_status": { "type": "string", "default": "DRAFT", "enum": [ "DRAFT", "PUBLISHED" ] }, "question_set_id": { "type": "integer", "example": 12 }, "title": { "type": "string", "example": "Chapter review" } } }, "handlers.createEmailTemplateReq": { "type": "object", "required": [ "body_html", "body_text", "name", "slug", "subject" ], "properties": { "body_html": { "type": "string" }, "body_text": { "type": "string" }, "name": { "type": "string" }, "slug": { "type": "string" }, "status": { "type": "string" }, "subject": { "type": "string" }, "variables": { "type": "array", "items": { "type": "string" } } } }, "handlers.createFAQReq": { "type": "object", "required": [ "answer", "question" ], "properties": { "answer": { "type": "string" }, "category": { "type": "string" }, "display_order": { "type": "integer" }, "question": { "type": "string" }, "status": { "type": "string" } } }, "handlers.createFieldOptionReq": { "type": "object", "required": [ "code", "field_key", "label" ], "properties": { "code": { "type": "string" }, "display_order": { "type": "integer" }, "field_key": { "type": "string" }, "label": { "type": "string" }, "status": { "type": "string" } } }, "handlers.createIssueReq": { "type": "object", "required": [ "description", "issue_type", "subject" ], "properties": { "description": { "type": "string" }, "issue_type": { "type": "string" }, "metadata": { "type": "object", "additionalProperties": true }, "subject": { "type": "string" } } }, "handlers.createMobileAppVersionReq": { "type": "object", "required": [ "platform", "version_code", "version_name" ], "properties": { "min_supported_version_code": { "type": "integer" }, "platform": { "type": "string" }, "release_notes": { "type": "string" }, "status": { "type": "string" }, "store_url": { "type": "string" }, "update_type": { "type": "string" }, "version_code": { "type": "integer", "minimum": 1 }, "version_name": { "type": "string" } } }, "handlers.createPlanReq": { "type": "object", "required": [ "category", "currency", "name" ], "properties": { "category": { "type": "string", "enum": [ "EDUCATION" ] }, "currency": { "type": "string" }, "description": { "type": "string" }, "duration_unit": { "type": "string" }, "duration_value": { "type": "integer" }, "is_active": { "type": "boolean" }, "is_free": { "type": "boolean" }, "is_lifetime": { "type": "boolean" }, "name": { "type": "string" }, "price": { "type": "number", "minimum": 0 } } }, "handlers.createQuestionReq": { "type": "object", "properties": { "audio_correct_answer_text": { "type": "string" }, "difficulty_level": { "type": "string" }, "dynamic_payload": { "$ref": "#/definitions/domain.DynamicQuestionPayload" }, "explanation": { "type": "string" }, "image_url": { "type": "string" }, "options": { "type": "array", "items": { "$ref": "#/definitions/handlers.optionInput" } }, "points": { "type": "integer" }, "question_text": { "type": "string" }, "question_type": { "type": "string" }, "question_type_definition_id": { "type": "integer" }, "sample_answer_voice_prompt": { "type": "string" }, "short_answers": { "type": "array", "items": { "$ref": "#/definitions/handlers.shortAnswerInput" } }, "status": { "type": "string" }, "tips": { "type": "string" }, "voice_prompt": { "type": "string" } } }, "handlers.createQuestionSetReq": { "type": "object", "required": [ "set_type", "title" ], "properties": { "banner_image": { "type": "string" }, "description": { "type": "string" }, "intro_video_url": { "type": "string" }, "owner_id": { "type": "integer" }, "owner_type": { "type": "string" }, "passing_score": { "type": "integer" }, "persona": { "type": "string" }, "set_type": { "type": "string", "enum": [ "PRACTICE", "QUIZ", "EXAM", "SURVEY", "CAPSTONE" ] }, "shuffle_questions": { "type": "boolean" }, "status": { "type": "string" }, "time_limit_minutes": { "type": "integer" }, "title": { "type": "string" } } }, "handlers.createQuestionTypeDefinitionGroupReq": { "type": "object", "required": [ "name" ], "properties": { "description": { "type": "string" }, "display_order": { "type": "integer" }, "name": { "type": "string" }, "status": { "type": "string" } } }, "handlers.createQuestionTypeDefinitionReq": { "type": "object", "required": [ "display_name", "key" ], "properties": { "description": { "type": "string" }, "display_name": { "type": "string" }, "group_ids": { "type": "array", "items": { "type": "integer" } }, "key": { "type": "string" }, "response_component_kinds": { "type": "array", "items": { "type": "string" } }, "response_schema": { "type": "array", "items": { "$ref": "#/definitions/domain.DynamicElementDefinition" } }, "status": { "type": "string" }, "stimulus_component_kinds": { "type": "array", "items": { "type": "string" } }, "stimulus_schema": { "type": "array", "items": { "$ref": "#/definitions/domain.DynamicElementDefinition" } } } }, "handlers.documentAdminGetSampleVideoData": { "type": "object", "properties": { "iframe": { "type": "string" }, "video": { "$ref": "#/definitions/handlers.VimeoVideoResponse" } } }, "handlers.emailTemplateRes": { "type": "object", "properties": { "body_html": { "type": "string" }, "body_text": { "type": "string" }, "created_at": { "type": "string" }, "id": { "type": "integer" }, "is_system": { "type": "boolean" }, "name": { "type": "string" }, "slug": { "type": "string" }, "status": { "type": "string" }, "subject": { "type": "string" }, "updated_at": { "type": "string" }, "variables": { "type": "array", "items": { "type": "string" } } } }, "handlers.faqRes": { "type": "object", "properties": { "answer": { "type": "string" }, "category": { "type": "string" }, "created_at": { "type": "string" }, "display_order": { "type": "integer" }, "id": { "type": "integer" }, "question": { "type": "string" }, "status": { "type": "string" }, "updated_at": { "type": "string" } } }, "handlers.fieldOptionRes": { "type": "object", "properties": { "code": { "type": "string" }, "created_at": { "type": "string" }, "display_order": { "type": "integer" }, "field_key": { "type": "string" }, "id": { "type": "integer" }, "label": { "type": "string" }, "status": { "type": "string" }, "updated_at": { "type": "string" } } }, "handlers.initiateChapaDirectPaymentReq": { "type": "object", "required": [ "email", "payment_method", "phone", "plan_id" ], "properties": { "email": { "type": "string" }, "payment_method": { "type": "string" }, "phone": { "type": "string" }, "plan_id": { "type": "integer" } } }, "handlers.initiateDirectPaymentReq": { "type": "object", "required": [ "email", "payment_method", "phone", "plan_id" ], "properties": { "email": { "type": "string" }, "payment_method": { "type": "string" }, "phone": { "type": "string" }, "plan_id": { "type": "integer" } } }, "handlers.initiatePaymentReq": { "type": "object", "required": [ "email", "phone", "plan_id", "provider" ], "properties": { "email": { "type": "string" }, "phone": { "type": "string" }, "plan_id": { "type": "integer" }, "provider": { "type": "string" } } }, "handlers.issueListRes": { "type": "object", "properties": { "issues": { "type": "array", "items": { "$ref": "#/definitions/handlers.issueRes" } }, "total_count": { "type": "integer" } } }, "handlers.issueRes": { "type": "object", "properties": { "created_at": { "type": "string" }, "description": { "type": "string" }, "id": { "type": "integer" }, "issue_type": { "type": "string" }, "metadata": { "type": "object", "additionalProperties": true }, "status": { "type": "string" }, "subject": { "type": "string" }, "updated_at": { "type": "string" }, "user_id": { "type": "integer" }, "user_role": { "type": "string" } } }, "handlers.lessonListData": { "type": "object", "properties": { "lessons": { "type": "array", "items": { "$ref": "#/definitions/domain.ExamPrepLesson" } }, "limit": { "type": "integer" }, "offset": { "type": "integer" }, "total_count": { "type": "integer" } } }, "handlers.listAdminPaymentsRes": { "type": "object", "properties": { "limit": { "type": "integer" }, "offset": { "type": "integer" }, "payments": { "type": "array", "items": { "$ref": "#/definitions/handlers.adminPaymentListItemRes" } }, "total_count": { "type": "integer" } } }, "handlers.listEmailTemplatesRes": { "type": "object", "properties": { "templates": { "type": "array", "items": { "$ref": "#/definitions/handlers.emailTemplateRes" } }, "total_count": { "type": "integer" } } }, "handlers.listFAQsRes": { "type": "object", "properties": { "faqs": { "type": "array", "items": { "$ref": "#/definitions/handlers.faqRes" } }, "total_count": { "type": "integer" } } }, "handlers.listFieldOptionsRes": { "type": "object", "properties": { "options": { "type": "array", "items": { "$ref": "#/definitions/handlers.fieldOptionRes" } }, "total_count": { "type": "integer" } } }, "handlers.listMobileAppVersionsRes": { "type": "object", "properties": { "total_count": { "type": "integer" }, "versions": { "type": "array", "items": { "$ref": "#/definitions/handlers.mobileAppVersionRes" } } } }, "handlers.listPersonasData": { "type": "object", "properties": { "limit": { "type": "integer" }, "offset": { "type": "integer" }, "personas": { "type": "array", "items": { "$ref": "#/definitions/domain.LmsPersona" } }, "total_count": { "type": "integer" } } }, "handlers.listQuestionSetsRes": { "type": "object", "properties": { "question_sets": { "type": "array", "items": { "$ref": "#/definitions/handlers.questionSetRes" } }, "total_count": { "type": "integer" } } }, "handlers.listQuestionTypeDefinitionGroupsData": { "type": "object", "properties": { "groups": { "type": "array", "items": { "$ref": "#/definitions/domain.QuestionTypeDefinitionGroup" } }, "limit": { "type": "integer" }, "offset": { "type": "integer" }, "total_count": { "type": "integer" } } }, "handlers.listQuestionTypeDefinitionsData": { "type": "object", "properties": { "limit": { "type": "integer" }, "offset": { "type": "integer" }, "question_type_definitions": { "type": "array", "items": { "$ref": "#/definitions/domain.QuestionTypeDefinition" } }, "total_count": { "type": "integer" } } }, "handlers.listQuestionsRes": { "type": "object", "properties": { "questions": { "type": "array", "items": { "$ref": "#/definitions/handlers.questionRes" } }, "total_count": { "type": "integer" } } }, "handlers.listTeamInvitationsRes": { "type": "object", "properties": { "invitations": { "type": "array", "items": { "$ref": "#/definitions/handlers.teamInvitationListItem" } }, "total_count": { "type": "integer" } } }, "handlers.loginUserRes": { "type": "object", "properties": { "access_token": { "type": "string" }, "refresh_token": { "type": "string" }, "role": { "type": "string" }, "user_id": { "type": "integer" } } }, "handlers.logoutReq": { "type": "object", "required": [ "refresh_token" ], "properties": { "device_token": { "type": "string", "example": "\u003cfcm-device-token\u003e" }, "refresh_token": { "type": "string", "example": "\u003crefresh-token\u003e" } } }, "handlers.mobileAppVersionRes": { "type": "object", "properties": { "created_at": { "type": "string" }, "id": { "type": "integer" }, "min_supported_version_code": { "type": "integer" }, "platform": { "type": "string" }, "release_notes": { "type": "string" }, "status": { "type": "string" }, "store_url": { "type": "string" }, "update_type": { "type": "string" }, "updated_at": { "type": "string" }, "version_code": { "type": "integer" }, "version_name": { "type": "string" } } }, "handlers.optionInput": { "type": "object", "required": [ "option_text" ], "properties": { "is_correct": { "type": "boolean" }, "option_order": { "type": "integer" }, "option_text": { "type": "string" } } }, "handlers.optionRes": { "type": "object", "properties": { "id": { "type": "integer" }, "is_correct": { "type": "boolean" }, "option_order": { "type": "integer" }, "option_text": { "type": "string" } } }, "handlers.paginatedQuestionSetItemsRes": { "type": "object", "properties": { "limit": { "type": "integer" }, "offset": { "type": "integer" }, "questions": { "type": "array", "items": { "$ref": "#/definitions/handlers.questionSetItemRes" } }, "stimulus_blocks": { "type": "array", "items": { "$ref": "#/definitions/domain.PracticeStimulusBlock" } }, "total_count": { "type": "integer" } } }, "handlers.paymentRes": { "type": "object", "properties": { "amount": { "type": "number" }, "course_id": { "type": "integer" }, "created_at": { "type": "string" }, "currency": { "type": "string" }, "expires_at": { "type": "string" }, "id": { "type": "integer" }, "paid_at": { "type": "string" }, "payment_method": { "type": "string" }, "payment_url": { "type": "string" }, "plan_id": { "type": "integer" }, "plan_name": { "type": "string" }, "session_id": { "type": "string" }, "status": { "type": "string" }, "subscription_id": { "type": "integer" }, "user_id": { "type": "integer" } } }, "handlers.planRes": { "type": "object", "properties": { "category": { "type": "string" }, "created_at": { "type": "string" }, "currency": { "type": "string" }, "description": { "type": "string" }, "duration_unit": { "type": "string" }, "duration_value": { "type": "integer" }, "id": { "type": "integer" }, "is_active": { "type": "boolean" }, "is_free": { "type": "boolean" }, "is_lifetime": { "type": "boolean" }, "name": { "type": "string" }, "price": { "type": "number" } } }, "handlers.presignedUploadReq": { "type": "object", "properties": { "content_type": { "type": "string" }, "file_size": { "type": "integer" }, "filename": { "type": "string" }, "media_type": { "type": "string" } } }, "handlers.presignedUploadRes": { "type": "object", "properties": { "content_type": { "type": "string" }, "expires_in": { "type": "integer" }, "media_type": { "type": "string" }, "object_key": { "type": "string" }, "provider": { "type": "string" }, "reference": { "type": "string" }, "upload_url": { "type": "string" } } }, "handlers.previewEmailTemplateReq": { "type": "object", "properties": { "variables": { "type": "object", "additionalProperties": {} } } }, "handlers.questionRes": { "type": "object", "properties": { "associated_question_id": { "type": "integer" }, "audio_correct_answer_text": { "type": "string" }, "created_at": { "type": "string" }, "difficulty_level": { "type": "string" }, "display_order": { "type": "integer" }, "dynamic_payload": { "$ref": "#/definitions/domain.DynamicQuestionPayload" }, "effective_dynamic_payload": { "$ref": "#/definitions/domain.DynamicQuestionPayload" }, "explanation": { "type": "string" }, "id": { "type": "integer" }, "image_url": { "type": "string" }, "options": { "type": "array", "items": { "$ref": "#/definitions/handlers.optionRes" } }, "points": { "type": "integer" }, "prerequisite_question_ids": { "type": "array", "items": { "type": "integer" } }, "preview_text": { "type": "string" }, "question_text": { "type": "string" }, "question_type": { "type": "string" }, "question_type_definition_id": { "type": "integer" }, "sample_answer_voice_prompt": { "type": "string" }, "shared_stimulus": { "type": "array", "items": { "$ref": "#/definitions/handlers.questionSharedStimulusRes" } }, "short_answers": { "type": "array", "items": { "$ref": "#/definitions/handlers.shortAnswerRes" } }, "status": { "type": "string" }, "stimulus_block_key": { "type": "string" }, "tips": { "type": "string" }, "voice_prompt": { "type": "string" } } }, "handlers.questionSetItemRes": { "type": "object", "properties": { "associated_question_id": { "type": "integer" }, "audio_correct_answer_text": { "type": "string" }, "difficulty_level": { "type": "string" }, "display_order": { "type": "integer" }, "dynamic_payload": { "$ref": "#/definitions/domain.DynamicQuestionPayload" }, "effective_dynamic_payload": { "$ref": "#/definitions/domain.DynamicQuestionPayload" }, "explanation": { "type": "string" }, "id": { "type": "integer" }, "image_url": { "type": "string" }, "points": { "type": "integer" }, "prerequisite_question_ids": { "type": "array", "items": { "type": "integer" } }, "preview_text": { "type": "string" }, "question_id": { "type": "integer" }, "question_status": { "type": "string" }, "question_text": { "type": "string" }, "question_type": { "type": "string" }, "sample_answer_voice_prompt": { "type": "string" }, "set_id": { "type": "integer" }, "stimulus_block_key": { "type": "string" }, "tips": { "type": "string" }, "voice_prompt": { "type": "string" } } }, "handlers.questionSetRes": { "type": "object", "properties": { "banner_image": { "type": "string" }, "created_at": { "type": "string" }, "description": { "type": "string" }, "id": { "type": "integer" }, "intro_video_url": { "type": "string" }, "owner_id": { "type": "integer" }, "owner_type": { "type": "string" }, "passing_score": { "type": "integer" }, "persona": { "type": "string" }, "question_count": { "type": "integer" }, "set_type": { "type": "string" }, "shuffle_questions": { "type": "boolean" }, "status": { "type": "string" }, "time_limit_minutes": { "type": "integer" }, "title": { "type": "string" } } }, "handlers.questionSharedStimulusRes": { "type": "object", "properties": { "block_key": { "type": "string" }, "display_order": { "type": "integer" }, "effective_dynamic_payload": { "$ref": "#/definitions/domain.DynamicQuestionPayload" }, "practice_id": { "type": "integer" }, "practice_kind": { "type": "string" }, "stimulus": { "type": "array", "items": { "$ref": "#/definitions/domain.DynamicElementInstance" } } } }, "handlers.quizFullData": { "type": "object", "properties": { "practice": { "$ref": "#/definitions/domain.ExamPrepPractice" }, "question_set": { "$ref": "#/definitions/handlers.questionSetRes" }, "questions": { "type": "array", "items": { "$ref": "#/definitions/handlers.questionRes" } }, "stimulus_blocks": { "type": "array", "items": { "$ref": "#/definitions/domain.PracticeStimulusBlock" } } } }, "handlers.quizListData": { "type": "object", "properties": { "limit": { "type": "integer" }, "offset": { "type": "integer" }, "quizzes": { "type": "array", "items": { "$ref": "#/definitions/domain.ExamPrepPractice" } }, "total_count": { "type": "integer" } } }, "handlers.ratingRes": { "type": "object", "properties": { "created_at": { "type": "string" }, "id": { "type": "integer" }, "review": { "type": "string" }, "stars": { "type": "integer" }, "target_id": { "type": "integer" }, "target_type": { "type": "string" }, "updated_at": { "type": "string" }, "user_id": { "type": "integer" } } }, "handlers.ratingSummaryRes": { "type": "object", "properties": { "average_stars": { "type": "number" }, "total_count": { "type": "integer" } } }, "handlers.refreshFileURLReq": { "type": "object", "properties": { "reference": { "type": "string" } } }, "handlers.refreshToken": { "type": "object", "required": [ "access_token", "refresh_token" ], "properties": { "access_token": { "type": "string", "example": "\u003cjwt-token\u003e" }, "refresh_token": { "type": "string", "example": "\u003crefresh-token\u003e" } } }, "handlers.requestCheckoutLinkReq": { "type": "object", "properties": { "category": { "type": "string" }, "plan_id": { "type": "integer" } } }, "handlers.requestCheckoutLinkRes": { "type": "object", "properties": { "channel": { "type": "string" }, "destination_hint": { "type": "string" } } }, "handlers.serviceInfoResponse": { "type": "object", "properties": { "message": { "type": "string", "example": "Welcome to Rezina Backend API" }, "version": { "type": "string", "example": "1.0.1" } } }, "handlers.shortAnswerInput": { "type": "object", "required": [ "acceptable_answer" ], "properties": { "acceptable_answer": { "type": "string" }, "match_type": { "type": "string" } } }, "handlers.shortAnswerRes": { "type": "object", "properties": { "acceptable_answer": { "type": "string" }, "id": { "type": "integer" }, "match_type": { "type": "string" } } }, "handlers.submitRatingReq": { "type": "object", "required": [ "stars", "target_type" ], "properties": { "review": { "type": "string" }, "stars": { "type": "integer", "maximum": 5, "minimum": 1 }, "target_id": { "type": "integer" }, "target_type": { "type": "string" } } }, "handlers.subscribeReq": { "type": "object", "required": [ "plan_id" ], "properties": { "payment_method": { "type": "string" }, "payment_reference": { "type": "string" }, "plan_id": { "type": "integer" } } }, "handlers.subscribeWithPaymentReq": { "type": "object", "required": [ "email", "phone", "plan_id", "provider" ], "properties": { "email": { "type": "string" }, "phone": { "type": "string" }, "plan_id": { "type": "integer" }, "provider": { "type": "string" } } }, "handlers.subscriptionCheckoutRes": { "type": "object", "properties": { "amount": { "type": "number" }, "currency": { "type": "string" }, "expires_at": { "type": "string" }, "free_enrollment": { "type": "boolean" }, "payment_id": { "type": "integer" }, "payment_url": { "type": "string" }, "session_id": { "type": "string" }, "subscription": { "$ref": "#/definitions/handlers.subscriptionRes" }, "subscription_id": { "type": "integer" } } }, "handlers.subscriptionRes": { "type": "object", "properties": { "auto_renew": { "type": "boolean" }, "category": { "type": "string" }, "created_at": { "type": "string" }, "currency": { "type": "string" }, "duration_unit": { "type": "string" }, "duration_value": { "type": "integer" }, "expires_at": { "type": "string" }, "id": { "type": "integer" }, "is_lifetime": { "type": "boolean" }, "payment_method": { "type": "string" }, "payment_reference": { "type": "string" }, "plan_id": { "type": "integer" }, "plan_name": { "type": "string" }, "price": { "type": "number" }, "starts_at": { "type": "string" }, "status": { "type": "string" }, "user_id": { "type": "integer" } } }, "handlers.teamInvitationListItem": { "type": "object", "properties": { "created_at": { "type": "string" }, "email": { "type": "string" }, "expires_at": { "type": "string" }, "first_name": { "type": "string" }, "id": { "type": "integer" }, "last_name": { "type": "string" }, "status": { "type": "string" }, "team_member_id": { "type": "integer" }, "team_role": { "type": "string" } } }, "handlers.teamMemberLoginRes": { "type": "object", "properties": { "access_token": { "type": "string", "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." }, "member_id": { "type": "integer", "example": 1 }, "refresh_token": { "type": "string", "example": "\u003copaque-refresh-token\u003e" }, "team_role": { "type": "string", "example": "admin" } } }, "handlers.teamMemberRefreshReq": { "type": "object", "required": [ "refresh_token" ], "properties": { "refresh_token": { "type": "string" } } }, "handlers.updateAdminReq": { "type": "object", "properties": { "first_name": { "type": "string", "example": "John" }, "last_name": { "type": "string", "example": "Doe" }, "suspended": { "type": "boolean", "example": false } } }, "handlers.updateEmailTemplateReq": { "type": "object", "properties": { "body_html": { "type": "string" }, "body_text": { "type": "string" }, "name": { "type": "string" }, "status": { "type": "string" }, "subject": { "type": "string" }, "variables": { "type": "array", "items": { "type": "string" } } } }, "handlers.updateFAQReq": { "type": "object", "properties": { "answer": { "type": "string" }, "category": { "type": "string" }, "display_order": { "type": "integer" }, "question": { "type": "string" }, "status": { "type": "string" } } }, "handlers.updateFieldOptionReq": { "type": "object", "properties": { "display_order": { "type": "integer" }, "label": { "type": "string" }, "status": { "type": "string" } } }, "handlers.updateIssueStatusReq": { "type": "object", "required": [ "status" ], "properties": { "status": { "type": "string", "enum": [ "pending", "in_progress", "resolved", "rejected" ] } } }, "handlers.updateMobileAppVersionReq": { "type": "object", "properties": { "min_supported_version_code": { "type": "integer" }, "release_notes": { "type": "string" }, "status": { "type": "string" }, "store_url": { "type": "string" }, "update_type": { "type": "string" }, "version_code": { "type": "integer" }, "version_name": { "type": "string" } } }, "handlers.updatePlanReq": { "type": "object", "properties": { "category": { "type": "string", "enum": [ "EDUCATION" ] }, "currency": { "type": "string" }, "description": { "type": "string" }, "duration_unit": { "type": "string" }, "duration_value": { "type": "integer" }, "is_active": { "type": "boolean" }, "is_free": { "type": "boolean" }, "is_lifetime": { "type": "boolean" }, "name": { "type": "string" }, "price": { "type": "number" } } }, "handlers.updateQuestionOrderReq": { "type": "object", "required": [ "display_order" ], "properties": { "associated_question_id": { "type": "integer", "minimum": 1 }, "display_order": { "type": "integer" } } }, "handlers.updateQuestionReq": { "type": "object", "properties": { "audio_correct_answer_text": { "type": "string" }, "difficulty_level": { "type": "string" }, "dynamic_payload": { "$ref": "#/definitions/domain.DynamicQuestionPayload" }, "explanation": { "type": "string" }, "image_url": { "type": "string" }, "options": { "type": "array", "items": { "$ref": "#/definitions/handlers.optionInput" } }, "points": { "type": "integer" }, "question_text": { "type": "string" }, "question_type": { "type": "string" }, "question_type_definition_id": { "type": "integer" }, "sample_answer_voice_prompt": { "type": "string" }, "short_answers": { "type": "array", "items": { "$ref": "#/definitions/handlers.shortAnswerInput" } }, "status": { "type": "string" }, "tips": { "type": "string" }, "voice_prompt": { "type": "string" } } }, "handlers.updateQuestionSetReq": { "type": "object", "properties": { "banner_image": { "type": "string" }, "description": { "type": "string" }, "intro_video_url": { "type": "string" }, "passing_score": { "type": "integer" }, "persona": { "type": "string" }, "shuffle_questions": { "type": "boolean" }, "status": { "type": "string" }, "time_limit_minutes": { "type": "integer" }, "title": { "type": "string" } } }, "handlers.updateQuestionTypeDefinitionGroupReq": { "type": "object", "properties": { "description": { "type": "string" }, "display_order": { "type": "integer" }, "name": { "type": "string" }, "status": { "type": "string" } } }, "handlers.updateQuestionTypeDefinitionReq": { "type": "object" }, "handlers.updateReferralSettingsReq": { "type": "object", "required": [ "commission_percent" ], "properties": { "commission_percent": { "description": "Percentage of the qualifying verified course payment, with at most two decimal places. Zero disables new commissions.", "type": "number", "maximum": 100, "minimum": 0, "example": 10.25 } } }, "handlers.uploadMediaRes": { "type": "object", "properties": { "content_type": { "type": "string" }, "embed_url": { "type": "string" }, "media_type": { "type": "string" }, "object_key": { "type": "string" }, "provider": { "type": "string" }, "url": { "type": "string" }, "vimeo_id": { "type": "string" } } }, "handlers.userPersonaRes": { "type": "object", "properties": { "display_order": { "type": "integer" }, "first_name": { "type": "string" }, "id": { "type": "integer" }, "last_name": { "type": "string" }, "nick_name": { "type": "string" }, "profile_picture_url": { "type": "string" }, "role": { "type": "string" } } }, "handlers.validateQuestionTypeDefinitionReq": { "type": "object", "properties": { "response_component_kinds": { "type": "array", "items": { "type": "string" } }, "stimulus_component_kinds": { "type": "array", "items": { "type": "string" } } } }, "handlers.verifyOTPReq": { "type": "object", "required": [ "otp", "session_id" ], "properties": { "otp": { "type": "string" }, "session_id": { "type": "string" } } }, "response.APIResponse": { "type": "object", "properties": { "message": { "type": "string" }, "metadata": { "description": "Optional endpoint-specific metadata; omitted when there is no metadata.", "type": "object" }, "page": { "type": "integer" }, "status": { "$ref": "#/definitions/response.Status" }, "timestamp": { "type": "string" }, "total": { "type": "integer" } } }, "response.Status": { "type": "string", "enum": [ "error", "success" ], "x-enum-varnames": [ "Error", "Success" ] }, "vimeo.OEmbedResponse": { "type": "object", "properties": { "author_name": { "type": "string" }, "author_url": { "type": "string" }, "description": { "type": "string" }, "duration": { "type": "integer" }, "height": { "type": "integer" }, "html": { "type": "string" }, "is_plus": { "type": "string" }, "provider_name": { "type": "string" }, "provider_url": { "type": "string" }, "thumbnail_height": { "type": "integer" }, "thumbnail_url": { "type": "string" }, "thumbnail_width": { "type": "integer" }, "title": { "type": "string" }, "type": { "type": "string" }, "version": { "type": "string" }, "video_id": { "type": "integer" }, "width": { "type": "integer" } } } }, "securityDefinitions": { "Bearer": { "type": "apiKey", "name": "Authorization", "in": "header" } } }` // SwaggerInfo holds exported Swagger Info so clients can modify it var SwaggerInfo = &swag.Spec{ Version: "1.0.1", Host: "", BasePath: "", Schemes: []string{}, Title: "Rezina API", Description: "Rezina LMS API. Learning content follows course -> chapter -> lesson with chapter-only quizzes and no course category selection. Admin panel endpoints use /api/v1/admin; customer web and mobile endpoints retain /api/v1. Use the audience-specific Swagger pages to browse each API. For protected endpoints, enter Bearer followed by a space and the access token in Authorize.", InfoInstanceName: "swagger", SwaggerTemplate: docTemplate, LeftDelim: "{{", RightDelim: "}}", } func init() { swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo) }