Skip to main content

Welcome to Ilumiera AI B2B API

The Ilumiera AI B2B API provides REST endpoints for ingesting learning sources and generating educational content including quizzes, flashcards, and mind maps. Build powerful educational tools and integrate AI-powered learning features into your applications.

Base URL

All API endpoints are available at:
https://b2b-api-backend-95487.ondigitalocean.app/

Authentication

The API uses API key authentication for all endpoints. Obtain your API key from the Ilumiera AI Dashboard.

Required Header

api-key: <your-api-key>
See the Authentication guide for detailed information.

Core Workflow

1. Obtain API Key

Get your API key from the Ilumiera AI Dashboard:
  • Sign up for an account
  • Create your organization
  • Generate an API key
  • Store it securely

2. Ingest Learning Sources

Ingest learning materials from various sources:
// Ingest a YouTube video
POST /source/ingestSource
{
  "source": {
    "sourceType": "youtube",
    "userId": "user-123",
    "url": "https://youtube.com/watch?v=...",
    "metadata": { "topic": "Mathematics" }
  }
}

// Upload a PDF file
POST /source/ingestSource
Content-Type: multipart/form-data
- file: [PDF file]
- source: {"sourceType": "file", "userId": "user-123"}

3. Generate Educational Content

Generate educational content from ingested sources:
// Generate quiz
POST /source/generateQuiz/{sourceId}
{
  "userId": "user-123",
  "numberOfQuestions": 10,
  "difficulty": "medium"
}

// Generate flashcards
POST /source/generateFlashcards/{sourceId}
{
  "userId": "user-123"
}

// Generate mind map
POST /source/generateMindMap/{sourceId}
{
  "userId": "user-123"
}

4. Retrieve Generated Content

Access generated content:
// Get quiz
GET / quiz / getQuizById / { quizId };

// Get flashcards
GET / flashcard / getFlashCardById / { flashcardId };

// Get mind map
GET / mindmap / getMindMap / { mindmapId };

Supported Source Types

  • YouTube - Educational videos
  • Webpage - Online articles and resources
  • File - PDF documents
  • Lecture Audio - Audio recordings of lectures
  • Lecture Video - Video recordings of lectures

Response Format

Successful Response

Responses return the requested data directly:
{
  "_id": "65f1...",
  "orgId": "65f1c0f5a2b3c4d5e6f7a8b9",
  "userId": "user-123"
  // ... additional fields
}

Error Response

Errors return with appropriate HTTP status codes:
{
  "error": "Error description"
}
Or as plain text:
Not found

API Endpoints by Category

Health Check

  • GET / - Check API status

Source Management

  • POST /source/ingestSource - Ingest learning source
  • POST /source/generateQuiz/{sourceId} - Generate quiz from source
  • POST /source/generateFlashcards/{sourceId} - Generate flashcards
  • POST /source/generateMindMap/{sourceId} - Generate mind map

Content Access

  • GET /quiz/getQuizById/{quizId} - Get quiz details
  • PUT /quiz/startQuiz/{quizId} - Mark quiz as started
  • PUT /quiz/endQuiz/{quizId} - Mark quiz as completed
  • GET /flashcard/getFlashCardById/{flashcardId} - Get flashcard set
  • GET /mindmap/getMindMap/{mindmapId} - Get mind map

Security

  • All endpoints served over HTTPS only
  • API key required for all endpoints
  • CORS enabled for all origins (during beta)
  • Rate limiting may be applied to prevent abuse

Quick Start Example

Here’s a complete example of ingesting a YouTube video and generating educational content:
// Step 1: Ingest YouTube video
const sourceResponse = await fetch(
  "https://b2b-api-backend-95487.ondigitalocean.app/source/ingestSource",
  {
    method: "POST",
    headers: {
      "api-key": "YOUR_API_KEY",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      source: {
        sourceType: "youtube",
        userId: "user-123",
        url: "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
        metadata: { topic: "Physics" },
      },
    }),
  }
);

const source = await sourceResponse.json();

// Step 2: Generate quiz
const quizResponse = await fetch(
  `https://b2b-api-backend-95487.ondigitalocean.app/source/generateQuiz/${source._id}`,
  {
    method: "POST",
    headers: {
      "api-key": "YOUR_API_KEY",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      userId: "user-123",
      numberOfQuestions: 10,
      difficulty: "medium",
    }),
  }
);

const { quiz } = await quizResponse.json();
console.log("Generated quiz:", quiz);

Support

For support or questions, contact the Ilumiera AI team at [email protected].