The Classrooms API manages the organizational layer of the platform — teachers create classrooms (courses), generate time-limited invite codes, and students join those courses using the code. Every guide, assignment, and grading workflow is scoped to a course, making classroom management the essential first step for any new class.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/vruizz22/innova-backend-serverless/llms.txt
Use this file to discover all available pages before exploring further.
POST /classrooms
Create a new classroom owned by the authenticated teacher. The course name can be supplied explicitly or auto-derived from the grade level, letter, and subject (e.g."8° básico A · Matemática").
Auth: JWT (TEACHER)
Request body
Display name for the classroom. If omitted, a label is auto-generated from
gradeLevel, letter, and the resolved subject name.Optional description shown to students.
Grade level from 1 to 12. Grades 1–8 are treated as básico; grades 9–12 map to I–IV Medio. Defaults to
4 if omitted.Section letter (e.g.
"A", "B"). Combined with gradeLevel in the auto-generated name.Subject code to look up in the subjects table (e.g.
"MATH"). Defaults to "MATH" if omitted.Response
Returns the newly createdCourse Prisma record.
UUID of the new classroom/course.
Display name (explicitly provided or auto-derived).
The grade level stored on the record.
Section letter, if provided.
Calendar year the course was created in.
Example request
Example response
GET /classrooms/mine
Get all non-archived classrooms where the authenticated teacher has acourseTeacher link (ordered by addedAt ascending).
Auth: JWT (TEACHER)
Response
Returns an array ofCourse objects. Archived courses (archivedAt is not null) are excluded automatically.
Course UUID.
Course display name.
Grade level.
Academic year.
Example request
GET /classrooms/student/mine
Get all courses the authenticated student is actively enrolled in. Auth: JWT (STUDENT)Response
Returns an array ofCourse objects for active enrollments. Returns an empty array ([]) if the student profile does not exist rather than a 404.
Course UUID.
Course display name.
Example request
Route order matters:
/classrooms/student/mine is registered before /classrooms/:id, so it is matched first and never interpreted as an :id lookup.GET /classrooms/:id
Fetch a single classroom by its UUID. Accessible to any authenticated user. Auth: JWTPath parameters
UUID of the classroom to retrieve.
Response
Returns theCourse Prisma record, or null if not found.
Example request
POST /classrooms/:id/invite
Generate a new invitation for a classroom. The server creates aClassroomInvite record and returns both the raw code and a fully-qualified join URL built from the PUBLIC_APP_URL environment variable.
Auth: JWT (TEACHER)
Path parameters
UUID of the classroom to invite students into. The authenticated teacher must own this course.
Response
Short alphanumeric invite code (stored as
ClassroomInvite.code).Fully-qualified join URL in the format
{PUBLIC_APP_URL}/join?code={code}. Share this link directly with students.Example request
Example response
POST /classrooms/join
Enroll the authenticated student in a classroom using an invitation code. The operation is idempotent — if the student was previously enrolled and later removed, the status is reset toACTIVE via an upsert. The invite useCount is incremented atomically in the same transaction.
Auth: JWT (STUDENT)
Request body
The invitation code obtained from the teacher (e.g.
"X7K9QM").Response
Returns theCourse record of the classroom that was joined.
UUID of the classroom the student just joined.
Display name of the classroom.
Example request
DELETE /classrooms/:id
Soft-delete (archive) a course owned by the authenticated teacher. The course record is not removed from the database —archivedAt is set to the current timestamp instead. Archived courses are excluded from GET /classrooms/mine automatically.
Auth: JWT (TEACHER)
Path parameters
UUID of the classroom to archive. The authenticated teacher must be the owner.
Response
Returns 200 OK with{ "id": "<courseId>" } on success. The course is not deleted from the database — archivedAt is set to the current timestamp, and the course is excluded from future GET /classrooms/mine responses.
Example request
Example response
Enrollment flow
Teacher creates a classroom
Call
POST /classrooms with grade level, letter, and subject. The classroom is immediately active and appears in the teacher’s roster.Teacher generates an invite link
Call
POST /classrooms/:id/invite to create an invitation. Copy the returned url.Teacher shares the invite URL
Send
url to students via your preferred channel (chat, email, printed QR code, etc.).Students register and join
Each student registers an account (STUDENT role), then calls
POST /classrooms/join with the code. Existing accounts simply call join directly.