Overview

The Materials API allows you to upload, manage, and organize various types of study materials including documents, videos, audio files, and more. Materials can be organized into folders and serve as the foundation for generating study components like flashcards, quizzes, and practice tests.

Supported File Types

The Materials API supports the following content types:
  • Documents: PDF, EPUB, TXT
  • Videos: MP4, AVI, MOV, MKV
  • Audio: MP3, WAV, M4A
  • Images: JPG, PNG, GIF
  • Text: Plain text content
  • URLs: Web content fetching

Material Object

{
  "_id": "mat_123abc",
  "name": "Biology Chapter 1",
  "organizationId": "org_456def",
  "folderId": "folder_789ghi",
  "contentType": "pdf",
  "content": {
    "s3Key": "materials/org_456def/file.pdf",
    "s3Url": "https://s3.amazonaws.com/...",
    "filename": "biology-ch1.pdf",
    "fileSize": 2048576,
    "mimeType": "application/pdf"
  },
  "metadata": {
    "title": "Biology Chapter 1",
    "wordCount": 5420,
    "pageCount": 12,
    "embeddingCount": 45,
    "chunks": 15,
    "extractedText": "...",
    "images": [
      {
        "id": "img_001",
        "s3Key": "materials/org_456def/images/img_001.jpg",
        "s3Url": "https://s3.amazonaws.com/...",
        "description": "Cell structure diagram"
      }
    ]
  },
  "status": "active",
  "createdAt": "2024-01-15T10:00:00Z",
  "updatedAt": "2024-01-15T10:05:00Z"
}

Status Values

Materials go through different status values during their lifecycle:
  • pending_upload - Waiting for file upload (S3 presigned URL)
  • processing - Being processed (OCR, transcription, embeddings)
  • active - Ready to use
  • error - Processing failed
  • deleted - Soft deleted
Important: Materials must have status: 'active' before they can be used in components or for grading. Attempting to use materials with status: 'processing' will result in errors. Always implement polling to check material status after upload.

Next Steps