Generate Flashcards
Generate a flashcard deck from study content using AI. Supports text input and file uploads.Authentication is optional. Authenticated users can save decks and track study progress with spaced repetition.
POST /api/flashcards/generate
Request Parameters
Text content to generate flashcards from. Can be provided directly or via file upload.
Optional file upload (PDF, DOCX, TXT). Maximum 10MB. File content takes precedence over text content.
Name for the flashcard deck. If not provided, AI will suggest a name based on content.
Source of the content (e.g., “Chapter 5”, “Lecture Notes”)
Number of flashcards to generate. Min: 5, Max: 50, Default: 10
Response
Whether the operation was successful
The generated flashcard deck
Error Responses
Get User Decks
Retrieve all flashcard decks for the authenticated user with study progress statistics.GET /api/flashcards/decks
Response
Whether the operation was successful
Array of flashcard decks with progress statistics
Get Deck by ID
Retrieve a specific flashcard deck with full card details.GET /api/flashcards/deck/:id
Path Parameters
The unique identifier of the deck
Response
Whether the operation was successful
Complete deck object including all cards
Study progress for each card (only for authenticated users)
Mastery statistics (only for authenticated users)
Error Responses
Get Study Session
Get cards to study in a session using spaced repetition algorithm.GET /api/flashcards/deck/:id/study
Path Parameters
The unique identifier of the deck
Query Parameters
Study mode. Options:
flip (default), quiz, matchMaximum number of cards in the session. Default: 25
Response
Whether the operation was successful
Study session details
Current mastery statistics
Study session recommendations based on progress
Record Study Progress
Record the results of a study session using the SM-2 spaced repetition algorithm.POST /api/flashcards/deck/:id/progress
Path Parameters
The unique identifier of the deck
Request Parameters
Array of card results from the study session
Study mode used
Duration of the study session in seconds
Response
Whether the operation was successful
Array of updated progress for each card with new review intervals
Updated mastery statistics
Session summary
Share Deck
Generate a shareable link for a flashcard deck.POST /api/flashcards/deck/:id/share
Path Parameters
The unique identifier of the deck to share
Response
Whether the operation was successful
Complete shareable URL
Unique share token
Get Shared Deck
Retrieve a publicly shared flashcard deck using its share token.GET /api/flashcards/shared/:token
Path Parameters
The share token for the deck
Response
Whether the operation was successful
Complete deck object with all cards
Error Responses
Delete Deck
Delete a flashcard deck and all associated progress.DELETE /api/flashcards/deck/:id
Path Parameters
The unique identifier of the deck
Response
Spaced Repetition Algorithm
The flashcards feature uses the SM-2 (SuperMemo 2) spaced repetition algorithm to optimize learning:
- Quality Ratings (0-5): After each review, rate how well you recalled the answer
- Ease Factor: Adjusts based on performance (easier cards have longer intervals)
- Intervals: Time between reviews increases exponentially for well-known cards
- Mastery Levels: Cards progress through learning stages as you review them correctly