The Guides API manages the full teacher-worksheet lifecycle, from PDF upload to student results. A teacher creates a guide, receives a presigned S3 URL to upload the PDF, triggers extraction, reviews and edits the extracted questions in the wizard UI, and finally publishes — which materialises exercises and creates an assignment for all enrolled students. All endpoints require theDocumentation 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.
TEACHER role and a valid JWT.
POST /guides
Create a new guide record and receive a presigned S3PUT URL for uploading the worksheet PDF. The guide starts in UPLOADED status. Upload the PDF directly to the returned URL, then call POST /guides/:id/ingest to start extraction.
POST /guides
Request body
UUID of the course this guide belongs to. The authenticated teacher must be assigned to this course.
Guide title (e.g.
Guía 3 — Fracciones).Optional description shown to the teacher in the guides list.
Original PDF filename. Accepted by the API but not persisted — reserved for future content-type inference.
ISO 8601 datetime string for the due date (e.g.
2025-09-15T23:59:00Z). Optional — guides without a due date remain open indefinitely.Response 201
UUID of the newly created guide.
S3 presigned
PUT URL. Upload the PDF with Content-Type: application/pdf. The URL expires after the configured TTL (default: 10 minutes).The S3 object key where the PDF will be stored. Keep this for reference; it is also returned by
GET /guides/:id/source-url.Example
GET /guides
List the authenticated teacher’s guides with optional filters. Results are scoped to courses the teacher leads or assists. Guides that have been archived (DELETE /guides/:id) are excluded.
GET /guides
Query parameters
Filter by course UUID. Must belong to the teacher.
Filter by guide status. One of:
UPLOADED, EXTRACTING, EXTRACTION_FAILED, GENERATING_SOLUTIONS, GENERATION_FAILED, REVIEW, PUBLISHED, ARCHIVED.1-based page number. Defaults to
1.Items per page. Defaults to
20, maximum 100.Response 200
Array of guide records, ordered by creation date descending. Each item includes a
_count object with questions and submissions counts.Total matching guides (for pagination controls).
Current page number.
Items returned per page.
GET /guides/:id
Full guide detail for the wizard UI: the guide record, its extracted questions in sequence order, and each question’s current solution (where one exists). GET/guides/:id
Path parameters
Guide UUID.
Response 200
Returns the guide object with a questions array. Each question includes:
topic— resolved curriculum topic (id,code,name)domain— resolved taxonomy domain (id,code,name)subdomain— resolved taxonomy subdomain (id,code,name)solutions— array with the single current solution (empty if not yet generated)
PATCH /guides/:id
Update guide metadata. All fields are optional — only provided fields are updated. PATCH/guides/:id
Path parameters
Guide UUID.
Request body
Updated guide title.
Updated description.
Updated ISO 8601 due date.
Maximum number of re-submissions allowed per student. Must be
0 or greater.When
true, the canonical solution is revealed to the student after their submission is graded.Response 200
Returns the updated guide record.
POST /guides/:id/ingest
Start (or retry) PDF extraction for the uploaded guide. Returns202 Accepted immediately — extraction runs asynchronously. The guide status moves to EXTRACTING and then to GENERATING_SOLUTIONS once the extractor completes successfully.
POST /guides/:id/ingest
This endpoint is idempotent for in-progress states: calling it while the guide is already
EXTRACTING or GENERATING_SOLUTIONS returns the current status without re-enqueueing. Call it to retry after EXTRACTION_FAILED or GENERATION_FAILED.Path parameters
Guide UUID.
Response 202
The new guide status after the enqueue.
Example
PATCH /guides/:id/questions/:qid
Edit a question, confirm its taxonomy classification, or set its review status toAPPROVED or EXCLUDED. Only APPROVED and EXCLUDED statuses may be set by the teacher — EXTRACTED and NEEDS_REVIEW are assigned by the pipeline (ADR-119).
PATCH /guides/:id/questions/:qid
Path parameters
Guide UUID.
Question UUID.
Request body
Corrected LaTeX for the question statement.
Display label for the question (e.g.
1.a).Points value for this question. Must be
0 or greater.UUID of the confirmed taxonomy subdomain. Preferred since v9.1 — sets
domainId automatically from the subdomain and marks topicSource as TEACHER.UUID of the confirmed curriculum topic (legacy). Use
subdomainId for new integrations.Question review status. Must be
APPROVED or EXCLUDED.Response 200
Returns the updated question record.
PATCH /guides/:id/questions/:qid/solution
Save an edited solution for a question. Each save creates a newGuideSolution version with source = TEACHER_EDITED and marks it as isCurrent = true, demoting the previous version. The stepsJson is validated against the canonical solution schema (ADR-118) and must contain at least one checkpoint step.
PATCH /guides/:id/questions/:qid/solution
Path parameters
Guide UUID.
Question UUID.
Request body
The correct final answer as a string (e.g.
"27").Canonical solution object (ADR-118). Must conform to the schema below and include at least one step with
checkpoint: true.Derived LaTeX render of the full solution. Optional — used for display only, not the source of truth.
Array of error tag codes this question is designed to surface (e.g.
["BORROW_OMITTED", "SUB_BORROW_NO_REGROUP"]).Response 200
Returns the newly created GuideSolution record.
POST /guides/:id/questions/:qid/regenerate-solution
Re-enqueue LLM solution generation for a single question without changing the guide’s overall status. Use this when the auto-generated solution is incorrect and you want a fresh attempt rather than editing it manually. Returns202 Accepted.
POST /guides/:id/questions/:qid/regenerate-solution
Path parameters
Guide UUID.
Question UUID.
Response 202
POST /guides/:id/publish
Publish the guide: materialise oneExercise per approved question (that has a confirmed topic), create an Assignment of kind GUIDE, create an AssignmentTarget for every actively enrolled student, and flip the guide status to PUBLISHED. Students cannot see the guide until this endpoint is called.
POST /guides/:id/publish
Path parameters
Guide UUID. Must currently be in
REVIEW status.Response 201
The updated guide record in
PUBLISHED status.UUID of the newly created assignment.
Number of
Exercise records created.Number of approved questions that were skipped because they had no confirmed topic.
Number of students who received an
AssignmentTarget.Example
DELETE /guides/:id
Soft-delete (archive) a guide. Setsstatus to ARCHIVED and records archivedAt. Archived guides are excluded from GET /guides results. This transition is irreversible — there is no unarchive endpoint.
DELETE /guides/:id
Path parameters
Guide UUID.
Response 200
Returns the updated guide record with status: "ARCHIVED".
GET /guides/:id/source-url
Get a short-lived presigned S3GET URL to view the original uploaded PDF in the browser. TTL defaults to 300 seconds (configurable via GUIDES_PRESIGNED_GET_TTL).
GET /guides/:id/source-url
Path parameters
Guide UUID.
Response 200
Presigned S3 GET URL. Valid for the configured TTL (default 5 minutes). Do not cache — request a fresh URL for each viewer session.
GET /guides/:id/results
Results matrix for a published guide: latest submission per student × question combination, with per-question common-error aggregation. Use this to render the teacher’s C11 class results dashboard. GET/guides/:id/results
Path parameters
Guide UUID. The guide should be
PUBLISHED for meaningful results.Response 200
The guide UUID.
ISO 8601 due date, or
null if none was set.Active enrolled students, sorted by display name.
Approved questions in sequence order.
Flattened latest-submission-per-cell data. Join on
questionId + studentId to build the matrix.Top-5 error tags per question across all incorrect submissions.
GET /guides/:id/submissions/:sid
Submission detail for the results drawer (C11). Returns presigned photo URLs, OCR transcription, alignment data against the canonical solution, and the effective error tag. GET/guides/:id/submissions/:sid
Path parameters
Guide UUID.
Submission UUID.
Response 200
Submission UUID.
1-based question position in the guide.
Question display label.
Question statement in LaTeX.
Submission pipeline status.
Numeric score.
Whether graded correct.
1-based attempt count.
Full OCR transcription in LaTeX.
OCR confidence.
Step-level alignment of the student’s work against the canonical solution.
Pipeline failure message when applicable.
Presigned S3 GET URLs for submission photos (TTL: default 300 seconds).
Effective error tag code (teacher override preferred).
Effective error tag display name.
Whether the tag was set by a teacher override.
PATCH /guides/:id/submissions/:sid/error-tag
Override or clear a submission’s error tag manually. Stores the override on the submission row so it takes precedence over the pipeline-assigned tag everywhere (results matrix, mastery updates). PasserrorTagCode: null to clear a previous override and revert to the pipeline tag.
PATCH /guides/:id/submissions/:sid/error-tag
Path parameters
Guide UUID.
Submission UUID.
Request body
Error tag code from the catalog (e.g.
SUB_BORROW_NO_REGROUP), or null to clear the override and revert to the pipeline tag.Response 200
Submission UUID.
Applied error tag code, or
null after clearing.Applied error tag display name.
true when an override is active; false after clearing.Example
Guide state machine
A guide progresses through a defined set of statuses. Invalid transitions are rejected with400 Bad Request by assertTransition (ADR-119).
| From | To (allowed) |
|---|---|
UPLOADED | EXTRACTING, ARCHIVED |
EXTRACTING | GENERATING_SOLUTIONS, EXTRACTION_FAILED, ARCHIVED |
EXTRACTION_FAILED | EXTRACTING, ARCHIVED |
GENERATING_SOLUTIONS | REVIEW, GENERATION_FAILED, ARCHIVED |
GENERATION_FAILED | EXTRACTING, GENERATING_SOLUTIONS, ARCHIVED |
REVIEW | PUBLISHED, GENERATING_SOLUTIONS, ARCHIVED |
PUBLISHED | ARCHIVED |
ARCHIVED | (none) |
| Status | Description |
|---|---|
UPLOADED | Guide record created; PDF upload pending or complete. |
EXTRACTING | PDF extraction worker is running. |
EXTRACTION_FAILED | Extraction failed. Call POST /guides/:id/ingest to retry (moves back to EXTRACTING). |
GENERATING_SOLUTIONS | LLM solution-generation worker is running for extracted questions. |
GENERATION_FAILED | Solution generation failed. Call POST /guides/:id/ingest to retry (moves to EXTRACTING or GENERATING_SOLUTIONS). |
REVIEW | Extraction and generation complete. Teacher reviews questions in the wizard. Can re-trigger solution generation without re-extracting. |
PUBLISHED | Guide published; exercises and assignment materialised; visible to students. |
ARCHIVED | Guide soft-deleted. Hidden from all listings. |
Nothing is visible to students before
PUBLISHED. Guides in REVIEW or earlier statuses are invisible to the student-facing app regardless of enrollment status.