TellaAI
API Reference/Core Content

Study Guides API

AI-powered study guide generation and management endpoints

Study Guides API

The Study Guides API allows users to generate AI-powered study guides from course materials and notes. Study guides provide comprehensive summaries and structured learning materials to help with exam preparation and concept mastery.

Study Guide Model

  • id: Unique study guide identifier (string)
  • title: Study guide title (string)
  • description: Study guide description (string, optional)
  • difficulty: Difficulty level (string: "EASY" | "MEDIUM" | "HARD")
  • courseId: Associated course ID (string)
  • content: Structured study content (object)
  • sections: Array of study sections (array)
  • createdAt: ISO datetime when created (string)
  • updatedAt: ISO datetime when last updated (string)
  • userId: Owner user ID (string)

Study Section Model

  • id: Unique section identifier (string)
  • title: Section title (string)
  • content: Section content (string)
  • order: Display order in guide (number)
  • subsections: Array of subsection objects (array, optional)
  • studyGuideId: Parent study guide ID (string)

Endpoints

All study guide endpoints require authentication and are scoped to the authenticated user.

Get All Study Guides

Retrieve all study guides for the authenticated user with optional filtering.

GET /api/study-guides

# Filter by course
GET /api/study-guides?courseId=course_abc123

Query Parameters

  • courseId: Filter study guides by specific course ID (optional)

Get Study Guides for Note

Retrieve all study guides associated with a specific note.

GET /api/notes/{noteId}/study-guides

Path Parameters

  • noteId: ID of the note to get study guides for (required, string)

Response (200)

{
  "success": true,
  "data": [
    {
      "id": "study_guide_abc123",
      "title": "Cell Biology Study Guide",
      "content": "# Cell Biology Study Guide\n\n## Key Concepts\n\n### Cell Structure\n- **Nucleus**: Controls cell activities\n- **Mitochondria**: Powerhouse of the cell\n- **Ribosomes**: Protein synthesis\n\n## Important Terms\n- **Cytoplasm**: Gel-like substance inside cell\n- **Organelles**: Specialized structures within cells\n\n## Study Tips\n1. Focus on organelle functions\n2. Understand cell membrane structure\n3. Practice with diagrams",
      "courseId": "course_abc123",
      "noteId": "note_abc123",
      "createdAt": "2024-01-01T00:00:00.000Z",
      "updatedAt": "2024-01-01T00:00:00.000Z",
      "userId": "user_123",
      "course": {
        "id": "course_abc123",
        "name": "Biology 101"
      },
      "note": {
        "id": "note_abc123",
        "title": "Biology Lecture: Cell Structure"
      }
    }
  ],
  "message": "Note study guides retrieved successfully"
}

Errors:

  • 401: Authentication required
  • 404: Note not found or access denied

Generate Study Guide with AI

Generate a new study guide using AI based on course materials and notes.

POST /api/study-guides/generate
Content-Type: application/json

{
  "courseId": "course_abc123",
  "noteIds": ["note_123", "note_456", "note_789"]
}

Request Body Parameters

  • courseId: ID of the course to generate the study guide for (required, string)
  • noteIds: Array of specific note IDs to use for study guide generation (required, array of strings)

Response (201)

{
  "success": true,
  "data": {
    "id": "study_guide_abc123",
    "title": "Generated Study Guide: Biology Fundamentals",
    "content": "# Biology Fundamentals Study Guide\n\n## Key Concepts\n\n### Cell Structure\n- **Nucleus**: Controls cell activities\n- **Mitochondria**: Powerhouse of the cell\n- **Ribosomes**: Protein synthesis\n\n## Important Terms\n- **Cytoplasm**: Gel-like substance inside cell\n- **Organelles**: Specialized structures within cells\n\n## Study Tips\n1. Focus on organelle functions\n2. Understand cell membrane structure\n3. Practice with diagrams",
    "courseId": "course_abc123",
    "noteId": "note_123",
    "createdAt": "2024-01-01T00:00:00.000Z",
    "updatedAt": "2024-01-01T00:00:00.000Z",
    "userId": "user_123"
  },
  "message": "Study guide generated successfully"
}

Errors:

  • 400: Invalid input data, missing course, or invalid note IDs
  • 401: Authentication required
  • 404: Course or notes not found

Get Study Guide by ID

Retrieve a specific study guide by its ID.

GET /api/study-guides/{id}

Path Parameters

  • id: ID of the study guide to retrieve (required, string)

Response (200)

{
  "success": true,
  "data": {
    "id": "study_guide_abc123",
    "title": "Biology Chapter 1 Study Guide",
    "content": "# Cell Biology Study Guide\n\n## Key Concepts\n\n### Cell Structure\n- **Nucleus**: Controls cell activities\n- **Mitochondria**: Powerhouse of the cell\n- **Ribosomes**: Protein synthesis\n\n## Important Terms\n- **Cytoplasm**: Gel-like substance inside cell\n- **Organelles**: Specialized structures within cells\n\n## Study Tips\n1. Focus on organelle functions\n2. Understand cell membrane structure\n3. Practice with diagrams",
    "courseId": "course_abc123",
    "noteId": "note_123",
    "createdAt": "2024-01-01T00:00:00.000Z",
    "updatedAt": "2024-01-01T00:00:00.000Z",
    "userId": "user_123",
    "course": {
      "id": "course_abc123",
      "name": "Biology 101"
    },
    "note": {
      "id": "note_123",
      "title": "Biology Lecture: Cell Structure"
    }
  },
  "message": "Study guide retrieved successfully"
}

Errors:

  • 401: Authentication required
  • 404: Study guide not found

Delete Study Guide

Delete a study guide.

DELETE /api/study-guides/{id}

Path Parameters

  • id: ID of the study guide to delete (required, string)

Response (200)

{
  "success": true,
  "message": "Study guide deleted successfully"
}

Errors:

  • 401: Authentication required
  • 404: Study guide not found

Usage Examples

Generate Study Guide from Notes

// Generate study guide from specific notes in a course
const response = await fetch('/api/study-guides/generate', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer your-token'
  },
  body: JSON.stringify({
    courseId: 'course_abc123',
    noteIds: ['note_123', 'note_456']
  })
});

const result = await response.json();
console.log('Generated study guide:', result.data.id);

Get Study Guides for a Note

// Get all study guides for a specific note
const response = await fetch('/api/notes/note_123/study-guides', {
  headers: {
    'Authorization': 'Bearer your-token'
  }
});

const studyGuides = await response.json();
console.log('Study guides for note:', studyGuides.data.length);

Get All Study Guides for a Course

// Retrieve all study guides for a specific course
const response = await fetch('/api/study-guides?courseId=course_abc123', {
  headers: {
    'Authorization': 'Bearer your-token'
  }
});

const data = await response.json();
console.log('Course study guides:', data.data.length);

AI Generation Features

Content Analysis

  • Key Concept Extraction: Identifies important topics and themes from notes
  • Structure Organization: Creates logical study guide structure
  • Content Summarization: Distills complex topics into digestible sections
  • Context Preservation: Maintains educational context from source material

Quality Assurance

  • Relevance Scoring: Study guides directly relate to source material
  • Clarity Optimization: Content is clear and well-organized
  • Duplicate Prevention: Avoids redundant or similar study guides
  • Educational Value: Focuses on learning objectives and key concepts

Deduplication

  • Note-Specific: Prevents multiple study guides for the same note
  • Content-Based: Checks for existing guides with similar content
  • User-Scoped: Deduplication is per user and course
  • Idempotent: Multiple requests return the same existing guide

Integration Notes

  • Study guides are automatically organized by course and note
  • Generated content integrates with the universal search system
  • AI generation respects course context and difficulty level
  • All study guide operations are scoped to the authenticated user
  • Note-specific endpoints provide efficient access to related study guides
  • Deduplication prevents multiple study guides for the same note content

Retrieve a specific study guide by its ID with full content and sections.

GET /api/study-guides/{id}

Path Parameters

  • id: ID of the study guide to retrieve (required, string)

Response (200)

{
  "success": true,
  "data": {
    "id": "guide_abc123",
    "title": "Biology Chapter 1 Study Guide",
    "description": "Comprehensive guide covering cell structure and function",
    "difficulty": "MEDIUM",
    "courseId": "course_abc123",
    "content": {
      "overview": "This study guide covers the fundamental concepts of cell biology...",
      "keyTerms": ["cell", "nucleus", "mitochondria", "membrane"],
      "learningObjectives": [
        "Understand the basic structure of cells",
        "Identify major cellular organelles",
        "Explain cellular functions"
      ],
      "studyTips": [
        "Create diagrams of cell structures",
        "Use mnemonics for organelle functions",
        "Practice with microscope images"
      ]
    },
    "sections": [
      {
        "id": "section_abc123",
        "title": "Cell Structure",
        "content": "Cells are the basic units of life...",
        "order": 1,
        "subsections": [
          {
            "title": "Cell Membrane",
            "content": "The cell membrane controls cellular entry and exit..."
          }
        ],
        "studyGuideId": "guide_abc123"
      }
    ],
    "createdAt": "2024-01-01T00:00:00.000Z",
    "updatedAt": "2024-01-01T00:00:00.000Z",
    "userId": "user_123"
  },
  "message": "Study guide retrieved successfully"
}

Errors:

  • 401: Authentication required
  • 404: Study guide not found

Usage Examples

Generate Study Guide from Notes

// Generate a study guide from specific notes in a course
const response = await fetch('/api/study-guides/generate', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer your-token'
  },
  body: JSON.stringify({
    courseId: 'course_abc123',
    noteIds: ['note_123', 'note_456']
  })
});

const result = await response.json();
console.log('Generated study guide:', result.data.studyGuide.id);
console.log('Number of sections:', result.data.studyGuide.sections.length);

Get All Study Guides for a Course

// Retrieve all study guides for a specific course
const response = await fetch('/api/study-guides?courseId=course_abc123', {
  headers: {
    'Authorization': 'Bearer your-token'
  }
});

const data = await response.json();
console.log('Course study guides:', data.data.length);

Access Study Guide Content

// Get a specific study guide with full content
const response = await fetch('/api/study-guides/guide_abc123', {
  headers: {
    'Authorization': 'Bearer your-token'
  }
});

const studyGuide = await response.json();
console.log('Study guide:', studyGuide.data.title);
console.log('Key terms:', studyGuide.data.content.keyTerms);
console.log('Learning objectives:', studyGuide.data.content.learningObjectives);

// Iterate through sections
studyGuide.data.sections.forEach((section, index) => {
  console.log(`Section ${index + 1}: ${section.title}`);
  console.log(`Content: ${section.content}`);
  
  // Access subsections if available
  if (section.subsections) {
    section.subsections.forEach(subsection => {
      console.log(`  - ${subsection.title}: ${subsection.content}`);
    });
  }
});

AI Generation Features

Content Structure

  • Overview: High-level summary of the topic
  • Key Terms: Important vocabulary and definitions
  • Learning Objectives: Clear goals for understanding
  • Study Tips: Practical advice for learning
  • Sections: Organized topic breakdown with subsections

Content Analysis

  • Topic Identification: Automatically identifies main concepts from notes
  • Hierarchical Organization: Creates logical flow from general to specific topics
  • Concept Connections: Links related ideas across different source materials
  • Difficulty Adaptation: Adjusts language and complexity based on course level

Study Enhancement

  • Visual Learning: Suggests diagrams and visual aids
  • Memory Techniques: Includes mnemonics and memory strategies
  • Practice Recommendations: Suggests exercises and review methods
  • Real-world Applications: Connects concepts to practical examples

Quality Assurance

  • Content Accuracy: Validates information against source materials
  • Completeness Check: Ensures comprehensive coverage of topics
  • Clarity Optimization: Uses clear, educational language
  • Learning Flow: Organizes content in logical learning progression

Integration Notes

  • Study guides are automatically organized by course
  • Generated content includes multiple learning strategies
  • Study guide data integrates with the universal search system
  • AI generation adapts to course context and student level
  • All study guide operations are scoped to the authenticated user
  • Content can be used for exam preparation and review sessions
  • Sections and subsections provide flexible navigation and study organization