API Spec
- Production API
- Development API
AnonymousAuthHandler handles anonymous user authentication
Allows users to log in or sign up anonymously using a shared password and optional code
Request Body schema: application/json
Anonymous authentication request payload
| classId | string |
| code | string |
| isConsent | boolean |
Responses
Request samples
- Payload
{- "classId": "string",
- "code": "string",
- "isConsent": true
}Response samples
- 200
- 400
- 401
- 500
{- "property1": "string",
- "property2": "string"
}HandleLogin processes user login requests
Authenticates a user using email and password
Request Body schema: application/json
Login request payload
string | |
| password | string |
Responses
Request samples
- Payload
{- "email": "string",
- "password": "string"
}Response samples
- 200
- 400
- 401
{- "property1": "string",
- "property2": "string"
}ProviderHandler initiates third-party provider authentication
Redirects the user to the third-party provider's authentication page
path Parameters
| provider required | string Third-party provider (e.g., google, github) |
query Parameters
| redirect_to | string URL to redirect to after authentication |
Responses
Response samples
- 302
- 500
"string"HandleSignUp processes user signup requests
Registers a new user using email, password, first name, and last name
Request Body schema: application/json
Signup request payload
string | |
| firstName | string |
| isConsent | boolean |
| lastName | string |
| password | string |
Responses
Request samples
- Payload
{- "email": "string",
- "firstName": "string",
- "isConsent": true,
- "lastName": "string",
- "password": "string"
}Response samples
- 200
- 400
- 401
- 500
{- "property1": "string",
- "property2": "string"
}GetAllClasses retrieves all classes with optional pagination and filtering
Fetches all classes, with options for pagination, searching, and filtering by user
query Parameters
| includeStudents | boolean Whether to include enrolled students in the response |
| page | integer Page number for pagination (default is 1) |
| limit | integer Number of items per page for pagination (default is 50) |
| search | string Search term to filter classes by title or code |
| user_id | string Filter classes by a specific user ID (instructor or student) |
Responses
Response samples
- 200
- 500
{ }CreateClass creates a new class
Creates a new class in the database with the provided details
Request Body schema: application/json
Class creation request
| classCode | string |
| classDescription | string |
| classHexColor | string |
| classImageCover | string |
| classTitle | string |
| instructorId | string |
Responses
Request samples
- Payload
{- "classCode": "string",
- "classDescription": "string",
- "classHexColor": "string",
- "classImageCover": "string",
- "classTitle": "string",
- "instructorId": "string"
}Response samples
- 201
- 400
- 500
{- "property1": "string",
- "property2": "string"
}UpdateEnrollmentStatus updates a user's enrollment status in a class
Updates the enrollment status of a user in a specific class
Request Body schema: application/json
Enrollment status update request
| classId required | string |
| status required | string |
| userId required | string |
Responses
Request samples
- Payload
{- "classId": "string",
- "status": "string",
- "userId": "string"
}Response samples
- 200
- 400
- 500
{- "property1": "string",
- "property2": "string"
}GetClassesByInstructor retrieves classes taught by a specific instructor
Fetches all classes associated with the given instructor ID. Optionally includes enrolled students
path Parameters
| instructor_id required | string Instructor ID |
query Parameters
| includeStudents | boolean Whether to include enrolled students in the response |
Responses
Response samples
- 200
- 400
- 500
[- {
- "classCode": "string",
- "classDescription": "string",
- "classHexColor": "string",
- "classImageCover": "string",
- "classTitle": "string",
- "createdAt": "string",
- "enrollmentStatus": "WAITLISTED",
- "id": "string",
- "instructorId": "string",
- "instructorName": "string",
- "joinedAt": "string",
- "studentCount": 0,
- "students": [
- {
- "avatarUrl": "string",
- "createdAt": "string",
- "email": "string",
- "enrollmentStatus": "WAITLISTED",
- "firstName": "string",
- "id": "string",
- "isConsent": true,
- "lastName": "string",
- "pid": "string",
- "role": "STUDENT",
- "settings": {
- "bugPercentage": 0,
- "enableDashboard": true,
- "enableQuiz": true,
- "mode": "string",
- "showNotifications": true,
- "test_group": "string"
}, - "status": "string"
}
]
}
]RegisterClass registers a user to a class
Registers a user to a class in the database
Request Body schema: application/json
Class registration request
| classId required | string |
| userId required | string |
Responses
Request samples
- Payload
{- "classId": "string",
- "userId": "string"
}Response samples
- 200
- 400
- 500
{- "property1": "string",
- "property2": "string"
}UnregisterClass unregisters a user from a class
Unregisters a user from a specific class in the database
Request Body schema: application/json
Class unregistration request
| classId required | string |
| userId required | string |
Responses
Request samples
- Payload
{- "classId": "string",
- "userId": "string"
}Response samples
- 200
- 400
- 500
{- "property1": "string",
- "property2": "string"
}GetAClass retrieves a specific class by ID
Fetches a class from the database based on the provided class ID. Optionally includes enrolled students and enrollment status for a specific user
path Parameters
| class_id required | string ID of the class |
query Parameters
| includeStudents | boolean Whether to include enrolled students in the response |
| user_id | string User ID to get enrollment status for (optional) |
Responses
Response samples
- 200
- 400
- 404
- 500
{- "classCode": "string",
- "classDescription": "string",
- "classHexColor": "string",
- "classImageCover": "string",
- "classTitle": "string",
- "createdAt": "string",
- "enrollmentStatus": "WAITLISTED",
- "id": "string",
- "instructorId": "string",
- "instructorName": "string",
- "joinedAt": "string",
- "studentCount": 0,
- "students": [
- {
- "avatarUrl": "string",
- "createdAt": "string",
- "email": "string",
- "enrollmentStatus": "WAITLISTED",
- "firstName": "string",
- "id": "string",
- "isConsent": true,
- "lastName": "string",
- "pid": "string",
- "role": "STUDENT",
- "settings": {
- "bugPercentage": 0,
- "enableDashboard": true,
- "enableQuiz": true,
- "mode": "string",
- "showNotifications": true,
- "test_group": "string"
}, - "status": "string"
}
]
}UpdateClass updates an existing class
Updates the details of an existing class in the database
path Parameters
| class_id required | string ID of the class to update |
Request Body schema: application/json
Class update request
| classCode | string |
| classDescription | string |
| classHexColor | string |
| classImageCover | string |
| classTitle | string |
| instructorId | string |
Responses
Request samples
- Payload
{- "classCode": "string",
- "classDescription": "string",
- "classHexColor": "string",
- "classImageCover": "string",
- "classTitle": "string",
- "instructorId": "string"
}Response samples
- 200
- 400
- 500
{- "property1": "string",
- "property2": "string"
}UpdateClassStudentsSettings updates settings for multiple students in a class
Updates the user settings for multiple students enrolled in a specific class
path Parameters
| class_id required | string ID of the class |
Request Body schema: application/json
Settings update request
required | object (models.UserSettings) |
| studentIds required | Array of strings |
Responses
Request samples
- Payload
{- "settings": {
- "bugPercentage": 0,
- "enableDashboard": true,
- "enableQuiz": true,
- "mode": "string",
- "showNotifications": true,
- "test_group": "string"
}, - "studentIds": [
- "string"
]
}Response samples
- 200
- 400
- 500
{ }Handle image upload
Endpoint to handle image uploads to Supabase Storage
Request Body schema: multipart/form-data
| image required | string <binary> Image file to upload |
Responses
Response samples
- 200
- 400
- 500
{- "error": "string",
- "image_path": "string",
- "image_url": "string",
- "success": true
}Response samples
- 200
- 500
[- {
- "client_ip": "string",
- "error_message": "string",
- "method": "string",
- "request_path": "string",
- "route": "string",
- "status_code": 0,
- "user_agent": "string"
}
]Response samples
- 200
- 500
[- {
- "class_id": "string",
- "duration": 0,
- "event": "SUGGESTION_ACCEPT",
- "explanation": "string",
- "has_bug": true,
- "language": "string",
- "log_created_at": "string",
- "log_id": "string",
- "model": "string",
- "prompt": "string",
- "suggestion_array": [
- "string"
], - "suggestion_created_at": "string",
- "suggestion_id": "string",
- "user_id": "string",
- "vendor": "string"
}
]GetLogsByClassID retrieves logs for a specific class
Fetches logs from the database for a specific class ID
path Parameters
| class_id required | string ID of the class |
Responses
Response samples
- 200
- 500
[- {
- "class_id": "string",
- "duration": 0,
- "event": "SUGGESTION_ACCEPT",
- "explanation": "string",
- "has_bug": true,
- "language": "string",
- "log_created_at": "string",
- "log_id": "string",
- "model": "string",
- "prompt": "string",
- "suggestion_array": [
- "string"
], - "suggestion_created_at": "string",
- "suggestion_id": "string",
- "user_id": "string",
- "vendor": "string"
}
]HandleLogsForInstructor retrieves logs for a specific instructor
Fetches logs from the database for a specific instructor ID
path Parameters
| instructor_id required | string ID of the instructor |
Responses
Response samples
- 200
- 500
[- {
- "class_id": "string",
- "duration": 0,
- "event": "SUGGESTION_ACCEPT",
- "explanation": "string",
- "has_bug": true,
- "language": "string",
- "log_created_at": "string",
- "log_id": "string",
- "model": "string",
- "prompt": "string",
- "suggestion_array": [
- "string"
], - "suggestion_created_at": "string",
- "suggestion_id": "string",
- "user_id": "string",
- "vendor": "string"
}
]LogSuggestionEvent logs a suggestion event
Logs a suggestion event to the database based on the mode
path Parameters
| mode required | string Mode of the suggestion (CODE_BLOCK, LINE_BY_LINE, CODE_SELECTION) |
Request Body schema: application/json
Log Suggestion Event Request
Responses
Request samples
- Payload
nullResponse samples
- 201
- 400
- 500
{- "property1": "string",
- "property2": "string"
}GetUserSuggestionLogsByMode retrieves suggestion logs for a user based on GetUserSuggestionLogsByMode
Fetches suggestion logs from the database for a specific user and mode
path Parameters
| user_id required | string ID of the user |
| mode required | string Mode of the suggestion logs to retrieve (CODE_BLOCK, LINE_BY_LINE, CODE_SELECTION) |
Responses
Response samples
- 200
- 400
- 500
{ }GetUserTypingLogs retrieves typing logs and statistics for a specific user
Fetches typing logs and statistics from the database for a specific user ID and mode
path Parameters
| user_id required | string ID of the user |
query Parameters
| mode required | string Mode of typing logs to retrieve (block, line, or selection) |
| interval_type | string Type of interval for statistics (days, weeks, months, hours, minutes). Default is days. |
| interval_count | integer Number of intervals to retrieve. Default is 30. |
Responses
Response samples
- 200
- 400
- 500
{- "logs": [
- {
- "acceptedNumber": 0,
- "createdAt": "string",
- "id": "string",
- "suggestionId": "string",
- "suggestionLineId": "string",
- "suggestionSelectionItemId": "string",
- "typedNumber": 0,
- "userId": "string"
}
], - "totalAccepted": 0,
- "totalTyped": 0,
- "typingRate": 0
}LogUserTyping logs typing statistics for a user
Logs typing statistics to the database for a specific user
path Parameters
| user_id required | string ID of the user |
Request Body schema: application/json
Typing Statistics Request
| accepted_number | integer |
| suggestion_id | string |
| suggestion_line_id | string |
| suggestion_selection_item_id | string |
| typed_number | integer |
Responses
Request samples
- Payload
{- "accepted_number": 0,
- "suggestion_id": "string",
- "suggestion_line_id": "string",
- "suggestion_selection_item_id": "string",
- "typed_number": 0
}Response samples
- 200
- 400
- 500
{- "property1": "string",
- "property2": "string"
}LogUserEvent logs a user event
Logs a user event to the database
Request Body schema: application/json
Log User Event Request
| error_message | string |
| event required | string |
| user_id | string |
Responses
Request samples
- Payload
{- "error_message": "string",
- "event": "string",
- "user_id": "string"
}Response samples
- 201
- 400
- 500
{- "property1": "string",
- "property2": "string"
}GetLogsByUserID retrieves logs for a specific user
Fetches logs from the database for a specific user ID
path Parameters
| user_id required | string ID of the user |
Responses
Response samples
- 200
- 500
[- {
- "class_id": "string",
- "duration": 0,
- "event": "SUGGESTION_ACCEPT",
- "explanation": "string",
- "has_bug": true,
- "language": "string",
- "log_created_at": "string",
- "log_id": "string",
- "model": "string",
- "prompt": "string",
- "suggestion_array": [
- "string"
], - "suggestion_created_at": "string",
- "suggestion_id": "string",
- "user_id": "string",
- "vendor": "string"
}
]/api/v1/suggestion/{mode}
path Parameters
| mode required | string Suggestion mode: code_block, line_by_line, code_selection |
Request Body schema: application/json
Suggestion request payload
| bugPercentage | integer |
| classId | string |
| fileName | string |
| language | string |
| prompt | string |
| rawText | string |
| userId | string |
Responses
Request samples
- Payload
{- "bugPercentage": 0,
- "classId": "string",
- "fileName": "string",
- "language": "string",
- "prompt": "string",
- "rawText": "string",
- "userId": "string"
}Response samples
- 200
- 400
- 500
{ }GetSuggestionByModeAndId retrieves a suggestion based on mode and ID
Fetches a suggestion from the database based on the provided mode and suggestion ID
path Parameters
| mode required | string Mode of the suggestion (CODE_BLOCK, LINE_BY_LINE, CODE_SELECTION) |
| suggestion_id required | string ID of the suggestion |
Responses
Response samples
- 200
- 400
- 404
- 500
nullGet classes by student ID
Retrieves all classes a specific student is enrolled in.
path Parameters
| student_id required | string Student ID |
Responses
Response samples
- 200
- 400
- 500
[- {
- "classCode": "string",
- "classDescription": "string",
- "classHexColor": "string",
- "classImageCover": "string",
- "classTitle": "string",
- "createdAt": "string",
- "enrollmentStatus": "WAITLISTED",
- "id": "string",
- "instructorId": "string",
- "instructorName": "string",
- "joinedAt": "string",
- "studentCount": 0,
- "students": [
- {
- "avatarUrl": "string",
- "createdAt": "string",
- "email": "string",
- "enrollmentStatus": "WAITLISTED",
- "firstName": "string",
- "id": "string",
- "isConsent": true,
- "lastName": "string",
- "pid": "string",
- "role": "STUDENT",
- "settings": {
- "bugPercentage": 0,
- "enableDashboard": true,
- "enableQuiz": true,
- "mode": "string",
- "showNotifications": true,
- "test_group": "string"
}, - "status": "string"
}
]
}
]Update user settings
Updates the settings for a specific user based on their ID.
path Parameters
| user_id required | string User ID |
Request Body schema: application/json
User Settings Payload
| bugPercentage | integer |
| enableDashboard | boolean |
| enableQuiz | boolean |
| mode | string |
| showNotifications | boolean |
| test_group | string |
Responses
Request samples
- Payload
{- "bugPercentage": 0,
- "enableDashboard": true,
- "enableQuiz": true,
- "mode": "string",
- "showNotifications": true,
- "test_group": "string"
}Response samples
- 200
- 400
- 500
{- "property1": "string",
- "property2": "string"
}AnonymousAuthHandler handles anonymous user authentication
Allows users to log in or sign up anonymously using a shared password and optional code
Request Body schema: application/json
Anonymous authentication request payload
| code | string |
| isConsent | boolean |
Responses
Request samples
- Payload
{- "code": "string",
- "isConsent": true
}Response samples
- 200
- 400
- 401
- 500
{- "property1": "string",
- "property2": "string"
}HandleLogin processes user login requests
Authenticates a user using email and password
Request Body schema: application/json
Login request payload
string | |
| password | string |
Responses
Request samples
- Payload
{- "email": "string",
- "password": "string"
}Response samples
- 200
- 400
- 401
{- "property1": "string",
- "property2": "string"
}ProviderHandler initiates third-party provider authentication
Redirects the user to the third-party provider's authentication page
path Parameters
| provider required | string Third-party provider (e.g., google, github) |
query Parameters
| redirect_to | string URL to redirect to after authentication |
Responses
Response samples
- 302
- 500
"string"HandleSignUp processes user signup requests
Registers a new user using email, password, first name, and last name
Request Body schema: application/json
Signup request payload
string | |
| firstName | string |
| isConsent | boolean |
| lastName | string |
| password | string |
Responses
Request samples
- Payload
{- "email": "string",
- "firstName": "string",
- "isConsent": true,
- "lastName": "string",
- "password": "string"
}Response samples
- 200
- 400
- 401
- 500
{- "property1": "string",
- "property2": "string"
}GetAllClasses retrieves all classes with optional pagination and filtering
Fetches all classes, with options for pagination, searching, and filtering by user
query Parameters
| includeStudents | boolean Whether to include enrolled students in the response |
| page | integer Page number for pagination (default is 1) |
| limit | integer Number of items per page for pagination (default is 50) |
| search | string Search term to filter classes by title or code |
| user_id | string Filter classes by a specific user ID (instructor or student) |
Responses
Response samples
- 200
- 500
{ }CreateClass creates a new class
Creates a new class in the database with the provided details
Request Body schema: application/json
Class creation request
| classCode | string |
| classDescription | string |
| classHexColor | string |
| classImageCover | string |
| classTitle | string |
| instructorId | string |
Responses
Request samples
- Payload
{- "classCode": "string",
- "classDescription": "string",
- "classHexColor": "string",
- "classImageCover": "string",
- "classTitle": "string",
- "instructorId": "string"
}Response samples
- 201
- 400
- 500
{- "property1": "string",
- "property2": "string"
}UpdateEnrollmentStatus updates a user's enrollment status in a class
Updates the enrollment status of a user in a specific class
Request Body schema: application/json
Enrollment status update request
| classId required | string |
| status required | string |
| userId required | string |
Responses
Request samples
- Payload
{- "classId": "string",
- "status": "string",
- "userId": "string"
}Response samples
- 200
- 400
- 500
{- "property1": "string",
- "property2": "string"
}GetClassesByInstructor retrieves classes taught by a specific instructor
Fetches all classes associated with the given instructor ID. Optionally includes enrolled students
path Parameters
| instructor_id required | string Instructor ID |
query Parameters
| includeStudents | boolean Whether to include enrolled students in the response |
Responses
Response samples
- 200
- 400
- 500
[- {
- "classCode": "string",
- "classDescription": "string",
- "classHexColor": "string",
- "classImageCover": "string",
- "classTitle": "string",
- "createdAt": "string",
- "enrollmentStatus": "WAITLISTED",
- "id": "string",
- "instructorId": "string",
- "instructorName": "string",
- "joinedAt": "string",
- "studentCount": 0,
- "students": [
- {
- "avatarUrl": "string",
- "createdAt": "string",
- "email": "string",
- "enrollmentStatus": "WAITLISTED",
- "firstName": "string",
- "id": "string",
- "lastName": "string",
- "pid": "string",
- "role": "STUDENT",
- "settings": {
- "bugPercentage": 0,
- "enableDashboard": true,
- "enableQuiz": true,
- "mode": "string",
- "showNotifications": true
}, - "status": "string"
}
]
}
]RegisterClass registers a user to a class
Registers a user to a class in the database
Request Body schema: application/json
Class registration request
| classId required | string |
| userId required | string |
Responses
Request samples
- Payload
{- "classId": "string",
- "userId": "string"
}Response samples
- 200
- 400
- 500
{- "property1": "string",
- "property2": "string"
}UnregisterClass unregisters a user from a class
Unregisters a user from a specific class in the database
Request Body schema: application/json
Class unregistration request
| classId required | string |
| userId required | string |
Responses
Request samples
- Payload
{- "classId": "string",
- "userId": "string"
}Response samples
- 200
- 400
- 500
{- "property1": "string",
- "property2": "string"
}GetAClass retrieves a specific class by ID
Fetches a class from the database based on the provided class ID. Optionally includes enrolled students and enrollment status for a specific user
path Parameters
| class_id required | string ID of the class |
query Parameters
| includeStudents | boolean Whether to include enrolled students in the response |
| user_id | string User ID to get enrollment status for (optional) |
Responses
Response samples
- 200
- 400
- 404
- 500
{- "classCode": "string",
- "classDescription": "string",
- "classHexColor": "string",
- "classImageCover": "string",
- "classTitle": "string",
- "createdAt": "string",
- "enrollmentStatus": "WAITLISTED",
- "id": "string",
- "instructorId": "string",
- "instructorName": "string",
- "joinedAt": "string",
- "studentCount": 0,
- "students": [
- {
- "avatarUrl": "string",
- "createdAt": "string",
- "email": "string",
- "enrollmentStatus": "WAITLISTED",
- "firstName": "string",
- "id": "string",
- "lastName": "string",
- "pid": "string",
- "role": "STUDENT",
- "settings": {
- "bugPercentage": 0,
- "enableDashboard": true,
- "enableQuiz": true,
- "mode": "string",
- "showNotifications": true
}, - "status": "string"
}
]
}UpdateClass updates an existing class
Updates the details of an existing class in the database
path Parameters
| class_id required | string ID of the class to update |
Request Body schema: application/json
Class update request
| classCode | string |
| classDescription | string |
| classHexColor | string |
| classImageCover | string |
| classTitle | string |
| instructorId | string |
Responses
Request samples
- Payload
{- "classCode": "string",
- "classDescription": "string",
- "classHexColor": "string",
- "classImageCover": "string",
- "classTitle": "string",
- "instructorId": "string"
}Response samples
- 200
- 400
- 500
{- "property1": "string",
- "property2": "string"
}UpdateClassStudentsSettings updates settings for multiple students in a class
Updates the user settings for multiple students enrolled in a specific class
path Parameters
| class_id required | string ID of the class |
Request Body schema: application/json
Settings update request
required | object (models.UserSettings) |
| studentIds required | Array of strings |
Responses
Request samples
- Payload
{- "settings": {
- "bugPercentage": 0,
- "enableDashboard": true,
- "enableQuiz": true,
- "mode": "string",
- "showNotifications": true
}, - "studentIds": [
- "string"
]
}Response samples
- 200
- 400
- 500
{ }Handle image upload
Endpoint to handle image uploads to Supabase Storage
Request Body schema: multipart/form-data
| image required | string <binary> Image file to upload |
Responses
Response samples
- 200
- 400
- 500
{- "error": "string",
- "image_path": "string",
- "image_url": "string",
- "success": true
}Response samples
- 200
- 500
[- {
- "client_ip": "string",
- "error_message": "string",
- "method": "string",
- "request_path": "string",
- "route": "string",
- "status_code": 0,
- "user_agent": "string"
}
]Response samples
- 200
- 500
[- {
- "class_id": "string",
- "duration": 0,
- "event": "SUGGESTION_ACCEPT",
- "explanation": "string",
- "has_bug": true,
- "language": "string",
- "log_created_at": "string",
- "log_id": "string",
- "model": "string",
- "prompt": "string",
- "suggestion_array": [
- "string"
], - "suggestion_created_at": "string",
- "suggestion_id": "string",
- "user_id": "string",
- "vendor": "string"
}
]GetLogsByClassID retrieves logs for a specific class
Fetches logs from the database for a specific class ID
path Parameters
| class_id required | string ID of the class |
Responses
Response samples
- 200
- 500
[- {
- "class_id": "string",
- "duration": 0,
- "event": "SUGGESTION_ACCEPT",
- "explanation": "string",
- "has_bug": true,
- "language": "string",
- "log_created_at": "string",
- "log_id": "string",
- "model": "string",
- "prompt": "string",
- "suggestion_array": [
- "string"
], - "suggestion_created_at": "string",
- "suggestion_id": "string",
- "user_id": "string",
- "vendor": "string"
}
]HandleLogsForInstructor retrieves logs for a specific instructor
Fetches logs from the database for a specific instructor ID
path Parameters
| instructor_id required | string ID of the instructor |
Responses
Response samples
- 200
- 500
[- {
- "class_id": "string",
- "duration": 0,
- "event": "SUGGESTION_ACCEPT",
- "explanation": "string",
- "has_bug": true,
- "language": "string",
- "log_created_at": "string",
- "log_id": "string",
- "model": "string",
- "prompt": "string",
- "suggestion_array": [
- "string"
], - "suggestion_created_at": "string",
- "suggestion_id": "string",
- "user_id": "string",
- "vendor": "string"
}
]LogSuggestionEvent logs a suggestion event
Logs a suggestion event to the database based on the mode
path Parameters
| mode required | string Mode of the suggestion (CODE_BLOCK, LINE_BY_LINE, CODE_SELECTION) |
Request Body schema: application/json
Log Suggestion Event Request
Responses
Request samples
- Payload
nullResponse samples
- 201
- 400
- 500
{- "property1": "string",
- "property2": "string"
}GetUserSuggestionLogsByMode retrieves suggestion logs for a user based on GetUserSuggestionLogsByMode
Fetches suggestion logs from the database for a specific user and mode
path Parameters
| user_id required | string ID of the user |
| mode required | string Mode of the suggestion logs to retrieve (CODE_BLOCK, LINE_BY_LINE, CODE_SELECTION) |
Responses
Response samples
- 200
- 400
- 500
{ }GetUserTypingLogs retrieves typing logs and statistics for a specific user
Fetches typing logs and statistics from the database for a specific user ID and mode
path Parameters
| user_id required | string ID of the user |
query Parameters
| mode required | string Mode of typing logs to retrieve (block, line, or selection) |
| interval_type | string Type of interval for statistics (days, weeks, months, hours, minutes). Default is days. |
| interval_count | integer Number of intervals to retrieve. Default is 30. |
Responses
Response samples
- 200
- 400
- 500
{- "logs": [
- {
- "acceptedNumber": 0,
- "createdAt": "string",
- "id": "string",
- "suggestionId": "string",
- "suggestionLineId": "string",
- "suggestionSelectionItemId": "string",
- "typedNumber": 0,
- "userId": "string"
}
], - "totalAccepted": 0,
- "totalTyped": 0,
- "typingRate": 0
}LogUserTyping logs typing statistics for a user
Logs typing statistics to the database for a specific user
path Parameters
| user_id required | string ID of the user |
Request Body schema: application/json
Typing Statistics Request
| accepted_number | integer |
| suggestion_id | string |
| suggestion_line_id | string |
| suggestion_selection_item_id | string |
| typed_number | integer |
Responses
Request samples
- Payload
{- "accepted_number": 0,
- "suggestion_id": "string",
- "suggestion_line_id": "string",
- "suggestion_selection_item_id": "string",
- "typed_number": 0
}Response samples
- 200
- 400
- 500
{- "property1": "string",
- "property2": "string"
}LogUserEvent logs a user event
Logs a user event to the database
Request Body schema: application/json
Log User Event Request
| error_message | string |
| event required | string |
| user_id | string |
Responses
Request samples
- Payload
{- "error_message": "string",
- "event": "string",
- "user_id": "string"
}Response samples
- 201
- 400
- 500
{- "property1": "string",
- "property2": "string"
}GetLogsByUserID retrieves logs for a specific user
Fetches logs from the database for a specific user ID
path Parameters
| user_id required | string ID of the user |
Responses
Response samples
- 200
- 500
[- {
- "class_id": "string",
- "duration": 0,
- "event": "SUGGESTION_ACCEPT",
- "explanation": "string",
- "has_bug": true,
- "language": "string",
- "log_created_at": "string",
- "log_id": "string",
- "model": "string",
- "prompt": "string",
- "suggestion_array": [
- "string"
], - "suggestion_created_at": "string",
- "suggestion_id": "string",
- "user_id": "string",
- "vendor": "string"
}
]/api/v1/suggestion/{mode}
path Parameters
| mode required | string Suggestion mode: code_block, line_by_line, code_selection |
Request Body schema: application/json
Suggestion request payload
| classId | string |
| language | string |
| prompt | string |
| userId | string |
Responses
Request samples
- Payload
{- "classId": "string",
- "language": "string",
- "prompt": "string",
- "userId": "string"
}Response samples
- 200
- 400
- 500
{ }GetSuggestionByModeAndId retrieves a suggestion based on mode and ID
Fetches a suggestion from the database based on the provided mode and suggestion ID
path Parameters
| mode required | string Mode of the suggestion (CODE_BLOCK, LINE_BY_LINE, CODE_SELECTION) |
| suggestion_id required | string ID of the suggestion |
Responses
Response samples
- 200
- 400
- 404
- 500
nullGet classes by student ID
Retrieves all classes a specific student is enrolled in.
path Parameters
| student_id required | string Student ID |
Responses
Response samples
- 200
- 400
- 500
[- {
- "classCode": "string",
- "classDescription": "string",
- "classHexColor": "string",
- "classImageCover": "string",
- "classTitle": "string",
- "createdAt": "string",
- "enrollmentStatus": "WAITLISTED",
- "id": "string",
- "instructorId": "string",
- "instructorName": "string",
- "joinedAt": "string",
- "studentCount": 0,
- "students": [
- {
- "avatarUrl": "string",
- "createdAt": "string",
- "email": "string",
- "enrollmentStatus": "WAITLISTED",
- "firstName": "string",
- "id": "string",
- "lastName": "string",
- "pid": "string",
- "role": "STUDENT",
- "settings": {
- "bugPercentage": 0,
- "enableDashboard": true,
- "enableQuiz": true,
- "mode": "string",
- "showNotifications": true
}, - "status": "string"
}
]
}
]Update user settings
Updates the settings for a specific user based on their ID.
path Parameters
| user_id required | string User ID |
Request Body schema: application/json
User Settings Payload
| bugPercentage | integer |
| enableDashboard | boolean |
| enableQuiz | boolean |
| mode | string |
| showNotifications | boolean |
Responses
Request samples
- Payload
{- "bugPercentage": 0,
- "enableDashboard": true,
- "enableQuiz": true,
- "mode": "string",
- "showNotifications": true
}Response samples
- 200
- 400
- 500
{- "property1": "string",
- "property2": "string"
}