const response = await fetch('https://api.pictory.ai/pictoryapis/v2/video/storyboard/render', {
method: 'POST',
headers: {
'Authorization': 'YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
videoName: 'complete_video_render',
aspectRatio: '16:9',
saveProject: true,
webhook: 'https://your-server.com/webhook',
// Branding
brandName: 'My Brand',
// Voice-over
voiceOver: {
enabled: true,
aiVoices: [{
speaker: 'Emma',
speed: 100,
amplificationLevel: 0
}]
},
// Background music
backgroundMusic: {
enabled: true,
autoMusic: true,
volume: 0.3
},
// Logo
logo: {
url: 'https://example.com/logo.png',
position: 'top-right',
width: '15%'
},
// Subtitle styling
subtitleStyle: {
fontFamily: 'Montserrat',
fontSize: 48,
color: 'rgba(255, 255, 255, 1)',
position: 'bottom-center'
},
// Scenes
scenes: [{
story: 'Welcome to our company. We create innovative solutions. Join us on this journey.',
createSceneOnEndOfSentence: true,
highlightKeywords: true,
sceneTransition: 'fade'
}]
})
});
const data = await response.json();
console.log('Job ID:', data.data.jobId);