Skip to main content
GET
/
api
/
assessments
/
history
Assessment History
curl --request GET \
  --url https://api.example.com/api/assessments/history
{
  "response": [
    {
      "id": 123,
      "chapter_name": "<string>",
      "questions": 123,
      "created_at": "<string>",
      "status": "<string>"
    }
  ]
}
Retrieves a list of all saved assessments for the authenticated user, ordered by creation date (newest first).

Authentication

This endpoint requires authentication. Include a valid JWT token in the Authorization header:
Authorization: Bearer <your_access_token>

Request

No parameters required. The endpoint automatically filters assessments by the authenticated user.

Response

Returns an array of assessment history items.
response
array
Array of saved assessments.

Example Request

curl -X GET "http://localhost:8000/api/assessments/history" \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."

Example Response

[
  {
    "id": 42,
    "chapter_name": "Chapter 3: Photosynthesis",
    "questions": 20,
    "created_at": "2026-03-08T14:32:15.123456",
    "status": "completed"
  },
  {
    "id": 38,
    "chapter_name": "Chapter 2: Cell Structure",
    "questions": 15,
    "created_at": "2026-03-07T09:15:42.789012",
    "status": "completed"
  },
  {
    "id": 35,
    "chapter_name": "Chapter 1: Introduction to Biology",
    "questions": 18,
    "created_at": "2026-03-06T16:20:33.456789",
    "status": "completed"
  }
]

Empty Response

If the user has no saved assessments:
[]

Error Responses

401 Unauthorized

Returned when the Authorization header is missing or contains an invalid token.
{
  "detail": "Not authenticated"
}

Notes

  • Results are ordered by created_at in descending order (newest first)
  • Only assessments belonging to the authenticated user are returned
  • The questions count is calculated by counting MCQs in the stored content_json
  • Use the id field with the Get Assessment endpoint to retrieve full assessment details including all questions and answers

Use Cases

  • Display a dashboard of past assessments
  • Allow users to browse and select previous assessments for review
  • Show assessment creation dates and question counts for quick reference
  • Track assessment generation history over time

Build docs developers (and LLMs) love