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
Requires code as the anonymous username and auth_mode signin or signup. Signup additionally requires consent information. Uses a server-configured shared password.
path Parameters
| auth_mode required | string Enum: "signin" "signup" Anonymous authentication action |
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
{ }Get 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"
}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 Enum: "code-block" "line-by-line" "code-selection" Suggestion mode |
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 Enum: "code-block" "line-by-line" "code-selection" Suggestion log mode |
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"
}
]HandleSuggestion processes code suggestions based on the specified mode (block, line-by-line, selection).
path Parameters
| mode required | string Enum: "code-block" "line-by-line" "code-selection" Suggestion mode |
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
{ }HandleSuggestionTest processes code suggestions based on the specified mode (block, line-by-line, selection).
path Parameters
| mode required | string Enum: "code-block" "line-by-line" "code-selection" Suggestion mode |
Request Body schema: application/json
Suggestion request payload
| bugPercentage | integer |
| fileName | string |
| language | string |
| prompt | string |
| rawText | string |
| version | string |
Responses
Request samples
- Payload
{- "bugPercentage": 0,
- "fileName": "string",
- "language": "string",
- "prompt": "string",
- "rawText": "string",
- "version": "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 Enum: "code-block" "line-by-line" "code-selection" Suggestion mode |
| suggestion_id required | string ID of the suggestion |
Responses
Response samples
- 200
- 400
- 404
- 500
nullHandleSuggestion processes line-by-line code suggestions directly without mode parameter
Requires a nonempty client-generated eventId scoped to userId and this endpoint. Reuse the same eventId and decoded payload on retries to receive the original suggestions, suggestionLineId, and bugPercentage without another AI call or duplicate records. Concurrent retries wait for the first transaction. Failed attempts roll back and may invoke AI again on retry. Reusing a committed key with a different payload returns 409. PUT is canonical. The deprecated POST alias uses the same receipt and payload rules, including when retries switch methods.
Request Body schema: application/json
Suggestion request payload
| bugPercentage | integer |
| classId | string |
| contextId | string |
| eventId required | string |
| fileName | string |
| language | string |
| prompt | string |
| snapshot | string |
| userId required | string |
Responses
Request samples
- Payload
{- "bugPercentage": 0,
- "classId": "string",
- "contextId": "string",
- "eventId": "string",
- "fileName": "string",
- "language": "string",
- "prompt": "string",
- "snapshot": "string",
- "userId": "string"
}Response samples
- 200
- 400
- 409
- 500
{- "bugPercentage": 0,
- "message": "string",
- "suggestionLineId": "string",
- "suggestions": [
- {
- "correctLine": "string",
- "incorrectLine": "string",
- "shownBug": true
}
]
}HandleSuggestion processes line-by-line code suggestions directly without mode parameter Deprecated
Requires a nonempty client-generated eventId scoped to userId and this endpoint. Reuse the same eventId and decoded payload on retries to receive the original suggestions, suggestionLineId, and bugPercentage without another AI call or duplicate records. Concurrent retries wait for the first transaction. Failed attempts roll back and may invoke AI again on retry. Reusing a committed key with a different payload returns 409. PUT is canonical. The deprecated POST alias uses the same receipt and payload rules, including when retries switch methods.
Request Body schema: application/json
Suggestion request payload
| bugPercentage | integer |
| classId | string |
| contextId | string |
| eventId required | string |
| fileName | string |
| language | string |
| prompt | string |
| snapshot | string |
| userId required | string |
Responses
Request samples
- Payload
{- "bugPercentage": 0,
- "classId": "string",
- "contextId": "string",
- "eventId": "string",
- "fileName": "string",
- "language": "string",
- "prompt": "string",
- "snapshot": "string",
- "userId": "string"
}Response samples
- 200
- 400
- 409
- 500
{- "bugPercentage": 0,
- "message": "string",
- "suggestionLineId": "string",
- "suggestions": [
- {
- "correctLine": "string",
- "incorrectLine": "string",
- "shownBug": true
}
]
}Log an event idempotently
Requires a nonempty client-generated eventId, scoped to userId and this endpoint. Retry with the same payload, including clientTimestamp (RFC3339), to receive the original 200 response without duplicate logs. Concurrent retries are deduplicated; failed transactions roll back and can be retried. Reusing the key with a different decoded payload returns 409. The client eventId does not replace server-generated row IDs. PUT is canonical. The deprecated POST alias uses the same receipt and payload rules, including when retries switch methods.
Request Body schema: application/json
Event with a stable client eventId
| clientTimestamp required | string |
| event required | string |
| eventId required | string |
| lineSuggestionId | string |
| snapshot | string |
| userId required | string |
Responses
Request samples
- Payload
{- "clientTimestamp": "string",
- "event": "string",
- "eventId": "string",
- "lineSuggestionId": "string",
- "snapshot": "string",
- "userId": "string"
}Response samples
- 200
- 400
- 409
- 500
{- "property1": "string",
- "property2": "string"
}Log an event idempotently Deprecated
Requires a nonempty client-generated eventId, scoped to userId and this endpoint. Retry with the same payload, including clientTimestamp (RFC3339), to receive the original 200 response without duplicate logs. Concurrent retries are deduplicated; failed transactions roll back and can be retried. Reusing the key with a different decoded payload returns 409. The client eventId does not replace server-generated row IDs. PUT is canonical. The deprecated POST alias uses the same receipt and payload rules, including when retries switch methods.
Request Body schema: application/json
Event with a stable client eventId
| clientTimestamp required | string |
| event required | string |
| eventId required | string |
| lineSuggestionId | string |
| snapshot | string |
| userId required | string |
Responses
Request samples
- Payload
{- "clientTimestamp": "string",
- "event": "string",
- "eventId": "string",
- "lineSuggestionId": "string",
- "snapshot": "string",
- "userId": "string"
}Response samples
- 200
- 400
- 409
- 500
{- "property1": "string",
- "property2": "string"
}Log a ProgSnap event idempotently
Requires UUIDv4 eventId and sessionId and integer sequence from 1 through 9007199254740991. Session positions are unique per user across ProgSnap, suggestion-event, and run logs; gaps and out-of-order arrival are allowed. After commit, acknowledges eventId, sessionId and sequence alongside server-generated event_id. Identical replays return the same acknowledgement without duplicate writes. Changed payloads or occupied session positions return 409. Internal logs keep server-generated IDs; no automatic retries. PUT is canonical. The deprecated POST alias uses the same receipt and payload rules, including when retries switch methods.
Request Body schema: application/json
ProgSnap event with a stable client eventId
| changeMade | string |
| clientTimestamp required | string |
| codeSnippet | string Event fields (optional) |
| codeUsed | string |
| contextId | string |
| editType | string Edit fields (optional - for edit events) |
| eventId required | string |
| eventType required | string Event fields (required) |
| fileName | string |
| isAttentionCheck | boolean |
| keyPress | string |
| language | string |
| sequence required | integer [ 1 .. 9007199254740991 ] |
| sessionId required | string |
| suggestionText | string Suggestion fields (optional - for suggestion events) |
| userId required | string |
Responses
Request samples
- Payload
{- "changeMade": "string",
- "clientTimestamp": "string",
- "codeSnippet": "string",
- "codeUsed": "string",
- "contextId": "string",
- "editType": "string",
- "eventId": "string",
- "eventType": "string",
- "fileName": "string",
- "isAttentionCheck": true,
- "keyPress": "string",
- "language": "string",
- "sequence": 1,
- "sessionId": "string",
- "suggestionText": "string",
- "userId": "string"
}Response samples
- 200
- 400
- 409
- 500
{- "eventId": "string",
- "event_id": "string",
- "message": "string",
- "sequence": 0,
- "sessionId": "string"
}Log a ProgSnap event idempotently Deprecated
Requires UUIDv4 eventId and sessionId and integer sequence from 1 through 9007199254740991. Session positions are unique per user across ProgSnap, suggestion-event, and run logs; gaps and out-of-order arrival are allowed. After commit, acknowledges eventId, sessionId and sequence alongside server-generated event_id. Identical replays return the same acknowledgement without duplicate writes. Changed payloads or occupied session positions return 409. Internal logs keep server-generated IDs; no automatic retries. PUT is canonical. The deprecated POST alias uses the same receipt and payload rules, including when retries switch methods.
Request Body schema: application/json
ProgSnap event with a stable client eventId
| changeMade | string |
| clientTimestamp required | string |
| codeSnippet | string Event fields (optional) |
| codeUsed | string |
| contextId | string |
| editType | string Edit fields (optional - for edit events) |
| eventId required | string |
| eventType required | string Event fields (required) |
| fileName | string |
| isAttentionCheck | boolean |
| keyPress | string |
| language | string |
| sequence required | integer [ 1 .. 9007199254740991 ] |
| sessionId required | string |
| suggestionText | string Suggestion fields (optional - for suggestion events) |
| userId required | string |
Responses
Request samples
- Payload
{- "changeMade": "string",
- "clientTimestamp": "string",
- "codeSnippet": "string",
- "codeUsed": "string",
- "contextId": "string",
- "editType": "string",
- "eventId": "string",
- "eventType": "string",
- "fileName": "string",
- "isAttentionCheck": true,
- "keyPress": "string",
- "language": "string",
- "sequence": 1,
- "sessionId": "string",
- "suggestionText": "string",
- "userId": "string"
}Response samples
- 200
- 400
- 409
- 500
{- "eventId": "string",
- "event_id": "string",
- "message": "string",
- "sequence": 0,
- "sessionId": "string"
}Log terminal contents idempotently
Requires UUIDv4 eventId and sessionId and integer sequence from 1 through 9007199254740991. Session positions are unique per user across ProgSnap, suggestion-event, and run logs; gaps and out-of-order arrival are allowed. Retry the same payload for the original 200 response and terminalLogId. Changed payloads or occupied session positions return 409. All writes and identity metadata commit atomically. clientTimestamp is run start (RFC3339); end time is start plus duration in milliseconds (0 through 9223372036854, default 0). exitCode is persisted, defaulting to 0. PUT is canonical. The deprecated POST alias uses the same receipt and payload rules, including when retries switch methods.
Request Body schema: application/json
Run event with a required stable client eventId
| clientTimestamp required | string |
| duration | integer [ 0 .. 9223372036854 ] |
| eventId required | string |
| exitCode | integer |
| fileName required | string |
| language | string |
| sequence required | integer [ 1 .. 9007199254740991 ] |
| sessionId required | string |
| snapshot | string |
| terminalContents required | string |
| userId required | string |
Responses
Request samples
- Payload
{- "clientTimestamp": "string",
- "duration": 9223372036854,
- "eventId": "string",
- "exitCode": 0,
- "fileName": "string",
- "language": "string",
- "sequence": 1,
- "sessionId": "string",
- "snapshot": "string",
- "terminalContents": "string",
- "userId": "string"
}Response samples
- 200
- 400
- 409
- 500
{- "property1": "string",
- "property2": "string"
}Log terminal contents idempotently Deprecated
Requires UUIDv4 eventId and sessionId and integer sequence from 1 through 9007199254740991. Session positions are unique per user across ProgSnap, suggestion-event, and run logs; gaps and out-of-order arrival are allowed. Retry the same payload for the original 200 response and terminalLogId. Changed payloads or occupied session positions return 409. All writes and identity metadata commit atomically. clientTimestamp is run start (RFC3339); end time is start plus duration in milliseconds (0 through 9223372036854, default 0). exitCode is persisted, defaulting to 0. PUT is canonical. The deprecated POST alias uses the same receipt and payload rules, including when retries switch methods.
Request Body schema: application/json
Run event with a required stable client eventId
| clientTimestamp required | string |
| duration | integer [ 0 .. 9223372036854 ] |
| eventId required | string |
| exitCode | integer |
| fileName required | string |
| language | string |
| sequence required | integer [ 1 .. 9007199254740991 ] |
| sessionId required | string |
| snapshot | string |
| terminalContents required | string |
| userId required | string |
Responses
Request samples
- Payload
{- "clientTimestamp": "string",
- "duration": 9223372036854,
- "eventId": "string",
- "exitCode": 0,
- "fileName": "string",
- "language": "string",
- "sequence": 1,
- "sessionId": "string",
- "snapshot": "string",
- "terminalContents": "string",
- "userId": "string"
}Response samples
- 200
- 400
- 409
- 500
{- "property1": "string",
- "property2": "string"
}Log a suggestion event idempotently
Requires UUIDv4 eventId and sessionId and integer sequence from 1 through 9007199254740991. Session positions are unique per user across ProgSnap, suggestion-event, and run logs; gaps and out-of-order arrival are allowed. Retry the same payload, including clientTimestamp (RFC3339), for the original 201 response and lineId without duplicate writes. Changed payloads or occupied session positions return 409. All writes and identity metadata commit atomically; failed requests can be retried. PUT is canonical. The deprecated POST alias uses the same receipt and payload rules, including when retries switch methods.
Request Body schema: application/json
Suggestion event with a stable client eventId
| bugPercentage | integer |
| classId | string |
| clientTimestamp required | string |
| contextId | string |
| duration | integer |
| event required | string (models.SuggestionEvent) Enum: "SUGGESTION_ACCEPT" "SUGGESTION_REJECT" "SUGGESTION_GENERATE" "SUGGESTION_ERROR" "SUGGESTION_LINE_ACCEPT" "SUGGESTION_LINE_REJECT" "SUGGESTION_LINE_GENERATE" "SUGGESTION_LINE_ERROR" "SUGGESTION_SELECTION_GENERATE" "SUGGESTION_SELECTION_ACCEPT" "SUGGESTION_SELECTION_REJECT" "SUGGESTION_SELECTION_ERROR" |
| eventId required | string |
| fileName | string |
| fileText | string |
| groupId required | string |
| language | string |
| lineIndex | integer |
required | object (suggestion.LineSuggestion) |
| sequence required | integer [ 1 .. 9007199254740991 ] |
| sessionId required | string |
| userId required | string |
Responses
Request samples
- Payload
{- "bugPercentage": 0,
- "classId": "string",
- "clientTimestamp": "string",
- "contextId": "string",
- "duration": 0,
- "event": "SUGGESTION_ACCEPT",
- "eventId": "string",
- "fileName": "string",
- "fileText": "string",
- "groupId": "string",
- "language": "string",
- "lineIndex": 0,
- "lineSuggestion": {
- "correctLine": "string",
- "incorrectLine": "string",
- "shownBug": true
}, - "sequence": 1,
- "sessionId": "string",
- "userId": "string"
}Response samples
- 201
- 400
- 409
- 500
{- "property1": "string",
- "property2": "string"
}Log a suggestion event idempotently Deprecated
Requires UUIDv4 eventId and sessionId and integer sequence from 1 through 9007199254740991. Session positions are unique per user across ProgSnap, suggestion-event, and run logs; gaps and out-of-order arrival are allowed. Retry the same payload, including clientTimestamp (RFC3339), for the original 201 response and lineId without duplicate writes. Changed payloads or occupied session positions return 409. All writes and identity metadata commit atomically; failed requests can be retried. PUT is canonical. The deprecated POST alias uses the same receipt and payload rules, including when retries switch methods.
Request Body schema: application/json
Suggestion event with a stable client eventId
| bugPercentage | integer |
| classId | string |
| clientTimestamp required | string |
| contextId | string |
| duration | integer |
| event required | string (models.SuggestionEvent) Enum: "SUGGESTION_ACCEPT" "SUGGESTION_REJECT" "SUGGESTION_GENERATE" "SUGGESTION_ERROR" "SUGGESTION_LINE_ACCEPT" "SUGGESTION_LINE_REJECT" "SUGGESTION_LINE_GENERATE" "SUGGESTION_LINE_ERROR" "SUGGESTION_SELECTION_GENERATE" "SUGGESTION_SELECTION_ACCEPT" "SUGGESTION_SELECTION_REJECT" "SUGGESTION_SELECTION_ERROR" |
| eventId required | string |
| fileName | string |
| fileText | string |
| groupId required | string |
| language | string |
| lineIndex | integer |
required | object (suggestion.LineSuggestion) |
| sequence required | integer [ 1 .. 9007199254740991 ] |
| sessionId required | string |
| userId required | string |
Responses
Request samples
- Payload
{- "bugPercentage": 0,
- "classId": "string",
- "clientTimestamp": "string",
- "contextId": "string",
- "duration": 0,
- "event": "SUGGESTION_ACCEPT",
- "eventId": "string",
- "fileName": "string",
- "fileText": "string",
- "groupId": "string",
- "language": "string",
- "lineIndex": 0,
- "lineSuggestion": {
- "correctLine": "string",
- "incorrectLine": "string",
- "shownBug": true
}, - "sequence": 1,
- "sessionId": "string",
- "userId": "string"
}Response samples
- 201
- 400
- 409
- 500
{- "property1": "string",
- "property2": "string"
}