Skip to main content

Generate Study Guide

curl -X POST https://api.inspir.uk/api/study-guide/generate \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -F "[email protected]" \
  -F "title=Biology Chapter 5" \
  -F "subject=Biology"
Generate a comprehensive study guide from uploaded documents or text content. Supports optional authentication for saving.

Request

files
file[]
Upload 1-5 files (PDF, DOCX, or TXT). Max 10MB per file.
content
string
Text content to generate study guide from. Required if no files uploaded.
title
string
Custom title for the study guide. Auto-generated if not provided.
subject
string
Subject area (e.g., Biology, History, Mathematics). Auto-detected if not provided.

Response

success
boolean
Indicates if the operation was successful
guide
object
{
  "success": true,
  "guide": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "title": "Photosynthesis Study Guide",
    "subject": "Biology",
    "sourceMaterials": ["chapter5.pdf"],
    "overview": "Photosynthesis is the process by which plants convert light energy into chemical energy...",
    "keyConcepts": [
      {
        "concept": "Chlorophyll",
        "description": "The green pigment that absorbs light energy"
      }
    ],
    "definitions": [
      {
        "term": "Chlorophyll",
        "definition": "A green pigment found in chloroplasts that captures light energy for photosynthesis..."
      }
    ],
    "examples": [
      {
        "title": "C3 Plants",
        "description": "Most common type of photosynthesis, used by plants like wheat and rice..."
      }
    ],
    "questions": [
      {
        "type": "multiple_choice",
        "question": "Where does photosynthesis occur?",
        "options": ["Mitochondria", "Chloroplast", "Nucleus", "Ribosome"],
        "answer": "Chloroplast"
      }
    ],
    "summary": "Photosynthesis is essential for life on Earth...",
    "wordCount": 1250
  }
}

Errors

error
string
Error message
details
string
Additional error details
{
  "error": "Content is required"
}

Get Study Guides

curl https://api.inspir.uk/api/study-guide/ \
  -H "Authorization: Bearer YOUR_TOKEN"
Retrieve all study guides for the authenticated user. Returns up to 50 most recent guides.

Response

success
boolean
Indicates if the operation was successful
guides
array
{
  "success": true,
  "guides": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "title": "Photosynthesis Study Guide",
      "subject": "Biology",
      "source_materials": ["chapter5.pdf"],
      "word_count": 1250,
      "created_at": "2024-01-15T10:30:00Z",
      "updated_at": "2024-01-15T10:30:00Z"
    }
  ]
}

Get Study Guide by ID

curl https://api.inspir.uk/api/study-guide/550e8400-e29b-41d4-a716-446655440000 \
  -H "Authorization: Bearer YOUR_TOKEN"
Retrieve a specific study guide by ID. Access requires authentication if the guide is private.

Response

success
boolean
Indicates if the operation was successful
guide
object
Complete study guide object including all sections and metadata
{
  "success": true,
  "guide": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "user_id": "user123",
    "title": "Photosynthesis Study Guide",
    "subject": "Biology",
    "source_materials": ["chapter5.pdf"],
    "structure": {
      "overview": "...",
      "keyConcepts": [...],
      "definitions": [...],
      "examples": [...],
      "questions": [...],
      "summary": "..."
    },
    "word_count": 1250,
    "is_editable": true,
    "is_shared": false,
    "share_token": null,
    "created_at": "2024-01-15T10:30:00Z",
    "updated_at": "2024-01-15T10:30:00Z"
  }
}

Errors

{
  "error": "Study guide not found"
}

Update Study Guide

curl -X PUT https://api.inspir.uk/api/study-guide/550e8400-e29b-41d4-a716-446655440000 \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Updated Title",
    "subject": "Advanced Biology"
  }'
Update a study guide’s title, subject, or content structure. Requires ownership.

Request

title
string
New title
subject
string
New subject
structure
object
Updated study guide structure

Response

success
boolean
Indicates if the operation was successful
guide
object
Updated study guide object

Errors

{
  "error": "This study guide is not editable"
}

Share Study Guide

curl -X POST https://api.inspir.uk/api/study-guide/550e8400-e29b-41d4-a716-446655440000/share \
  -H "Authorization: Bearer YOUR_TOKEN"
Generate a public share link for a study guide.

Response

success
boolean
Indicates if the operation was successful
shareUrl
string
Public URL to access the shared study guide
shareToken
string
Unique share token
{
  "success": true,
  "shareUrl": "https://quiz.inspir.uk/shared/study-guide/a1b2c3d4-e5f6-4789-a0b1-c2d3e4f5a6b7",
  "shareToken": "a1b2c3d4-e5f6-4789-a0b1-c2d3e4f5a6b7"
}

Delete Study Guide

curl -X DELETE https://api.inspir.uk/api/study-guide/550e8400-e29b-41d4-a716-446655440000 \
  -H "Authorization: Bearer YOUR_TOKEN"
Permanently delete a study guide. Requires ownership.

Response

success
boolean
Indicates if the operation was successful
message
string
Confirmation message
{
  "success": true,
  "message": "Study guide deleted successfully"
}

Get Shared Study Guide

curl https://api.inspir.uk/api/study-guide/shared/a1b2c3d4-e5f6-4789-a0b1-c2d3e4f5a6b7
Retrieve a publicly shared study guide using its share token. No authentication required.

Response

success
boolean
Indicates if the operation was successful
guide
object
Complete study guide object
{
  "error": "Study guide not found or not shared"
}

Build docs developers (and LLMs) love