MagicSlides API Documentation

Welcome to the MagicSlides API documentation. Our API allows you to integrate AI-powered presentation generation into your applications. We recommend using the unified PPT-from-Text API with API key authentication for all new integrations.

Authentication

The API supports two authentication methods:

API Key Authentication (Recommended)

Use an API key for authentication. Get your API key from /dashboard/settings.

Include the apiKey field in your request body. The API key format is: ms-api-{base64-encoded-payload}.{secret}

Email and AccessId (Backward Compatibility)

For backward compatibility, you can use email and accessId instead of an API key. Note: API key authentication takes precedence over email/accessId.

API Endpoints

PPT-from-Text (Unified API)

NEW

Unified endpoint that handles all input types: topics, summaries, YouTube videos, websites, PDFs, and DOCX documents. Automatically detects input type and processes accordingly. Recommended for all new integrations.

POST

Endpoint URL

https://api.magicslides.app/public/api/ppt-from-text

Parameters

Parameter
Description
apiKey
Your API key from /dashboard/settings (recommended)
email
Your email address (required if apiKey not provided)
accessId
Your MagicSlides API access ID (required if apiKey not provided)
topic
Plain text topic, URL (auto-detected), or summary
summary
Plain text summary content
youtubeURL
YouTube video URL
websiteURL
Website URL to extract content from
pdfURL
PDF file URL
docxURL
DOCX file URL
template
Optional: Presentation template style (default: "bullet-point1")
language
Optional: Target language for the presentation (default: "en")
slideCount
Optional: Number of slides to generate (default: 10)
aiImages
Optional: Enable AI-generated images (default: false)
imageForEachSlide
Optional: Include images on every slide (default: true)
googleImage
Optional: Use Google Images instead of AI images (default: false)
googleText
Optional: Use Google search for content enhancement (default: false)
model
Optional: AI model to use - "gemini" or "gpt-4" (default: "gemini")
presentationFor
Optional: Target audience for the presentation
presentationCategory
Optional: Object with category, subCategory, and tone
watermark
Optional: Object to add image watermark { width: string, height: string, brandURL: string, position: TopLeft|TopRight|BottomLeft|BottomRight }

Example Usage

TypeScript/JavaScript
import axios from 'axios';

const generateFromTopic = async () => {
  try {
    const response = await axios.post(
      'https://api.magicslides.app/public/api/ppt-from-text',
      {
        apiKey: 'ms-api-your-api-key-here',
        topic: 'Introduction to Quantum Computing: Understanding quantum mechanics, qubits, superposition, and quantum algorithms.',
        template: 'bullet-point1',
        language: 'en',
        slideCount: 10,
        imageForEachSlide: true,
        aiImages: false
      }
    );
    
    console.log('Presentation URL:', response.data.url);
    console.log('PPT ID:', response.data.pptId);
  } catch (error) {
    console.error('Error:', error);
  }
};
Python
import requests

def generate_from_topic():
    try:
        response = requests.post(
            'https://api.magicslides.app/public/api/ppt-from-text',
            json={
                'apiKey': 'ms-api-your-api-key-here',
                'topic': 'Introduction to Quantum Computing: Understanding quantum mechanics, qubits, superposition, and quantum algorithms.',
                'template': 'bullet-point1',
                'language': 'en',
                'slideCount': 10,
                'imageForEachSlide': True,
                'aiImages': False
            }
        )
        response.raise_for_status()
        result = response.json()
        print('Presentation URL:', result['url'])
        print('PPT ID:', result['pptId'])
    except requests.exceptions.RequestException as e:
        print('Error:', e)
cURL
curl -X POST \
  'https://api.magicslides.app/public/api/ppt-from-text' \
  -H 'Content-Type: application/json' \
  -d '{
    "apiKey": "ms-api-your-api-key-here",
    "topic": "Introduction to Quantum Computing: Understanding quantum mechanics, qubits, superposition, and quantum algorithms.",
    "template": "bullet-point1",
    "language": "en",
    "slideCount": 10,
    "imageForEachSlide": true,
    "aiImages": false
  }'

Topic to PPT

DEPRECATED

Generate a customized presentation from any topic with AI. Control presentation style, length, language, and image options.

⚠️ This endpoint is deprecated but still functional. We recommend migrating to the unified PPT-from-Text API for all new integrations.

POST

Endpoint URL

https://api.magicslides.app/public/api/ppt_from_topic

Parameters

Parameter
Description
topic
The main topic for the presentation
extraInfoSource
Additional information to guide the presentation generation
email
Your email address
accessId
Your MagicSlides API access ID
template
Optional: Presentation template style (default: "bullet-point1")
language
Optional: Target language for the presentation (default: "en")
slideCount
Optional: Number of slides to generate (default: 10)
aiImages
Optional: Enable AI-generated images (default: false)
imageForEachSlide
Optional: Include images on every slide (default: true)
googleImage
Optional: Use Google Images instead of AI images (default: false)
googleText
Optional: Use Google search for content enhancement (default: false)
model
Optional: AI model to use - "gpt-4" or "gpt-3.5" (default: "gpt-4")
presentationFor
Optional: Target audience for the presentation
watermark
Optional: Object to add image watermark { width: string, height: string, brandURL: string, position: TopLeft|TopRight|BottomLeft|BottomRight }

Example Usage

TypeScript/JavaScript
import axios from 'axios';

const generateFromTopic = async () => {
  try {
    const response = await axios.post(
      'https://api.magicslides.app/public/api/ppt_from_topic',
      {
        topic: 'Artificial Intelligence in Healthcare',
        extraInfoSource: 'Focus on recent developments and future prospects',
        email: 'your-email@example.com',
        accessId: 'your-access-id',
        template: 'bullet-point1',
        language: 'en',
        slideCount: 10,
        aiImages: false,
        imageForEachSlide: true,
        googleImage: false,
        googleText: false,
        model: 'gpt-4',
        presentationFor: 'healthcare professionals',
        watermark: {
          width: '48',
          height: '48',
          brandURL: 'https://djgurnpwsdoqjscwqbsj.supabase.co/storage/v1/object/public/watermarks/1712216042174_Sahoo.png',
          position: 'BottomRight'
        }
      }
    );
    
    console.log('Presentation URL:', response.data.url);
  } catch (error) {
    console.error('Error:', error);
  }
};
Python
import requests

def generate_from_topic():
    try:
        response = requests.post(
            'https://api.magicslides.app/public/api/ppt_from_topic',
            json={
                'topic': 'Artificial Intelligence in Healthcare',
                'extraInfoSource': 'Focus on recent developments and future prospects',
                'email': 'your-email@example.com',
                'accessId': 'your-access-id',
                'template': 'bullet-point1',
                'language': 'en',
                'slideCount': 10,
                'aiImages': False,
                'imageForEachSlide': True,
                'googleImage': False,
                'googleText': False,
                'model': 'gpt-4',
                'presentationFor': 'healthcare professionals',
                'watermark': {
                    'width': '48',
                    'height': '48',
                    'brandURL': 'https://djgurnpwsdoqjscwqbsj.supabase.co/storage/v1/object/public/watermarks/1712216042174_Sahoo.png',
                    'position': 'BottomRight'
                }
            }
        )
        response.raise_for_status()
        print('Presentation URL:', response.json()['url'])
    except requests.exceptions.RequestException as e:
        print('Error:', e)
cURL
curl -X POST \
  'https://api.magicslides.app/public/api/ppt_from_topic' \
  -H 'Content-Type: application/json' \
  -d '{
    "topic": "Artificial Intelligence in Healthcare",
    "extraInfoSource": "Focus on recent developments and future prospects",
    "email": "your-email@example.com",
    "accessId": "your-access-id",
    "template": "bullet-point1",
    "language": "en",
    "slideCount": 10,
    "aiImages": false,
    "imageForEachSlide": true,
    "googleImage": false,
    "googleText": false,
    "model": "gpt-4",
    "presentationFor": "healthcare professionals",
    "watermark": {
      "width": "48",
      "height": "48",
      "brandURL": "https://djgurnpwsdoqjscwqbsj.supabase.co/storage/v1/object/public/watermarks/1712216042174_Sahoo.png",
      "position": "BottomRight"
    }
  }'

Summary to PPT

DEPRECATED

Generate a presentation from a text summary.

⚠️ This endpoint is deprecated but still functional. We recommend migrating to the unified PPT-from-Text API for all new integrations.

POST

Endpoint URL

https://api.magicslides.app/public/api/ppt_from_summery

Parameters

Parameter
Description
msSummaryText
The summary text to convert into a presentation
email
Your email address
accessId
Your MagicSlides API access ID
template
Optional: Presentation template style (default: "bullet-point1")
language
Optional: Target language for the presentation (default: "en")
slideCount
Optional: Number of slides to generate (default: 10)
aiImages
Optional: Enable AI-generated images (default: false)
imageForEachSlide
Optional: Include images on every slide (default: true)
googleImage
Optional: Use Google Images instead of AI images (default: false)
googleText
Optional: Use Google search for content enhancement (default: false)
model
Optional: AI model to use - "gpt-4" or "gpt-3.5" (default: "gpt-4")
presentationFor
Optional: Target audience for the presentation
watermark
Optional: Object to add image watermark { width: string, height: string, brandURL: string, position: TopLeft|TopRight|BottomLeft|BottomRight }

Example Usage

TypeScript/JavaScript
import axios from 'axios';

const generateFromSummary = async () => {
  try {
    const response = await axios.post(
      'https://api.magicslides.app/public/api/ppt_from_summery',
      {
        msSummaryText: 'Your detailed summary text here...',
        email: 'your-email@example.com',
        accessId: 'your-access-id',
        template: 'bullet-point1',
        language: 'en',
        slideCount: 10,
        aiImages: false,
        imageForEachSlide: true,
        googleImage: false,
        googleText: false,
        model: 'gpt-4',
        presentationFor: 'general audience',
        watermark: {
          width: '48',
          height: '48',
          brandURL: 'https://djgurnpwsdoqjscwqbsj.supabase.co/storage/v1/object/public/watermarks/1712216042174_Sahoo.png',
          position: 'BottomRight'
        }
      }
    );
    
    console.log('Presentation URL:', response.data.url);
  } catch (error) {
    console.error('Error:', error);
  }
};
Python
import requests

def generate_from_summary():
    try:
        response = requests.post(
            'https://api.magicslides.app/public/api/ppt_from_summery',
            json={
                'msSummaryText': 'Your detailed summary text here...',
                'email': 'your-email@example.com',
                'accessId': 'your-access-id',
                'template': 'bullet-point1',
                'language': 'en',
                'slideCount': 10,
                'aiImages': False,
                'imageForEachSlide': True,
                'googleImage': False,
                'googleText': False,
                'model': 'gpt-4',
                'presentationFor': 'general audience',
                'watermark': {
                    'width': '48',
                    'height': '48',
                    'brandURL': 'https://djgurnpwsdoqjscwqbsj.supabase.co/storage/v1/object/public/watermarks/1712216042174_Sahoo.png',
                    'position': 'BottomRight'
                }
            }
        )
        response.raise_for_status()
        print('Presentation URL:', response.json()['url'])
    except requests.exceptions.RequestException as e:
        print('Error:', e)
cURL
curl -X POST \
  'https://api.magicslides.app/public/api/ppt_from_summery' \
  -H 'Content-Type: application/json' \
  -d '{
    "msSummaryText": "Your detailed summary text here...",
    "email": "your-email@example.com",
    "accessId": "your-access-id",
    "template": "bullet-point1",
    "language": "en",
    "slideCount": 10,
    "aiImages": false,
    "imageForEachSlide": true,
    "googleImage": false,
    "googleText": false,
    "model": "gpt-4",
    "presentationFor": "general audience",
    "watermark": {
      "width": "48",
      "height": "48",
      "brandURL": "https://djgurnpwsdoqjscwqbsj.supabase.co/storage/v1/object/public/watermarks/1712216042174_Sahoo.png",
      "position": "BottomRight"
    }
  }'

YouTube to PPT

DEPRECATED

Generate a presentation from a YouTube video.

⚠️ This endpoint is deprecated but still functional. We recommend migrating to the unified PPT-from-Text API for all new integrations.

POST

Endpoint URL

https://api.magicslides.app/public/api/ppt_from_youtube

Parameters

Parameter
Description
youtubeURL
The YouTube video URL
email
Your email address
accessId
Your MagicSlides API access ID
template
Optional: Presentation template style (default: "bullet-point1")
language
Optional: Target language for the presentation (default: "en")
slideCount
Optional: Number of slides to generate (default: 10)
aiImages
Optional: Enable AI-generated images (default: false)
imageForEachSlide
Optional: Include images on every slide (default: true)
googleImage
Optional: Use Google Images instead of AI images (default: false)
googleText
Optional: Use Google search for content enhancement (default: false)
model
Optional: AI model to use - "gpt-4" or "gpt-3.5" (default: "gpt-4")
presentationFor
Optional: Target audience for the presentation
watermark
Optional: Object to add image watermark { width: string, height: string, brandURL: string, position: TopLeft|TopRight|BottomLeft|BottomRight }

Example Usage

TypeScript/JavaScript
import axios from 'axios';

const generateFromYouTube = async () => {
  try {
    const response = await axios.post(
      'https://api.magicslides.app/public/api/ppt_from_youtube',
      {
        youtubeURL: 'https://www.youtube.com/watch?v=example',
        email: 'your-email@example.com',
        accessId: 'your-access-id',
        template: 'bullet-point1',
        language: 'en',
        slideCount: 10,
        aiImages: false,
        imageForEachSlide: true,
        googleImage: false,
        googleText: false,
        model: 'gpt-4',
        presentationFor: 'general audience',
        watermark: {
          width: '48',
          height: '48',
          brandURL: 'https://djgurnpwsdoqjscwqbsj.supabase.co/storage/v1/object/public/watermarks/1712216042174_Sahoo.png',
          position: 'BottomRight'
        }
      }
    );
    
    console.log('Presentation URL:', response.data.url);
  } catch (error) {
    console.error('Error:', error);
  }
};
Python
import requests

def generate_from_youtube():
    try:
        response = requests.post(
            'https://api.magicslides.app/public/api/ppt_from_youtube',
            json={
                'youtubeURL': 'https://www.youtube.com/watch?v=example',
                'email': 'your-email@example.com',
                'accessId': 'your-access-id',
                'template': 'bullet-point1',
                'language': 'en',
                'slideCount': 10,
                'aiImages': False,
                'imageForEachSlide': True,
                'googleImage': False,
                'googleText': False,
                'model': 'gpt-4',
                'presentationFor': 'general audience',
                'watermark': {
                    'width': '48',
                    'height': '48',
                    'brandURL': 'https://djgurnpwsdoqjscwqbsj.supabase.co/storage/v1/object/public/watermarks/1712216042174_Sahoo.png',
                    'position': 'BottomRight'
                }
            }
        )
        response.raise_for_status()
        print('Presentation URL:', response.json()['url'])
    except requests.exceptions.RequestException as e:
        print('Error:', e)
cURL
curl -X POST \
  'https://api.magicslides.app/public/api/ppt_from_youtube' \
  -H 'Content-Type: application/json' \
  -d '{
    "youtubeURL": "https://www.youtube.com/watch?v=example",
    "email": "your-email@example.com",
    "accessId": "your-access-id",
    "template": "bullet-point1",
    "language": "en",
    "slideCount": 10,
    "aiImages": false,
    "imageForEachSlide": true,
    "googleImage": false,
    "googleText": false,
    "model": "gpt-4",
    "presentationFor": "general audience",
    "watermark": {
      "width": "48",
      "height": "48",
      "brandURL": "https://djgurnpwsdoqjscwqbsj.supabase.co/storage/v1/object/public/watermarks/1712216042174_Sahoo.png",
      "position": "BottomRight"
    }
  }'

Response Format

All API endpoints return a JSON response. The unified API returns:

{
  "status": "success",
  "message": "Presentation generated successfully",
  "inputType": "topic",
  "url": "https://example.com/path/to/presentation.pptx",
  "pptId": "presentation-id",
  "pdfUrl": "https://example.com/path/to/presentation.pdf",
  "json": {
    "presentationTitle": "Title",
    "presentationSubtitle": "Subtitle",
    "slides": [...]
  },
  "tokenUsed": 1234,
  "openAICallTime": 5000
}

Deprecated endpoints may return a slightly different format with success and data fields.

Error Handling

In case of an error, the API will return a JSON response with an error message:

{
  "success": false,
  "error": "Invalid access ID provided",
  "code": "AUTH_ERROR"
}

Rate Limits

The API is rate-limited to ensure fair usage. Please contact support for details about rate limits for your account.