Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/geeky-hamster/Quizmaster/llms.txt

Use this file to discover all available pages before exploring further.

Subjects are the top-level content categories in Quizmaster. Each subject contains one or more chapters, and chapters in turn contain quizzes. Reading subjects and chapters is open to everyone, while creating, updating, and deleting records requires an admin bearer token.

GET /api/subjects

List all subjects. This endpoint is public and does not require authentication. No request body. Response — 200 OK Returns an array of subject objects, each including a nested chapters array.
id
number
Subject ID.
name
string
Subject name.
description
string
Optional description.
chapters
object[]
Chapters belonging to this subject.
createdAt
string
Creation timestamp.
updatedAt
string
Last updated timestamp.
cURL
curl --request GET \
  --url https://your-domain.com/api/subjects

GET /api/subjects/:id

Retrieve a single subject along with its chapters. This endpoint is public.
id
number
required
The ID of the subject to retrieve.
Response — 200 OK Returns the subject object with a nested chapters array. Errors
StatusMessage
404Subject not found
cURL
curl --request GET \
  --url https://your-domain.com/api/subjects/3

POST /api/subjects

Create a new subject. Requires a valid bearer token with admin role.
name
string
required
Name of the subject.
description
string
Optional description of the subject.
Response fields — 201 Created
message
string
Confirmation message.
subject
object
Errors
StatusMessage
400Subject already exists
cURL
curl --request POST \
  --url https://your-domain.com/api/subjects \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "name": "Mathematics",
    "description": "Core mathematics topics from algebra to calculus."
  }'

PUT /api/subjects/:id

Update an existing subject. Requires a valid bearer token with admin role.
id
number
required
The ID of the subject to update.
name
string
Updated subject name.
description
string
Updated description.
Response fields — 200 OK
message
string
Confirmation message.
subject
object
Updated subject object.
cURL
curl --request PUT \
  --url https://your-domain.com/api/subjects/3 \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "description": "Covers algebra, geometry, and calculus."
  }'

DELETE /api/subjects/:id

Delete a subject by ID. Requires a valid bearer token with admin role.
id
number
required
The ID of the subject to delete.
Response fields — 200 OK
message
string
Confirmation message: Subject deleted successfully.
cURL
curl --request DELETE \
  --url https://your-domain.com/api/subjects/3 \
  --header 'Authorization: Bearer <token>'

GET /api/chapters

List all chapters with their associated subject. Requires a valid bearer token. No request body. Response — 200 OK Returns an array of chapter objects, each including a nested subject object.
id
number
Chapter ID.
subject_id
number
ID of the parent subject.
name
string
Chapter name.
description
string
Optional description.
createdAt
string
Creation timestamp.
updatedAt
string
Last updated timestamp.
subject
object
The parent subject object.
cURL
curl --request GET \
  --url https://your-domain.com/api/chapters \
  --header 'Authorization: Bearer <token>'

GET /api/chapters/subject/:subjectId

List all chapters belonging to a specific subject. Requires a valid bearer token.
subjectId
number
required
The ID of the subject whose chapters to retrieve.
Response — 200 OK Returns an array of chapter objects for the given subject.
cURL
curl --request GET \
  --url https://your-domain.com/api/chapters/subject/3 \
  --header 'Authorization: Bearer <token>'

GET /api/chapters/:id

Retrieve a single chapter by ID. Requires a valid bearer token.
id
number
required
The ID of the chapter to retrieve.
Response — 200 OK Returns the chapter object.
cURL
curl --request GET \
  --url https://your-domain.com/api/chapters/7 \
  --header 'Authorization: Bearer <token>'

POST /api/chapters

Create a new chapter. Requires a valid bearer token with admin role.
subjectId
number
required
ID of the parent subject.
name
string
required
Name of the chapter.
description
string
Optional description of the chapter.
Response fields — 201 Created
message
string
Confirmation message.
chapter
object
Errors
StatusMessage
404Subject not found
400Chapter already exists in this subject
cURL
curl --request POST \
  --url https://your-domain.com/api/chapters \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "subjectId": 3,
    "name": "Linear Algebra",
    "description": "Vectors, matrices, and transformations."
  }'

PUT /api/chapters/:id

Update an existing chapter. Requires a valid bearer token with admin role.
id
number
required
The ID of the chapter to update.
name
string
Updated chapter name.
description
string
Updated description.
subjectId
number
Move the chapter to a different subject.
Response fields — 200 OK
message
string
Confirmation message.
chapter
object
Updated chapter object.
cURL
curl --request PUT \
  --url https://your-domain.com/api/chapters/7 \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "name": "Linear Algebra & Matrix Theory"
  }'

DELETE /api/chapters/:id

Delete a chapter by ID. Requires a valid bearer token with admin role.
id
number
required
The ID of the chapter to delete.
Response fields — 200 OK
message
string
Confirmation message: Chapter deleted successfully.
cURL
curl --request DELETE \
  --url https://your-domain.com/api/chapters/7 \
  --header 'Authorization: Bearer <token>'

Build docs developers (and LLMs) love