/* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ import type { AccessTimesHeatmap } from '../models/AccessTimesHeatmap'; import type { ActiveUsersList } from '../models/ActiveUsersList'; import type { ActiveUsersPerCourse } from '../models/ActiveUsersPerCourse'; import type { ActivityAPI } from '../models/ActivityAPI'; import type { AnalyticsOverview } from '../models/AnalyticsOverview'; import type { Average } from '../models/Average'; import type { AverageOvertime } from '../models/AverageOvertime'; import type { AvgCourseGradeWithCutoff } from '../models/AvgCourseGradeWithCutoff'; import type { BaseFinanceResponse } from '../models/BaseFinanceResponse'; import type { ChatHistoryFilterData } from '../models/ChatHistoryFilterData'; import type { ContentDetailsResponse } from '../models/ContentDetailsResponse'; import type { ContentResponse } from '../models/ContentResponse'; import type { ConversationDetailResponse } from '../models/ConversationDetailResponse'; import type { ConversationListResponse } from '../models/ConversationListResponse'; import type { ConversationMessage } from '../models/ConversationMessage'; import type { Conversations } from '../models/Conversations'; import type { ConversationsChart } from '../models/ConversationsChart'; import type { ConversationSummary } from '../models/ConversationSummary'; import type { ConversationVolume } from '../models/ConversationVolume'; import type { Cost } from '../models/Cost'; import type { CostPerTenant } from '../models/CostPerTenant'; import type { Count } from '../models/Count'; import type { CourseCompletionPerCourse } from '../models/CourseCompletionPerCourse'; import type { CourseCompletionSummaryOvertime } from '../models/CourseCompletionSummaryOvertime'; import type { CourseGradeSummary } from '../models/CourseGradeSummary'; import type { CourseGradingDetail } from '../models/CourseGradingDetail'; import type { CurrentUsersResponse } from '../models/CurrentUsersResponse'; import type { DetailedGradeView } from '../models/DetailedGradeView'; import type { EngagementPerCourse } from '../models/EngagementPerCourse'; import type { Enrollments } from '../models/Enrollments'; import type { EnrollmentsPerUser } from '../models/EnrollmentsPerUser'; import type { FinanceDetailsResponse } from '../models/FinanceDetailsResponse'; import type { GradingPerUser } from '../models/GradingPerUser'; import type { GroupList } from '../models/GroupList'; import type { InvoiceReportResponse } from '../models/InvoiceReportResponse'; import type { LearnerAnalyticsResponse } from '../models/LearnerAnalyticsResponse'; import type { LearnerDetailsResponse } from '../models/LearnerDetailsResponse'; import type { LearnerInformationAPI } from '../models/LearnerInformationAPI'; import type { LearnerListResponse } from '../models/LearnerListResponse'; import type { LLMTracesListResponse } from '../models/LLMTracesListResponse'; import type { LlmUsageAnalyticsResponse } from '../models/LlmUsageAnalyticsResponse'; import type { MentorDetailAnalytics } from '../models/MentorDetailAnalytics'; import type { MessageStatistics } from '../models/MessageStatistics'; import type { ModelCost } from '../models/ModelCost'; import type { NewPerLearnerList } from '../models/NewPerLearnerList'; import type { Observation } from '../models/Observation'; import type { OvertimeWithChangeInfo } from '../models/OvertimeWithChangeInfo'; import type { OverTimeWithTotal } from '../models/OverTimeWithTotal'; import type { PaginatedConversationsList } from '../models/PaginatedConversationsList'; import type { PaginatedObservationList } from '../models/PaginatedObservationList'; import type { PaginatedTopicStatisticsResponse } from '../models/PaginatedTopicStatisticsResponse'; import type { PaginatedTraceList } from '../models/PaginatedTraceList'; import type { PatchedConversations } from '../models/PatchedConversations'; import type { PerformanceGradesPerCourse } from '../models/PerformanceGradesPerCourse'; import type { PerlearnerCourseProgress } from '../models/PerlearnerCourseProgress'; import type { PerLearnerCourseVideosWatched } from '../models/PerLearnerCourseVideosWatched'; import type { PerlearnerEngagementVideosWatchedPerCourse } from '../models/PerlearnerEngagementVideosWatchedPerCourse'; import type { PerlearnerGradeSummary } from '../models/PerlearnerGradeSummary'; import type { PerlearnerGradeWithCutOff } from '../models/PerlearnerGradeWithCutOff'; import type { PerlearnerGradingPerCourseAPI } from '../models/PerlearnerGradingPerCourseAPI'; import type { PerLearnerLastAccess } from '../models/PerLearnerLastAccess'; import type { PerLearnerTimeSpentInCourseTree } from '../models/PerLearnerTimeSpentInCourseTree'; import type { PerlearnerUserList } from '../models/PerlearnerUserList'; import type { PieChartData } from '../models/PieChartData'; import type { RatingRecord } from '../models/RatingRecord'; import type { RatingsOvertime } from '../models/RatingsOvertime'; import type { ReportCreate } from '../models/ReportCreate'; import type { ReportRequest } from '../models/ReportRequest'; import type { SentimentSummary } from '../models/SentimentSummary'; import type { SessionsChart } from '../models/SessionsChart'; import type { StudentChatMessage } from '../models/StudentChatMessage'; import type { TenantMentorTraces } from '../models/TenantMentorTraces'; import type { TimeDetail } from '../models/TimeDetail'; import type { TimeSpentByUsersInCourse } from '../models/TimeSpentByUsersInCourse'; import type { TimeSpentPerCourse } from '../models/TimeSpentPerCourse'; import type { TimeSpentPerUserResponse } from '../models/TimeSpentPerUserResponse'; import type { TimeSpentUpdateRequest } from '../models/TimeSpentUpdateRequest'; import type { TimeSpentUpdateResponse } from '../models/TimeSpentUpdateResponse'; import type { TopicDetails } from '../models/TopicDetails'; import type { TopicRecord } from '../models/TopicRecord'; import type { TopicsOverview } from '../models/TopicsOverview'; import type { TopicStatisticsResponse } from '../models/TopicStatisticsResponse'; import type { TopicSummaryView } from '../models/TopicSummaryView'; import type { Trace } from '../models/Trace'; import type { TrendEntry } from '../models/TrendEntry'; import type { UserChatByPeriod } from '../models/UserChatByPeriod'; import type { UserChatFeedbackCount } from '../models/UserChatFeedbackCount'; import type { UserChatHistoryFilterData } from '../models/UserChatHistoryFilterData'; import type { UserCountRecord } from '../models/UserCountRecord'; import type { UserDetail } from '../models/UserDetail'; import type { UserMetricsResponse } from '../models/UserMetricsResponse'; import type { UserReportListResponse } from '../models/UserReportListResponse'; import type { UserSentimentCountView } from '../models/UserSentimentCountView'; import type { UserTrendByPeriod } from '../models/UserTrendByPeriod'; import type { Value } from '../models/Value'; import type { VideoEngagementPerCourse } from '../models/VideoEngagementPerCourse'; import type { VideosCount } from '../models/VideosCount'; import type { VideosInCourseSummary } from '../models/VideosInCourseSummary'; import type { VideosSpecificCourse } from '../models/VideosSpecificCourse'; import type { WatchedVideosPerCourse } from '../models/WatchedVideosPerCourse'; import type { WatchedVideosPerUser } from '../models/WatchedVideosPerUser'; import type { CancelablePromise } from '../core/CancelablePromise'; import { OpenAPI } from '../core/OpenAPI'; import { request as __request } from '../core/request'; export class AiAnalyticsService { /** * Get active user counts over time. * * This endpoint provides daily counts of active users (users with known activity) * over a specified time period. * * Query Parameters: * start_date (str, optional): Start date for the time range (ISO format) * end_date (str, optional): End date for the time range (ISO format) * * Returns: * Daily active user counts over the specified time period, with change metrics * compared to previous periods. * * Default time range is the last 7 days if no dates are specified. * * An active user is defined as a user with any activity within the past 30 days. * @returns OvertimeWithChangeInfo * @throws ApiError */ public static aiAnalyticsAudienceOrgsActiveUsersOverTimeRetrieve({ org, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/audience/orgs/{org}/active-users/over-time', path: { 'org': org, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * Get active user counts on a per-course basis. * * This endpoint provides counts of active users for each course within * the specified date range. * * Query Parameters: * start_date (str, optional): Start date for filtering (ISO format) * end_date (str, optional): End date for filtering (ISO format) * * Returns: * A list of courses with their active user counts. * * Default time range is the last 7 days if no dates are specified. * @returns ActiveUsersPerCourse * @throws ApiError */ public static aiAnalyticsAudienceOrgsActiveUsersPerCourseRetrieve({ org, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/audience/orgs/{org}/active-users/per-course', path: { 'org': org, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * Get a list of active users with activity metrics. * * This endpoint provides a paginated list of users who have had activity * within the specified date range. * * Query Parameters: * start_date (str, optional): Start date for filtering (ISO format) * end_date (str, optional): End date for filtering (ISO format) * course_id (str, optional): Filter by course ID * page (int, optional): Page number for pagination * length (int, optional): Number of items per page * * Returns: * A paginated list of active users with their activity metrics. * * Default time range is the last 7 days if no dates are specified. * @returns ActiveUsersList * @throws ApiError */ public static aiAnalyticsAudienceOrgsActiveUsersUsersRetrieve({ org, departmentId, format = 'json', includeMainPlatform = true, length, page, }: { org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * Size of data to return */ length?: number, /** * Page offset */ page?: number, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/audience/orgs/{org}/active-users/users', path: { 'org': org, }, query: { 'department_id': departmentId, 'format': format, 'include_main_platform': includeMainPlatform, 'length': length, 'page': page, }, }); } /** * Get enrollment or unenrollment counts over time. * * This endpoint provides daily counts of new enrollments or unenrollments * over a specified time period. * * Query Parameters: * start_date (str, optional): Start date for the time range (ISO format) * end_date (str, optional): End date for the time range (ISO format) * course_id (str, optional): Filter by course ID * active (bool): Get enrollments when true, unenrollments when false * * Returns: * Daily counts over the specified time period, with change metrics * compared to previous periods. * * Default time range is the last 7 days if no dates are specified. * @returns OvertimeWithChangeInfo * @throws ApiError */ public static aiAnalyticsAudienceOrgsEnrollmentsCoursesOverTimeRetrieve({ courseId, org, active = 'y', departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { courseId: string, org: string, /** * Any of `y`, `yes`, `true`. set to false or no for unenrollments * * * `y` - y * * `yes` - yes * * `true` - true * * `True` - True * * `n` - n * * `no` - no * * `false` - false * * `False` - False */ active?: 'y' | 'yes' | 'true' | 'True' | 'n' | 'no' | 'false' | 'False', /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/audience/orgs/{org}/enrollments/courses/{course_id}/over-time', path: { 'course_id': courseId, 'org': org, }, query: { 'active': active, 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * List users enrolled in a specific course. * * This endpoint provides a list of users who are enrolled or unenrolled * in a specified course. * * Query Parameters: * course_id (str): The course ID to get enrollments for * active (bool): Filter for active enrollments when true, inactive when false * page (int, optional): Page number for pagination * length (int, optional): Number of items per page * * Returns: * A paginated list of users with: * - Username * - Full name * - Email * - Enrollment timestamp * @returns EnrollmentsPerUser * @throws ApiError */ public static aiAnalyticsAudienceOrgsEnrollmentsCoursesUsersRetrieve({ courseId, org, active = 'y', departmentId, endDate, format = 'json', includeMainPlatform = true, length, page, startDate, }: { courseId: string, org: string, /** * Any of `y`, `yes`, `true`. set to false or no for unenrollments * * * `y` - y * * `yes` - yes * * `true` - true * * `True` - True * * `n` - n * * `no` - no * * `false` - false * * `False` - False */ active?: 'y' | 'yes' | 'true' | 'True' | 'n' | 'no' | 'false' | 'False', /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * Size of data to return */ length?: number, /** * Page offset */ page?: number, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/audience/orgs/{org}/enrollments/courses/{course_id}/users', path: { 'course_id': courseId, 'org': org, }, query: { 'active': active, 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'length': length, 'page': page, 'start_date': startDate, }, }); } /** * Get enrollment or unenrollment counts over time. * * This endpoint provides daily counts of new enrollments or unenrollments * over a specified time period. * * Query Parameters: * start_date (str, optional): Start date for the time range (ISO format) * end_date (str, optional): End date for the time range (ISO format) * course_id (str, optional): Filter by course ID * active (bool): Get enrollments when true, unenrollments when false * * Returns: * Daily counts over the specified time period, with change metrics * compared to previous periods. * * Default time range is the last 7 days if no dates are specified. * @returns OvertimeWithChangeInfo * @throws ApiError */ public static aiAnalyticsAudienceOrgsEnrollmentsOverTimeRetrieve({ org, active = 'y', departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { org: string, /** * Any of `y`, `yes`, `true`. set to false or no for unenrollments * * * `y` - y * * `yes` - yes * * `true` - true * * `True` - True * * `n` - n * * `no` - no * * `false` - false * * `False` - False */ active?: 'y' | 'yes' | 'true' | 'True' | 'n' | 'no' | 'false' | 'False', /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/audience/orgs/{org}/enrollments/over-time', path: { 'org': org, }, query: { 'active': active, 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * List enrollment statistics on a per-course basis. * * This endpoint provides enrollment counts for all courses, with options * to filter for active or inactive enrollments and to include time-based data. * * Query Parameters: * active (bool): Filter for active enrollments when true, inactive when false * start_date (str, optional): Start date for time-based filtering (ISO format) * end_date (str, optional): End date for time-based filtering (ISO format) * page (int, optional): Page number for pagination * length (int, optional): Number of items per page * * Returns: * A paginated list of courses with their enrollment counts and percentages. * @returns Enrollments * @throws ApiError */ public static aiAnalyticsAudienceOrgsEnrollmentsPerCourseRetrieve({ org, active = 'y', departmentId, endDate, format = 'json', includeMainPlatform = true, length, page, startDate, }: { org: string, /** * Any of `y`, `yes`, `true`. set to false or no for unenrollments * * * `y` - y * * `yes` - yes * * `true` - true * * `True` - True * * `n` - n * * `no` - no * * `false` - false * * `False` - False */ active?: 'y' | 'yes' | 'true' | 'True' | 'n' | 'no' | 'false' | 'False', /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * Size of data to return */ length?: number, /** * Page offset */ page?: number, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/audience/orgs/{org}/enrollments/per-course', path: { 'org': org, }, query: { 'active': active, 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'length': length, 'page': page, 'start_date': startDate, }, }); } /** * List all learners on the platform with aggregated metrics. * * This endpoint returns a paginated list of all learners with key metrics including: * - Enrollment counts * - Completion counts * - Time spent on platform * * Query Parameters: * page (int): Page number for pagination * length (int): Number of items per page * search (str): Filter learners by username, email, or name * * Returns: * A paginated list of learners with their associated metrics. * @returns PerlearnerUserList * @throws ApiError */ public static aiAnalyticsAudienceOrgsRegisteredUsersRetrieve({ org, departmentId, format = 'json', includeMainPlatform = true, length, page, search, }: { org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * Size of data to return */ length?: number, /** * Page offset */ page?: number, /** * Search string for learner */ search?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/audience/orgs/{org}/registered-users/', path: { 'org': org, }, query: { 'department_id': departmentId, 'format': format, 'include_main_platform': includeMainPlatform, 'length': length, 'page': page, 'search': search, }, }); } /** * Get registered user counts over time. * * This endpoint provides daily counts of new user registrations over a * specified time period. * * Query Parameters: * start_date (str, optional): Start date for the time range (ISO format) * end_date (str, optional): End date for the time range (ISO format) * * Returns: * Daily registration counts over the specified time period, with change metrics * compared to previous periods. * * Default time range is the last 7 days if no dates are specified. * @returns OvertimeWithChangeInfo * @throws ApiError */ public static aiAnalyticsAudienceOrgsRegisteredUsersOverTimeRetrieve({ org, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/audience/orgs/{org}/registered-users/over-time', path: { 'org': org, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * List enrollment statistics on a per-course basis. * * This endpoint provides enrollment counts for all courses, with options * to filter for active or inactive enrollments and to include time-based data. * * Query Parameters: * active (bool): Filter for active enrollments when true, inactive when false * start_date (str, optional): Start date for time-based filtering (ISO format) * end_date (str, optional): End date for time-based filtering (ISO format) * page (int, optional): Page number for pagination * length (int, optional): Number of items per page * * Returns: * A paginated list of courses with their enrollment counts and percentages. * @returns Enrollments * @throws ApiError */ public static aiAnalyticsAudienceOrgsRegisteredUsersPerCourseRetrieve({ org, active = 'y', departmentId, endDate, format = 'json', includeMainPlatform = true, length, page, startDate, }: { org: string, /** * Any of `y`, `yes`, `true`. set to false or no for unenrollments * * * `y` - y * * `yes` - yes * * `true` - true * * `True` - True * * `n` - n * * `no` - no * * `false` - false * * `False` - False */ active?: 'y' | 'yes' | 'true' | 'True' | 'n' | 'no' | 'false' | 'False', /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * Size of data to return */ length?: number, /** * Page offset */ page?: number, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/audience/orgs/{org}/registered-users/per-course', path: { 'org': org, }, query: { 'active': active, 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'length': length, 'page': page, 'start_date': startDate, }, }); } /** * Retrieve paginated LLM usage costs aggregated by tenant. * @returns CostPerTenant * @throws ApiError */ public static aiAnalyticsCostsPertenantList({ endDate, startDate, }: { endDate: string, startDate: string, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/costs/pertenant/', query: { 'end_date': endDate, 'start_date': startDate, }, errors: { 400: `Invalid parameters`, }, }); } /** * Get a list of departments with metrics and filtering options. * * This endpoint provides a paginated list of departments with aggregated metrics * about learner performance, course completions, and skill acquisition. * * Query Parameters: * page (int, optional): Page number for pagination * length (int, optional): Number of items per page * program (str, optional): Filter by program * pathway (str, optional): Filter by pathway * departments (list, optional): Filter by department ids * department_id (str, optional): Filter by department id * location (str, optional): Filter by location * is_enrolled (bool, optional): Filter for departments with enrolled users * start_date (date, optional): Filter by learner join date (start range) * end_date (date, optional): Filter by learner join date (end range) * * Returns: * A paginated list of departments with comprehensive metrics. * @returns GroupList * @throws ApiError */ public static aiAnalyticsDepartmentsOrgsRetrieve({ org, departmentId, departments, endDate, format = 'json', includeMainPlatform = true, isEnrolled, length, location, page, pathway, program, startDate, }: { org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * Departments search string. Single string or list of strings. e.g 'sample_department' or `['department', 'another department']` */ departments?: Array, /** * Filter by learners date_joined. Start date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * Filter for users who have at least an enro;lment */ isEnrolled?: boolean | null, /** * Size of data to return */ length?: number, /** * Location search string */ location?: string, /** * Page offset */ page?: number, /** * Pathway string */ pathway?: string, /** * Program search string */ program?: string, /** * Filter by learners date_joined. Start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/departments/orgs/{org}/', path: { 'org': org, }, query: { 'department_id': departmentId, 'departments': departments, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'is_enrolled': isEnrolled, 'length': length, 'location': location, 'page': page, 'pathway': pathway, 'program': program, 'start_date': startDate, }, }); } /** * Get engagement metrics on a per-course basis. * * This endpoint provides a paginated list of courses with engagement metrics * including activity counts, time spent, and interaction data. * * Query Parameters: * page (int, optional): Page number for pagination * length (int, optional): Number of items per page * * Returns: * A paginated list of courses with their engagement metrics. * @returns EngagementPerCourse * @throws ApiError */ public static aiAnalyticsEngagementOrgsActivityRetrieve({ org, departmentId, format = 'json', includeMainPlatform = true, length, page, }: { org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * Size of data to return */ length?: number, /** * Page offset */ page?: number, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/engagement/orgs/{org}/activity', path: { 'org': org, }, query: { 'department_id': departmentId, 'format': format, 'include_main_platform': includeMainPlatform, 'length': length, 'page': page, }, }); } /** * Completion count per user per course across the platform * * Query Params * 1. start_date e.g 2020-10-01 * 2. end_date e.g 2020-10-10 * * Default result when no query param is added is last_7_days (today inclusive) * @returns OvertimeWithChangeInfo * @throws ApiError */ public static aiAnalyticsEngagementOrgsCourseCompletionOverTimeRetrieve({ org, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/engagement/orgs/{org}/course_completion/over-time', path: { 'org': org, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * List course completion metrics on a per-course basis. * * This endpoint provides a paginated table of courses with enrollment and * completion statistics for each course. * * Returns: * A paginated list of courses with: * - Course identification (ID and name) * - Enrollment count * - Completion count * - Average completion rate * @returns CourseCompletionPerCourse * @throws ApiError */ public static aiAnalyticsEngagementOrgsCourseCompletionPerCourseRetrieve({ org, departmentId, format = 'json', includeMainPlatform = true, length, page, }: { org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * Size of data to return */ length?: number, /** * Page offset */ page?: number, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/engagement/orgs/{org}/course_completion/per-course', path: { 'org': org, }, query: { 'department_id': departmentId, 'format': format, 'include_main_platform': includeMainPlatform, 'length': length, 'page': page, }, }); } /** * Average time spent in secs on a per-day basis * * Query Params * 1. start_date e.g 2020-10-01 * 2. end_date e.g 2020-10-10 * 3. course_id * * Default result when no query param is added is last_7_days (today inclusive) * @returns AverageOvertime * @throws ApiError */ public static aiAnalyticsEngagementOrgsCoursesTimeAverageRetrieve({ courseId, org, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { courseId: string, org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/engagement/orgs/{org}/courses/{course_id}/time/average', path: { 'course_id': courseId, 'org': org, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * Time spent per course in secs in a tree like form * * Kwargs * course_id e.g course-v1:Org+Course4+Run * * Query Params * 1. start_date e.g 2020-10-01 * 2. end_date e.g 2020-10-10 * @returns TimeDetail * @throws ApiError */ public static aiAnalyticsEngagementOrgsCoursesTimeDetailRetrieve({ courseId, org, departmentId, format = 'json', includeMainPlatform = true, }: { courseId: string, org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/engagement/orgs/{org}/courses/{course_id}/time/detail', path: { 'course_id': courseId, 'org': org, }, query: { 'department_id': departmentId, 'format': format, 'include_main_platform': includeMainPlatform, }, }); } /** * Time spent per course in secs on a per-day basis * * Query Params * 1. start_date e.g 2020-10-01 * 2. end_date e.g 2020-10-10 * Kwargs * 3. course_id * * Default result when no query param is added is last_7_days (today inclusive) * @returns OverTimeWithTotal * @throws ApiError */ public static aiAnalyticsEngagementOrgsCoursesTimeOverTimeRetrieve({ courseId, org, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { courseId: string, org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/engagement/orgs/{org}/courses/{course_id}/time/over-time', path: { 'course_id': courseId, 'org': org, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * Time spent by users in a course * * Query Params * course_id e.g course-v1:Org+Course4+Run * @returns TimeSpentByUsersInCourse * @throws ApiError */ public static aiAnalyticsEngagementOrgsCoursesTimeUsersRetrieve({ courseId, org, departmentId, endDate, format = 'json', includeMainPlatform = true, length, page, startDate, }: { courseId: string, org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * Size of data to return */ length?: number, /** * Page offset */ page?: number, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/engagement/orgs/{org}/courses/{course_id}/time/users', path: { 'course_id': courseId, 'org': org, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'length': length, 'page': page, 'start_date': startDate, }, }); } /** * Time spent within a course in ordered hierarchical format * * Kwargs * 1. course_id e.g course-v1:Org+Course4+Run * 2. user_id e.g developer@ibleducation.com or dev123 (username|email) * Query Params * 3. start_date e.g 2020-10-01 * 4. end_date e.g 2020-10-10 * @returns PerLearnerTimeSpentInCourseTree * @throws ApiError */ public static aiAnalyticsEngagementOrgsCoursesTimeUsersDetailRetrieve({ courseId, org, userId, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { courseId: string, org: string, userId: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/engagement/orgs/{org}/courses/{course_id}/time/users/{user_id}/detail', path: { 'course_id': courseId, 'org': org, 'user_id': userId, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * Time spent in secs on a per-day basis * * Query Params * 1. course_id e.g course-v1:Org+Course4+Run * 2. user_id e.g developer@ibleducation.com or dev123 (username|email) * 3. start_date e.g 2020-10-01 * 4. end_date e.g 2020-10-10 * * Default result when no query param is added is last_7_days (today inclusive) * @returns OverTimeWithTotal * @throws ApiError */ public static aiAnalyticsEngagementOrgsCoursesTimeUsersOverTimeRetrieve({ courseId, org, userId, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { courseId: string, org: string, userId: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/engagement/orgs/{org}/courses/{course_id}/time/users/{user_id}/over-time', path: { 'course_id': courseId, 'org': org, 'user_id': userId, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * Get video engagement metrics for a specific course. * * This endpoint provides detailed video engagement statistics for a single course, * including view counts, completion rates, and time spent on videos. * * Query Parameters: * course_id (str): The course ID to get video engagement data for * * Returns: * Detailed video engagement metrics for the specified course. * @returns VideosSpecificCourse * @throws ApiError */ public static aiAnalyticsEngagementOrgsCoursesVideosRetrieve({ courseId, org, departmentId, format = 'json', includeMainPlatform = true, }: { courseId: string, org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/engagement/orgs/{org}/courses/{course_id}/videos/', path: { 'course_id': courseId, 'org': org, }, query: { 'department_id': departmentId, 'format': format, 'include_main_platform': includeMainPlatform, }, }); } /** * Get video watch counts over time. * * This endpoint provides daily counts of videos watched over a specified time period, * with options to filter by course or user. * * Query Parameters: * start_date (str, optional): Start date for the time range (ISO format) * end_date (str, optional): End date for the time range (ISO format) * course_id (str, optional): Filter by course ID * user_id (str, optional): Filter by username or email * * Returns: * Daily video watch counts over the specified time period. * * Default time range is the last 7 days if no dates are specified. * * Access Control: * - Platform admins can access any video watch data * - Learners can access their own video watch data * @returns OverTimeWithTotal * @throws ApiError */ public static aiAnalyticsEngagementOrgsCoursesVideosOverTimeRetrieve({ courseId, org, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { courseId: string, org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/engagement/orgs/{org}/courses/{course_id}/videos/over-time', path: { 'course_id': courseId, 'org': org, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * Get a summary of video watch statistics for a specific course. * * This endpoint provides a structured summary of video watch data for a course, * organized in a tree-like format by course sections and subsections. * * Query Parameters: * course_id (str): The course ID to get video summary for * * Returns: * A hierarchical structure of video watch data for the course, including: * - Section and subsection organization * - Video identification and metadata * - Watch counts and completion rates * @returns VideosInCourseSummary * @throws ApiError */ public static aiAnalyticsEngagementOrgsCoursesVideosSummaryRetrieve({ courseId, org, departmentId, format = 'json', includeMainPlatform = true, }: { courseId: string, org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/engagement/orgs/{org}/courses/{course_id}/videos/summary', path: { 'course_id': courseId, 'org': org, }, query: { 'department_id': departmentId, 'format': format, 'include_main_platform': includeMainPlatform, }, }); } /** * List of users' videos completed records for a specific course * * Kwargs * course_id e.g course-v1:Org+Course4+Run * @returns WatchedVideosPerUser * @throws ApiError */ public static aiAnalyticsEngagementOrgsCoursesVideosUsersRetrieve({ courseId, org, departmentId, format = 'json', includeMainPlatform = true, }: { courseId: string, org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/engagement/orgs/{org}/courses/{course_id}/videos/users', path: { 'course_id': courseId, 'org': org, }, query: { 'department_id': departmentId, 'format': format, 'include_main_platform': includeMainPlatform, }, }); } /** * Average time spent by a learner in enrolled courses. Gives a rough estimate of whats the average time * that would be spent by a learner in a course * * Query Params * 1. start_date e.g 2020-10-01 * 2. end_date e.g 2020-10-10 * @returns AverageOvertime * @throws ApiError */ public static aiAnalyticsEngagementOrgsTimeAveragePerlearnerPercourseRetrieve({ org, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/engagement/orgs/{org}/time/average-perlearner-percourse', path: { 'org': org, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * Average time spent in secs on a per-day basis * * Query Params * 1. start_date e.g 2020-10-01 * 2. end_date e.g 2020-10-10 * 3. course_id * * Default result when no query param is added is last_7_days (today inclusive) * @returns AverageOvertime * @throws ApiError */ public static aiAnalyticsEngagementOrgsTimeAverageWithOverTimeRetrieve({ org, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/engagement/orgs/{org}/time/average-with-over-time', path: { 'org': org, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * Get time spent on the platform over time. * * This endpoint provides daily time spent values (in seconds) across the * platform over a specified time period. * * Query Parameters: * start_date (str, optional): Start date for the time range (ISO format) * end_date (str, optional): End date for the time range (ISO format) * * Returns: * Daily time spent values over the specified time period, with change metrics * compared to previous periods. * * Default time range is the last 7 days if no dates are specified. * @returns OvertimeWithChangeInfo * @throws ApiError */ public static aiAnalyticsEngagementOrgsTimeOverTimeRetrieve({ org, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/engagement/orgs/{org}/time/over-time', path: { 'org': org, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * Get time spent statistics on a per-course basis. * * This endpoint provides a paginated list of courses with the total time * spent by users in each course. * * Query Parameters: * start_date (str, optional): Start date for filtering (ISO format) * end_date (str, optional): End date for filtering (ISO format) * page (int, optional): Page number for pagination * length (int, optional): Number of items per page * * Returns: * A paginated list of courses with: * - Course identification (ID and name) * - Total time spent (in seconds) * - Formatted time spent (human-readable) * - Percentage of total platform time * @returns TimeSpentPerCourse * @throws ApiError */ public static aiAnalyticsEngagementOrgsTimePerCourseRetrieve({ org, departmentId, endDate, format = 'json', includeMainPlatform = true, length, page, startDate, }: { org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * Size of data to return */ length?: number, /** * Page offset */ page?: number, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/engagement/orgs/{org}/time/per-course', path: { 'org': org, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'length': length, 'page': page, 'start_date': startDate, }, }); } /** * Get video engagement metrics on a per-course basis. * * This endpoint provides a paginated list of courses with video engagement metrics * including view counts, completion rates, and time spent on videos. * * Query Parameters: * page (int, optional): Page number for pagination * length (int, optional): Number of items per page * * Returns: * A paginated list of courses with their video engagement metrics. * @returns VideoEngagementPerCourse * @throws ApiError */ public static aiAnalyticsEngagementOrgsVideosRetrieve({ org, departmentId, format = 'json', includeMainPlatform = true, length, page, }: { org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * Size of data to return */ length?: number, /** * Page offset */ page?: number, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/engagement/orgs/{org}/videos/', path: { 'org': org, }, query: { 'department_id': departmentId, 'format': format, 'include_main_platform': includeMainPlatform, 'length': length, 'page': page, }, }); } /** * Get video watch counts over time. * * This endpoint provides daily counts of videos watched over a specified time period, * with options to filter by course or user. * * Query Parameters: * start_date (str, optional): Start date for the time range (ISO format) * end_date (str, optional): End date for the time range (ISO format) * course_id (str, optional): Filter by course ID * user_id (str, optional): Filter by username or email * * Returns: * Daily video watch counts over the specified time period. * * Default time range is the last 7 days if no dates are specified. * * Access Control: * - Platform admins can access any video watch data * - Learners can access their own video watch data * @returns OverTimeWithTotal * @throws ApiError */ public static aiAnalyticsEngagementOrgsVideosOverTimeRetrieve({ org, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/engagement/orgs/{org}/videos/over-time', path: { 'org': org, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * Retrieve summary statistics about mentors. * * This endpoint returns aggregated statistics about mentors within an organization, * including total mentors, active mentors (mentors with at least one session), * questions answered, and ratings. * * Args: * request: The HTTP request. * org: Organization key identifier. * * Returns: * Response: Summary statistics about mentors. * * Raises: * NotFound: If the specified organization does not exist. * @returns MentorDetailAnalytics * @throws ApiError */ public static aiAnalyticsOrgsUsersAgentDetailRetrieve({ org, userId, }: { org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/orgs/{org}/users/{user_id}/agent-detail/', path: { 'org': org, 'user_id': userId, }, errors: { 404: `Organization not found`, }, }); } /** * Retrieve summary statistics about mentors. * * This endpoint returns aggregated statistics about mentors within an organization, * including total mentors, active mentors (mentors with at least one session), * questions answered, and ratings. * * Args: * request: The HTTP request. * org: Organization key identifier. * * Returns: * Response: Summary statistics about mentors. * * Raises: * NotFound: If the specified organization does not exist. * @returns MentorDetailAnalytics * @throws ApiError */ public static aiAnalyticsOrgsUsersAgentSummaryRetrieve({ org, userId, }: { org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/orgs/{org}/users/{user_id}/agent-summary/', path: { 'org': org, 'user_id': userId, }, errors: { 404: `Organization not found`, }, }); } /** * Retrieve LLM usage costs for a specific mentor. * * This endpoint returns data on the total cost of LLM usage for a specific mentor * within a specified date range. The cost is calculated by summing the costs * of all observations associated with traces from the tenant's sessions. * * Args: * request: The HTTP request containing filter query parameters. * org: Organization key identifier. * mentor_unique_id: User key identifier. * * Returns: * Response: Total LLM usage cost for the specified tenant. * * Raises: * NotFound: If the specified organization does not exist. * BadRequest: If the provided parameters are invalid. * * Query Parameters: * start_date (str): Start date for filtering (YYYY-MM-DD) - required. * end_date (str): End date for filtering (YYYY-MM-DD) - required. * @returns Cost * @throws ApiError */ public static aiAnalyticsOrgsUsersAgentsCostRetrieve({ endDate, mentorUniqueId, org, startDate, userId, }: { endDate: string, mentorUniqueId: string, org: string, startDate: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/orgs/{org}/users/{user_id}/agents/{mentor_unique_id}/cost/', path: { 'mentor_unique_id': mentorUniqueId, 'org': org, 'user_id': userId, }, query: { 'end_date': endDate, 'start_date': startDate, }, errors: { 400: `Invalid parameters`, 404: `Organization not found`, }, }); } /** * Retrieve average message counts per session over time. * * This endpoint returns data on the average number of messages exchanged in each * conversation session within a specified date range, with options for filtering * by mentor and aggregating by different time periods (hourly, daily, weekly). * * Args: * request: The HTTP request containing filter query parameters. * org: Organization key identifier. * * Returns: * Response: Time series of average message counts and session totals. * * Raises: * NotFound: If the specified organization does not exist. * BadRequest: If the provided parameters are invalid. * * Query Parameters: * start_date (str): Start date for filtering (YYYY-MM-DD) - required. * end_date (str): End date for filtering (YYYY-MM-DD) - required. * mentor_id (str): Filter by mentor unique ID. * aggregation (str): Time aggregation level (hourly, daily, weekly) - default: daily. * @returns MessageStatistics * @throws ApiError */ public static aiAnalyticsOrgsUsersAverageMessagesPerSessionList({ endDate, org, startDate, userId, aggregation = 'daily', groupBy = 'day', mentorId, }: { /** * End date for filtering (YYYY-MM-DD) */ endDate: string, org: string, /** * Start date for filtering (YYYY-MM-DD) */ startDate: string, userId: string, /** * Time aggregation level (hourly, daily, weekly) */ aggregation?: 'daily' | 'hourly' | 'weekly', groupBy?: string, /** * Filter by mentor unique ID */ mentorId?: string, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/orgs/{org}/users/{user_id}/average-messages-per-session/', path: { 'org': org, 'user_id': userId, }, query: { 'aggregation': aggregation, 'end_date': endDate, 'group_by': groupBy, 'mentor_id': mentorId, 'start_date': startDate, }, errors: { 400: `Invalid parameters`, 404: `Organization not found`, }, }); } /** * API viewset for retrieving and filtering chat message history. * * This viewset provides endpoints for retrieving chat message history * within an organization, with extensive filtering options by date range, * user, topic, mentor, and sentiment. * * Permissions: * - Restricted to platform administrators only * @returns PaginatedConversationsList * @throws ApiError */ public static aiAnalyticsOrgsUsersChatHistoryList({ org, userId, endDate, filterUserId, mentor, page, pageSize, sentiment, startDate, topics, }: { org: string, userId: string, endDate?: string, filterUserId?: string, mentor?: string, /** * A page number within the paginated result set. */ page?: number, /** * Number of results to return per page. */ pageSize?: number, sentiment?: string, startDate?: string, topics?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/orgs/{org}/users/{user_id}/chat-history/', path: { 'org': org, 'user_id': userId, }, query: { 'end_date': endDate, 'filter_user_id': filterUserId, 'mentor': mentor, 'page': page, 'page_size': pageSize, 'sentiment': sentiment, 'start_date': startDate, 'topics': topics, }, }); } /** * API viewset for retrieving and filtering chat message history. * * This viewset provides endpoints for retrieving chat message history * within an organization, with extensive filtering options by date range, * user, topic, mentor, and sentiment. * * Permissions: * - Restricted to platform administrators only * @returns Conversations * @throws ApiError */ public static aiAnalyticsOrgsUsersChatHistoryCreate({ org, userId, requestBody, endDate, filterUserId, mentor, sentiment, startDate, topics, }: { org: string, userId: string, requestBody: Conversations, endDate?: string, filterUserId?: string, mentor?: string, sentiment?: string, startDate?: string, topics?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-analytics/orgs/{org}/users/{user_id}/chat-history/', path: { 'org': org, 'user_id': userId, }, query: { 'end_date': endDate, 'filter_user_id': filterUserId, 'mentor': mentor, 'sentiment': sentiment, 'start_date': startDate, 'topics': topics, }, body: requestBody, mediaType: 'application/json', }); } /** * Retrieve filter options for chat message history. * * This endpoint returns data on available filter options for the chat message * history endpoint, including topics, date ranges (weekly or monthly), * sentiments, and users who have chat history. * * Args: * request: The HTTP request containing query parameters. * org: Organization key identifier. * * Returns: * Response: Available filter options for chat message history. * * Raises: * NotFound: If the specified organization does not exist. * * Query Parameters: * monthly_range (bool): Whether to return monthly or weekly date ranges. * mentor_id (str): Filter users by those who have chatted with a specific mentor. * @returns ChatHistoryFilterData * @throws ApiError */ public static aiAnalyticsOrgsUsersChatHistoryFilterRetrieve({ org, userId, endDate, mentorId, monthlyRange = false, startDate, }: { org: string, userId: string, endDate?: string, mentorId?: string, monthlyRange?: boolean, startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/orgs/{org}/users/{user_id}/chat-history-filter/', path: { 'org': org, 'user_id': userId, }, query: { 'end_date': endDate, 'mentor_id': mentorId, 'monthly_range': monthlyRange, 'start_date': startDate, }, errors: { 404: `Organization not found`, }, }); } /** * API viewset for retrieving and filtering chat message history. * * This viewset provides endpoints for retrieving chat message history * within an organization, with extensive filtering options by date range, * user, topic, mentor, and sentiment. * * Permissions: * - Restricted to platform administrators only * @returns Conversations * @throws ApiError */ public static aiAnalyticsOrgsUsersChatHistoryRetrieve({ id, org, userId, endDate, filterUserId, mentor, sentiment, startDate, topics, }: { id: string, org: string, userId: string, endDate?: string, filterUserId?: string, mentor?: string, sentiment?: string, startDate?: string, topics?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/orgs/{org}/users/{user_id}/chat-history/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, query: { 'end_date': endDate, 'filter_user_id': filterUserId, 'mentor': mentor, 'sentiment': sentiment, 'start_date': startDate, 'topics': topics, }, }); } /** * API viewset for retrieving and filtering chat message history. * * This viewset provides endpoints for retrieving chat message history * within an organization, with extensive filtering options by date range, * user, topic, mentor, and sentiment. * * Permissions: * - Restricted to platform administrators only * @returns Conversations * @throws ApiError */ public static aiAnalyticsOrgsUsersChatHistoryUpdate({ id, org, userId, requestBody, endDate, filterUserId, mentor, sentiment, startDate, topics, }: { id: string, org: string, userId: string, requestBody: Conversations, endDate?: string, filterUserId?: string, mentor?: string, sentiment?: string, startDate?: string, topics?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'PUT', url: '/api/ai-analytics/orgs/{org}/users/{user_id}/chat-history/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, query: { 'end_date': endDate, 'filter_user_id': filterUserId, 'mentor': mentor, 'sentiment': sentiment, 'start_date': startDate, 'topics': topics, }, body: requestBody, mediaType: 'application/json', }); } /** * API viewset for retrieving and filtering chat message history. * * This viewset provides endpoints for retrieving chat message history * within an organization, with extensive filtering options by date range, * user, topic, mentor, and sentiment. * * Permissions: * - Restricted to platform administrators only * @returns Conversations * @throws ApiError */ public static aiAnalyticsOrgsUsersChatHistoryPartialUpdate({ id, org, userId, endDate, filterUserId, mentor, sentiment, startDate, topics, requestBody, }: { id: string, org: string, userId: string, endDate?: string, filterUserId?: string, mentor?: string, sentiment?: string, startDate?: string, topics?: string, requestBody?: PatchedConversations, }): CancelablePromise { return __request(OpenAPI, { method: 'PATCH', url: '/api/ai-analytics/orgs/{org}/users/{user_id}/chat-history/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, query: { 'end_date': endDate, 'filter_user_id': filterUserId, 'mentor': mentor, 'sentiment': sentiment, 'start_date': startDate, 'topics': topics, }, body: requestBody, mediaType: 'application/json', }); } /** * API viewset for retrieving and filtering chat message history. * * This viewset provides endpoints for retrieving chat message history * within an organization, with extensive filtering options by date range, * user, topic, mentor, and sentiment. * * Permissions: * - Restricted to platform administrators only * @returns void * @throws ApiError */ public static aiAnalyticsOrgsUsersChatHistoryDestroy({ id, org, userId, endDate, filterUserId, mentor, sentiment, startDate, topics, }: { id: string, org: string, userId: string, endDate?: string, filterUserId?: string, mentor?: string, sentiment?: string, startDate?: string, topics?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'DELETE', url: '/api/ai-analytics/orgs/{org}/users/{user_id}/chat-history/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, query: { 'end_date': endDate, 'filter_user_id': filterUserId, 'mentor': mentor, 'sentiment': sentiment, 'start_date': startDate, 'topics': topics, }, }); } /** * Retrieve conversation volume data over time. * * This endpoint returns data on the number of conversations that occurred * within a specified date range, with options for different time aggregations * (hourly, daily, weekly). Results can be filtered by mentor. * * Args: * request: The HTTP request containing filter query parameters. * org: Organization key identifier. * user_id: User identifier (not used in the implementation). * * Returns: * Response: Time series data of conversation counts. * * Raises: * NotFound: If the specified organization does not exist. * BadRequest: If the provided parameters are invalid. * * Query Parameters: * start_date (str): Start date for filtering (YYYY-MM-DD) - required. * end_date (str): End date for filtering (YYYY-MM-DD) - required. * mentor_id (str): Filter by mentor unique ID. * aggregation (str): Time aggregation level (hourly, daily, weekly) - default: daily. * @returns ConversationVolume * @throws ApiError */ public static aiAnalyticsOrgsUsersConversationList({ endDate, org, startDate, userId, aggregation = 'daily', mentorId, }: { /** * End date for filtering (YYYY-MM-DD) */ endDate: string, org: string, /** * Start date for filtering (YYYY-MM-DD) */ startDate: string, userId: string, /** * Time aggregation level (hourly, daily, weekly) */ aggregation?: 'daily' | 'hourly' | 'weekly', /** * Filter by mentor unique ID */ mentorId?: string, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/orgs/{org}/users/{user_id}/conversation/', path: { 'org': org, 'user_id': userId, }, query: { 'aggregation': aggregation, 'end_date': endDate, 'mentor_id': mentorId, 'start_date': startDate, }, errors: { 400: `Invalid parameters`, 404: `Organization not found`, }, }); } /** * Retrieve a summary of conversation metrics. * * This endpoint returns aggregated metrics about conversations within an organization, * including: * - Total number of conversations * - Total number of human messages * - Total number of AI messages * * Results can be filtered by mentor. * * Args: * request: The HTTP request containing filter query parameters. * org: Organization key identifier. * * Returns: * Response: Summary of conversation metrics. * * Raises: * NotFound: If the specified organization does not exist. * * Query Parameters: * mentor_id (str): Filter by mentor unique ID. * @returns ConversationSummary * @throws ApiError */ public static aiAnalyticsOrgsUsersConversationSummaryRetrieve({ org, userId, groupBy = 'day', mentorId, }: { org: string, userId: string, groupBy?: string, /** * Filter by mentor unique ID */ mentorId?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/orgs/{org}/users/{user_id}/conversation-summary/', path: { 'org': org, 'user_id': userId, }, query: { 'group_by': groupBy, 'mentor_id': mentorId, }, errors: { 404: `Organization not found`, }, }); } /** * Retrieve the model costs for a tenant * * Filter parameters for period are start_date and enddate * * Accessible to tenant Admins only. * @returns ModelCost * @throws ApiError */ public static aiAnalyticsOrgsUsersCostsModelRetrieve({ endDate, org, startDate, userId, }: { endDate: string, org: string, startDate: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/orgs/{org}/users/{user_id}/costs/model/', path: { 'org': org, 'user_id': userId, }, query: { 'end_date': endDate, 'start_date': startDate, }, }); } /** * Retrieve LLM usage costs aggregated by mentor. * * This endpoint returns data on the total cost of LLM usage for each mentor * within a specified date range, with pagination support. The costs are * calculated by summing the costs of all observations associated with * traces from the mentor's sessions. * * Args: * request: The HTTP request containing filter query parameters. * org: Organization key identifier. * * Returns: * Response: Paginated list of mentors with their total LLM usage costs. * * Raises: * NotFound: If the specified organization does not exist. * BadRequest: If the provided parameters are invalid. * * Query Parameters: * start_date (str): Start date for filtering (YYYY-MM-DD) - required. * end_date (str): End date for filtering (YYYY-MM-DD) - required. * limit (int): Number of results per page - default: 5. * offset (int): Offset for pagination - default: 0. * @returns TenantMentorTraces * @throws ApiError */ public static aiAnalyticsOrgsUsersCostsPeragentRetrieve({ endDate, org, startDate, userId, }: { endDate: string, org: string, startDate: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/orgs/{org}/users/{user_id}/costs/peragent/', path: { 'org': org, 'user_id': userId, }, query: { 'end_date': endDate, 'start_date': startDate, }, errors: { 400: `Invalid parameters`, 404: `Organization not found`, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-analytics/orgs/{org}/users/{user_id}/costs/peragent/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-analytics/orgs/{org}/users/{user_id}/costs/peragent/` (`mentor` → `agent`) and will be removed in a future release. * * Retrieve LLM usage costs aggregated by mentor. * * This endpoint returns data on the total cost of LLM usage for each mentor * within a specified date range, with pagination support. The costs are * calculated by summing the costs of all observations associated with * traces from the mentor's sessions. * * Args: * request: The HTTP request containing filter query parameters. * org: Organization key identifier. * * Returns: * Response: Paginated list of mentors with their total LLM usage costs. * * Raises: * NotFound: If the specified organization does not exist. * BadRequest: If the provided parameters are invalid. * * Query Parameters: * start_date (str): Start date for filtering (YYYY-MM-DD) - required. * end_date (str): End date for filtering (YYYY-MM-DD) - required. * limit (int): Number of results per page - default: 5. * offset (int): Offset for pagination - default: 0. * @returns TenantMentorTraces * @throws ApiError */ public static aiAnalyticsOrgsUsersCostsPermentorRetrieve({ endDate, org, startDate, userId, }: { endDate: string, org: string, startDate: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/orgs/{org}/users/{user_id}/costs/permentor/', path: { 'org': org, 'user_id': userId, }, query: { 'end_date': endDate, 'start_date': startDate, }, errors: { 400: `Invalid parameters`, 404: `Organization not found`, }, }); } /** * Retrieve LLM usage costs aggregated by user. * * This endpoint returns data on the total cost of LLM usage for each user * within a specified date range, with pagination support. The costs are * calculated by summing the costs of all observations associated with * traces from the user's sessions. * * Args: * request: The HTTP request containing filter query parameters. * org: Organization key identifier. * * Returns: * Response: Paginated list of users with their total LLM usage costs. * * Raises: * NotFound: If the specified organization does not exist. * BadRequest: If the provided parameters are invalid. * * Query Parameters: * start_date (str): Start date for filtering (YYYY-MM-DD) - required. * end_date (str): End date for filtering (YYYY-MM-DD) - required. * limit (int): Number of results per page - default: 10. * offset (int): Offset for pagination - default: 0. * @returns LLMTracesListResponse * @throws ApiError */ public static aiAnalyticsOrgsUsersCostsPeruserRetrieve({ endDate, org, startDate, userId, }: { endDate: string, org: string, startDate: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/orgs/{org}/users/{user_id}/costs/peruser/', path: { 'org': org, 'user_id': userId, }, query: { 'end_date': endDate, 'start_date': startDate, }, errors: { 400: `Invalid parameters`, 404: `Organization not found`, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-analytics/orgs/{org}/users/{user_id}/agent-detail/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-analytics/orgs/{org}/users/{user_id}/agent-detail/` (`mentor` → `agent`) and will be removed in a future release. * * Retrieve summary statistics about mentors. * * This endpoint returns aggregated statistics about mentors within an organization, * including total mentors, active mentors (mentors with at least one session), * questions answered, and ratings. * * Args: * request: The HTTP request. * org: Organization key identifier. * * Returns: * Response: Summary statistics about mentors. * * Raises: * NotFound: If the specified organization does not exist. * @returns MentorDetailAnalytics * @throws ApiError */ public static aiAnalyticsOrgsUsersMentorDetailRetrieve({ org, userId, }: { org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/orgs/{org}/users/{user_id}/mentor-detail/', path: { 'org': org, 'user_id': userId, }, errors: { 404: `Organization not found`, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-analytics/orgs/{org}/users/{user_id}/agent-summary/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-analytics/orgs/{org}/users/{user_id}/agent-summary/` (`mentor` → `agent`) and will be removed in a future release. * * Retrieve summary statistics about mentors. * * This endpoint returns aggregated statistics about mentors within an organization, * including total mentors, active mentors (mentors with at least one session), * questions answered, and ratings. * * Args: * request: The HTTP request. * org: Organization key identifier. * * Returns: * Response: Summary statistics about mentors. * * Raises: * NotFound: If the specified organization does not exist. * @returns MentorDetailAnalytics * @throws ApiError */ public static aiAnalyticsOrgsUsersMentorSummaryRetrieve({ org, userId, }: { org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/orgs/{org}/users/{user_id}/mentor-summary/', path: { 'org': org, 'user_id': userId, }, errors: { 404: `Organization not found`, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-analytics/orgs/{org}/users/{user_id}/agents/{mentor_unique_id}/cost/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-analytics/orgs/{org}/users/{user_id}/agents/{mentor_unique_id}/cost/` (`mentor` → `agent`) and will be removed in a future release. * * Retrieve LLM usage costs for a specific mentor. * * This endpoint returns data on the total cost of LLM usage for a specific mentor * within a specified date range. The cost is calculated by summing the costs * of all observations associated with traces from the tenant's sessions. * * Args: * request: The HTTP request containing filter query parameters. * org: Organization key identifier. * mentor_unique_id: User key identifier. * * Returns: * Response: Total LLM usage cost for the specified tenant. * * Raises: * NotFound: If the specified organization does not exist. * BadRequest: If the provided parameters are invalid. * * Query Parameters: * start_date (str): Start date for filtering (YYYY-MM-DD) - required. * end_date (str): End date for filtering (YYYY-MM-DD) - required. * @returns Cost * @throws ApiError */ public static aiAnalyticsOrgsUsersMentorsCostRetrieve({ endDate, mentorUniqueId, org, startDate, userId, }: { endDate: string, mentorUniqueId: string, org: string, startDate: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/orgs/{org}/users/{user_id}/mentors/{mentor_unique_id}/cost/', path: { 'mentor_unique_id': mentorUniqueId, 'org': org, 'user_id': userId, }, query: { 'end_date': endDate, 'start_date': startDate, }, errors: { 400: `Invalid parameters`, 404: `Organization not found`, }, }); } /** * Retrieve the most discussed topics over time. * * This endpoint returns data on the frequency of topics discussed in conversations * within a specified date range, with options for filtering by mentor and * aggregating by different time periods (hourly, daily, weekly). * * Args: * request: The HTTP request containing filter query parameters. * org: Organization key identifier. * * Returns: * Response: List of topics with their conversation counts, ordered by frequency. * * Raises: * NotFound: If the specified organization does not exist. * BadRequest: If the provided parameters are invalid. * * Query Parameters: * start_date (str): Start date for filtering (YYYY-MM-DD) - required. * end_date (str): End date for filtering (YYYY-MM-DD) - required. * mentor_id (str): Filter by mentor unique ID. * aggregation (str): Time aggregation level (hourly, daily, weekly) - default: daily. * @returns TopicRecord * @throws ApiError */ public static aiAnalyticsOrgsUsersMostDiscussedTopicsList({ endDate, org, startDate, userId, aggregation = 'daily', groupBy = 'day', mentorId, }: { /** * End date for filtering (YYYY-MM-DD) */ endDate: string, org: string, /** * Start date for filtering (YYYY-MM-DD) */ startDate: string, userId: string, /** * Time aggregation level (hourly, daily, weekly) */ aggregation?: 'daily' | 'hourly' | 'weekly', groupBy?: string, /** * Filter by mentor unique ID */ mentorId?: string, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/orgs/{org}/users/{user_id}/most-discussed-topics/', path: { 'org': org, 'user_id': userId, }, query: { 'aggregation': aggregation, 'end_date': endDate, 'group_by': groupBy, 'mentor_id': mentorId, 'start_date': startDate, }, errors: { 400: `Invalid parameters`, 404: `Organization not found`, }, }); } /** * API viewset for retrieving a user's own chat message history. * * Permissions: * - Any authenticated user can access their own data * - Users cannot access other users' data * @returns PaginatedConversationsList * @throws ApiError */ public static aiAnalyticsOrgsUsersMyChatHistoryList({ org, userId, endDate, mentor, page, pageSize, sentiment, startDate, topics, }: { org: string, userId: string, endDate?: string, mentor?: string, /** * A page number within the paginated result set. */ page?: number, /** * Number of results to return per page. */ pageSize?: number, sentiment?: string, startDate?: string, topics?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/orgs/{org}/users/{user_id}/my-chat-history/', path: { 'org': org, 'user_id': userId, }, query: { 'end_date': endDate, 'mentor': mentor, 'page': page, 'page_size': pageSize, 'sentiment': sentiment, 'start_date': startDate, 'topics': topics, }, }); } /** * Retrieve filter options for the user's own chat message history. * @returns UserChatHistoryFilterData * @throws ApiError */ public static aiAnalyticsOrgsUsersMyChatHistoryFilterRetrieve({ org, userId, endDate, mentorId, monthlyRange = false, startDate, }: { org: string, userId: string, endDate?: string, mentorId?: string, monthlyRange?: boolean, startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/orgs/{org}/users/{user_id}/my-chat-history-filter/', path: { 'org': org, 'user_id': userId, }, query: { 'end_date': endDate, 'mentor_id': mentorId, 'monthly_range': monthlyRange, 'start_date': startDate, }, errors: { 403: `Cannot access another user's data`, 404: `Organization not found`, }, }); } /** * List user chat history reports * List all chat history reports created by the user. * @returns UserReportListResponse * @throws ApiError */ public static aiAnalyticsOrgsUsersMyChatHistoryReportRetrieve({ org, userId, }: { org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/orgs/{org}/users/{user_id}/my-chat-history-report/', path: { 'org': org, 'user_id': userId, }, }); } /** * Create user chat history report * Create a report for the user's own chat history. Only my-chat-history report is allowed. * * Supported filters in request body: * - `mentor_id` or `mentor`: Filter by specific mentor ID (single value or list) * - `topic`: Filter by conversation topic * - `sentiment`: Filter by sentiment (positive, negative, neutral) * - `start_date` and `end_date`: Date range filters (YYYY-MM-DD format) * @returns ReportCreate * @throws ApiError */ public static aiAnalyticsOrgsUsersMyChatHistoryReportCreate({ org, userId, requestBody, }: { org: string, userId: string, requestBody?: ReportRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/ai-analytics/orgs/{org}/users/{user_id}/my-chat-history-report/', path: { 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * Get user report status * Get the status of a user's own chat history report. * @returns ReportCreate * @throws ApiError */ public static aiAnalyticsOrgsUsersMyChatHistoryReportRetrieve2({ org, taskId, userId, }: { org: string, taskId: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/orgs/{org}/users/{user_id}/my-chat-history-report/{task_id}/', path: { 'org': org, 'task_id': taskId, 'user_id': userId, }, }); } /** * Download user chat history report * Download a completed user chat history report as CSV or JSON. * @returns any No response body * @throws ApiError */ public static aiAnalyticsOrgsUsersMyChatHistoryReportDownloadRetrieve({ org, taskId, userId, columns, format = 'csv', }: { org: string, taskId: string, userId: string, /** * Comma-separated column names to control output order. */ columns?: string, /** * Download format */ format?: 'csv' | 'json', }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/orgs/{org}/users/{user_id}/my-chat-history-report/{task_id}/download/', path: { 'org': org, 'task_id': taskId, 'user_id': userId, }, query: { 'columns': columns, 'format': format, }, }); } /** * API viewset for retrieving a user's own chat message history. * * Permissions: * - Any authenticated user can access their own data * - Users cannot access other users' data * @returns Conversations * @throws ApiError */ public static aiAnalyticsOrgsUsersMyChatHistoryRetrieve({ id, org, userId, endDate, mentor, sentiment, startDate, topics, }: { id: string, org: string, userId: string, endDate?: string, mentor?: string, sentiment?: string, startDate?: string, topics?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/orgs/{org}/users/{user_id}/my-chat-history/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, query: { 'end_date': endDate, 'mentor': mentor, 'sentiment': sentiment, 'start_date': startDate, 'topics': topics, }, }); } /** * Viewset for retrieving and listing Langfuse observations. * * This viewset provides read-only access to Langfuse observations data for platform admins. * Observations represent detailed tracking of AI model interactions and responses. * * Permissions: * - Restricted to platform administrators only * @returns PaginatedObservationList * @throws ApiError */ public static aiAnalyticsOrgsUsersObservationsList({ org, userId, limit, offset, ordering, search, }: { org: string, userId: string, /** * Number of results to return per page. */ limit?: number, /** * The initial index from which to return the results. */ offset?: number, /** * Which field to use when ordering the results. */ ordering?: string, /** * A search term. */ search?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/orgs/{org}/users/{user_id}/observations/', path: { 'org': org, 'user_id': userId, }, query: { 'limit': limit, 'offset': offset, 'ordering': ordering, 'search': search, }, }); } /** * Viewset for retrieving and listing Langfuse observations. * * This viewset provides read-only access to Langfuse observations data for platform admins. * Observations represent detailed tracking of AI model interactions and responses. * * Permissions: * - Restricted to platform administrators only * @returns Observation * @throws ApiError */ public static aiAnalyticsOrgsUsersObservationsRetrieve({ id, org, userId, }: { id: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/orgs/{org}/users/{user_id}/observations/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, }); } /** * Retrieve an overview of key analytics metrics. * * This endpoint returns a comprehensive overview of key analytics metrics * for an organization, including: * - Conversation volume: Total sessions and month-over-month change * - Users: Total unique users and month-over-month change * - Topics: Total unique topics and month-over-month change * - User ratings: Total ratings and month-over-month change * * Results can be filtered by mentor. * * Args: * request: The HTTP request containing filter query parameters. * org: Organization key identifier. * user_id: User identifier (not used in the implementation). * * Returns: * Response: Overview of key analytics metrics with month-over-month changes. * * Raises: * NotFound: If the specified organization does not exist. * * Query Parameters: * mentor_id (str): Filter analytics by mentor unique ID. * @returns AnalyticsOverview * @throws ApiError */ public static aiAnalyticsOrgsUsersOverviewSummaryRetrieve({ org, userId, groupBy = 'day', mentorId, }: { org: string, userId: string, groupBy?: string, /** * Filter analytics by mentor unique ID */ mentorId?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/orgs/{org}/users/{user_id}/overview-summary/', path: { 'org': org, 'user_id': userId, }, query: { 'group_by': groupBy, 'mentor_id': mentorId, }, errors: { 404: `Organization not found`, }, }); } /** * Retrieve user rating metrics over time. * * This endpoint returns data on the number of user ratings submitted * within a specified date range, aggregated by day or hour. * * Args: * request: The HTTP request containing filter query parameters. * org: Organization key identifier. * * Returns: * Response: Time series of rating counts aggregated by day or hour. * * Raises: * NotFound: If the specified organization does not exist. * BadRequest: If the provided parameters are invalid. * * Query Parameters: * start_date (str): Start date for filtering (YYYY-MM-DD) - required. * end_date (str): End date for filtering (YYYY-MM-DD) - required. * group_by (str): Aggregation level (day or hour) - default: day. * @returns RatingRecord * @throws ApiError */ public static aiAnalyticsOrgsUsersRatingSummaryList({ endDate, org, startDate, userId, groupBy = 'day', }: { /** * End date for filtering (YYYY-MM-DD) */ endDate: string, org: string, /** * Start date for filtering (YYYY-MM-DD) */ startDate: string, userId: string, /** * Aggregation level (day or hour) */ groupBy?: 'day' | 'hour', }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/orgs/{org}/users/{user_id}/rating-summary/', path: { 'org': org, 'user_id': userId, }, query: { 'end_date': endDate, 'group_by': groupBy, 'start_date': startDate, }, errors: { 400: `Invalid parameters`, 404: `Organization not found`, }, }); } /** * Retrieve trends of registered users over time. * * This endpoint returns data on the number of new user registrations * within a specified date range, with options for different time aggregations * (hourly, daily, weekly, monthly). The data is backfilled to ensure * continuous time series even for periods with zero registrations. * * Args: * request: The HTTP request containing filter query parameters. * org: Organization key identifier. * * Returns: * Response: Time series of user registration counts. * * Raises: * NotFound: If the specified organization does not exist. * BadRequest: If the provided parameters are invalid. * * Query Parameters: * start_date (str): Start date for filtering (YYYY-MM-DD) - required. * end_date (str): End date for filtering (YYYY-MM-DD) - required. * aggregation (str): Time aggregation level (hourly, daily, weekly, monthly) - default: daily. * @returns TrendEntry * @throws ApiError */ public static aiAnalyticsOrgsUsersRegisteredUsersTrendList({ endDate, org, startDate, userId, aggregation = 'daily', groupBy = 'day', }: { /** * End date for filtering (YYYY-MM-DD) */ endDate: string, org: string, /** * Start date for filtering (YYYY-MM-DD) */ startDate: string, userId: string, /** * Time aggregation level (hourly, daily, weekly, monthly) */ aggregation?: 'daily' | 'hourly' | 'monthly' | 'weekly', groupBy?: string, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/orgs/{org}/users/{user_id}/registered-users-trend/', path: { 'org': org, 'user_id': userId, }, query: { 'aggregation': aggregation, 'end_date': endDate, 'group_by': groupBy, 'start_date': startDate, }, errors: { 400: `Invalid parameters`, 404: `Organization not found`, }, }); } /** * Retrieve user sentiment counts over time. * * This endpoint returns data on the number of user sentiment entries * within a specified time period, aggregated by date. * * Args: * request: The HTTP request containing filter query parameters. * org: Organization key identifier. * user_id: User identifier. * * Returns: * Response: Time series data of sentiment counts. * * Raises: * NotFound: If the specified organization does not exist. * ValidationError: If the provided query parameters are invalid. * * Query Parameters: * period (str): Time period filter (today, yesterday, 7d, 30d, 90d) - default: 7d. * @returns UserSentimentCountView * @throws ApiError */ public static aiAnalyticsOrgsUsersSentimentCountList({ org, userId, period = '7d', }: { org: string, userId: string, period?: string, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/orgs/{org}/users/{user_id}/sentiment-count/', path: { 'org': org, 'user_id': userId, }, query: { 'period': period, }, errors: { 404: `Organization not found`, }, }); } /** * Retrieve LLM usage costs for a specific tenant. * * This endpoint returns data on the total cost of LLM usage for a specific tenant * within a specified date range. The cost is calculated by summing the costs * of all observations associated with traces from the tenant's sessions. * * Args: * request: The HTTP request containing filter query parameters. * org: Organization key identifier. * * Returns: * Response: Total LLM usage cost for the specified tenant. * * Raises: * NotFound: If the specified organization does not exist. * BadRequest: If the provided parameters are invalid. * * Query Parameters: * start_date (str): Start date for filtering (YYYY-MM-DD) - required. * end_date (str): End date for filtering (YYYY-MM-DD) - required. * @returns Cost * @throws ApiError */ public static aiAnalyticsOrgsUsersTenantCostRetrieve({ endDate, org, startDate, userId, }: { endDate: string, org: string, startDate: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/orgs/{org}/users/{user_id}/tenant-cost/', path: { 'org': org, 'user_id': userId, }, query: { 'end_date': endDate, 'start_date': startDate, }, errors: { 400: `Invalid parameters`, 404: `Organization not found`, }, }); } /** * Retrieve the most engaged students based on chat message count. * * This endpoint returns data on the top 20 students with the highest number of * chat messages, with optional filtering by mentor and date range. * * Args: * request: The HTTP request containing filter query parameters. * org: Organization key identifier. * user_id: User identifier (not used in the implementation). * * Returns: * Response: List of top students with their chat message counts. * * Raises: * NotFound: If the specified organization does not exist. * BadRequest: If the provided parameters are invalid. * * Query Parameters: * mentor_id (str): Filter by mentor unique ID. * start_date (str): Start date for filtering (YYYY-MM-DD). * end_date (str): End date for filtering (YYYY-MM-DD). * @returns StudentChatMessage * @throws ApiError */ public static aiAnalyticsOrgsUsersTopStudentsByChatMessagesList({ org, userId, groupBy = 'day', }: { org: string, userId: string, groupBy?: string, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/orgs/{org}/users/{user_id}/top-students-by-chat-messages/', path: { 'org': org, 'user_id': userId, }, query: { 'group_by': groupBy, }, errors: { 400: `Invalid parameters`, 404: `Organization not found`, }, }); } /** * Retrieve aggregated topic statistics. * * This endpoint returns statistical information about topics within an organization, * including total topics, new topics, and percentage changes compared to the * previous month. Results can be filtered by mentor. * * Args: * request: The HTTP request containing filter query parameters. * org: Organization key identifier. * * Returns: * Response: Statistical information about topics. * * Raises: * NotFound: If the specified organization or mentor does not exist. * * Query Parameters: * mentor_id (str): Filter statistics by mentor unique ID. * @returns TopicStatisticsResponse * @throws ApiError */ public static aiAnalyticsOrgsUsersTopicOverviewRetrieve({ org, userId, mentorId, }: { org: string, userId: string, /** * Filter statistics by mentor unique ID */ mentorId?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/orgs/{org}/users/{user_id}/topic-overview/', path: { 'org': org, 'user_id': userId, }, query: { 'mentor_id': mentorId, }, errors: { 404: `Organization or mentor not found`, }, }); } /** * Retrieve paginated statistics about topics. * * This endpoint returns detailed statistics about topics, including: * - Number of conversations related to each topic * - Total message count for each topic * - Average sentiment of conversations about each topic * - Average user rating for conversations about each topic * * Results can be filtered by mentor and date range, and are paginated. * * Args: * request: The HTTP request containing filter query parameters. * org: Organization key identifier. * * Returns: * Response: Paginated list of topic statistics. * * Raises: * NotFound: If the specified organization or mentor does not exist. * BadRequest: If the provided parameters are invalid. * * Query Parameters: * start_date (str): Start date for filtering (YYYY-MM-DD). * end_date (str): End date for filtering (YYYY-MM-DD). * mentor_id (str): Filter by mentor unique ID. * page (int): Page number for pagination - default: 1. * page_size (int): Number of results per page - default: 20. * @returns PaginatedTopicStatisticsResponse * @throws ApiError */ public static aiAnalyticsOrgsUsersTopicStatisticsRetrieve({ org, userId, endDate, groupBy = 'day', mentorId, page = 1, pageSize = 20, startDate, }: { org: string, userId: string, /** * End date for filtering (YYYY-MM-DD) */ endDate?: string, groupBy?: string, /** * Filter by mentor unique ID */ mentorId?: string, /** * Page number for pagination */ page?: number, /** * Number of results per page */ pageSize?: number, /** * Start date for filtering (YYYY-MM-DD) */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/orgs/{org}/users/{user_id}/topic-statistics/', path: { 'org': org, 'user_id': userId, }, query: { 'end_date': endDate, 'group_by': groupBy, 'mentor_id': mentorId, 'page': page, 'page_size': pageSize, 'start_date': startDate, }, errors: { 400: `Invalid parameters`, 404: `Organization or mentor not found`, }, }); } /** * Retrieve a summary of the most frequent topics. * * This endpoint returns a summary of the top 10 topics discussed in chat sessions, * ordered by conversation count. Results can be filtered by mentor and date range. * * Args: * request: The HTTP request containing filter query parameters. * org: Organization key identifier. * * Returns: * Response: A list of the top 10 topics with their conversation counts. * * Raises: * NotFound: If the specified organization does not exist. * BadRequest: If the provided date format is invalid. * * Query Parameters: * mentor_id (str): Filter by mentor unique ID. * start_date (str): Start date for filtering (YYYY-MM-DD). * end_date (str): End date for filtering (YYYY-MM-DD). * @returns TopicSummaryView * @throws ApiError */ public static aiAnalyticsOrgsUsersTopicsSummaryList({ org, userId, endDate, startDate, }: { org: string, userId: string, endDate?: string, startDate?: string, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/orgs/{org}/users/{user_id}/topics/summary/', path: { 'org': org, 'user_id': userId, }, query: { 'end_date': endDate, 'start_date': startDate, }, errors: { 400: `Invalid date format`, 404: `Organization not found`, }, }); } /** * Retrieve the total number of users interacting with mentors over time. * * This endpoint returns data on the number of unique users who interacted with * mentors each day or hour within a specified date range, with optional * filtering by specific mentor. If no date range is provided, the last 30 days * are used by default. * * Args: * request: The HTTP request containing filter query parameters. * org: Organization key identifier. * * Returns: * Response: Time series of unique user counts. * * Raises: * NotFound: If the specified organization or mentor does not exist. * BadRequest: If the provided parameters are invalid. * * Query Parameters: * start_date (str): Start date for filtering (YYYY-MM-DD) - defaults to 30 days ago. * end_date (str): End date for filtering (YYYY-MM-DD) - defaults to today. * aggregation (str): Time aggregation level (hourly, daily) - default: daily. * mentor_id (str): Filter by mentor unique ID. * @returns UserChatByPeriod * @throws ApiError */ public static aiAnalyticsOrgsUsersTotalUsersByAgentList({ org, userId, aggregation = 'daily', endDate, groupBy = 'day', mentorId, startDate, }: { org: string, userId: string, /** * Time aggregation level (hourly, daily) */ aggregation?: 'daily' | 'hourly', /** * End date for filtering (YYYY-MM-DD) */ endDate?: string, groupBy?: string, /** * Filter by mentor unique ID */ mentorId?: string, /** * Start date for filtering (YYYY-MM-DD) */ startDate?: string, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/orgs/{org}/users/{user_id}/total-users-by-agent/', path: { 'org': org, 'user_id': userId, }, query: { 'aggregation': aggregation, 'end_date': endDate, 'group_by': groupBy, 'mentor_id': mentorId, 'start_date': startDate, }, errors: { 400: `Invalid parameters`, 404: `Organization or mentor not found`, }, }); } /** * @deprecated * **Deprecated — use `/api/ai-analytics/orgs/{org}/users/{user_id}/total-users-by-agent/` instead.** This `mentor`-spelled path is an alias kept for backward compatibility; it is equivalent to `/api/ai-analytics/orgs/{org}/users/{user_id}/total-users-by-agent/` (`mentor` → `agent`) and will be removed in a future release. * * Retrieve the total number of users interacting with mentors over time. * * This endpoint returns data on the number of unique users who interacted with * mentors each day or hour within a specified date range, with optional * filtering by specific mentor. If no date range is provided, the last 30 days * are used by default. * * Args: * request: The HTTP request containing filter query parameters. * org: Organization key identifier. * * Returns: * Response: Time series of unique user counts. * * Raises: * NotFound: If the specified organization or mentor does not exist. * BadRequest: If the provided parameters are invalid. * * Query Parameters: * start_date (str): Start date for filtering (YYYY-MM-DD) - defaults to 30 days ago. * end_date (str): End date for filtering (YYYY-MM-DD) - defaults to today. * aggregation (str): Time aggregation level (hourly, daily) - default: daily. * mentor_id (str): Filter by mentor unique ID. * @returns UserChatByPeriod * @throws ApiError */ public static aiAnalyticsOrgsUsersTotalUsersByMentorList({ org, userId, aggregation = 'daily', endDate, groupBy = 'day', mentorId, startDate, }: { org: string, userId: string, /** * Time aggregation level (hourly, daily) */ aggregation?: 'daily' | 'hourly', /** * End date for filtering (YYYY-MM-DD) */ endDate?: string, groupBy?: string, /** * Filter by mentor unique ID */ mentorId?: string, /** * Start date for filtering (YYYY-MM-DD) */ startDate?: string, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/orgs/{org}/users/{user_id}/total-users-by-mentor/', path: { 'org': org, 'user_id': userId, }, query: { 'aggregation': aggregation, 'end_date': endDate, 'group_by': groupBy, 'mentor_id': mentorId, 'start_date': startDate, }, errors: { 400: `Invalid parameters`, 404: `Organization or mentor not found`, }, }); } /** * Viewset for retrieving and listing Langfuse traces. * * This viewset provides read-only access to Langfuse traces data for platform admins. * Traces represent high-level tracking of user interactions and AI responses. * * Permissions: * - Restricted to platform administrators only * @returns PaginatedTraceList * @throws ApiError */ public static aiAnalyticsOrgsUsersTracesList({ org, userId, limit, offset, ordering, search, }: { org: string, userId: string, /** * Number of results to return per page. */ limit?: number, /** * The initial index from which to return the results. */ offset?: number, /** * Which field to use when ordering the results. */ ordering?: string, /** * A search term. */ search?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/orgs/{org}/users/{user_id}/traces/', path: { 'org': org, 'user_id': userId, }, query: { 'limit': limit, 'offset': offset, 'ordering': ordering, 'search': search, }, }); } /** * Viewset for retrieving and listing Langfuse traces. * * This viewset provides read-only access to Langfuse traces data for platform admins. * Traces represent high-level tracking of user interactions and AI responses. * * Permissions: * - Restricted to platform administrators only * @returns Trace * @throws ApiError */ public static aiAnalyticsOrgsUsersTracesRetrieve({ id, org, userId, }: { id: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/orgs/{org}/users/{user_id}/traces/{id}/', path: { 'id': id, 'org': org, 'user_id': userId, }, }); } /** * Retrieve message data from conversations. * * This endpoint returns data on messages within conversations, with options * for filtering by date range, topics, and mentor. * * Args: * request: The HTTP request containing filter query parameters. * org: Organization key identifier. * user_id: User identifier (not used in the implementation). * * Returns: * Response: A list of conversation message data. * * Raises: * NotFound: If the specified organization does not exist. * ValidationError: If the provided query parameters are invalid. * * Query Parameters: * start_date (str): Start date for filtering (YYYY-MM-DD). * end_date (str): End date for filtering (YYYY-MM-DD). * topics (str): Comma-separated list of topics to filter by. * mentor (str): Filter by mentor unique ID. * @returns ConversationMessage * @throws ApiError */ public static aiAnalyticsOrgsUsersTranscriptsList({ org, userId, endDate, mentor, startDate, topics, }: { org: string, userId: string, endDate?: string, mentor?: string, startDate?: string, topics?: string, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/orgs/{org}/users/{user_id}/transcripts/', path: { 'org': org, 'user_id': userId, }, query: { 'end_date': endDate, 'mentor': mentor, 'start_date': startDate, 'topics': topics, }, errors: { 404: `Organization not found`, }, }); } /** * Retrieve daily user engagement metrics with mentors. * * This endpoint returns data on the number of unique users who interact with * mentors each day within a specified date range. * * Args: * request: The HTTP request containing filter query parameters. * org: Organization key identifier. * * Returns: * Response: Daily time series of unique user counts. * * Raises: * NotFound: If the specified organization does not exist. * BadRequest: If the provided parameters are invalid. * * Query Parameters: * start_date (str): Start date for filtering (YYYY-MM-DD) - required. * end_date (str): End date for filtering (YYYY-MM-DD) - required. * @returns UserCountRecord * @throws ApiError */ public static aiAnalyticsOrgsUsersUsageSummaryList({ endDate, org, startDate, userId, groupBy = 'day', }: { /** * End date for filtering (YYYY-MM-DD) */ endDate: string, org: string, /** * Start date for filtering (YYYY-MM-DD) */ startDate: string, userId: string, groupBy?: string, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/orgs/{org}/users/{user_id}/usage-summary/', path: { 'org': org, 'user_id': userId, }, query: { 'end_date': endDate, 'group_by': groupBy, 'start_date': startDate, }, errors: { 400: `Invalid parameters`, 404: `Organization not found`, }, }); } /** * Retrieve user cohort trends over time. * * This endpoint returns data on the distribution of new versus veteran users * over time, with options for different time aggregations and filtering by mentor. * New users are those who registered within the specified date range, while * veteran users are those who registered before the date range but were active * during it. * * Args: * request: The HTTP request containing filter query parameters. * org: Organization key identifier. * * Returns: * Response: Time series of new and veteran user counts. * * Raises: * NotFound: If the specified organization does not exist. * BadRequest: If the provided parameters are invalid. * * Query Parameters: * start_date (str): Start date for filtering (YYYY-MM-DD) - required. * end_date (str): End date for filtering (YYYY-MM-DD) - required. * aggregation (str): Time aggregation level (hourly, daily, weekly) - default: daily. * mentor_id (str): Filter by mentor unique ID. * @returns UserTrendByPeriod * @throws ApiError */ public static aiAnalyticsOrgsUsersUserCohortsOverTimeRetrieve({ endDate, org, startDate, userId, aggregation = 'daily', mentorId, }: { /** * End date for filtering (YYYY-MM-DD) */ endDate: string, org: string, /** * Start date for filtering (YYYY-MM-DD) */ startDate: string, userId: string, /** * Time aggregation level (hourly, daily, weekly) */ aggregation?: 'daily' | 'hourly' | 'weekly', /** * Filter by mentor unique ID */ mentorId?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/orgs/{org}/users/{user_id}/user-cohorts-over-time/', path: { 'org': org, 'user_id': userId, }, query: { 'aggregation': aggregation, 'end_date': endDate, 'mentor_id': mentorId, 'start_date': startDate, }, errors: { 400: `Invalid parameters`, 404: `Organization not found`, }, }); } /** * Retrieve LLM usage costs for a specific user. * * This endpoint returns data on the total cost of LLM usage for a specific user * within a specified date range. The cost is calculated by summing the costs * of all observations associated with traces from the tenant's sessions. * * Args: * request: The HTTP request containing filter query parameters. * org: Organization key identifier. * user_id: User key identifier. * * Returns: * Response: Total LLM usage cost for the specified tenant. * * Raises: * NotFound: If the specified organization does not exist. * BadRequest: If the provided parameters are invalid. * * Query Parameters: * start_date (str): Start date for filtering (YYYY-MM-DD) - required. * end_date (str): End date for filtering (YYYY-MM-DD) - required. * @returns Cost * @throws ApiError */ public static aiAnalyticsOrgsUsersUserCostRetrieve({ endDate, org, startDate, userId, username, }: { endDate: string, org: string, startDate: string, userId: string, username: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/orgs/{org}/users/{user_id}/user-cost/', path: { 'org': org, 'user_id': userId, }, query: { 'end_date': endDate, 'start_date': startDate, 'username': username, }, errors: { 400: `Invalid parameters`, 404: `Organization not found`, }, }); } /** * Retrieve aggregated user chat feedback counts. * * This endpoint returns data on the number of user chat feedback entries * within a specified date range, with options for different time aggregations * (hourly, daily, weekly). Results can be filtered by mentor. * * Args: * request: The HTTP request containing filter query parameters. * org: Organization key identifier. * * Returns: * Response: Time series data of feedback counts. * * Raises: * NotFound: If the specified organization does not exist. * BadRequest: If the provided parameters are invalid. * * Query Parameters: * start_date (str): Start date for filtering (YYYY-MM-DD) - required. * end_date (str): End date for filtering (YYYY-MM-DD) - required. * mentor_id (str): Filter by mentor unique ID. * aggregation (str): Time aggregation level (hourly, daily, weekly) - default: daily. * @returns UserChatFeedbackCount * @throws ApiError */ public static aiAnalyticsOrgsUsersUserFeedbackList({ endDate, org, startDate, userId, aggregation = 'daily', mentorId, }: { /** * End date for filtering (YYYY-MM-DD) */ endDate: string, org: string, /** * Start date for filtering (YYYY-MM-DD) */ startDate: string, userId: string, /** * Time aggregation level (hourly, daily, weekly) */ aggregation?: 'daily' | 'hourly' | 'weekly', /** * Filter by mentor unique ID */ mentorId?: string, }): CancelablePromise> { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/orgs/{org}/users/{user_id}/user-feedback/', path: { 'org': org, 'user_id': userId, }, query: { 'aggregation': aggregation, 'end_date': endDate, 'mentor_id': mentorId, 'start_date': startDate, }, errors: { 400: `Invalid parameters`, 404: `Organization not found`, }, }); } /** * Retrieve comprehensive user metrics. * * This endpoint returns data on various user metrics with month-over-month * change calculations: * - Registered users: Total users registered on the platform * - New users: Users who joined in the current month * - Unique users: Distinct users who have had sessions * - Veteran users: Users who have been active for at least 6 months * * Results can be filtered by mentor. * * Args: * request: The HTTP request containing filter query parameters. * org: Organization key identifier. * * Returns: * Response: Comprehensive user metrics with month-over-month changes. * * Raises: * NotFound: If the specified organization does not exist. * * Query Parameters: * mentor_id (str): Filter metrics by mentor unique ID. * @returns UserMetricsResponse * @throws ApiError */ public static aiAnalyticsOrgsUsersUserMetricsRetrieve({ org, userId, groupBy = 'day', mentorId, }: { org: string, userId: string, groupBy?: string, /** * Filter metrics by mentor unique ID */ mentorId?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/orgs/{org}/users/{user_id}/user-metrics/', path: { 'org': org, 'user_id': userId, }, query: { 'group_by': groupBy, 'mentor_id': mentorId, }, errors: { 404: `Organization not found`, }, }); } /** * Retrieve user distribution data for pie charts. * * This endpoint returns data on the distribution of new versus returning users * within a specified date range, including both counts and percentages, * suitable for pie chart visualization. * * Args: * request: The HTTP request containing filter query parameters. * org: Organization key identifier. * * Returns: * Response: Distribution of new versus returning users with counts and percentages. * * Raises: * NotFound: If the specified organization does not exist. * BadRequest: If the provided parameters are invalid. * * Query Parameters: * start_date (str): Start date for filtering (YYYY-MM-DD) - required. * end_date (str): End date for filtering (YYYY-MM-DD) - required. * mentor_id (str): Filter by mentor unique ID. * @returns PieChartData * @throws ApiError */ public static aiAnalyticsOrgsUsersUserMetricsPieChartRetrieve({ endDate, org, startDate, userId, mentorId, }: { /** * End date for filtering (YYYY-MM-DD) */ endDate: string, org: string, /** * Start date for filtering (YYYY-MM-DD) */ startDate: string, userId: string, /** * Filter by mentor unique ID */ mentorId?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/orgs/{org}/users/{user_id}/user-metrics-pie-chart/', path: { 'org': org, 'user_id': userId, }, query: { 'end_date': endDate, 'mentor_id': mentorId, 'start_date': startDate, }, errors: { 400: `Invalid parameters`, 404: `Organization not found`, }, }); } /** * Retrieve user sentiment distribution. * * This endpoint returns data on the distribution of user sentiments (positive, * negative, neutral) within a specified date range, expressed as percentages. * * Args: * request: The HTTP request containing filter query parameters. * org: Organization key identifier. * * Returns: * Response: Sentiment distribution percentages and total sentiment count. * * Raises: * NotFound: If the specified organization does not exist. * BadRequest: If the provided parameters are invalid. * * Query Parameters: * start_date (str): Start date for filtering (YYYY-MM-DD) - required. * end_date (str): End date for filtering (YYYY-MM-DD) - required. * @returns SentimentSummary * @throws ApiError */ public static aiAnalyticsOrgsUsersUserSentimentRetrieve({ endDate, org, startDate, userId, groupBy = 'day', }: { /** * End date for filtering (YYYY-MM-DD) */ endDate: string, org: string, /** * Start date for filtering (YYYY-MM-DD) */ startDate: string, userId: string, groupBy?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/orgs/{org}/users/{user_id}/user-sentiment/', path: { 'org': org, 'user_id': userId, }, query: { 'end_date': endDate, 'group_by': groupBy, 'start_date': startDate, }, errors: { 400: `Invalid parameters`, 404: `Organization not found`, }, }); } /** * Get active user counts over time. * * This endpoint provides daily counts of active users (users with known activity) * over a specified time period. * * Query Parameters: * start_date (str, optional): Start date for the time range (ISO format) * end_date (str, optional): End date for the time range (ISO format) * * Returns: * Daily active user counts over the specified time period, with change metrics * compared to previous periods. * * Default time range is the last 7 days if no dates are specified. * * An active user is defined as a user with any activity within the past 30 days. * @returns OvertimeWithChangeInfo * @throws ApiError */ public static aiAnalyticsOverviewOrgsActiveUsersRetrieve({ org, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/overview/orgs/{org}/active-users', path: { 'org': org, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * Get average grade value for platform, course, or user. * * This endpoint returns the average grade at different levels: * - Platform level: Average grade across all courses * - Course level: Average grade for a specific course * - Learner level: Average grade for a specific learner * - Course-learner level: Grade for a specific learner in a specific course * * Query Parameters: * course_id (str, optional): Filter by course ID * learner_id (str, optional): Filter by username or email * * Returns: * The average grade value based on the specified filters. * * Access Control: * - Platform admins can access any grade data * - Learners can access their own grade data * @returns Average * @throws ApiError */ public static aiAnalyticsOverviewOrgsAverageGradeRetrieve({ org, departmentId, format = 'json', includeMainPlatform = true, }: { org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/overview/orgs/{org}/average-grade', path: { 'org': org, }, query: { 'department_id': departmentId, 'format': format, 'include_main_platform': includeMainPlatform, }, }); } /** * Get course completion summary metrics over time. * * This endpoint provides completion statistics across the platform over a * specified time period, including daily completion counts and overall metrics. * * Query Parameters: * start_date (str): Start date for the time range (ISO format) * end_date (str): End date for the time range (ISO format) * * Returns: * Completion data including: * - Daily completion counts over time * - Total unique user count * - Total completion count * - Completion percentage * - Change metrics compared to previous periods * * Default time range is the last 7 days if no dates are specified. * @returns CourseCompletionSummaryOvertime * @throws ApiError */ public static aiAnalyticsOverviewOrgsCoursesCompletionsRetrieve({ org, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/overview/orgs/{org}/courses/completions', path: { 'org': org, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * List all learners on the platform with aggregated metrics. * * This endpoint returns a paginated list of all learners with key metrics including: * - Enrollment counts * - Completion counts * - Time spent on platform * * Query Parameters: * page (int): Page number for pagination * length (int): Number of items per page * search (str): Filter learners by username, email, or name * * Returns: * A paginated list of learners with their associated metrics. * @returns PerlearnerUserList * @throws ApiError */ public static aiAnalyticsOverviewOrgsLearnersRetrieve({ org, departmentId, format = 'json', includeMainPlatform = true, length, page, search, }: { org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * Size of data to return */ length?: number, /** * Page offset */ page?: number, /** * Search string for learner */ search?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/overview/orgs/{org}/learners', path: { 'org': org, }, query: { 'department_id': departmentId, 'format': format, 'include_main_platform': includeMainPlatform, 'length': length, 'page': page, 'search': search, }, }); } /** * Get time spent statistics on a per-course basis. * * This endpoint provides a paginated list of courses with the total time * spent by users in each course. * * Query Parameters: * start_date (str, optional): Start date for filtering (ISO format) * end_date (str, optional): End date for filtering (ISO format) * page (int, optional): Page number for pagination * length (int, optional): Number of items per page * * Returns: * A paginated list of courses with: * - Course identification (ID and name) * - Total time spent (in seconds) * - Formatted time spent (human-readable) * - Percentage of total platform time * @returns TimeSpentPerCourse * @throws ApiError */ public static aiAnalyticsOverviewOrgsMostActiveCoursesRetrieve({ org, departmentId, endDate, format = 'json', includeMainPlatform = true, length, page, startDate, }: { org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * Size of data to return */ length?: number, /** * Page offset */ page?: number, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/overview/orgs/{org}/most-active-courses', path: { 'org': org, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'length': length, 'page': page, 'start_date': startDate, }, }); } /** * Get registered user counts over time. * * This endpoint provides daily counts of new user registrations over a * specified time period. * * Query Parameters: * start_date (str, optional): Start date for the time range (ISO format) * end_date (str, optional): End date for the time range (ISO format) * * Returns: * Daily registration counts over the specified time period, with change metrics * compared to previous periods. * * Default time range is the last 7 days if no dates are specified. * @returns OvertimeWithChangeInfo * @throws ApiError */ public static aiAnalyticsOverviewOrgsRegisteredUsersRetrieve({ org, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/overview/orgs/{org}/registered-users', path: { 'org': org, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * Get average grade value for platform, course, or user. * * This endpoint returns the average grade at different levels: * - Platform level: Average grade across all courses * - Course level: Average grade for a specific course * - Learner level: Average grade for a specific learner * - Course-learner level: Grade for a specific learner in a specific course * * Query Parameters: * course_id (str, optional): Filter by course ID * learner_id (str, optional): Filter by username or email * * Returns: * The average grade value based on the specified filters. * * Access Control: * - Platform admins can access any grade data * - Learners can access their own grade data * @returns Average * @throws ApiError */ public static aiAnalyticsPerformanceOrgsCoursesGradingAverageRetrieve({ courseId, org, departmentId, format = 'json', includeMainPlatform = true, }: { courseId: string, org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/performance/orgs/{org}/courses/{course_id}/grading/average', path: { 'course_id': courseId, 'org': org, }, query: { 'department_id': departmentId, 'format': format, 'include_main_platform': includeMainPlatform, }, }); } /** * Returns average course grade and grade cuttoff * * e.g * ``` * { * "data": { * "grade_cutoffs": { * "A": 90, * "B": 80, * "C": 70, * }, * "average_grade": 50.0, * } * } * ``` * * Kwargs * course_id * @returns AvgCourseGradeWithCutoff * @throws ApiError */ public static aiAnalyticsPerformanceOrgsCoursesGradingAverageWithCutoffRetrieve({ courseId, org, departmentId, format = 'json', includeMainPlatform = true, }: { courseId: string, org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/performance/orgs/{org}/courses/{course_id}/grading/average-with-cutoff', path: { 'course_id': courseId, 'org': org, }, query: { 'department_id': departmentId, 'format': format, 'include_main_platform': includeMainPlatform, }, }); } /** * Grading summary for the entire course overview in a tree-like format * * Kwargs * course_id * @returns CourseGradingDetail * @throws ApiError */ public static aiAnalyticsPerformanceOrgsCoursesGradingDetailRetrieve({ courseId, org, departmentId, format = 'json', includeMainPlatform = true, }: { courseId: string, org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/performance/orgs/{org}/courses/{course_id}/grading/detail', path: { 'course_id': courseId, 'org': org, }, query: { 'department_id': departmentId, 'format': format, 'include_main_platform': includeMainPlatform, }, }); } /** * Grading information per enrolled user in a course * * Kwargs * course_id * @returns GradingPerUser * @throws ApiError */ public static aiAnalyticsPerformanceOrgsCoursesGradingPerLearnerRetrieve({ courseId, org, departmentId, format = 'json', includeMainPlatform = true, }: { courseId: string, org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/performance/orgs/{org}/courses/{course_id}/grading/per-learner', path: { 'course_id': courseId, 'org': org, }, query: { 'department_id': departmentId, 'format': format, 'include_main_platform': includeMainPlatform, }, }); } /** * Returns average grades across various assignment types in a course * * Query Params * course_id * * Returns: * dict * { * "data": [ * { * "assignment_type': , * "weight": , * "average_weighted_grade": , * "average_section_grade": * }, ... * ] * } * @returns CourseGradeSummary * @throws ApiError */ public static aiAnalyticsPerformanceOrgsCoursesGradingSummaryRetrieve({ courseId, org, departmentId, format = 'json', includeMainPlatform = true, }: { courseId: string, org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/performance/orgs/{org}/courses/{course_id}/grading/summary', path: { 'course_id': courseId, 'org': org, }, query: { 'department_id': departmentId, 'format': format, 'include_main_platform': includeMainPlatform, }, }); } /** * Get average grade value for platform, course, or user. * * This endpoint returns the average grade at different levels: * - Platform level: Average grade across all courses * - Course level: Average grade for a specific course * - Learner level: Average grade for a specific learner * - Course-learner level: Grade for a specific learner in a specific course * * Query Parameters: * course_id (str, optional): Filter by course ID * learner_id (str, optional): Filter by username or email * * Returns: * The average grade value based on the specified filters. * * Access Control: * - Platform admins can access any grade data * - Learners can access their own grade data * @returns Average * @throws ApiError */ public static aiAnalyticsPerformanceOrgsGradingAverageRetrieve({ org, departmentId, format = 'json', includeMainPlatform = true, }: { org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/performance/orgs/{org}/grading/average', path: { 'org': org, }, query: { 'department_id': departmentId, 'format': format, 'include_main_platform': includeMainPlatform, }, }); } /** * List grade-related performance data for all courses. * * This endpoint provides a comprehensive view of grade performance across * courses, including enrollment counts, pass rates, and average grades. * * Returns: * A paginated list of courses with: * - Course identification (ID and name) * - Enrollment count * - Number of students who passed * - Average grade * @returns PerformanceGradesPerCourse * @throws ApiError */ public static aiAnalyticsPerformanceOrgsGradingPerCourseRetrieve({ org, departmentId, format = 'json', includeMainPlatform = true, length, page, }: { org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * Size of data to return */ length?: number, /** * Page offset */ page?: number, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/performance/orgs/{org}/grading/per-course', path: { 'org': org, }, query: { 'department_id': departmentId, 'format': format, 'include_main_platform': includeMainPlatform, 'length': length, 'page': page, }, }); } /** * Enhanced API endpoint for listing learners with comprehensive filtering. * * This endpoint provides a paginated list of learners with detailed metrics * and supports advanced filtering options. It uses DM token authentication * and respects department-based access controls. * * Query Parameters: * page (int): Page number for pagination * length (int): Number of items per page * search (str): Filter by username, email, or full name * program (str): Filter by program * location (str): Filter by location * is_enrolled (bool): Filter for users with enrollments * platform (str): Filter by platform * start_date (date): Filter by join date (start range) * end_date (date): Filter by join date (end range) * * Returns: * A paginated list of learners with comprehensive metrics including: * - Course enrollments and completions * - Time spent on platform * - Pathway progress * - Certificate and skill information * - Location data * * Access Control: * - Platform admins can see all learners * - Department admins can only see learners in their departments * @returns NewPerLearnerList * @throws ApiError */ public static aiAnalyticsPerlearnerOrgsLearnersRetrieve({ org, departmentId, endDate, format = 'json', includeMainPlatform = true, isEnrolled, length, location, page, platform, program, search, startDate, }: { org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * Learner date_joined end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * Filter for users who have at least an enrollment */ isEnrolled?: boolean | null, /** * Size of data to return */ length?: number, /** * Location search string */ location?: string, /** * Page offset */ page?: number, /** * Platform search string */ platform?: string, /** * Program search string */ program?: string, /** * Search string for learner. email, username or full name */ search?: string, /** * Learner date_joined start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/perlearner/orgs/{org}/learners', path: { 'org': org, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'is_enrolled': isEnrolled, 'length': length, 'location': location, 'page': page, 'platform': platform, 'program': program, 'search': search, 'start_date': startDate, }, }); } /** * List all learners on the platform with aggregated metrics. * * This endpoint returns a paginated list of all learners with key metrics including: * - Enrollment counts * - Completion counts * - Time spent on platform * * Query Parameters: * page (int): Page number for pagination * length (int): Number of items per page * search (str): Filter learners by username, email, or name * * Returns: * A paginated list of learners with their associated metrics. * @returns PerlearnerUserList * @throws ApiError */ public static aiAnalyticsPerlearnerOrgsUsersRetrieve({ org, departmentId, format = 'json', includeMainPlatform = true, length, page, search, }: { org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * Size of data to return */ length?: number, /** * Page offset */ page?: number, /** * Search string for learner */ search?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/perlearner/orgs/{org}/users', path: { 'org': org, }, query: { 'department_id': departmentId, 'format': format, 'include_main_platform': includeMainPlatform, 'length': length, 'page': page, 'search': search, }, }); } /** * Provides information on user enrollments * * Params * user_id e.g developer@ibleducation.com| developer * @returns ActivityAPI * @throws ApiError */ public static aiAnalyticsPerlearnerOrgsUsersActivityRetrieve({ org, userId, departmentId, format = 'json', includeMainPlatform = true, }: { org: string, userId: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/perlearner/orgs/{org}/users/{user_id}/activity/', path: { 'org': org, 'user_id': userId, }, query: { 'department_id': departmentId, 'format': format, 'include_main_platform': includeMainPlatform, }, }); } /** * Provides about a learner current grade in a course with the course cut * Kwargs * 1. course_id e.g course-v1:Org+Course4+Run * 2. user_id e.g developer@ibleducation.com or dev123 (username|email) * @returns PerlearnerGradeWithCutOff * @throws ApiError */ public static aiAnalyticsPerlearnerOrgsUsersCoursesGradingCutoffsRetrieve({ courseId, org, userId, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { courseId: string, org: string, userId: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/perlearner/orgs/{org}/users/{user_id}/courses/{course_id}/grading/cutoffs', path: { 'course_id': courseId, 'org': org, 'user_id': userId, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * DRF view mixin that routes all ORM reads to the read replica. * * Falls back to the primary database if the replica is unreachable. * * Add as the **first** base class on read-only views/viewsets:: * * class MyView(ReadReplicaViewMixin, IsPlatformAdminDRFMixin, APIView): * ... * @returns DetailedGradeView * @throws ApiError */ public static aiAnalyticsPerlearnerOrgsUsersCoursesGradingDetailRetrieve({ courseId, org, userId, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { courseId: string, org: string, userId: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/perlearner/orgs/{org}/users/{user_id}/courses/{course_id}/grading/detail', path: { 'course_id': courseId, 'org': org, 'user_id': userId, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * Query Params * 1. course_id e.g course-v1:Org+Course4+Run * 2. user_id e.g developer@ibleducation.com or dev123 (username|email) * @returns PerlearnerGradeSummary * @throws ApiError */ public static aiAnalyticsPerlearnerOrgsUsersCoursesGradingSummaryRetrieve({ courseId, org, userId, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { courseId: string, org: string, userId: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/perlearner/orgs/{org}/users/{user_id}/courses/{course_id}/grading/summary', path: { 'course_id': courseId, 'org': org, 'user_id': userId, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * Average of days with atleast an activity within ENGAGEMENT_INDEX_PERIOD consecutive days for a learner in a course * @returns Value * @throws ApiError */ public static aiAnalyticsPerlearnerOrgsUsersCoursesOverviewEngagementIndexRetrieve({ courseId, org, userId, }: { courseId: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/perlearner/orgs/{org}/users/{user_id}/courses/{course_id}/overview/engagement-index', path: { 'course_id': courseId, 'org': org, 'user_id': userId, }, }); } /** * Provides about a learner current grade in a course with the course cut * Kwargs * 1. course_id e.g course-v1:Org+Course4+Run * 2. user_id e.g developer@ibleducation.com or dev123 (username|email) * @returns PerlearnerGradeWithCutOff * @throws ApiError */ public static aiAnalyticsPerlearnerOrgsUsersCoursesOverviewGradeRetrieve({ courseId, org, userId, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { courseId: string, org: string, userId: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/perlearner/orgs/{org}/users/{user_id}/courses/{course_id}/overview/grade', path: { 'course_id': courseId, 'org': org, 'user_id': userId, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * Evaluates performance index for platform, per course, per user and per user-per course * * Query Params * course_id * learner_id * @returns Value * @throws ApiError */ public static aiAnalyticsPerlearnerOrgsUsersCoursesOverviewPerformanceIndexRetrieve({ courseId, org, userId, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { courseId: string, org: string, userId: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/perlearner/orgs/{org}/users/{user_id}/courses/{course_id}/overview/performance-index', path: { 'course_id': courseId, 'org': org, 'user_id': userId, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * Time spent within a course in secs on a per-day basis * * Kwargs * 1. course_id e.g course-v1:Org+Course4+Run * 2. user_id e.g developer@ibleducation.com or dev123 (username|email) * Query Params * 3. start_date e.g 2020-10-01 * 4. end_date e.g 2020-10-10 * * Default result when no query param is added is last_7_days (today inclusive) * @returns OverTimeWithTotal * @throws ApiError */ public static aiAnalyticsPerlearnerOrgsUsersCoursesOverviewTimeOverTimeRetrieve({ courseId, org, userId, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { courseId: string, org: string, userId: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/perlearner/orgs/{org}/users/{user_id}/courses/{course_id}/overview/time/over-time', path: { 'course_id': courseId, 'org': org, 'user_id': userId, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * List of videos within a course a learner has watched * * Kwargs * 1. course_id e.g course-v1:Org+Course4+Run * 2. user_id e.g developer@ibleducation.com or dev123 (username|email) * * Default result when no query param is added is [], 0 * @returns PerLearnerCourseVideosWatched * @throws ApiError */ public static aiAnalyticsPerlearnerOrgsUsersCoursesVideosRetrieve({ courseId, org, userId, departmentId, format = 'json', includeMainPlatform = true, }: { courseId: string, org: string, userId: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/perlearner/orgs/{org}/users/{user_id}/courses/{course_id}/videos', path: { 'course_id': courseId, 'org': org, 'user_id': userId, }, query: { 'department_id': departmentId, 'format': format, 'include_main_platform': includeMainPlatform, }, }); } /** * Get video watch counts over time. * * This endpoint provides daily counts of videos watched over a specified time period, * with options to filter by course or user. * * Query Parameters: * start_date (str, optional): Start date for the time range (ISO format) * end_date (str, optional): End date for the time range (ISO format) * course_id (str, optional): Filter by course ID * user_id (str, optional): Filter by username or email * * Returns: * Daily video watch counts over the specified time period. * * Default time range is the last 7 days if no dates are specified. * * Access Control: * - Platform admins can access any video watch data * - Learners can access their own video watch data * @returns OverTimeWithTotal * @throws ApiError */ public static aiAnalyticsPerlearnerOrgsUsersCoursesVideosOverTimeRetrieve({ courseId, org, userId, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { courseId: string, org: string, userId: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/perlearner/orgs/{org}/users/{user_id}/courses/{course_id}/videos/over-time', path: { 'course_id': courseId, 'org': org, 'user_id': userId, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * Summary Grading Information for a learner on a per-enrollment basis * * Query Params * 1. user_id e.g developer@ibleducation.com or dev123 (username|email) * @returns PerlearnerGradingPerCourseAPI * @throws ApiError */ public static aiAnalyticsPerlearnerOrgsUsersGradesPerCourseRetrieve({ org, userId, departmentId, format = 'json', includeMainPlatform = true, }: { org: string, userId: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/perlearner/orgs/{org}/users/{user_id}/grades/per-course', path: { 'org': org, 'user_id': userId, }, query: { 'department_id': departmentId, 'format': format, 'include_main_platform': includeMainPlatform, }, }); } /** * Retrieve detailed information about a specific learner. * * This endpoint returns personal and activity information about a learner, * including profile data, activity metrics, and location information. * * Path Parameters: * user_id (str): The username or email of the learner * * Query Parameters: * meta (bool): Include additional analytics information when true * * Returns: * Detailed learner information including: * - Profile data (username, name, email) * - Registration and activity dates * - Activity metrics (assessments, time spent, videos watched) * - Location and browser information (when available) * * Access Control: * - Platform admins can access any learner * - Learners can access their own information * - Department admins can access learners in their departments * @returns LearnerInformationAPI * @throws ApiError */ public static aiAnalyticsPerlearnerOrgsUsersInfoRetrieve({ org, userId, departmentId, format = 'json', includeMainPlatform = true, meta = 'n', search, }: { org: string, userId: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * Include extra analytics information? * * * `y` - y * * `yes` - yes * * `true` - true * * `True` - True * * `n` - n * * `no` - no * * `false` - false * * `False` - False */ meta?: 'y' | 'yes' | 'true' | 'True' | 'n' | 'no' | 'false' | 'False', search?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/perlearner/orgs/{org}/users/{user_id}/info', path: { 'org': org, 'user_id': userId, }, query: { 'department_id': departmentId, 'format': format, 'include_main_platform': includeMainPlatform, 'meta': meta, 'search': search, }, }); } /** * Last course accessed by a learner, includes upto unit information as well * @returns PerLearnerLastAccess * @throws ApiError */ public static aiAnalyticsPerlearnerOrgsUsersLastAccessRetrieve({ org, userId, departmentId, format = 'json', includeMainPlatform = true, }: { org: string, userId: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/perlearner/orgs/{org}/users/{user_id}/last-access', path: { 'org': org, 'user_id': userId, }, query: { 'department_id': departmentId, 'format': format, 'include_main_platform': includeMainPlatform, }, }); } /** * Average of days with atleast an activity within ENGAGEMENT_INDEX_PERIOD consecutive days * @returns Value * @throws ApiError */ public static aiAnalyticsPerlearnerOrgsUsersOverviewEngagementIndexRetrieve({ org, userId, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { org: string, userId: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/perlearner/orgs/{org}/users/{user_id}/overview/engagement-index', path: { 'org': org, 'user_id': userId, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * Get average grade value for platform, course, or user. * * This endpoint returns the average grade at different levels: * - Platform level: Average grade across all courses * - Course level: Average grade for a specific course * - Learner level: Average grade for a specific learner * - Course-learner level: Grade for a specific learner in a specific course * * Query Parameters: * course_id (str, optional): Filter by course ID * learner_id (str, optional): Filter by username or email * * Returns: * The average grade value based on the specified filters. * * Access Control: * - Platform admins can access any grade data * - Learners can access their own grade data * @returns Average * @throws ApiError */ public static aiAnalyticsPerlearnerOrgsUsersOverviewGradesAverageRetrieve({ org, userId, departmentId, format = 'json', includeMainPlatform = true, }: { org: string, userId: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/perlearner/orgs/{org}/users/{user_id}/overview/grades/average', path: { 'org': org, 'user_id': userId, }, query: { 'department_id': departmentId, 'format': format, 'include_main_platform': includeMainPlatform, }, }); } /** * Evaluates performance index for platform, per course, per user and per user-per course * * Query Params * course_id * learner_id * @returns Value * @throws ApiError */ public static aiAnalyticsPerlearnerOrgsUsersOverviewPerformanceIndexRetrieve({ org, userId, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { org: string, userId: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/perlearner/orgs/{org}/users/{user_id}/overview/performance-index', path: { 'org': org, 'user_id': userId, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * Time spent in secs on a per-day basis * * Query Params * 1. course_id e.g course-v1:Org+Course4+Run * 2. user_id e.g developer@ibleducation.com or dev123 (username|email) * 3. start_date e.g 2020-10-01 * 4. end_date e.g 2020-10-10 * * Default result when no query param is added is last_7_days (today inclusive) * @returns OverTimeWithTotal * @throws ApiError */ public static aiAnalyticsPerlearnerOrgsUsersOverviewTimeOverTimeRetrieve({ org, userId, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { org: string, userId: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/perlearner/orgs/{org}/users/{user_id}/overview/time/over-time', path: { 'org': org, 'user_id': userId, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * Get video watch counts over time. * * This endpoint provides daily counts of videos watched over a specified time period, * with options to filter by course or user. * * Query Parameters: * start_date (str, optional): Start date for the time range (ISO format) * end_date (str, optional): End date for the time range (ISO format) * course_id (str, optional): Filter by course ID * user_id (str, optional): Filter by username or email * * Returns: * Daily video watch counts over the specified time period. * * Default time range is the last 7 days if no dates are specified. * * Access Control: * - Platform admins can access any video watch data * - Learners can access their own video watch data * @returns OverTimeWithTotal * @throws ApiError */ public static aiAnalyticsPerlearnerOrgsUsersVideosOverTimeRetrieve({ org, userId, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { org: string, userId: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/perlearner/orgs/{org}/users/{user_id}/videos/over-time', path: { 'org': org, 'user_id': userId, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * Summary Videos watched data for a learner per enrollment * * Query Params * 1. user_id e.g developer@ibleducation.com or dev123 (username|email) * @returns PerlearnerEngagementVideosWatchedPerCourse * @throws ApiError */ public static aiAnalyticsPerlearnerOrgsUsersVideosPerCourseRetrieve({ org, userId, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { org: string, userId: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/perlearner/orgs/{org}/users/{user_id}/videos/per-course', path: { 'org': org, 'user_id': userId, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * Get a list of user groups with metrics and filtering options. * * This endpoint provides a paginated list of user groups with aggregated metrics * about learner performance, course completions, and skill acquisition. * * This endpoint uses DM token authentication and respects department-based * access controls. * * Query Parameters: * page (int, optional): Page number for pagination * length (int, optional): Number of items per page * program (str, optional): Filter by program * pathway (str, optional): Filter by pathway * groups (list, optional): Filter by group names * location (str, optional): Filter by location * is_enrolled (bool, optional): Filter for groups with enrolled users * start_date (date, optional): Filter by learner join date (start range) * end_date (date, optional): Filter by learner join date (end range) * * Returns: * A paginated list of user groups with comprehensive metrics. * * Access Control: * - Platform admins can see all groups * - Department admins can only see groups in their departments * @returns GroupList * @throws ApiError */ public static aiAnalyticsUserGroupsOrgsRetrieve({ org, departmentId, endDate, format = 'json', groups, includeMainPlatform = true, isEnrolled, length, location, page, pathway, program, startDate, }: { org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * Filter by learners date_joined. Start date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Groups search string. Single string or list of strings. e.g 'sample_group' or `['group', 'another group']` */ groups?: Array, /** * Include main platform data */ includeMainPlatform?: boolean, /** * Filter for users who have at least an enrollment */ isEnrolled?: boolean | null, /** * Size of data to return */ length?: number, /** * Location search string */ location?: string, /** * Page offset */ page?: number, /** * Pathway string */ pathway?: string, /** * Program search string */ program?: string, /** * Filter by learners date_joined. Start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/ai-analytics/user-groups/orgs/{org}/', path: { 'org': org, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'groups': groups, 'include_main_platform': includeMainPlatform, 'is_enrolled': isEnrolled, 'length': length, 'location': location, 'page': page, 'pathway': pathway, 'program': program, 'start_date': startDate, }, }); } /** * Get Content Analytics * * Retrieve aggregated analytics for catalog content (courses, programs, pathways, skills). * * Returns both summary statistics and paginated list of content items with individual analytics. * When a platform_key is provided, results are filtered to show only content consumed by * learners associated with that platform. * * **RBAC Requirements:** * - Requires: Analytics Viewer role (Ibl.Analytics/Core/read) or Tenant Admin role (Ibl.*) * * **Metrics supported:** * - `course` or `courses`: Course analytics with time spent * - `program` or `programs`: Program analytics * - `pathway` or `pathways`: Pathway analytics * - `skill` or `skills`: Skill analytics * * **Platform Filtering:** * - Without platform_key: Shows global analytics across all platforms * - With platform_key: Shows analytics filtered by platform learners only * * **Time Spent Analytics:** * - Platform-level: Total time spent across all content and average per learner * - Course-level: Total time spent per course and average per enrolled learner * - Time values are provided in seconds for precision * - Overtime: Time series data showing platform time spent over last 7 days (courses only, and include_overtime=true) * * **External Content:** * - Content not owned by the requesting platform but used by its learners is marked as "external" * - External content has limited metadata exposure for privacy * * @returns ContentResponse * @throws ApiError */ public static getContentAnalytics({ metric, dateFilter = 'today', endDate, granularity = 'hour', includeOvertime = false, limit = 20, mentorUniqueId, page = 1, platformKey, search, sortBy = 'name', startDate, usergroupIds, }: { /** * The type of content to retrieve (course, program, pathway, skill) * * * `course` - course * * `courses` - courses * * `program` - program * * `programs` - programs * * `pathway` - pathway * * `pathways` - pathways * * `skill` - skill * * `skills` - skills */ metric: 'course' | 'courses' | 'program' | 'programs' | 'pathway' | 'pathways' | 'skill' | 'skills', /** * * `today` - Today only * * `7d` - Last 7 days * * `30d` - Last 30 days * * `90d` - Last 90 days * * `all_time` - All time * * `custom` - Custom date range */ dateFilter?: 'today' | '7d' | '30d' | '90d' | 'all_time' | 'custom', endDate?: string, /** * * `day` - day * * `hour` - hour * * `week` - week * * `month` - month */ granularity?: 'day' | 'hour' | 'week' | 'month', /** * Include time spent over time data */ includeOvertime?: boolean, /** * Number of items per page (max 100) */ limit?: number, mentorUniqueId?: string, /** * Page number for pagination */ page?: number, /** * Optional platform key to filter results by platform */ platformKey?: string | null, /** * Filter results by name/slug (case-insensitive substring match) */ search?: string, /** * Sort order for results. 'active_enrollments' is only supported for course, program, and pathway metrics; it is ignored for skill. * * * `name` - Name (default) * * `active_enrollments` - Active enrollments (descending) */ sortBy?: 'name' | 'active_enrollments', startDate?: string, /** * Optional list of usergroup IDs to filter results */ usergroupIds?: Array | null, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/analytics/content/', query: { 'date_filter': dateFilter, 'end_date': endDate, 'granularity': granularity, 'include_overtime': includeOvertime, 'limit': limit, 'mentor_unique_id': mentorUniqueId, 'metric': metric, 'page': page, 'platform_key': platformKey, 'search': search, 'sort_by': sortBy, 'start_date': startDate, 'usergroup_ids': usergroupIds, }, }); } /** * Get Content Details * Retrieve detailed analytics for a specific content item including summary statistics, learner-level data, and optional time series information. * @returns ContentDetailsResponse * @throws ApiError */ public static getContentDetails({ contentId, metric, dateFilter = 'today', endDate, limit = 10, mentorUniqueId, page = 1, platformKey, search, startDate, timeMetric, usergroupIds, }: { contentId: string, /** * Content type to fetch (course, program, pathway, skill) * * * `course` - course * * `courses` - courses * * `program` - program * * `programs` - programs * * `pathway` - pathway * * `pathways` - pathways * * `skill` - skill * * `skills` - skills */ metric: 'course' | 'courses' | 'program' | 'programs' | 'pathway' | 'pathways' | 'skill' | 'skills', /** * * `today` - Today only * * `7d` - Last 7 days * * `30d` - Last 30 days * * `90d` - Last 90 days * * `all_time` - All time * * `custom` - Custom date range */ dateFilter?: 'today' | '7d' | '30d' | '90d' | 'all_time' | 'custom', endDate?: string, /** * Number of learner records per page */ limit?: number, mentorUniqueId?: string, page?: number, platformKey?: string, search?: string, startDate?: string, /** * Optional time series metric (enrollments, completions, ratings, time_spent) */ timeMetric?: string | null, /** * Optional list of usergroup IDs to filter results */ usergroupIds?: Array | null, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/analytics/content/details/{content_id}/', path: { 'content_id': contentId, }, query: { 'date_filter': dateFilter, 'end_date': endDate, 'limit': limit, 'mentor_unique_id': mentorUniqueId, 'metric': metric, 'page': page, 'platform_key': platformKey, 'search': search, 'start_date': startDate, 'time_metric': timeMetric, 'usergroup_ids': usergroupIds, }, }); } /** * Mixin for RBAC validation for mentor analytics views. * * Mentor analytics endpoints enforce RBAC in two phases: * 1. Endpoint authorization (_perform_mentor_analytics_validation): * - Aggregate (no mentor_unique_id): requires * "Ibl.Analytics/CanViewAnalytics/action" on /platforms/{pk}/ AND * "Ibl.Analytics/Mentors/read" on /platforms/{pk}/mentors/. * - Per-mentor (mentor_unique_id provided): requires * "Ibl.Analytics/CanViewMentorAnalytics/action" on * /platforms/{pk}/mentors/{mentor_id}/. The mentor-owner bypass * (is_owner) applies via the MENTOR_OWNER well-known role. * 2. Row-level filter (_get_accessible_user_ids_for_mentor_analytics): * - Enumerates accessible users under * /platforms/{pk}/mentors/{mentor_id}/users/ using * "Ibl.Analytics/Mentors/read". Grants on the mentor resource itself * cascade to its users (full mentor access). Usergroup authorization * is resolved at platform-level (/platforms/{pk}/usergroups/) — * mentor-level grants do NOT cascade to usergroup access. * * Special case - Mentor owner unfiltered access: * If the requesting user owns the mentor AND no usergroup_ids are * specified, returns None (no filtering) — the analytics query layer is * already scoped to the mentor. With usergroup_ids provided, the owner * falls through to normal RBAC filtering and still needs explicit access * (ownership or grant) to the requested groups. * * Note: Mentor analytics APIs work with platform_key (from query params). * @returns ConversationsChart * @throws ApiError */ public static analyticsConversationsRetrieve({ dateFilter = 'today', endDate, granularity = 'hour', mentorUniqueId, metric = 'conversations', platformKey, startDate, usergroupIds, }: { /** * * `today` - Today only * * `7d` - Last 7 days * * `30d` - Last 30 days * * `90d` - Last 90 days * * `all_time` - All time * * `custom` - Custom date range */ dateFilter?: 'today' | '7d' | '30d' | '90d' | 'all_time' | 'custom', endDate?: string, /** * * `day` - day * * `hour` - hour * * `week` - week * * `month` - month */ granularity?: 'day' | 'hour' | 'week' | 'month', mentorUniqueId?: string, /** * * `conversations` - Conversations over time * * `headline` - Headline metrics for conversations (avg messages per conversation, avg rating) */ metric?: 'conversations' | 'headline', platformKey?: string, startDate?: string, /** * Optional list of usergroup IDs to filter results */ usergroupIds?: Array | null, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/analytics/conversations/', query: { 'date_filter': dateFilter, 'end_date': endDate, 'granularity': granularity, 'mentor_unique_id': mentorUniqueId, 'metric': metric, 'platform_key': platformKey, 'start_date': startDate, 'usergroup_ids': usergroupIds, }, }); } /** * Financial Analytics API - Get comprehensive cost metrics with comparison analysis. * * This endpoint provides period-based cost analysis (not cumulative) with support for: * - Multiple time granularities and metrics * - Cross-dimensional filtering * - Percentage change vs comparison periods * - Forward-filled time series * * **Examples:** * * **Basic Weekly Costs:** * ``` * GET /api/analytics/financial/?metric=weekly_costs&comparison_days=10 * ``` * * **Platform & Mentor Filtered:** * ``` * # Get total costs for a specific platform and agent * GET /api/analytics/financial/?metric=total_costs&platform_key=web-app&mentor_unique_id=mentor-123&comparison_days=14 * ``` * * **Monthly Costs by Provider:** * ``` * GET /api/analytics/financial/?metric=monthly_costs&provider=openai&granularity=month&comparison_days=30 * ``` * * **Daily Costs for Specific User:** * ``` * GET /api/analytics/financial/?metric=total_costs&username=user-456&granularity=day&start_date=2025-01-15&end_date=2025-01-21&comparison_days=7 * ``` * * * **Response Structure:** * ```json * { * "metric": "weekly_costs", * "value": 12.47, * "percentage_change": 8.5, * "overtime": [ * {"date": "2025-01-06", "value": 2.89}, * {"date": "2025-01-13", "value": 3.12} * ], * "period_info": { * "start_date": "2025-01-01", * "end_date": "2025-01-31", * "period_days": 31 * }, * "comparison_info": { * "previous_period_value": 11.50, * ... * } * } * ``` * @returns BaseFinanceResponse Successful financial metrics response with period-based cost data * @throws ApiError */ public static analyticsFinancialRetrieve({ metric, comparisonDays, dateFilter = 'today', endDate, fillMethod = 'zero', granularity = 'day', llmModel, mentorUniqueId, platformKey, provider, showOvertime = true, startDate, usergroupIds, username, }: { /** * Type of financial metric to retrieve * * * `total_costs` - Total costs for selected timeframe * * `weekly_costs` - Costs for current/selected week * * `monthly_costs` - Costs for current/selected month */ metric: 'total_costs' | 'weekly_costs' | 'monthly_costs', /** * Number of days for comparison period to calculate percentage change (e.g., 10 for 10-day comparison) */ comparisonDays?: number, /** * * `today` - Today only * * `7d` - Last 7 days * * `30d` - Last 30 days * * `90d` - Last 90 days * * `all_time` - All time * * `custom` - Custom date range */ dateFilter?: 'today' | '7d' | '30d' | '90d' | 'all_time' | 'custom', endDate?: string, /** * Method for filling missing time periods in overtime data * * * `zero` - Fill missing periods with zero * * `previous` - Fill missing periods with previous value */ fillMethod?: 'zero' | 'previous', /** * Time granularity for overtime series data * * * `day` - Daily data points * * `week` - Weekly data points * * `month` - Monthly data points */ granularity?: 'day' | 'week' | 'month', /** * Filter by specific LLM model (e.g., gpt-4o, claude-3-5-sonnet) */ llmModel?: string, mentorUniqueId?: string, platformKey?: string, /** * Filter by AI provider * * * `openai` - OpenAI * * `anthropic` - Anthropic * * `azure` - Azure * * `google` - Google * * `meta` - Meta * * `other` - Other */ provider?: 'openai' | 'anthropic' | 'azure' | 'google' | 'meta' | 'other', /** * Whether to include overtime series data in response */ showOvertime?: boolean, startDate?: string, /** * Optional list of usergroup IDs to filter results */ usergroupIds?: Array | null, /** * Filter by specific username - returns costs for this user only */ username?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/analytics/financial/', query: { 'comparison_days': comparisonDays, 'date_filter': dateFilter, 'end_date': endDate, 'fill_method': fillMethod, 'granularity': granularity, 'llm_model': llmModel, 'mentor_unique_id': mentorUniqueId, 'metric': metric, 'platform_key': platformKey, 'provider': provider, 'show_overtime': showOvertime, 'start_date': startDate, 'usergroup_ids': usergroupIds, 'username': username, }, errors: { 400: `Bad Request - Invalid query parameters`, 403: `Forbidden - Insufficient permissions`, 500: `Internal Server Error`, }, }); } /** * Financial Details Analytics API – paginated cost tables with flexible grouping. * * This endpoint returns tabular cost metrics aggregated by the dimension * specified via the `group_by` query parameter. One or more KPI columns * can be requested through the comma-separated `metrics` list while * typical filters (date range, provider, platform_key, user, etc.) narrow the * dataset. Results are paginated with `page` / `limit`. * * **Required query parameters** * - group_by – provider | llm_model | username | mentor | platform * - metrics – csv list of KPI names, e.g. total_cost, sessions * * **Shared optional filters** * - start_date, end_date – ISO yyyy-mm-dd (ignored when all_time=true) * - platform_key – tenant isolation * - mentor_unique_id – filter to one agent * - username – filter to a learner * - provider / llm_model – filter to LLM provider / model * - all_time – true → lifetime totals * - page (default 1), limit (default 50) * * **Examples** * -------- * 1. Cost by provider for the last week * ``` * GET /api/v2/analytics/financial/details? * group_by=provider& * metrics=total_cost& * start_date=2025-01-01& * end_date=2025-01-07& * page=1&limit=10 * ``` * * 2. Lifetime cost per user with extra KPIs * ``` * GET /api/v2/analytics/financial/details? * group_by=username& * metrics=total_cost,sessions& * all_time=true&page=1&limit=50 * ``` * 3. Cost by LLM model with tenant filter * ``` * GET /api/v2/analytics/financial/details? * group_by=llm_model& * metrics=total_cost& * platform_key=web-app& * start_date=2025-01-01&end_date=2025-01-31 * ``` * Response structure * ------------------- * ``` * { * "page": 1, * "limit": 10, * "total_pages": 1, * "total_records": 3, * "rows": [ * {"provider": "openai", "total_cost": "2.50000"}, * {"provider": "anthropic", "total_cost": "1.00000"}, * {"provider": "azure", "total_cost": "0.50000"} * ], * "metrics": [ * { * "name": "total_cost", * "unit": "$", * "description": "Cost for this entity in period" * } * ], * "total_cost": "4.00000" // optional grand-total when available * } * `` * @returns FinanceDetailsResponse * @throws ApiError */ public static analyticsFinancialDetailsRetrieve({ groupBy, dateFilter = 'today', endDate, limit = 20, llmModel, mentorUniqueId, metrics = 'total_cost', page = 1, platformKey, provider, search, startDate, usergroupIds, username, }: { /** * Dimension to group by * * * `provider` - Group by provider * * `llm_model` - Group by LLM model * * `username` - Group by username * * `mentor` - Group by agent * * `platform` - Group by platform * * `action` - Group by actions */ groupBy: 'provider' | 'llm_model' | 'username' | 'mentor' | 'platform' | 'action', /** * * `today` - Today only * * `7d` - Last 7 days * * `30d` - Last 30 days * * `90d` - Last 90 days * * `all_time` - All time * * `custom` - Custom date range */ dateFilter?: 'today' | '7d' | '30d' | '90d' | 'all_time' | 'custom', endDate?: string, limit?: number, llmModel?: string, mentorUniqueId?: string, /** * Comma-separated list of metrics (e.g. total_cost,sessions, last_active) */ metrics?: string, page?: number, platformKey?: string, provider?: string, search?: string, startDate?: string, /** * Optional list of usergroup IDs to filter results */ usergroupIds?: Array | null, username?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/analytics/financial/details/', query: { 'date_filter': dateFilter, 'end_date': endDate, 'group_by': groupBy, 'limit': limit, 'llm_model': llmModel, 'mentor_unique_id': mentorUniqueId, 'metrics': metrics, 'page': page, 'platform_key': platformKey, 'provider': provider, 'search': search, 'start_date': startDate, 'usergroup_ids': usergroupIds, 'username': username, }, errors: { 400: `Bad Request – invalid query params`, 500: `Internal Server Error`, }, }); } /** * Flexible Invoice Report API – Billing summary with username and platform filtering. * * This endpoint generates invoice reports with flexible filtering options: * - Platform admins can view their platform's data and filter by username within their platform * - Super admins can view any combination of username/platform or global summaries * * **Key Features:** * - Flexible filtering by username and/or platform_key * - Essential metrics: total cost, sessions, usage period * - Provider breakdown (OpenAI, Anthropic, etc.) * - Top agents/actions by cost * - Clean, invoice-ready format * * **Query Parameters:** * - username: Filter by specific username (optional) * - platform_key: Filter by platform (optional, but required for platform admins) * - start_date, end_date: billing period (defaults to last 30 days) * - include_breakdown: show provider/agent details (default: true) * * **Permission Logic:** * - Platform admins: Must include platform_key matching their permission scope * - Super admins: Can use any combination of filters or none (global summary) * * **Examples:** * ``` * # Platform admin viewing their platform * GET /api/analytics/financial/invoice?platform_key=web-app * * # Platform admin viewing specific user in their platform * GET /api/analytics/financial/invoice?platform_key=web-app&username=john.doe * * # Super admin viewing specific user across all platforms * GET /api/analytics/financial/invoice?username=john.doe * * # Super admin viewing global summary * GET /api/analytics/financial/invoice * ``` * * **Response Structure:** * ```json * { * "entity": { * "type": "user|platform|global", * "username": "john.doe", * "platform_key": "web-app", * "platform_name": "Web Application", * "display_name": "John Doe on Web Application" * }, * "billing_period": { * "start_date": "2025-01-01", * "end_date": "2025-01-31", * "days": 31 * }, * "summary": { * "total_cost": 245.750, * "total_sessions": 1250, * "active_users": 85, * "cost_per_session": 0.196 * }, * "breakdown": { * "by_provider": [...], * "by_mentor": [...], * "by_action": [...] * } * } * ``` * @returns InvoiceReportResponse * @throws ApiError */ public static analyticsFinancialInvoiceRetrieve({ endDate, includeBreakdown = true, platformKey, startDate, usergroupIds, username, }: { /** * End date for billing period (defaults to today) */ endDate?: string, /** * Whether to include provider and agent breakdown */ includeBreakdown?: boolean, /** * Platform key to filter by (optional, required for platform admins) */ platformKey?: string, /** * Start date for billing period (defaults to 30 days ago) */ startDate?: string, /** * Optional list of usergroup IDs to filter results */ usergroupIds?: Array | null, /** * Username to generate invoice for (optional) */ username?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/analytics/financial/invoice/', query: { 'end_date': endDate, 'include_breakdown': includeBreakdown, 'platform_key': platformKey, 'start_date': startDate, 'usergroup_ids': usergroupIds, 'username': username, }, errors: { 400: `Bad Request – invalid parameters`, 403: `Forbidden – insufficient permissions`, 404: `No data found`, 500: `Internal Server Error`, }, }); } /** * * Retrieve a holistic snapshot of a user across catalog enrollments, agent * engagement, skills, credentials, and time spent data. The `metrics` query parameter controls * which sections are returned and defaults to `courses` when omitted. A user can call this * endpoint for themselves without passing `username`; admins pass `username` to target a * user in their scope. * * The `mentors` section lists every agent the user has engaged, sourced from both their * sessions and saved agents. Each agent's `interactions` block reports engagement depth * (`session_count`, `conversation_count`, human/AI message counts, `avg_messages_per_session`), * recency and stickiness (`first_interaction`, `latest_interaction`, `active_days`), * affinity (`rating`, `is_starred`), and spend (`cost_usd`, in USD). The user's total * agent spend is `user.total_agent_cost_usd`. * * Optional `course_id` / `program_id` / `pathway_id` scope the matching section to a * single item (empty list if the user is not enrolled — never a 404); omitting them * returns the full list unchanged. When `course_id` is set, the course block is also * enriched with the user's live edX Progress data under `edx_progress` (completion * summary, grade, grade summary) unless `include_edx_progress=false`. The edX call is * best-effort: on failure `edx_progress` is null and the DM data is still returned. * `program_id` / `pathway_id` get scoping only — no edX enrichment. * * When AI is enabled, three additional sections surface the user's conversation * analytics for the same user: * - `conversations`: headline metrics (average messages per conversation, rating, * and cost) by default, or conversation counts over time when * `conversation_metric=conversations`. * - `messages`: the user's conversation list with `summary`, `results`, and * `pagination`. Supports `page`, `limit`, `search`, `min_messages`, * `max_messages`, `sentiment`, and `topic`. All-time unless a date filter is * supplied. * - `message_detail`: one conversation's transcript (summary plus human/AI message * pairs); requires `session_id`. A `session_id` belonging to another user returns * 403. Optionally scope any of these to one agent with `mentor_unique_id`. * * @returns LearnerDetailsResponse Learner profile with requested analytics data * @throws ApiError */ public static analyticsLearnerDetailsRetrieve({ conversationMetric = 'headline', courseId, dateFilter = 'today', endDate, granularity = 'hour', includeEdxProgress = true, limit = 20, maxMessages, mentorUniqueId, metrics, minMessages, overtime = false, page = 1, pathwayId, platformKey, programId, search, sentiment, sessionId, startDate, topic, usergroupIds, username, }: { /** * For the `conversations` metric: `headline` (avg messages/rating/cost, the default) or `conversations` (conversation counts over time). * * * `conversations` - conversations * * `headline` - headline */ conversationMetric?: 'conversations' | 'headline', /** * Scope the `courses` and `time_spent` sections to a single course. When set, also enriches the course with live edX progress (see `include_edx_progress`). */ courseId?: string, /** * * `today` - Today only * * `7d` - Last 7 days * * `30d` - Last 30 days * * `90d` - Last 90 days * * `all_time` - All time * * `custom` - Custom date range */ dateFilter?: 'today' | '7d' | '30d' | '90d' | 'all_time' | 'custom', endDate?: string, /** * * `day` - day * * `hour` - hour * * `week` - week * * `month` - month */ granularity?: 'day' | 'hour' | 'week' | 'month', /** * When `course_id` is set, fold the learner's live edX Progress-page data (completion summary, grade, grade summary) into the course block. Defaults to true; set false to skip the edX round-trip. */ includeEdxProgress?: boolean, /** * Page size for the `messages` metric (default: 20, max: 100). */ limit?: number, /** * Filter the `messages` list to conversations with at most N messages. */ maxMessages?: number, mentorUniqueId?: string, /** * Comma-separated sections to return: courses, programs, pathways, agents, skills, credentials, time_spent, conversations, messages, message_detail. `agents` is an alias for the agent section. The conversations/messages/message_detail sections are available when AI is enabled. Defaults to courses when omitted. */ metrics?: string, /** * Filter the `messages` list to conversations with at least N messages. */ minMessages?: number, /** * Include overtime metrics for time_spent data (default: false) */ overtime?: boolean, /** * Page number for the `messages` metric (default: 1). */ page?: number, /** * Scope the `pathways` section to a single pathway. */ pathwayId?: string, platformKey?: string, /** * Scope the `programs` section to a single program. */ programId?: string, /** * Filter the `messages` list by first user message or username. */ search?: string, /** * Filter the `messages` list by conversation sentiment. * * * `positive` - positive * * `negative` - negative * * `neutral` - neutral */ sentiment?: 'positive' | 'negative' | 'neutral', /** * Required for the `message_detail` metric: the conversation to fetch. */ sessionId?: string, startDate?: string, /** * Filter the `messages` list to conversations whose topic contains this text. */ topic?: string, /** * Optional list of usergroup IDs to filter results */ usergroupIds?: Array | null, username?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/analytics/learner/details', query: { 'conversation_metric': conversationMetric, 'course_id': courseId, 'date_filter': dateFilter, 'end_date': endDate, 'granularity': granularity, 'include_edx_progress': includeEdxProgress, 'limit': limit, 'max_messages': maxMessages, 'mentor_unique_id': mentorUniqueId, 'metrics': metrics, 'min_messages': minMessages, 'overtime': overtime, 'page': page, 'pathway_id': pathwayId, 'platform_key': platformKey, 'program_id': programId, 'search': search, 'sentiment': sentiment, 'session_id': sessionId, 'start_date': startDate, 'topic': topic, 'usergroup_ids': usergroupIds, 'username': username, }, errors: { 400: `Bad Request - Invalid parameters supplied`, 404: `Learner not found`, 500: `Unexpected error`, }, }); } /** * Unified API endpoint for learner analytics. * * This endpoint provides either: * 1. Cross-platform summary (when only username is provided) * 2. Platform-specific detailed data (when username + platform_key are provided) * * Query params: * - username (required): Username of the learner * - platform_key (optional): Platform key for platform-specific data * - page (optional): Page number (default: 1) * - limit (optional): Records per page (default: 20, max: 100) * * Returns: * - If platform_key provided: Detailed platform metrics * - If no platform_key: Cross-platform summary with pagination * @returns LearnerAnalyticsResponse * @throws ApiError */ public static analyticsLearnersRetrieve({ dateFilter = 'today', endDate, granularity = 'hour', limit = 20, mentorUniqueId, overtime = false, page = 1, platformKey, startDate, usergroupIds, username, }: { /** * * `today` - Today only * * `7d` - Last 7 days * * `30d` - Last 30 days * * `90d` - Last 90 days * * `all_time` - All time * * `custom` - Custom date range */ dateFilter?: 'today' | '7d' | '30d' | '90d' | 'all_time' | 'custom', endDate?: string, /** * * `day` - day * * `hour` - hour * * `week` - week * * `month` - month */ granularity?: 'day' | 'hour' | 'week' | 'month', /** * Number of records per page (default: 20, max: 100) */ limit?: number, mentorUniqueId?: string, /** * Include overtime metrics for the user in the platform (default: false) */ overtime?: boolean, /** * Page number (default: 1) */ page?: number, /** * Optional platform key - if provided, returns platform-specific detailed data */ platformKey?: string, startDate?: string, /** * Optional list of usergroup IDs to filter results */ usergroupIds?: Array | null, /** * Username of the learner to get analytics for. Defaults to self if not provided. */ username?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/analytics/learners/', query: { 'date_filter': dateFilter, 'end_date': endDate, 'granularity': granularity, 'limit': limit, 'mentor_unique_id': mentorUniqueId, 'overtime': overtime, 'page': page, 'platform_key': platformKey, 'start_date': startDate, 'usergroup_ids': usergroupIds, 'username': username, }, }); } /** * * Retrieve a paginated list of learners for a specific platform with their comprehensive * metrics from the UserPlatformSummary materialized view. This endpoint is accessible only * to platform administrators and supports search, sorting, and pagination. * * @returns LearnerListResponse Paginated list of learners with their metrics * @throws ApiError */ public static analyticsLearnersListRetrieve({ platformKey, dateFilter = 'today', endDate, granularity = 'hour', limit = 20, mentorUniqueId, page = 1, search, sortBy = 'last_activity', sortOrder = 'desc', startDate, usergroupIds, }: { /** * Platform key to filter learners by platform */ platformKey: string, /** * * `today` - Today only * * `7d` - Last 7 days * * `30d` - Last 30 days * * `90d` - Last 90 days * * `all_time` - All time * * `custom` - Custom date range */ dateFilter?: 'today' | '7d' | '30d' | '90d' | 'all_time' | 'custom', endDate?: string, /** * * `day` - day * * `hour` - hour * * `week` - week * * `month` - month */ granularity?: 'day' | 'hour' | 'week' | 'month', /** * Number of learners per page (default: 20, max: 100) */ limit?: number, mentorUniqueId?: string, /** * Page number for pagination (default: 1) */ page?: number, /** * Search term to filter learners by username, email, or name */ search?: string, /** * Field to sort learners by (default: last_activity) * * * `username` - Username * * `name` - Name * * `last_activity` - Last Activity * * `total_points` - Total Points * * `total_time_spent_seconds` - Time Spent * * `total_enrollments` - Enrollments * * `total_skills_count` - Skills Count */ sortBy?: 'username' | 'name' | 'last_activity' | 'total_points' | 'total_time_spent_seconds' | 'total_enrollments' | 'total_skills_count', /** * Sort order (default: desc) * * * `asc` - Ascending * * `desc` - Descending */ sortOrder?: 'asc' | 'desc', startDate?: string, /** * Optional list of usergroup IDs to filter results */ usergroupIds?: Array | null, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/analytics/learners/list/', query: { 'date_filter': dateFilter, 'end_date': endDate, 'granularity': granularity, 'limit': limit, 'mentor_unique_id': mentorUniqueId, 'page': page, 'platform_key': platformKey, 'search': search, 'sort_by': sortBy, 'sort_order': sortOrder, 'start_date': startDate, 'usergroup_ids': usergroupIds, }, errors: { 400: `Bad Request - Invalid parameters supplied`, 403: `Forbidden - Platform admin access required`, 500: `Unexpected error`, }, }); } /** * LLM cost/usage analytics * Platform-scoped analytics for LLM **cost, token usage, latency, and counts**. One endpoint serves three resources selected by the `resource` param: * * - `metrics` (default) — aggregate measures with optional `group_by` (type|model|tags|environment) and `granularity` (day|week|month) time series. * - `observations` — row-level generation drill-down, page-paginated; pass `observation_id` to fetch one observation. * - `traces` — trace list (per-user/per-session drill-down the metrics resource cannot group by); pass `trace_id` to fetch one trace. * * **Tenant isolation:** every *list* query is scoped to the validated request platform via a server-injected `metadata.platform_key` filter. Get-by-id (`trace_id`/`observation_id`) takes only the id, so ownership is verified after the fetch and a cross-tenant record returns **404** (never 403) so its existence is not leaked. The client `platform_key` is used only for RBAC validation, never to scope the upstream call — the analytics store is project-scoped across all tenants. * * **Default time frame:** when no date params are given the query defaults to `date_filter=today` (start=end=today). Widen it with `date_filter=7d|30d|90d`, `date_filter=all_time` for full history, or `date_filter=custom` plus `start_date`/`end_date`. * * **Measures** (csv `measures`): total_cost, input_tokens, output_tokens, total_tokens, count, latency. **Aggregation** applies to every measure: sum|avg|count|min|max|p50|p75|p90|p95|p99. * * **Per-mentor ranking:** the metrics resource cannot group by custom metadata, so use `group_by=tags` — traces carry both `platform_key:` and `mentor_id:` tags, so with the platform filter applied each tag bucket collapses to one mentor. Parse `mentor_id:` out of the returned `tags` array. * * **Recipes** * ``` * # Total spend today (tenant-wide) * GET ?platform_key=acme&resource=metrics&measures=total_cost * * # Cost + tokens + calls per service, last 30 days * GET ?platform_key=acme&resource=metrics&measures=total_cost,total_tokens,count&group_by=type&date_filter=30d * * # Cost per model over a custom range * GET ?platform_key=acme&resource=metrics&measures=total_cost&group_by=model&date_filter=custom&start_date=2025-01-01&end_date=2025-01-31 * * # Per-mentor cost ranking * GET ?platform_key=acme&resource=metrics&measures=total_cost&group_by=tags * * # Daily cost time series * GET ?platform_key=acme&resource=metrics&measures=total_cost&granularity=day&date_filter=30d * * # Latency percentiles for the chat service * GET ?platform_key=acme&resource=metrics&measures=latency&aggregation=p95&trace_name=chat * * # One learner's spend * GET ?platform_key=acme&resource=metrics&measures=total_cost&username=alice * * # Row-level drill-down for a trace * GET ?platform_key=acme&resource=observations&trace_id=abc123&page=1&limit=50 * * # Fetch a single observation * GET ?platform_key=acme&resource=observations&observation_id=obs123 * * # Recent traces for one learner (newest first) * GET ?platform_key=acme&resource=traces&username=alice&order_by=timestamp&direction=desc&limit=50 * * # All traces in one conversation/session * GET ?platform_key=acme&resource=traces&session_id=sess123 * * # Fetch a single trace * GET ?platform_key=acme&resource=traces&trace_id=abc123 * ``` * * **Limits:** `limit` caps rows (default 50, max 1000). `group_by` cannot use userId/sessionId/mentor_id (the upstream store rejects them); those are filter-only. The metrics query requires bounded timestamps, so `date_filter=all_time` is served from a fixed 2020-01-01 lower bound through today (wide enough to cover all ingested history). * @returns LlmUsageAnalyticsResponse Metrics rows or paginated observation records. * @throws ApiError */ public static analyticsLlmUsageRetrieve({ aggregation = 'sum', dateFilter = 'today', direction = 'desc', endDate, granularity, groupBy, limit = 50, llmModel, measures, mentorUniqueId, observationId, orderBy, page = 1, platformKey, resource = 'metrics', sessionId, startDate, traceId, traceName, usergroupIds, username, view = 'observations', }: { /** * Aggregation applied to each measure. * * * `avg` - avg * * `count` - count * * `max` - max * * `min` - min * * `p50` - p50 * * `p75` - p75 * * `p90` - p90 * * `p95` - p95 * * `p99` - p99 * * `sum` - sum */ aggregation?: 'avg' | 'count' | 'max' | 'min' | 'p50' | 'p75' | 'p90' | 'p95' | 'p99' | 'sum', /** * * `today` - Today only * * `7d` - Last 7 days * * `30d` - Last 30 days * * `90d` - Last 90 days * * `all_time` - All time * * `custom` - Custom date range */ dateFilter?: 'today' | '7d' | '30d' | '90d' | 'all_time' | 'custom', /** * Ordering direction. * * * `asc` - asc * * `desc` - desc */ direction?: 'asc' | 'desc', endDate?: string, /** * Time-series bucket size; omit for a flat aggregate. * * * `day` - day * * `month` - month * * `week` - week */ granularity?: 'day' | 'month' | 'week', /** * Dimension to group by (type|model|tags|environment). * * * `environment` - environment * * `model` - model * * `tags` - tags * * `type` - type */ groupBy?: 'environment' | 'model' | 'tags' | 'type', /** * Row cap (max 1000). */ limit?: number, /** * Filter to one model by its provided model name, e.g. gpt-4o-mini. */ llmModel?: string, /** * Comma-separated measures: count, input_tokens, latency, output_tokens, total_cost, total_tokens */ measures?: string, mentorUniqueId?: string, /** * Fetch a single observation by id (observations resource, get-by-id). */ observationId?: string, /** * Ordering field. Resource-dependent: for metrics a measure (count, input_tokens, latency, output_tokens, total_cost, total_tokens); for traces a trace field (name, session_id, timestamp, username, default timestamp). */ orderBy?: string, /** * 1-based page number for observation drill-down. */ page?: number, platformKey?: string, /** * Which analytics resource to query. * * * `metrics` - Aggregate metrics * * `observations` - Row-level observation drill-down * * `traces` - Trace list / single trace */ resource?: 'metrics' | 'observations' | 'traces', /** * Filter to one conversation/session (native sessionId). Supported on the metrics and traces resources only. */ sessionId?: string, startDate?: string, /** * Single-record selector. On the observations resource, scopes the list to one trace's observations; on the traces resource, fetches that one trace (get-by-id). */ traceId?: string, /** * Filter to one service by trace name, e.g. chat, call, memory, grading, moderation, embeddings. */ traceName?: string, /** * Optional list of usergroup IDs to filter results */ usergroupIds?: Array | null, /** * Filter to one learner by their username (native userId). Applies to both metrics and observations. */ username?: string, /** * Metrics view (observations|scores). * * * `observations` - observations * * `scores` - scores */ view?: 'observations' | 'scores', }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/analytics/llm-usage/', query: { 'aggregation': aggregation, 'date_filter': dateFilter, 'direction': direction, 'end_date': endDate, 'granularity': granularity, 'group_by': groupBy, 'limit': limit, 'llm_model': llmModel, 'measures': measures, 'mentor_unique_id': mentorUniqueId, 'observation_id': observationId, 'order_by': orderBy, 'page': page, 'platform_key': platformKey, 'resource': resource, 'session_id': sessionId, 'start_date': startDate, 'trace_id': traceId, 'trace_name': traceName, 'usergroup_ids': usergroupIds, 'username': username, 'view': view, }, errors: { 400: `Bad Request – invalid query params or a value outside the allowed vocabulary.`, 403: `Forbidden – caller lacks analytics access to this platform, or requested a mentor-scoped observation drill-down (not supported).`, 404: `Not Found – the requested \`trace_id\`/\`observation_id\` does not exist or belongs to another tenant (existence is not leaked, so cross-tenant get-by-id returns 404 not 403).`, 500: `Internal Server Error`, 502: `Bad Gateway – the upstream analytics provider was unreachable or returned an error.`, }, }); } /** * Conversation list endpoint for analytics. * * Query params (all optional unless specified by permissions): * - platform_key: filter by platform * - mentor_unique_id: filter by mentor * - page: page number (default 1) * - limit: page size (default 20, max 100) * - search: search in user name and first user message * - min_messages, max_messages: message_count range * - sentiment: positive|negative|neutral * - topic: topic name contains * - start_date, end_date: date filter on conversation date * * Returns: summary totals, results list (paginated), and pagination metadata. * @returns ConversationListResponse * @throws ApiError */ public static analyticsMessagesRetrieve({ endDate, limit = 20, maxMessages, mentorUniqueId, minMessages, page = 1, platformKey, search, sentiment, startDate, topic, usergroupIds, }: { endDate?: string, limit?: number, maxMessages?: number, mentorUniqueId?: string, minMessages?: number, page?: number, platformKey?: string, search?: string, /** * * `positive` - positive * * `negative` - negative * * `neutral` - neutral */ sentiment?: 'positive' | 'negative' | 'neutral', startDate?: string, topic?: string, /** * Optional list of usergroup IDs to filter results */ usergroupIds?: Array | null, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/analytics/messages/', query: { 'end_date': endDate, 'limit': limit, 'max_messages': maxMessages, 'mentor_unique_id': mentorUniqueId, 'min_messages': minMessages, 'page': page, 'platform_key': platformKey, 'search': search, 'sentiment': sentiment, 'start_date': startDate, 'topic': topic, 'usergroup_ids': usergroupIds, }, }); } /** * Conversation detail endpoint for analytics. * * Query params: * - session_id (required): UUID of the session to fetch * - platform_key, mentor_unique_id (optional): further scope * - start_date, end_date (optional): date filter on message timestamps * * Returns: summary metadata from conversation_list MV, and a list of * human/ai message pairs in chronological order. * @returns ConversationDetailResponse * @throws ApiError */ public static analyticsMessagesDetailsRetrieve({ sessionId, endDate, mentorUniqueId, platformKey, startDate, usergroupIds, }: { sessionId: string, endDate?: string, mentorUniqueId?: string, platformKey?: string, startDate?: string, /** * Optional list of usergroup IDs to filter results */ usergroupIds?: Array | null, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/analytics/messages/details/', query: { 'end_date': endDate, 'mentor_unique_id': mentorUniqueId, 'platform_key': platformKey, 'session_id': sessionId, 'start_date': startDate, 'usergroup_ids': usergroupIds, }, }); } /** * Update time spent tracking data from client-side events. * * This endpoint receives time spent data collected on the client side and * stores it in the analytics database. Authentication is optional - the API * supports both authenticated and anonymous requests. * * Methods: * POST: Submit time spent tracking data * * Authentication: * Optional - supports both authenticated and anonymous requests. * - Authenticated requests: User ID is associated with the record * - Anonymous requests: Records are stored with null user_id * * Returns: * A response indicating success or failure: * { * "success": true|false, * "message": "Error message if failed" (optional) * } * * Error Responses: * 400 Bad Request: If the request data is invalid or the API is disabled * * Notes: * This API must be enabled via the ENABLE_TIME_SPENT_UPDATE_API setting. * @returns TimeSpentUpdateResponse * @throws ApiError */ public static analyticsOrgsTimeUpdateCreate({ org, requestBody, }: { org: string, requestBody: TimeSpentUpdateRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/analytics/orgs/{org}/time/update/', path: { 'org': org, }, body: requestBody, mediaType: 'application/json', }); } /** * Ratings overtime endpoint. * * Query params: * - metric: only 'ratings' is supported (default) * - platform_key, mentor_unique_id: optional filters * - granularity: 'day' (default) or 'hour' (hour only for today) * - start_date, end_date: optional date range; defaults applied if not provided * * Returns: { metric: 'ratings', points: [{date, value}, ...] } * @returns RatingsOvertime * @throws ApiError */ public static analyticsRatingsRetrieve({ dateFilter = 'today', endDate, granularity = 'hour', mentorUniqueId, metric = 'ratings', platformKey, startDate, usergroupIds, }: { /** * * `today` - Today only * * `7d` - Last 7 days * * `30d` - Last 30 days * * `90d` - Last 90 days * * `all_time` - All time * * `custom` - Custom date range */ dateFilter?: 'today' | '7d' | '30d' | '90d' | 'all_time' | 'custom', endDate?: string, /** * * `day` - day * * `hour` - hour * * `week` - week * * `month` - month */ granularity?: 'day' | 'hour' | 'week' | 'month', mentorUniqueId?: string, /** * * `ratings` - Ratings over time */ metric?: 'ratings', platformKey?: string, startDate?: string, /** * Optional list of usergroup IDs to filter results */ usergroupIds?: Array | null, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/analytics/ratings/', query: { 'date_filter': dateFilter, 'end_date': endDate, 'granularity': granularity, 'mentor_unique_id': mentorUniqueId, 'metric': metric, 'platform_key': platformKey, 'start_date': startDate, 'usergroup_ids': usergroupIds, }, }); } /** * Mixin for RBAC validation for mentor analytics views. * * Mentor analytics endpoints enforce RBAC in two phases: * 1. Endpoint authorization (_perform_mentor_analytics_validation): * - Aggregate (no mentor_unique_id): requires * "Ibl.Analytics/CanViewAnalytics/action" on /platforms/{pk}/ AND * "Ibl.Analytics/Mentors/read" on /platforms/{pk}/mentors/. * - Per-mentor (mentor_unique_id provided): requires * "Ibl.Analytics/CanViewMentorAnalytics/action" on * /platforms/{pk}/mentors/{mentor_id}/. The mentor-owner bypass * (is_owner) applies via the MENTOR_OWNER well-known role. * 2. Row-level filter (_get_accessible_user_ids_for_mentor_analytics): * - Enumerates accessible users under * /platforms/{pk}/mentors/{mentor_id}/users/ using * "Ibl.Analytics/Mentors/read". Grants on the mentor resource itself * cascade to its users (full mentor access). Usergroup authorization * is resolved at platform-level (/platforms/{pk}/usergroups/) — * mentor-level grants do NOT cascade to usergroup access. * * Special case - Mentor owner unfiltered access: * If the requesting user owns the mentor AND no usergroup_ids are * specified, returns None (no filtering) — the analytics query layer is * already scoped to the mentor. With usergroup_ids provided, the owner * falls through to normal RBAC filtering and still needs explicit access * (ownership or grant) to the requested groups. * * Note: Mentor analytics APIs work with platform_key (from query params). * @returns SessionsChart * @throws ApiError */ public static analyticsSessionsRetrieve({ dateFilter = 'today', endDate, granularity = 'hour', mentorUniqueId, metric = 'sessions', platformKey, startDate, usergroupIds, }: { /** * * `today` - Today only * * `7d` - Last 7 days * * `30d` - Last 30 days * * `90d` - Last 90 days * * `all_time` - All time * * `custom` - Custom date range */ dateFilter?: 'today' | '7d' | '30d' | '90d' | 'all_time' | 'custom', endDate?: string, /** * * `day` - day * * `hour` - hour * * `week` - week * * `month` - month */ granularity?: 'day' | 'hour' | 'week' | 'month', mentorUniqueId?: string, /** * * `sessions` - Sessions over time * * `headline` - Headline metrics for sessions (avg messages per session, avg rating) */ metric?: 'sessions' | 'headline', platformKey?: string, startDate?: string, /** * Optional list of usergroup IDs to filter results */ usergroupIds?: Array | null, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/analytics/sessions/', query: { 'date_filter': dateFilter, 'end_date': endDate, 'granularity': granularity, 'mentor_unique_id': mentorUniqueId, 'metric': metric, 'platform_key': platformKey, 'start_date': startDate, 'usergroup_ids': usergroupIds, }, }); } /** * * Time Analytics API - User activity patterns by time of day and day of week. * * Provides heatmap data showing when users are most active, useful for: * - Understanding peak usage times * - Capacity planning and resource allocation * - User behavior analysis * - Support scheduling optimization * * **Key Features:** * - Day of week patterns (0=Sunday through 6=Saturday) * - Hour of day activity levels (0-23) * - Flexible date range filtering * - Platform and agent-specific filtering * - Message count aggregation * * **Data Structure:** * - `day_of_week`: 0-6 (Sunday-Saturday) * - `hour`: 0-23 (24-hour format) * - `value`: Message count for that time slot * * @returns AccessTimesHeatmap Access times heatmap data with day/hour patterns * @throws ApiError */ public static analyticsTimeRetrieve({ dateFilter = 'today', endDate, granularity = 'hour', mentorUniqueId, platformKey, startDate, usergroupIds, }: { /** * * `today` - Today only * * `7d` - Last 7 days * * `30d` - Last 30 days * * `90d` - Last 90 days * * `all_time` - All time * * `custom` - Custom date range */ dateFilter?: 'today' | '7d' | '30d' | '90d' | 'all_time' | 'custom', endDate?: string, /** * * `day` - day * * `hour` - hour * * `week` - week * * `month` - month */ granularity?: 'day' | 'hour' | 'week' | 'month', mentorUniqueId?: string, platformKey?: string, startDate?: string, /** * Optional list of usergroup IDs to filter results */ usergroupIds?: Array | null, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/analytics/time/', query: { 'date_filter': dateFilter, 'end_date': endDate, 'granularity': granularity, 'mentor_unique_id': mentorUniqueId, 'platform_key': platformKey, 'start_date': startDate, 'usergroup_ids': usergroupIds, }, errors: { 400: `Bad Request - Invalid parameters`, 403: `Forbidden - Insufficient permissions`, 500: `Internal Server Error`, }, }); } /** * Get total time spent for current user * * Returns the total time spent (in seconds) for the current authenticated user. * Can be filtered by platform, date range, course ID, URL, mentor UUID, and session UUID. * * @returns TimeSpentPerUserResponse * @throws ApiError */ public static analyticsTimeSpentUserRetrieve({ courseId, endDate, includeMainPlatform = true, mentorUuid, platformKey, sessionUuid, startDate, url, username, }: { /** * Course ID to filter by (can be partial) */ courseId?: string, /** * End date for time range (YYYY-MM-DD) */ endDate?: string, /** * Whether to include main platform data */ includeMainPlatform?: boolean, /** * Mentor UUID to filter by */ mentorUuid?: string, /** * Platform key to filter by */ platformKey?: string | null, /** * Session UUID to filter by */ sessionUuid?: string, /** * Start date for time range (YYYY-MM-DD) */ startDate?: string, /** * URL to filter by (can be partial) */ url?: string, /** * Username to get data for (admin users only) */ username?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/analytics/time-spent/user/', query: { 'course_id': courseId, 'end_date': endDate, 'include_main_platform': includeMainPlatform, 'mentor_uuid': mentorUuid, 'platform_key': platformKey, 'session_uuid': sessionUuid, 'start_date': startDate, 'url': url, 'username': username, }, errors: { 400: `Bad request`, 401: `Unauthorized`, }, }); } /** * Returns topics overview analytics for a given platform and agent. * * Permission Required: * - Platform Admin * - Ibl.Analytics/Mentors/read * @returns TopicsOverview * @throws ApiError */ public static analyticsTopicsRetrieve({ dateFilter = 'today', endDate, granularity = 'hour', mentorUniqueId, metric = 'overview', platformKey, startDate, usergroupIds, }: { /** * * `today` - Today only * * `7d` - Last 7 days * * `30d` - Last 30 days * * `90d` - Last 90 days * * `all_time` - All time * * `custom` - Custom date range */ dateFilter?: 'today' | '7d' | '30d' | '90d' | 'all_time' | 'custom', endDate?: string, /** * * `day` - day * * `hour` - hour * * `week` - week * * `month` - month */ granularity?: 'day' | 'hour' | 'week' | 'month', mentorUniqueId?: string, /** * * `overview` - Overall topic metrics * * `sessions` - Sessions over time * * `ratings` - Ratings over time * * `highlighted` - Highlighted topics */ metric?: 'overview' | 'sessions' | 'ratings' | 'highlighted', platformKey?: string, startDate?: string, /** * Optional list of usergroup IDs to filter results */ usergroupIds?: Array | null, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/analytics/topics/', query: { 'date_filter': dateFilter, 'end_date': endDate, 'granularity': granularity, 'mentor_unique_id': mentorUniqueId, 'metric': metric, 'platform_key': platformKey, 'start_date': startDate, 'usergroup_ids': usergroupIds, }, }); } /** * Returns topic details Analytics for a given platform and agent. * * Permission Required: * - Platform Admin * - Ibl.Analytics/Mentors/read * @returns TopicDetails * @throws ApiError */ public static analyticsTopicsDetailsRetrieve({ dateFilter = 'today', endDate, limit = 20, mentorUniqueId, page = 1, platformKey, search, startDate, usergroupIds, }: { /** * * `today` - Today only * * `7d` - Last 7 days * * `30d` - Last 30 days * * `90d` - Last 90 days * * `all_time` - All time * * `custom` - Custom date range */ dateFilter?: 'today' | '7d' | '30d' | '90d' | 'all_time' | 'custom', endDate?: string, limit?: number, mentorUniqueId?: string, page?: number, platformKey?: string, /** * Search by topic name */ search?: string, startDate?: string, /** * Optional list of usergroup IDs to filter results */ usergroupIds?: Array | null, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/analytics/topics/details/', query: { 'date_filter': dateFilter, 'end_date': endDate, 'limit': limit, 'mentor_unique_id': mentorUniqueId, 'page': page, 'platform_key': platformKey, 'search': search, 'start_date': startDate, 'usergroup_ids': usergroupIds, }, }); } /** * * Retrieve a holistic snapshot of a user across catalog enrollments, agent * engagement, skills, credentials, and time spent data. The `metrics` query parameter controls * which sections are returned and defaults to `courses` when omitted. A user can call this * endpoint for themselves without passing `username`; admins pass `username` to target a * user in their scope. * * The `mentors` section lists every agent the user has engaged, sourced from both their * sessions and saved agents. Each agent's `interactions` block reports engagement depth * (`session_count`, `conversation_count`, human/AI message counts, `avg_messages_per_session`), * recency and stickiness (`first_interaction`, `latest_interaction`, `active_days`), * affinity (`rating`, `is_starred`), and spend (`cost_usd`, in USD). The user's total * agent spend is `user.total_agent_cost_usd`. * * Optional `course_id` / `program_id` / `pathway_id` scope the matching section to a * single item (empty list if the user is not enrolled — never a 404); omitting them * returns the full list unchanged. When `course_id` is set, the course block is also * enriched with the user's live edX Progress data under `edx_progress` (completion * summary, grade, grade summary) unless `include_edx_progress=false`. The edX call is * best-effort: on failure `edx_progress` is null and the DM data is still returned. * `program_id` / `pathway_id` get scoping only — no edX enrichment. * * When AI is enabled, three additional sections surface the user's conversation * analytics for the same user: * - `conversations`: headline metrics (average messages per conversation, rating, * and cost) by default, or conversation counts over time when * `conversation_metric=conversations`. * - `messages`: the user's conversation list with `summary`, `results`, and * `pagination`. Supports `page`, `limit`, `search`, `min_messages`, * `max_messages`, `sentiment`, and `topic`. All-time unless a date filter is * supplied. * - `message_detail`: one conversation's transcript (summary plus human/AI message * pairs); requires `session_id`. A `session_id` belonging to another user returns * 403. Optionally scope any of these to one agent with `mentor_unique_id`. * * @returns LearnerDetailsResponse Learner profile with requested analytics data * @throws ApiError */ public static analyticsUserRetrieve({ conversationMetric = 'headline', courseId, dateFilter = 'today', endDate, granularity = 'hour', includeEdxProgress = true, limit = 20, maxMessages, mentorUniqueId, metrics, minMessages, overtime = false, page = 1, pathwayId, platformKey, programId, search, sentiment, sessionId, startDate, topic, usergroupIds, username, }: { /** * For the `conversations` metric: `headline` (avg messages/rating/cost, the default) or `conversations` (conversation counts over time). * * * `conversations` - conversations * * `headline` - headline */ conversationMetric?: 'conversations' | 'headline', /** * Scope the `courses` and `time_spent` sections to a single course. When set, also enriches the course with live edX progress (see `include_edx_progress`). */ courseId?: string, /** * * `today` - Today only * * `7d` - Last 7 days * * `30d` - Last 30 days * * `90d` - Last 90 days * * `all_time` - All time * * `custom` - Custom date range */ dateFilter?: 'today' | '7d' | '30d' | '90d' | 'all_time' | 'custom', endDate?: string, /** * * `day` - day * * `hour` - hour * * `week` - week * * `month` - month */ granularity?: 'day' | 'hour' | 'week' | 'month', /** * When `course_id` is set, fold the learner's live edX Progress-page data (completion summary, grade, grade summary) into the course block. Defaults to true; set false to skip the edX round-trip. */ includeEdxProgress?: boolean, /** * Page size for the `messages` metric (default: 20, max: 100). */ limit?: number, /** * Filter the `messages` list to conversations with at most N messages. */ maxMessages?: number, mentorUniqueId?: string, /** * Comma-separated sections to return: courses, programs, pathways, agents, skills, credentials, time_spent, conversations, messages, message_detail. `agents` is an alias for the agent section. The conversations/messages/message_detail sections are available when AI is enabled. Defaults to courses when omitted. */ metrics?: string, /** * Filter the `messages` list to conversations with at least N messages. */ minMessages?: number, /** * Include overtime metrics for time_spent data (default: false) */ overtime?: boolean, /** * Page number for the `messages` metric (default: 1). */ page?: number, /** * Scope the `pathways` section to a single pathway. */ pathwayId?: string, platformKey?: string, /** * Scope the `programs` section to a single program. */ programId?: string, /** * Filter the `messages` list by first user message or username. */ search?: string, /** * Filter the `messages` list by conversation sentiment. * * * `positive` - positive * * `negative` - negative * * `neutral` - neutral */ sentiment?: 'positive' | 'negative' | 'neutral', /** * Required for the `message_detail` metric: the conversation to fetch. */ sessionId?: string, startDate?: string, /** * Filter the `messages` list to conversations whose topic contains this text. */ topic?: string, /** * Optional list of usergroup IDs to filter results */ usergroupIds?: Array | null, username?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/analytics/user', query: { 'conversation_metric': conversationMetric, 'course_id': courseId, 'date_filter': dateFilter, 'end_date': endDate, 'granularity': granularity, 'include_edx_progress': includeEdxProgress, 'limit': limit, 'max_messages': maxMessages, 'mentor_unique_id': mentorUniqueId, 'metrics': metrics, 'min_messages': minMessages, 'overtime': overtime, 'page': page, 'pathway_id': pathwayId, 'platform_key': platformKey, 'program_id': programId, 'search': search, 'sentiment': sentiment, 'session_id': sessionId, 'start_date': startDate, 'topic': topic, 'usergroup_ids': usergroupIds, 'username': username, }, errors: { 400: `Bad Request - Invalid parameters supplied`, 404: `Learner not found`, 500: `Unexpected error`, }, }); } /** * * User Analytics API - Comprehensive user activity metrics and trends. * * Provides real-time and historical user analytics including: * - Currently active users (last hour) * - Active users over time periods (7d, 30d, 90d) * - Registered user counts and growth * - Time series charts with customizable granularity * * **Key Features:** * - Real-time active user counting * - Percentage change calculations vs previous periods * - Flexible date filtering and granularity * - Platform and agent-specific filtering * - Forward-filled time series data * * **Supported Metrics:** * - `currently_active`: Users active in last hour * - `active_users`: Unique users in specified period * - `registered_users`: Total and new user counts * * @returns CurrentUsersResponse User analytics metrics with comparison data * @throws ApiError */ public static analyticsUsersRetrieve({ metric, dateFilter = 'today', endDate, granularity = 'hour', mentorUniqueId, platformKey, startDate, usergroupIds, }: { /** * * `currently_active` - Users logged in right now * * `active_users` - Active users in a period * * `registered_users` - Registered users * * `active_users_last_30d` - Active users in the last 30 days */ metric: 'currently_active' | 'active_users' | 'registered_users' | 'active_users_last_30d', /** * * `today` - Today only * * `7d` - Last 7 days * * `30d` - Last 30 days * * `90d` - Last 90 days * * `all_time` - All time * * `custom` - Custom date range */ dateFilter?: 'today' | '7d' | '30d' | '90d' | 'all_time' | 'custom', endDate?: string, /** * * `day` - day * * `hour` - hour * * `week` - week * * `month` - month */ granularity?: 'day' | 'hour' | 'week' | 'month', mentorUniqueId?: string, platformKey?: string, startDate?: string, /** * Optional list of usergroup IDs to filter results */ usergroupIds?: Array | null, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/analytics/users/', query: { 'date_filter': dateFilter, 'end_date': endDate, 'granularity': granularity, 'mentor_unique_id': mentorUniqueId, 'metric': metric, 'platform_key': platformKey, 'start_date': startDate, 'usergroup_ids': usergroupIds, }, errors: { 400: `Bad Request - Invalid parameters`, 403: `Forbidden - Insufficient permissions`, 500: `Internal Server Error`, }, }); } /** * * User Details API - Comprehensive user activity details with search and filtering. * * Provides detailed user information including: * - User contact information (username, email, full name) * - Activity metrics (message count, last activity) * - Search functionality across multiple fields * - Flexible date range filtering * - CSV export capability * * **Key Features:** * - Full-text search across username, email, name, and user ID * - Date range filtering for activity periods * - Platform and agent-specific filtering * - Comprehensive pagination with metadata * - CSV export for data analysis * - User aggregation across platforms/agents * * **Search Capabilities:** * - Username matching * - Email address matching * - Full name search * - User ID lookup * - Partial string matching (case-insensitive) * * **Export Options:** * - JSON response (default) * - CSV export (?export=csv) * - Includes all user fields in export * * @returns UserDetail Paginated user details with activity metrics * @throws ApiError */ public static analyticsUsersDetailsRetrieve({ dateFilter = 'today', endDate, limit = 20, mentorUniqueId, page = 1, platformKey, search, startDate, usergroupIds, }: { /** * * `today` - Today only * * `7d` - Last 7 days * * `30d` - Last 30 days * * `90d` - Last 90 days * * `all_time` - All time * * `custom` - Custom date range */ dateFilter?: 'today' | '7d' | '30d' | '90d' | 'all_time' | 'custom', endDate?: string, limit?: number, mentorUniqueId?: string, page?: number, platformKey?: string, /** * Search by email, full name, or user ID */ search?: string, startDate?: string, /** * Optional list of usergroup IDs to filter results */ usergroupIds?: Array | null, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/analytics/users/details/', query: { 'date_filter': dateFilter, 'end_date': endDate, 'limit': limit, 'mentor_unique_id': mentorUniqueId, 'page': page, 'platform_key': platformKey, 'search': search, 'start_date': startDate, 'usergroup_ids': usergroupIds, }, errors: { 400: `Bad Request - Invalid parameters`, 403: `Forbidden - Insufficient permissions`, 500: `Internal Server Error`, }, }); } /** * Get active user counts over time. * * This endpoint provides daily counts of active users (users with known activity) * over a specified time period. * * Query Parameters: * start_date (str, optional): Start date for the time range (ISO format) * end_date (str, optional): End date for the time range (ISO format) * * Returns: * Daily active user counts over the specified time period, with change metrics * compared to previous periods. * * Default time range is the last 7 days if no dates are specified. * * An active user is defined as a user with any activity within the past 30 days. * @returns OvertimeWithChangeInfo * @throws ApiError */ public static audienceOrgsActiveUsersOverTimeRetrieve({ org, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/audience/orgs/{org}/active-users/over-time', path: { 'org': org, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * Get active user counts on a per-course basis. * * This endpoint provides counts of active users for each course within * the specified date range. * * Query Parameters: * start_date (str, optional): Start date for filtering (ISO format) * end_date (str, optional): End date for filtering (ISO format) * * Returns: * A list of courses with their active user counts. * * Default time range is the last 7 days if no dates are specified. * @returns ActiveUsersPerCourse * @throws ApiError */ public static audienceOrgsActiveUsersPerCourseRetrieve({ org, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/audience/orgs/{org}/active-users/per-course', path: { 'org': org, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * Get a list of active users with activity metrics. * * This endpoint provides a paginated list of users who have had activity * within the specified date range. * * Query Parameters: * start_date (str, optional): Start date for filtering (ISO format) * end_date (str, optional): End date for filtering (ISO format) * course_id (str, optional): Filter by course ID * page (int, optional): Page number for pagination * length (int, optional): Number of items per page * * Returns: * A paginated list of active users with their activity metrics. * * Default time range is the last 7 days if no dates are specified. * @returns ActiveUsersList * @throws ApiError */ public static audienceOrgsActiveUsersUsersRetrieve({ org, departmentId, format = 'json', includeMainPlatform = true, length, page, }: { org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * Size of data to return */ length?: number, /** * Page offset */ page?: number, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/audience/orgs/{org}/active-users/users', path: { 'org': org, }, query: { 'department_id': departmentId, 'format': format, 'include_main_platform': includeMainPlatform, 'length': length, 'page': page, }, }); } /** * Get enrollment or unenrollment counts over time. * * This endpoint provides daily counts of new enrollments or unenrollments * over a specified time period. * * Query Parameters: * start_date (str, optional): Start date for the time range (ISO format) * end_date (str, optional): End date for the time range (ISO format) * course_id (str, optional): Filter by course ID * active (bool): Get enrollments when true, unenrollments when false * * Returns: * Daily counts over the specified time period, with change metrics * compared to previous periods. * * Default time range is the last 7 days if no dates are specified. * @returns OvertimeWithChangeInfo * @throws ApiError */ public static audienceOrgsEnrollmentsCoursesOverTimeRetrieve({ courseId, org, active = 'y', departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { courseId: string, org: string, /** * Any of `y`, `yes`, `true`. set to false or no for unenrollments * * * `y` - y * * `yes` - yes * * `true` - true * * `True` - True * * `n` - n * * `no` - no * * `false` - false * * `False` - False */ active?: 'y' | 'yes' | 'true' | 'True' | 'n' | 'no' | 'false' | 'False', /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/audience/orgs/{org}/enrollments/courses/{course_id}/over-time', path: { 'course_id': courseId, 'org': org, }, query: { 'active': active, 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * List users enrolled in a specific course. * * This endpoint provides a list of users who are enrolled or unenrolled * in a specified course. * * Query Parameters: * course_id (str): The course ID to get enrollments for * active (bool): Filter for active enrollments when true, inactive when false * page (int, optional): Page number for pagination * length (int, optional): Number of items per page * * Returns: * A paginated list of users with: * - Username * - Full name * - Email * - Enrollment timestamp * @returns EnrollmentsPerUser * @throws ApiError */ public static audienceOrgsEnrollmentsCoursesUsersRetrieve({ courseId, org, active = 'y', departmentId, endDate, format = 'json', includeMainPlatform = true, length, page, startDate, }: { courseId: string, org: string, /** * Any of `y`, `yes`, `true`. set to false or no for unenrollments * * * `y` - y * * `yes` - yes * * `true` - true * * `True` - True * * `n` - n * * `no` - no * * `false` - false * * `False` - False */ active?: 'y' | 'yes' | 'true' | 'True' | 'n' | 'no' | 'false' | 'False', /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * Size of data to return */ length?: number, /** * Page offset */ page?: number, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/audience/orgs/{org}/enrollments/courses/{course_id}/users', path: { 'course_id': courseId, 'org': org, }, query: { 'active': active, 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'length': length, 'page': page, 'start_date': startDate, }, }); } /** * Get enrollment or unenrollment counts over time. * * This endpoint provides daily counts of new enrollments or unenrollments * over a specified time period. * * Query Parameters: * start_date (str, optional): Start date for the time range (ISO format) * end_date (str, optional): End date for the time range (ISO format) * course_id (str, optional): Filter by course ID * active (bool): Get enrollments when true, unenrollments when false * * Returns: * Daily counts over the specified time period, with change metrics * compared to previous periods. * * Default time range is the last 7 days if no dates are specified. * @returns OvertimeWithChangeInfo * @throws ApiError */ public static audienceOrgsEnrollmentsOverTimeRetrieve({ org, active = 'y', departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { org: string, /** * Any of `y`, `yes`, `true`. set to false or no for unenrollments * * * `y` - y * * `yes` - yes * * `true` - true * * `True` - True * * `n` - n * * `no` - no * * `false` - false * * `False` - False */ active?: 'y' | 'yes' | 'true' | 'True' | 'n' | 'no' | 'false' | 'False', /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/audience/orgs/{org}/enrollments/over-time', path: { 'org': org, }, query: { 'active': active, 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * List enrollment statistics on a per-course basis. * * This endpoint provides enrollment counts for all courses, with options * to filter for active or inactive enrollments and to include time-based data. * * Query Parameters: * active (bool): Filter for active enrollments when true, inactive when false * start_date (str, optional): Start date for time-based filtering (ISO format) * end_date (str, optional): End date for time-based filtering (ISO format) * page (int, optional): Page number for pagination * length (int, optional): Number of items per page * * Returns: * A paginated list of courses with their enrollment counts and percentages. * @returns Enrollments * @throws ApiError */ public static audienceOrgsEnrollmentsPerCourseRetrieve({ org, active = 'y', departmentId, endDate, format = 'json', includeMainPlatform = true, length, page, startDate, }: { org: string, /** * Any of `y`, `yes`, `true`. set to false or no for unenrollments * * * `y` - y * * `yes` - yes * * `true` - true * * `True` - True * * `n` - n * * `no` - no * * `false` - false * * `False` - False */ active?: 'y' | 'yes' | 'true' | 'True' | 'n' | 'no' | 'false' | 'False', /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * Size of data to return */ length?: number, /** * Page offset */ page?: number, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/audience/orgs/{org}/enrollments/per-course', path: { 'org': org, }, query: { 'active': active, 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'length': length, 'page': page, 'start_date': startDate, }, }); } /** * List all learners on the platform with aggregated metrics. * * This endpoint returns a paginated list of all learners with key metrics including: * - Enrollment counts * - Completion counts * - Time spent on platform * * Query Parameters: * page (int): Page number for pagination * length (int): Number of items per page * search (str): Filter learners by username, email, or name * * Returns: * A paginated list of learners with their associated metrics. * @returns PerlearnerUserList * @throws ApiError */ public static audienceOrgsRegisteredUsersRetrieve({ org, departmentId, format = 'json', includeMainPlatform = true, length, page, search, }: { org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * Size of data to return */ length?: number, /** * Page offset */ page?: number, /** * Search string for learner */ search?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/audience/orgs/{org}/registered-users/', path: { 'org': org, }, query: { 'department_id': departmentId, 'format': format, 'include_main_platform': includeMainPlatform, 'length': length, 'page': page, 'search': search, }, }); } /** * Get registered user counts over time. * * This endpoint provides daily counts of new user registrations over a * specified time period. * * Query Parameters: * start_date (str, optional): Start date for the time range (ISO format) * end_date (str, optional): End date for the time range (ISO format) * * Returns: * Daily registration counts over the specified time period, with change metrics * compared to previous periods. * * Default time range is the last 7 days if no dates are specified. * @returns OvertimeWithChangeInfo * @throws ApiError */ public static audienceOrgsRegisteredUsersOverTimeRetrieve({ org, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/audience/orgs/{org}/registered-users/over-time', path: { 'org': org, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * List enrollment statistics on a per-course basis. * * This endpoint provides enrollment counts for all courses, with options * to filter for active or inactive enrollments and to include time-based data. * * Query Parameters: * active (bool): Filter for active enrollments when true, inactive when false * start_date (str, optional): Start date for time-based filtering (ISO format) * end_date (str, optional): End date for time-based filtering (ISO format) * page (int, optional): Page number for pagination * length (int, optional): Number of items per page * * Returns: * A paginated list of courses with their enrollment counts and percentages. * @returns Enrollments * @throws ApiError */ public static audienceOrgsRegisteredUsersPerCourseRetrieve({ org, active = 'y', departmentId, endDate, format = 'json', includeMainPlatform = true, length, page, startDate, }: { org: string, /** * Any of `y`, `yes`, `true`. set to false or no for unenrollments * * * `y` - y * * `yes` - yes * * `true` - true * * `True` - True * * `n` - n * * `no` - no * * `false` - false * * `False` - False */ active?: 'y' | 'yes' | 'true' | 'True' | 'n' | 'no' | 'false' | 'False', /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * Size of data to return */ length?: number, /** * Page offset */ page?: number, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/audience/orgs/{org}/registered-users/per-course', path: { 'org': org, }, query: { 'active': active, 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'length': length, 'page': page, 'start_date': startDate, }, }); } /** * Get engagement metrics on a per-course basis. * * This endpoint provides a paginated list of courses with engagement metrics * including activity counts, time spent, and interaction data. * * Query Parameters: * page (int, optional): Page number for pagination * length (int, optional): Number of items per page * * Returns: * A paginated list of courses with their engagement metrics. * @returns EngagementPerCourse * @throws ApiError */ public static engagementOrgsActivityRetrieve({ org, departmentId, format = 'json', includeMainPlatform = true, length, page, }: { org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * Size of data to return */ length?: number, /** * Page offset */ page?: number, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/engagement/orgs/{org}/activity', path: { 'org': org, }, query: { 'department_id': departmentId, 'format': format, 'include_main_platform': includeMainPlatform, 'length': length, 'page': page, }, }); } /** * Completion count per user per course across the platform * * Query Params * 1. start_date e.g 2020-10-01 * 2. end_date e.g 2020-10-10 * * Default result when no query param is added is last_7_days (today inclusive) * @returns OvertimeWithChangeInfo * @throws ApiError */ public static engagementOrgsCourseCompletionOverTimeRetrieve({ org, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/engagement/orgs/{org}/course_completion/over-time', path: { 'org': org, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * List course completion metrics on a per-course basis. * * This endpoint provides a paginated table of courses with enrollment and * completion statistics for each course. * * Returns: * A paginated list of courses with: * - Course identification (ID and name) * - Enrollment count * - Completion count * - Average completion rate * @returns CourseCompletionPerCourse * @throws ApiError */ public static engagementOrgsCourseCompletionPerCourseRetrieve({ org, departmentId, format = 'json', includeMainPlatform = true, length, page, }: { org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * Size of data to return */ length?: number, /** * Page offset */ page?: number, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/engagement/orgs/{org}/course_completion/per-course', path: { 'org': org, }, query: { 'department_id': departmentId, 'format': format, 'include_main_platform': includeMainPlatform, 'length': length, 'page': page, }, }); } /** * Average time spent in secs on a per-day basis * * Query Params * 1. start_date e.g 2020-10-01 * 2. end_date e.g 2020-10-10 * 3. course_id * * Default result when no query param is added is last_7_days (today inclusive) * @returns AverageOvertime * @throws ApiError */ public static engagementOrgsCoursesTimeAverageRetrieve({ courseId, org, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { courseId: string, org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/engagement/orgs/{org}/courses/{course_id}/time/average', path: { 'course_id': courseId, 'org': org, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * Time spent per course in secs in a tree like form * * Kwargs * course_id e.g course-v1:Org+Course4+Run * * Query Params * 1. start_date e.g 2020-10-01 * 2. end_date e.g 2020-10-10 * @returns TimeDetail * @throws ApiError */ public static engagementOrgsCoursesTimeDetailRetrieve({ courseId, org, departmentId, format = 'json', includeMainPlatform = true, }: { courseId: string, org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/engagement/orgs/{org}/courses/{course_id}/time/detail', path: { 'course_id': courseId, 'org': org, }, query: { 'department_id': departmentId, 'format': format, 'include_main_platform': includeMainPlatform, }, }); } /** * Time spent per course in secs on a per-day basis * * Query Params * 1. start_date e.g 2020-10-01 * 2. end_date e.g 2020-10-10 * Kwargs * 3. course_id * * Default result when no query param is added is last_7_days (today inclusive) * @returns OverTimeWithTotal * @throws ApiError */ public static engagementOrgsCoursesTimeOverTimeRetrieve({ courseId, org, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { courseId: string, org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/engagement/orgs/{org}/courses/{course_id}/time/over-time', path: { 'course_id': courseId, 'org': org, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * Time spent by users in a course * * Query Params * course_id e.g course-v1:Org+Course4+Run * @returns TimeSpentByUsersInCourse * @throws ApiError */ public static engagementOrgsCoursesTimeUsersRetrieve({ courseId, org, departmentId, endDate, format = 'json', includeMainPlatform = true, length, page, startDate, }: { courseId: string, org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * Size of data to return */ length?: number, /** * Page offset */ page?: number, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/engagement/orgs/{org}/courses/{course_id}/time/users', path: { 'course_id': courseId, 'org': org, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'length': length, 'page': page, 'start_date': startDate, }, }); } /** * Time spent within a course in ordered hierarchical format * * Kwargs * 1. course_id e.g course-v1:Org+Course4+Run * 2. user_id e.g developer@ibleducation.com or dev123 (username|email) * Query Params * 3. start_date e.g 2020-10-01 * 4. end_date e.g 2020-10-10 * @returns PerLearnerTimeSpentInCourseTree * @throws ApiError */ public static engagementOrgsCoursesTimeUsersDetailRetrieve({ courseId, org, userId, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { courseId: string, org: string, userId: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/engagement/orgs/{org}/courses/{course_id}/time/users/{user_id}/detail', path: { 'course_id': courseId, 'org': org, 'user_id': userId, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * Time spent in secs on a per-day basis * * Query Params * 1. course_id e.g course-v1:Org+Course4+Run * 2. user_id e.g developer@ibleducation.com or dev123 (username|email) * 3. start_date e.g 2020-10-01 * 4. end_date e.g 2020-10-10 * * Default result when no query param is added is last_7_days (today inclusive) * @returns OverTimeWithTotal * @throws ApiError */ public static engagementOrgsCoursesTimeUsersOverTimeRetrieve({ courseId, org, userId, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { courseId: string, org: string, userId: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/engagement/orgs/{org}/courses/{course_id}/time/users/{user_id}/over-time', path: { 'course_id': courseId, 'org': org, 'user_id': userId, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * Get video engagement metrics for a specific course. * * This endpoint provides detailed video engagement statistics for a single course, * including view counts, completion rates, and time spent on videos. * * Query Parameters: * course_id (str): The course ID to get video engagement data for * * Returns: * Detailed video engagement metrics for the specified course. * @returns VideosSpecificCourse * @throws ApiError */ public static engagementOrgsCoursesVideosRetrieve({ courseId, org, departmentId, format = 'json', includeMainPlatform = true, }: { courseId: string, org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/engagement/orgs/{org}/courses/{course_id}/videos/', path: { 'course_id': courseId, 'org': org, }, query: { 'department_id': departmentId, 'format': format, 'include_main_platform': includeMainPlatform, }, }); } /** * Get video watch counts over time. * * This endpoint provides daily counts of videos watched over a specified time period, * with options to filter by course or user. * * Query Parameters: * start_date (str, optional): Start date for the time range (ISO format) * end_date (str, optional): End date for the time range (ISO format) * course_id (str, optional): Filter by course ID * user_id (str, optional): Filter by username or email * * Returns: * Daily video watch counts over the specified time period. * * Default time range is the last 7 days if no dates are specified. * * Access Control: * - Platform admins can access any video watch data * - Learners can access their own video watch data * @returns OverTimeWithTotal * @throws ApiError */ public static engagementOrgsCoursesVideosOverTimeRetrieve({ courseId, org, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { courseId: string, org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/engagement/orgs/{org}/courses/{course_id}/videos/over-time', path: { 'course_id': courseId, 'org': org, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * Get a summary of video watch statistics for a specific course. * * This endpoint provides a structured summary of video watch data for a course, * organized in a tree-like format by course sections and subsections. * * Query Parameters: * course_id (str): The course ID to get video summary for * * Returns: * A hierarchical structure of video watch data for the course, including: * - Section and subsection organization * - Video identification and metadata * - Watch counts and completion rates * @returns VideosInCourseSummary * @throws ApiError */ public static engagementOrgsCoursesVideosSummaryRetrieve({ courseId, org, departmentId, format = 'json', includeMainPlatform = true, }: { courseId: string, org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/engagement/orgs/{org}/courses/{course_id}/videos/summary', path: { 'course_id': courseId, 'org': org, }, query: { 'department_id': departmentId, 'format': format, 'include_main_platform': includeMainPlatform, }, }); } /** * List of users' videos completed records for a specific course * * Kwargs * course_id e.g course-v1:Org+Course4+Run * @returns WatchedVideosPerUser * @throws ApiError */ public static engagementOrgsCoursesVideosUsersRetrieve({ courseId, org, departmentId, format = 'json', includeMainPlatform = true, }: { courseId: string, org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/engagement/orgs/{org}/courses/{course_id}/videos/users', path: { 'course_id': courseId, 'org': org, }, query: { 'department_id': departmentId, 'format': format, 'include_main_platform': includeMainPlatform, }, }); } /** * Average time spent by a learner in enrolled courses. Gives a rough estimate of whats the average time * that would be spent by a learner in a course * * Query Params * 1. start_date e.g 2020-10-01 * 2. end_date e.g 2020-10-10 * @returns AverageOvertime * @throws ApiError */ public static engagementOrgsTimeAveragePerlearnerPercourseRetrieve({ org, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/engagement/orgs/{org}/time/average-perlearner-percourse', path: { 'org': org, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * Average time spent in secs on a per-day basis * * Query Params * 1. start_date e.g 2020-10-01 * 2. end_date e.g 2020-10-10 * 3. course_id * * Default result when no query param is added is last_7_days (today inclusive) * @returns AverageOvertime * @throws ApiError */ public static engagementOrgsTimeAverageWithOverTimeRetrieve({ org, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/engagement/orgs/{org}/time/average-with-over-time', path: { 'org': org, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * Get time spent on the platform over time. * * This endpoint provides daily time spent values (in seconds) across the * platform over a specified time period. * * Query Parameters: * start_date (str, optional): Start date for the time range (ISO format) * end_date (str, optional): End date for the time range (ISO format) * * Returns: * Daily time spent values over the specified time period, with change metrics * compared to previous periods. * * Default time range is the last 7 days if no dates are specified. * @returns OvertimeWithChangeInfo * @throws ApiError */ public static engagementOrgsTimeOverTimeRetrieve({ org, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/engagement/orgs/{org}/time/over-time', path: { 'org': org, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * Get time spent statistics on a per-course basis. * * This endpoint provides a paginated list of courses with the total time * spent by users in each course. * * Query Parameters: * start_date (str, optional): Start date for filtering (ISO format) * end_date (str, optional): End date for filtering (ISO format) * page (int, optional): Page number for pagination * length (int, optional): Number of items per page * * Returns: * A paginated list of courses with: * - Course identification (ID and name) * - Total time spent (in seconds) * - Formatted time spent (human-readable) * - Percentage of total platform time * @returns TimeSpentPerCourse * @throws ApiError */ public static engagementOrgsTimePerCourseRetrieve({ org, departmentId, endDate, format = 'json', includeMainPlatform = true, length, page, startDate, }: { org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * Size of data to return */ length?: number, /** * Page offset */ page?: number, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/engagement/orgs/{org}/time/per-course', path: { 'org': org, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'length': length, 'page': page, 'start_date': startDate, }, }); } /** * Get video engagement metrics on a per-course basis. * * This endpoint provides a paginated list of courses with video engagement metrics * including view counts, completion rates, and time spent on videos. * * Query Parameters: * page (int, optional): Page number for pagination * length (int, optional): Number of items per page * * Returns: * A paginated list of courses with their video engagement metrics. * @returns VideoEngagementPerCourse * @throws ApiError */ public static engagementOrgsVideosRetrieve({ org, departmentId, format = 'json', includeMainPlatform = true, length, page, }: { org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * Size of data to return */ length?: number, /** * Page offset */ page?: number, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/engagement/orgs/{org}/videos/', path: { 'org': org, }, query: { 'department_id': departmentId, 'format': format, 'include_main_platform': includeMainPlatform, 'length': length, 'page': page, }, }); } /** * Get video watch counts over time. * * This endpoint provides daily counts of videos watched over a specified time period, * with options to filter by course or user. * * Query Parameters: * start_date (str, optional): Start date for the time range (ISO format) * end_date (str, optional): End date for the time range (ISO format) * course_id (str, optional): Filter by course ID * user_id (str, optional): Filter by username or email * * Returns: * Daily video watch counts over the specified time period. * * Default time range is the last 7 days if no dates are specified. * * Access Control: * - Platform admins can access any video watch data * - Learners can access their own video watch data * @returns OverTimeWithTotal * @throws ApiError */ public static engagementOrgsVideosOverTimeRetrieve({ org, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/engagement/orgs/{org}/videos/over-time', path: { 'org': org, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * Get active user counts over time. * * This endpoint provides daily counts of active users (users with known activity) * over a specified time period. * * Query Parameters: * start_date (str, optional): Start date for the time range (ISO format) * end_date (str, optional): End date for the time range (ISO format) * * Returns: * Daily active user counts over the specified time period, with change metrics * compared to previous periods. * * Default time range is the last 7 days if no dates are specified. * * An active user is defined as a user with any activity within the past 30 days. * @returns OvertimeWithChangeInfo * @throws ApiError */ public static overviewOrgsActiveUsersRetrieve({ org, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/overview/orgs/{org}/active-users', path: { 'org': org, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * Get average grade value for platform, course, or user. * * This endpoint returns the average grade at different levels: * - Platform level: Average grade across all courses * - Course level: Average grade for a specific course * - Learner level: Average grade for a specific learner * - Course-learner level: Grade for a specific learner in a specific course * * Query Parameters: * course_id (str, optional): Filter by course ID * learner_id (str, optional): Filter by username or email * * Returns: * The average grade value based on the specified filters. * * Access Control: * - Platform admins can access any grade data * - Learners can access their own grade data * @returns Average * @throws ApiError */ public static overviewOrgsAverageGradeRetrieve({ org, departmentId, format = 'json', includeMainPlatform = true, }: { org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/overview/orgs/{org}/average-grade', path: { 'org': org, }, query: { 'department_id': departmentId, 'format': format, 'include_main_platform': includeMainPlatform, }, }); } /** * Get course completion summary metrics over time. * * This endpoint provides completion statistics across the platform over a * specified time period, including daily completion counts and overall metrics. * * Query Parameters: * start_date (str): Start date for the time range (ISO format) * end_date (str): End date for the time range (ISO format) * * Returns: * Completion data including: * - Daily completion counts over time * - Total unique user count * - Total completion count * - Completion percentage * - Change metrics compared to previous periods * * Default time range is the last 7 days if no dates are specified. * @returns CourseCompletionSummaryOvertime * @throws ApiError */ public static overviewOrgsCoursesCompletionsRetrieve({ org, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/overview/orgs/{org}/courses/completions', path: { 'org': org, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * List all learners on the platform with aggregated metrics. * * This endpoint returns a paginated list of all learners with key metrics including: * - Enrollment counts * - Completion counts * - Time spent on platform * * Query Parameters: * page (int): Page number for pagination * length (int): Number of items per page * search (str): Filter learners by username, email, or name * * Returns: * A paginated list of learners with their associated metrics. * @returns PerlearnerUserList * @throws ApiError */ public static overviewOrgsLearnersRetrieve({ org, departmentId, format = 'json', includeMainPlatform = true, length, page, search, }: { org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * Size of data to return */ length?: number, /** * Page offset */ page?: number, /** * Search string for learner */ search?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/overview/orgs/{org}/learners', path: { 'org': org, }, query: { 'department_id': departmentId, 'format': format, 'include_main_platform': includeMainPlatform, 'length': length, 'page': page, 'search': search, }, }); } /** * Get time spent statistics on a per-course basis. * * This endpoint provides a paginated list of courses with the total time * spent by users in each course. * * Query Parameters: * start_date (str, optional): Start date for filtering (ISO format) * end_date (str, optional): End date for filtering (ISO format) * page (int, optional): Page number for pagination * length (int, optional): Number of items per page * * Returns: * A paginated list of courses with: * - Course identification (ID and name) * - Total time spent (in seconds) * - Formatted time spent (human-readable) * - Percentage of total platform time * @returns TimeSpentPerCourse * @throws ApiError */ public static overviewOrgsMostActiveCoursesRetrieve({ org, departmentId, endDate, format = 'json', includeMainPlatform = true, length, page, startDate, }: { org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * Size of data to return */ length?: number, /** * Page offset */ page?: number, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/overview/orgs/{org}/most-active-courses', path: { 'org': org, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'length': length, 'page': page, 'start_date': startDate, }, }); } /** * Get registered user counts over time. * * This endpoint provides daily counts of new user registrations over a * specified time period. * * Query Parameters: * start_date (str, optional): Start date for the time range (ISO format) * end_date (str, optional): End date for the time range (ISO format) * * Returns: * Daily registration counts over the specified time period, with change metrics * compared to previous periods. * * Default time range is the last 7 days if no dates are specified. * @returns OvertimeWithChangeInfo * @throws ApiError */ public static overviewOrgsRegisteredUsersRetrieve({ org, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/overview/orgs/{org}/registered-users', path: { 'org': org, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * Get average grade value for platform, course, or user. * * This endpoint returns the average grade at different levels: * - Platform level: Average grade across all courses * - Course level: Average grade for a specific course * - Learner level: Average grade for a specific learner * - Course-learner level: Grade for a specific learner in a specific course * * Query Parameters: * course_id (str, optional): Filter by course ID * learner_id (str, optional): Filter by username or email * * Returns: * The average grade value based on the specified filters. * * Access Control: * - Platform admins can access any grade data * - Learners can access their own grade data * @returns Average * @throws ApiError */ public static performanceOrgsCoursesGradingAverageRetrieve({ courseId, org, departmentId, format = 'json', includeMainPlatform = true, }: { courseId: string, org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/performance/orgs/{org}/courses/{course_id}/grading/average', path: { 'course_id': courseId, 'org': org, }, query: { 'department_id': departmentId, 'format': format, 'include_main_platform': includeMainPlatform, }, }); } /** * Returns average course grade and grade cuttoff * * e.g * ``` * { * "data": { * "grade_cutoffs": { * "A": 90, * "B": 80, * "C": 70, * }, * "average_grade": 50.0, * } * } * ``` * * Kwargs * course_id * @returns AvgCourseGradeWithCutoff * @throws ApiError */ public static performanceOrgsCoursesGradingAverageWithCutoffRetrieve({ courseId, org, departmentId, format = 'json', includeMainPlatform = true, }: { courseId: string, org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/performance/orgs/{org}/courses/{course_id}/grading/average-with-cutoff', path: { 'course_id': courseId, 'org': org, }, query: { 'department_id': departmentId, 'format': format, 'include_main_platform': includeMainPlatform, }, }); } /** * Grading summary for the entire course overview in a tree-like format * * Kwargs * course_id * @returns CourseGradingDetail * @throws ApiError */ public static performanceOrgsCoursesGradingDetailRetrieve({ courseId, org, departmentId, format = 'json', includeMainPlatform = true, }: { courseId: string, org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/performance/orgs/{org}/courses/{course_id}/grading/detail', path: { 'course_id': courseId, 'org': org, }, query: { 'department_id': departmentId, 'format': format, 'include_main_platform': includeMainPlatform, }, }); } /** * Grading information per enrolled user in a course * * Kwargs * course_id * @returns GradingPerUser * @throws ApiError */ public static performanceOrgsCoursesGradingPerLearnerRetrieve({ courseId, org, departmentId, format = 'json', includeMainPlatform = true, }: { courseId: string, org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/performance/orgs/{org}/courses/{course_id}/grading/per-learner', path: { 'course_id': courseId, 'org': org, }, query: { 'department_id': departmentId, 'format': format, 'include_main_platform': includeMainPlatform, }, }); } /** * Returns average grades across various assignment types in a course * * Query Params * course_id * * Returns: * dict * { * "data": [ * { * "assignment_type': , * "weight": , * "average_weighted_grade": , * "average_section_grade": * }, ... * ] * } * @returns CourseGradeSummary * @throws ApiError */ public static performanceOrgsCoursesGradingSummaryRetrieve({ courseId, org, departmentId, format = 'json', includeMainPlatform = true, }: { courseId: string, org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/performance/orgs/{org}/courses/{course_id}/grading/summary', path: { 'course_id': courseId, 'org': org, }, query: { 'department_id': departmentId, 'format': format, 'include_main_platform': includeMainPlatform, }, }); } /** * Get average grade value for platform, course, or user. * * This endpoint returns the average grade at different levels: * - Platform level: Average grade across all courses * - Course level: Average grade for a specific course * - Learner level: Average grade for a specific learner * - Course-learner level: Grade for a specific learner in a specific course * * Query Parameters: * course_id (str, optional): Filter by course ID * learner_id (str, optional): Filter by username or email * * Returns: * The average grade value based on the specified filters. * * Access Control: * - Platform admins can access any grade data * - Learners can access their own grade data * @returns Average * @throws ApiError */ public static performanceOrgsGradingAverageRetrieve({ org, departmentId, format = 'json', includeMainPlatform = true, }: { org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/performance/orgs/{org}/grading/average', path: { 'org': org, }, query: { 'department_id': departmentId, 'format': format, 'include_main_platform': includeMainPlatform, }, }); } /** * List grade-related performance data for all courses. * * This endpoint provides a comprehensive view of grade performance across * courses, including enrollment counts, pass rates, and average grades. * * Returns: * A paginated list of courses with: * - Course identification (ID and name) * - Enrollment count * - Number of students who passed * - Average grade * @returns PerformanceGradesPerCourse * @throws ApiError */ public static performanceOrgsGradingPerCourseRetrieve({ org, departmentId, format = 'json', includeMainPlatform = true, length, page, }: { org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * Size of data to return */ length?: number, /** * Page offset */ page?: number, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/performance/orgs/{org}/grading/per-course', path: { 'org': org, }, query: { 'department_id': departmentId, 'format': format, 'include_main_platform': includeMainPlatform, 'length': length, 'page': page, }, }); } /** * Enhanced API endpoint for listing learners with comprehensive filtering. * * This endpoint provides a paginated list of learners with detailed metrics * and supports advanced filtering options. It uses DM token authentication * and respects department-based access controls. * * Query Parameters: * page (int): Page number for pagination * length (int): Number of items per page * search (str): Filter by username, email, or full name * program (str): Filter by program * location (str): Filter by location * is_enrolled (bool): Filter for users with enrollments * platform (str): Filter by platform * start_date (date): Filter by join date (start range) * end_date (date): Filter by join date (end range) * * Returns: * A paginated list of learners with comprehensive metrics including: * - Course enrollments and completions * - Time spent on platform * - Pathway progress * - Certificate and skill information * - Location data * * Access Control: * - Platform admins can see all learners * - Department admins can only see learners in their departments * @returns NewPerLearnerList * @throws ApiError */ public static perlearnerOrgsLearnersRetrieve({ org, departmentId, endDate, format = 'json', includeMainPlatform = true, isEnrolled, length, location, page, platform, program, search, startDate, }: { org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * Learner date_joined end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * Filter for users who have at least an enrollment */ isEnrolled?: boolean | null, /** * Size of data to return */ length?: number, /** * Location search string */ location?: string, /** * Page offset */ page?: number, /** * Platform search string */ platform?: string, /** * Program search string */ program?: string, /** * Search string for learner. email, username or full name */ search?: string, /** * Learner date_joined start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/perlearner/orgs/{org}/learners', path: { 'org': org, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'is_enrolled': isEnrolled, 'length': length, 'location': location, 'page': page, 'platform': platform, 'program': program, 'search': search, 'start_date': startDate, }, }); } /** * List all learners on the platform with aggregated metrics. * * This endpoint returns a paginated list of all learners with key metrics including: * - Enrollment counts * - Completion counts * - Time spent on platform * * Query Parameters: * page (int): Page number for pagination * length (int): Number of items per page * search (str): Filter learners by username, email, or name * * Returns: * A paginated list of learners with their associated metrics. * @returns PerlearnerUserList * @throws ApiError */ public static perlearnerOrgsUsersRetrieve({ org, departmentId, format = 'json', includeMainPlatform = true, length, page, search, }: { org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * Size of data to return */ length?: number, /** * Page offset */ page?: number, /** * Search string for learner */ search?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/perlearner/orgs/{org}/users', path: { 'org': org, }, query: { 'department_id': departmentId, 'format': format, 'include_main_platform': includeMainPlatform, 'length': length, 'page': page, 'search': search, }, }); } /** * Provides information on user enrollments * * Params * user_id e.g developer@ibleducation.com| developer * @returns ActivityAPI * @throws ApiError */ public static perlearnerOrgsUsersActivityRetrieve({ org, userId, departmentId, format = 'json', includeMainPlatform = true, }: { org: string, userId: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/perlearner/orgs/{org}/users/{user_id}/activity/', path: { 'org': org, 'user_id': userId, }, query: { 'department_id': departmentId, 'format': format, 'include_main_platform': includeMainPlatform, }, }); } /** * Provides about a learner current grade in a course with the course cut * Kwargs * 1. course_id e.g course-v1:Org+Course4+Run * 2. user_id e.g developer@ibleducation.com or dev123 (username|email) * @returns PerlearnerGradeWithCutOff * @throws ApiError */ public static perlearnerOrgsUsersCoursesGradingCutoffsRetrieve({ courseId, org, userId, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { courseId: string, org: string, userId: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/perlearner/orgs/{org}/users/{user_id}/courses/{course_id}/grading/cutoffs', path: { 'course_id': courseId, 'org': org, 'user_id': userId, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * DRF view mixin that routes all ORM reads to the read replica. * * Falls back to the primary database if the replica is unreachable. * * Add as the **first** base class on read-only views/viewsets:: * * class MyView(ReadReplicaViewMixin, IsPlatformAdminDRFMixin, APIView): * ... * @returns DetailedGradeView * @throws ApiError */ public static perlearnerOrgsUsersCoursesGradingDetailRetrieve({ courseId, org, userId, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { courseId: string, org: string, userId: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/perlearner/orgs/{org}/users/{user_id}/courses/{course_id}/grading/detail', path: { 'course_id': courseId, 'org': org, 'user_id': userId, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * Query Params * 1. course_id e.g course-v1:Org+Course4+Run * 2. user_id e.g developer@ibleducation.com or dev123 (username|email) * @returns PerlearnerGradeSummary * @throws ApiError */ public static perlearnerOrgsUsersCoursesGradingSummaryRetrieve({ courseId, org, userId, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { courseId: string, org: string, userId: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/perlearner/orgs/{org}/users/{user_id}/courses/{course_id}/grading/summary', path: { 'course_id': courseId, 'org': org, 'user_id': userId, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * Average of days with atleast an activity within ENGAGEMENT_INDEX_PERIOD consecutive days for a learner in a course * @returns Value * @throws ApiError */ public static perlearnerOrgsUsersCoursesOverviewEngagementIndexRetrieve({ courseId, org, userId, }: { courseId: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/perlearner/orgs/{org}/users/{user_id}/courses/{course_id}/overview/engagement-index', path: { 'course_id': courseId, 'org': org, 'user_id': userId, }, }); } /** * Provides about a learner current grade in a course with the course cut * Kwargs * 1. course_id e.g course-v1:Org+Course4+Run * 2. user_id e.g developer@ibleducation.com or dev123 (username|email) * @returns PerlearnerGradeWithCutOff * @throws ApiError */ public static perlearnerOrgsUsersCoursesOverviewGradeRetrieve({ courseId, org, userId, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { courseId: string, org: string, userId: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/perlearner/orgs/{org}/users/{user_id}/courses/{course_id}/overview/grade', path: { 'course_id': courseId, 'org': org, 'user_id': userId, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * Evaluates performance index for platform, per course, per user and per user-per course * * Query Params * course_id * learner_id * @returns Value * @throws ApiError */ public static perlearnerOrgsUsersCoursesOverviewPerformanceIndexRetrieve({ courseId, org, userId, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { courseId: string, org: string, userId: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/perlearner/orgs/{org}/users/{user_id}/courses/{course_id}/overview/performance-index', path: { 'course_id': courseId, 'org': org, 'user_id': userId, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * Time spent within a course in secs on a per-day basis * * Kwargs * 1. course_id e.g course-v1:Org+Course4+Run * 2. user_id e.g developer@ibleducation.com or dev123 (username|email) * Query Params * 3. start_date e.g 2020-10-01 * 4. end_date e.g 2020-10-10 * * Default result when no query param is added is last_7_days (today inclusive) * @returns OverTimeWithTotal * @throws ApiError */ public static perlearnerOrgsUsersCoursesOverviewTimeOverTimeRetrieve({ courseId, org, userId, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { courseId: string, org: string, userId: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/perlearner/orgs/{org}/users/{user_id}/courses/{course_id}/overview/time/over-time', path: { 'course_id': courseId, 'org': org, 'user_id': userId, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * List of videos within a course a learner has watched * * Kwargs * 1. course_id e.g course-v1:Org+Course4+Run * 2. user_id e.g developer@ibleducation.com or dev123 (username|email) * * Default result when no query param is added is [], 0 * @returns PerLearnerCourseVideosWatched * @throws ApiError */ public static perlearnerOrgsUsersCoursesVideosRetrieve({ courseId, org, userId, departmentId, format = 'json', includeMainPlatform = true, }: { courseId: string, org: string, userId: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/perlearner/orgs/{org}/users/{user_id}/courses/{course_id}/videos', path: { 'course_id': courseId, 'org': org, 'user_id': userId, }, query: { 'department_id': departmentId, 'format': format, 'include_main_platform': includeMainPlatform, }, }); } /** * Get video watch counts over time. * * This endpoint provides daily counts of videos watched over a specified time period, * with options to filter by course or user. * * Query Parameters: * start_date (str, optional): Start date for the time range (ISO format) * end_date (str, optional): End date for the time range (ISO format) * course_id (str, optional): Filter by course ID * user_id (str, optional): Filter by username or email * * Returns: * Daily video watch counts over the specified time period. * * Default time range is the last 7 days if no dates are specified. * * Access Control: * - Platform admins can access any video watch data * - Learners can access their own video watch data * @returns OverTimeWithTotal * @throws ApiError */ public static perlearnerOrgsUsersCoursesVideosOverTimeRetrieve({ courseId, org, userId, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { courseId: string, org: string, userId: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/perlearner/orgs/{org}/users/{user_id}/courses/{course_id}/videos/over-time', path: { 'course_id': courseId, 'org': org, 'user_id': userId, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * Summary Grading Information for a learner on a per-enrollment basis * * Query Params * 1. user_id e.g developer@ibleducation.com or dev123 (username|email) * @returns PerlearnerGradingPerCourseAPI * @throws ApiError */ public static perlearnerOrgsUsersGradesPerCourseRetrieve({ org, userId, departmentId, format = 'json', includeMainPlatform = true, }: { org: string, userId: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/perlearner/orgs/{org}/users/{user_id}/grades/per-course', path: { 'org': org, 'user_id': userId, }, query: { 'department_id': departmentId, 'format': format, 'include_main_platform': includeMainPlatform, }, }); } /** * Retrieve detailed information about a specific learner. * * This endpoint returns personal and activity information about a learner, * including profile data, activity metrics, and location information. * * Path Parameters: * user_id (str): The username or email of the learner * * Query Parameters: * meta (bool): Include additional analytics information when true * * Returns: * Detailed learner information including: * - Profile data (username, name, email) * - Registration and activity dates * - Activity metrics (assessments, time spent, videos watched) * - Location and browser information (when available) * * Access Control: * - Platform admins can access any learner * - Learners can access their own information * - Department admins can access learners in their departments * @returns LearnerInformationAPI * @throws ApiError */ public static perlearnerOrgsUsersInfoRetrieve({ org, userId, departmentId, format = 'json', includeMainPlatform = true, meta = 'n', search, }: { org: string, userId: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * Include extra analytics information? * * * `y` - y * * `yes` - yes * * `true` - true * * `True` - True * * `n` - n * * `no` - no * * `false` - false * * `False` - False */ meta?: 'y' | 'yes' | 'true' | 'True' | 'n' | 'no' | 'false' | 'False', search?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/perlearner/orgs/{org}/users/{user_id}/info', path: { 'org': org, 'user_id': userId, }, query: { 'department_id': departmentId, 'format': format, 'include_main_platform': includeMainPlatform, 'meta': meta, 'search': search, }, }); } /** * Last course accessed by a learner, includes upto unit information as well * @returns PerLearnerLastAccess * @throws ApiError */ public static perlearnerOrgsUsersLastAccessRetrieve({ org, userId, departmentId, format = 'json', includeMainPlatform = true, }: { org: string, userId: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/perlearner/orgs/{org}/users/{user_id}/last-access', path: { 'org': org, 'user_id': userId, }, query: { 'department_id': departmentId, 'format': format, 'include_main_platform': includeMainPlatform, }, }); } /** * Average of days with atleast an activity within ENGAGEMENT_INDEX_PERIOD consecutive days * @returns Value * @throws ApiError */ public static perlearnerOrgsUsersOverviewEngagementIndexRetrieve({ org, userId, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { org: string, userId: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/perlearner/orgs/{org}/users/{user_id}/overview/engagement-index', path: { 'org': org, 'user_id': userId, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * Get average grade value for platform, course, or user. * * This endpoint returns the average grade at different levels: * - Platform level: Average grade across all courses * - Course level: Average grade for a specific course * - Learner level: Average grade for a specific learner * - Course-learner level: Grade for a specific learner in a specific course * * Query Parameters: * course_id (str, optional): Filter by course ID * learner_id (str, optional): Filter by username or email * * Returns: * The average grade value based on the specified filters. * * Access Control: * - Platform admins can access any grade data * - Learners can access their own grade data * @returns Average * @throws ApiError */ public static perlearnerOrgsUsersOverviewGradesAverageRetrieve({ org, userId, departmentId, format = 'json', includeMainPlatform = true, }: { org: string, userId: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/perlearner/orgs/{org}/users/{user_id}/overview/grades/average', path: { 'org': org, 'user_id': userId, }, query: { 'department_id': departmentId, 'format': format, 'include_main_platform': includeMainPlatform, }, }); } /** * Evaluates performance index for platform, per course, per user and per user-per course * * Query Params * course_id * learner_id * @returns Value * @throws ApiError */ public static perlearnerOrgsUsersOverviewPerformanceIndexRetrieve({ org, userId, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { org: string, userId: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/perlearner/orgs/{org}/users/{user_id}/overview/performance-index', path: { 'org': org, 'user_id': userId, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * Time spent in secs on a per-day basis * * Query Params * 1. course_id e.g course-v1:Org+Course4+Run * 2. user_id e.g developer@ibleducation.com or dev123 (username|email) * 3. start_date e.g 2020-10-01 * 4. end_date e.g 2020-10-10 * * Default result when no query param is added is last_7_days (today inclusive) * @returns OverTimeWithTotal * @throws ApiError */ public static perlearnerOrgsUsersOverviewTimeOverTimeRetrieve({ org, userId, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { org: string, userId: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/perlearner/orgs/{org}/users/{user_id}/overview/time/over-time', path: { 'org': org, 'user_id': userId, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * Get video watch counts over time. * * This endpoint provides daily counts of videos watched over a specified time period, * with options to filter by course or user. * * Query Parameters: * start_date (str, optional): Start date for the time range (ISO format) * end_date (str, optional): End date for the time range (ISO format) * course_id (str, optional): Filter by course ID * user_id (str, optional): Filter by username or email * * Returns: * Daily video watch counts over the specified time period. * * Default time range is the last 7 days if no dates are specified. * * Access Control: * - Platform admins can access any video watch data * - Learners can access their own video watch data * @returns OverTimeWithTotal * @throws ApiError */ public static perlearnerOrgsUsersVideosOverTimeRetrieve({ org, userId, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { org: string, userId: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/perlearner/orgs/{org}/users/{user_id}/videos/over-time', path: { 'org': org, 'user_id': userId, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * Summary Videos watched data for a learner per enrollment * * Query Params * 1. user_id e.g developer@ibleducation.com or dev123 (username|email) * @returns PerlearnerEngagementVideosWatchedPerCourse * @throws ApiError */ public static perlearnerOrgsUsersVideosPerCourseRetrieve({ org, userId, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { org: string, userId: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/perlearner/orgs/{org}/users/{user_id}/videos/per-course', path: { 'org': org, 'user_id': userId, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * Get a list of registered users on the platform. * * This endpoint provides a list of all registered users with basic profile * information including username, name, email, and registration date. * * Returns: * A list of registered users with their profile information. * @returns any No response body * @throws ApiError */ public static platformOrgsRetrieve({ org, }: { org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/platform/orgs/{org}/', path: { 'org': org, }, }); } /** * Completion information per enrolled user * * Gives Percentage of units completed in course * * Query Params * course_id * user_id * @returns any No response body * @throws ApiError */ public static platformOrgsCoursesProgressRetrieve({ courseId, org, }: { courseId: string, org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/platform/orgs/{org}/courses/{course_id}/progress/', path: { 'course_id': courseId, 'org': org, }, }); } /** * Average days used to complete a course * * Query Params * 1. course_id e.g course-v1:Org+Course4+Run * @returns any No response body * @throws ApiError */ public static platformOrgsCoursesProgressAverageDaysToCompleteRetrieve({ courseId, org, }: { courseId: string, org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/platform/orgs/{org}/courses/{course_id}/progress/average-days-to-complete', path: { 'course_id': courseId, 'org': org, }, }); } /** * Average time used to complete a course in secs * * Query Params * 1. course_id e.g course-v1:Org+Course4+Run * @returns any No response body * @throws ApiError */ public static platformOrgsCoursesProgressAverageTimeToCompleteRetrieve({ courseId, org, }: { courseId: string, org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/platform/orgs/{org}/courses/{course_id}/progress/average-time-to-complete', path: { 'course_id': courseId, 'org': org, }, }); } /** * Get completion count statistics. * * This endpoint returns completion counts at different levels: * - Platform level: Total users who have completed at least one course * - Course level: Total completions for a specific course * - Learner level: Total courses completed by a specific learner * * Query Parameters: * course_id (str, optional): Filter by course ID * user_id (str, optional): Filter by username or email * * Returns: * A count of completions based on the specified filters. * @returns any No response body * @throws ApiError */ public static platformOrgsCoursesProgressCompletedRetrieve({ courseId, org, }: { courseId: string, org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/platform/orgs/{org}/courses/{course_id}/progress/completed', path: { 'course_id': courseId, 'org': org, }, }); } /** * Average of total completed units * @returns any No response body * @throws ApiError */ public static platformOrgsCoursesProgressCompletionRateRetrieve({ courseId, org, }: { courseId: string, org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/platform/orgs/{org}/courses/{course_id}/progress/completion-rate', path: { 'course_id': courseId, 'org': org, }, }); } /** * In Progress means any unit completion in the past 30 days * * For platform : Total users who have atleast a course in_progress on the platform * For course : Total users * For learner : Total courses in progress * * Query Params * 1. course_id e.g course-v1:Org+Course4+Run * 2. user_id e.g developer@ibleducation.com or dev123 (username|email) * @returns any No response body * @throws ApiError */ public static platformOrgsCoursesProgressInProgressRetrieve({ courseId, org, }: { courseId: string, org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/platform/orgs/{org}/courses/{course_id}/progress/in-progress', path: { 'course_id': courseId, 'org': org, }, }); } /** * Started means an enrollment * * For platform : Total users who have atleast an enrollment * For course : Total users enrolled * For learner : Total courses in progress * * Query Params * 1. course_id e.g course-v1:Org+Course4+Run * 2. user_id e.g developer@ibleducation.com or dev123 (username|email) * @returns any No response body * @throws ApiError */ public static platformOrgsCoursesProgressStartedRetrieve({ courseId, org, }: { courseId: string, org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/platform/orgs/{org}/courses/{course_id}/progress/started', path: { 'course_id': courseId, 'org': org, }, }); } /** * DRF view mixin that routes all ORM reads to the read replica. * * Falls back to the primary database if the replica is unreachable. * * Add as the **first** base class on read-only views/viewsets:: * * class MyView(ReadReplicaViewMixin, IsPlatformAdminDRFMixin, APIView): * ... * @returns any No response body * @throws ApiError */ public static platformOrgsCoursesUsersGradesPassedRetrieve({ courseId, org, userId, }: { courseId: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/platform/orgs/{org}/courses/{course_id}/users/{user_id}/grades/passed', path: { 'course_id': courseId, 'org': org, 'user_id': userId, }, }); } /** * Gives Percentage of units completed in course for a specific learner * @returns PerlearnerCourseProgress * @throws ApiError */ public static platformOrgsCoursesUsersProgressRetrieve({ courseId, org, userId, departmentId, format = 'json', includeMainPlatform = true, }: { courseId: string, org: string, userId: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/platform/orgs/{org}/courses/{course_id}/users/{user_id}/progress', path: { 'course_id': courseId, 'org': org, 'user_id': userId, }, query: { 'department_id': departmentId, 'format': format, 'include_main_platform': includeMainPlatform, }, }); } /** * Average days used to complete a course * * Query Params * 1. course_id e.g course-v1:Org+Course4+Run * @returns any No response body * @throws ApiError */ public static platformOrgsCoursesUsersProgressDaysToCompleteRetrieve({ courseId, org, userId, }: { courseId: string, org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/platform/orgs/{org}/courses/{course_id}/users/{user_id}/progress/days-to-complete', path: { 'course_id': courseId, 'org': org, 'user_id': userId, }, }); } /** * Time spent count in seconds within a course by a learner * @returns Count * @throws ApiError */ public static platformOrgsCoursesUsersTimeCountRetrieve({ courseId, org, userId, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { courseId: string, org: string, userId: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/platform/orgs/{org}/courses/{course_id}/users/{user_id}/time/count', path: { 'course_id': courseId, 'org': org, 'user_id': userId, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * (Total videos watched / Total Course Videos) or Total Videos watched in a course by a learner * @returns VideosCount * @throws ApiError */ public static platformOrgsCoursesUsersVideosCountRetrieve({ courseId, org, userId, departmentId, format = 'json', includeMainPlatform = true, }: { courseId: string, org: string, userId: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/platform/orgs/{org}/courses/{course_id}/users/{user_id}/videos/count', path: { 'course_id': courseId, 'org': org, 'user_id': userId, }, query: { 'department_id': departmentId, 'format': format, 'include_main_platform': includeMainPlatform, }, }); } /** * Count of total videos in a course * * Query Params * course_id e.g course-v1:Org+Course4+Run * @returns any No response body * @throws ApiError */ public static platformOrgsCoursesVideosRetrieve2({ courseId, org, }: { courseId: string, org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/platform/orgs/{org}/courses/{course_id}/videos/', path: { 'course_id': courseId, 'org': org, }, }); } /** * Get total count of courses on the platform. * * This endpoint returns the total number of courses available on the platform. * * Returns: * The total count of courses on the platform. * @returns Count * @throws ApiError */ public static platformOrgsCoursesCountRetrieve({ org, departmentId, format = 'json', includeMainPlatform = true, }: { org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/platform/orgs/{org}/courses/count', path: { 'org': org, }, query: { 'department_id': departmentId, 'format': format, 'include_main_platform': includeMainPlatform, }, }); } /** * List grading information on a per-course basis. * * This endpoint provides grading statistics for all courses, including * average grades and completion rates. * * Returns: * A list of courses with their associated grading metrics. * @returns any No response body * @throws ApiError */ public static platformOrgsCoursesGradesRetrieve({ org, }: { org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/platform/orgs/{org}/courses/grades', path: { 'org': org, }, }); } /** * Get video watch statistics on a per-course basis. * * This endpoint provides a list of courses with aggregated video watch metrics, * including total views and completion percentages. * * Returns: * A list of courses with: * - Course identification (ID and name) * - Video watch count * - Percentage of total videos watched * @returns WatchedVideosPerCourse * @throws ApiError */ public static platformOrgsCoursesVideosRetrieve({ org, departmentId, format = 'json', includeMainPlatform = true, }: { org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/platform/orgs/{org}/courses/videos', path: { 'org': org, }, query: { 'department_id': departmentId, 'format': format, 'include_main_platform': includeMainPlatform, }, }); } /** * Get completion count statistics. * * This endpoint returns completion counts at different levels: * - Platform level: Total users who have completed at least one course * - Course level: Total completions for a specific course * - Learner level: Total courses completed by a specific learner * * Query Parameters: * course_id (str, optional): Filter by course ID * user_id (str, optional): Filter by username or email * * Returns: * A count of completions based on the specified filters. * @returns any No response body * @throws ApiError */ public static platformOrgsProgressCompletedRetrieve({ org, }: { org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/platform/orgs/{org}/progress/completed', path: { 'org': org, }, }); } /** * Average of total completed units * @returns any No response body * @throws ApiError */ public static platformOrgsProgressCompletionRateRetrieve({ org, }: { org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/platform/orgs/{org}/progress/completion-rate', path: { 'org': org, }, }); } /** * In Progress means any unit completion in the past 30 days * * For platform : Total users who have atleast a course in_progress on the platform * For course : Total users * For learner : Total courses in progress * * Query Params * 1. course_id e.g course-v1:Org+Course4+Run * 2. user_id e.g developer@ibleducation.com or dev123 (username|email) * @returns any No response body * @throws ApiError */ public static platformOrgsProgressInProgressRetrieve({ org, }: { org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/platform/orgs/{org}/progress/in-progress', path: { 'org': org, }, }); } /** * Started means an enrollment * * For platform : Total users who have atleast an enrollment * For course : Total users enrolled * For learner : Total courses in progress * * Query Params * 1. course_id e.g course-v1:Org+Course4+Run * 2. user_id e.g developer@ibleducation.com or dev123 (username|email) * @returns any No response body * @throws ApiError */ public static platformOrgsProgressStartedRetrieve({ org, }: { org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/platform/orgs/{org}/progress/started', path: { 'org': org, }, }); } /** * Total time spent count on the platform within specified range or all time * * Query Params * 1. start_date e.g 2020-10-01 * 2. end_date e.g 2020-10-10 * * Default result is all time * @returns any No response body * @throws ApiError */ public static platformOrgsTimeCountRetrieve({ org, }: { org: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/platform/orgs/{org}/time/count', path: { 'org': org, }, }); } /** * Get count of active users on the platform. * * This endpoint returns the number of users who have had activity on the platform, * either for all time or within a specified date range. * * Query Parameters: * start_date (str, optional): Start date for filtering (ISO format) * end_date (str, optional): End date for filtering (ISO format) * * Returns: * The count of active users and change metrics compared to previous periods. * * Default behavior returns the count for all time if no date range is specified. * @returns OverTimeWithTotal * @throws ApiError */ public static platformOrgsUsersActiveCountRetrieve({ org, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/platform/orgs/{org}/users/active/count', path: { 'org': org, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * Get count of registered users on the platform. * * This endpoint returns the number of users registered on the platform, * either for all time or within a specified date range. * * Query Parameters: * start_date (str, optional): Start date for filtering (ISO format) * end_date (str, optional): End date for filtering (ISO format) * * Returns: * The count of registered users and change metrics compared to previous periods. * * Default behavior returns the count for all time if no date range is specified. * @returns OverTimeWithTotal * @throws ApiError */ public static platformOrgsUsersCountRetrieve({ org, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/platform/orgs/{org}/users/count', path: { 'org': org, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } /** * Count of users who have completed a course on the platform within specified range or all time * * Query Params * 1. start_date e.g 2020-10-01 * 2. end_date e.g 2020-10-10 * * Default is all time * @returns OverTimeWithTotal * @throws ApiError */ public static platformOrgsUsersCoursesCompletedCountRetrieve({ org, departmentId, endDate, format = 'json', includeMainPlatform = true, startDate, }: { org: string, /** * When `department_mode=1` is passed, it allows to filter data for only user content groups for the specified department */ departmentId?: number, /** * end date. ISO 8601 */ endDate?: string, /** * Format * * * `json` - json */ format?: 'json', /** * Include main platform data */ includeMainPlatform?: boolean, /** * start date. ISO 8601 */ startDate?: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/platform/orgs/{org}/users/courses-completed/count', path: { 'org': org, }, query: { 'department_id': departmentId, 'end_date': endDate, 'format': format, 'include_main_platform': includeMainPlatform, 'start_date': startDate, }, }); } }