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)
NEWUnified 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.
Endpoint URL
https://api.magicslides.app/public/api/ppt-from-textParameters
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
DEPRECATEDGenerate 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.
Endpoint URL
https://api.magicslides.app/public/api/ppt_from_topicParameters
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
DEPRECATEDGenerate 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.
Endpoint URL
https://api.magicslides.app/public/api/ppt_from_summeryParameters
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
DEPRECATEDGenerate 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.
Endpoint URL
https://api.magicslides.app/public/api/ppt_from_youtubeParameters
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.