curl -X POST "https://api.hooked.so/v1/project/create/tiktok-slideshow" \
-H "x-api-key: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"name": "5 morning habits",
"aspectRatio": "ratio_9_16",
"slides": [
{
"media": "cm8w1r7d20001l708x9y8z7w6",
"duration": 3,
"texts": [
{ "text": "5 morning habits that changed my life", "x": 100, "y": 760, "width": 880, "height": 400, "fontSize": 88 }
]
},
{
"media": "cm8w1s0aa0002l708q1w2e3r4",
"duration": 4,
"texts": [
{ "text": "1. No phone for the first hour", "x": 100, "y": 1400, "width": 880, "height": 240, "fontSize": 72 }
]
}
],
"musicId": "cm7m2u5ic0000l708h3k4m5n6"
}'
const response = await fetch("https://api.hooked.so/v1/project/create/tiktok-slideshow", {
method: "POST",
headers: {
"x-api-key": "your_api_key_here",
"Content-Type": "application/json",
},
body: JSON.stringify({
slides: [
{
media: "cm8w1r7d20001l708x9y8z7w6",
texts: [{ text: "5 morning habits", x: 100, y: 760, width: 880, height: 400, fontSize: 88 }],
},
{ media: "cm8w1s0aa0002l708q1w2e3r4", duration: 4 },
],
// Optional narration:
avatarId: "2",
script: "Here are five morning habits that changed my life.",
webhook: "https://example.com/hooks/hooked?token=YOUR_SECRET",
}),
});
const { data } = await response.json();
console.log(data.projectId);
import requests
response = requests.post(
"https://api.hooked.so/v1/project/create/tiktok-slideshow",
headers={"x-api-key": "your_api_key_here"},
json={
"slides": [
{
"media": "cm8w1r7d20001l708x9y8z7w6",
"texts": [{"text": "5 morning habits", "x": 100, "y": 760,
"width": 880, "height": 400, "fontSize": 88}],
},
{"media": "cm8w1s0aa0002l708q1w2e3r4", "duration": 4},
],
},
)
print(response.json()["data"]["projectId"])
{
"success": true,
"projectId": "cm8x4f2qk0007l708a1b2c3d4",
"data": {
"projectId": "cm8x4f2qk0007l708a1b2c3d4",
"status": "processing"
},
"message": "TikTok Slideshow successfully created"
}
{
"success": false,
"message": "slides.0.texts.0: The text box must fit the 1080x1920 canvas (x + width <= 1080, y + height <= 1920)"
}
{
"code": "not_authenticated",
"message": "Not authenticated",
"errorCode": "NOT_AUTHENTICATED",
"details": { "x-api-key": "Header not provided or API Key invalid" }
}
{
"success": false,
"code": "missing_credentials",
"errorCode": "MISSING_CREDENTIALS",
"missingProviders": ["gemini", "bria"],
"message": "Your team uses its own provider keys (BYOK) and these are missing or invalid: Google AI (Gemini), Bria. Add them in Settings → AI keys."
}
{
"success": false,
"code": "subscription_required",
"errorCode": "SUBSCRIPTION_REQUIRED",
"message": "Your team generates with Hooked's keys, which are paid by your plan. Subscribe to keep generating."
}
{
"success": false,
"errorCode": "INSUFFICIENT_CREDITS",
"message": "Not enough credits for TikTok Slideshow creation. Required: 7, Available: 3",
"creditsNeeded": 7,
"creditsAvailable": 3
}
{
"code": "entitlement_required",
"error": "entitlement_required",
"message": "This endpoint requires the \"app\" product.",
"product": "app"
}
TikTok Slideshow
Turn images and clips from your library into a slideshow with text on each slide, optionally narrated by an avatar
curl -X POST "https://api.hooked.so/v1/project/create/tiktok-slideshow" \
-H "x-api-key: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"name": "5 morning habits",
"aspectRatio": "ratio_9_16",
"slides": [
{
"media": "cm8w1r7d20001l708x9y8z7w6",
"duration": 3,
"texts": [
{ "text": "5 morning habits that changed my life", "x": 100, "y": 760, "width": 880, "height": 400, "fontSize": 88 }
]
},
{
"media": "cm8w1s0aa0002l708q1w2e3r4",
"duration": 4,
"texts": [
{ "text": "1. No phone for the first hour", "x": 100, "y": 1400, "width": 880, "height": 240, "fontSize": 72 }
]
}
],
"musicId": "cm7m2u5ic0000l708h3k4m5n6"
}'
const response = await fetch("https://api.hooked.so/v1/project/create/tiktok-slideshow", {
method: "POST",
headers: {
"x-api-key": "your_api_key_here",
"Content-Type": "application/json",
},
body: JSON.stringify({
slides: [
{
media: "cm8w1r7d20001l708x9y8z7w6",
texts: [{ text: "5 morning habits", x: 100, y: 760, width: 880, height: 400, fontSize: 88 }],
},
{ media: "cm8w1s0aa0002l708q1w2e3r4", duration: 4 },
],
// Optional narration:
avatarId: "2",
script: "Here are five morning habits that changed my life.",
webhook: "https://example.com/hooks/hooked?token=YOUR_SECRET",
}),
});
const { data } = await response.json();
console.log(data.projectId);
import requests
response = requests.post(
"https://api.hooked.so/v1/project/create/tiktok-slideshow",
headers={"x-api-key": "your_api_key_here"},
json={
"slides": [
{
"media": "cm8w1r7d20001l708x9y8z7w6",
"texts": [{"text": "5 morning habits", "x": 100, "y": 760,
"width": 880, "height": 400, "fontSize": 88}],
},
{"media": "cm8w1s0aa0002l708q1w2e3r4", "duration": 4},
],
},
)
print(response.json()["data"]["projectId"])
{
"success": true,
"projectId": "cm8x4f2qk0007l708a1b2c3d4",
"data": {
"projectId": "cm8x4f2qk0007l708a1b2c3d4",
"status": "processing"
},
"message": "TikTok Slideshow successfully created"
}
{
"success": false,
"message": "slides.0.texts.0: The text box must fit the 1080x1920 canvas (x + width <= 1080, y + height <= 1920)"
}
{
"code": "not_authenticated",
"message": "Not authenticated",
"errorCode": "NOT_AUTHENTICATED",
"details": { "x-api-key": "Header not provided or API Key invalid" }
}
{
"success": false,
"code": "missing_credentials",
"errorCode": "MISSING_CREDENTIALS",
"missingProviders": ["gemini", "bria"],
"message": "Your team uses its own provider keys (BYOK) and these are missing or invalid: Google AI (Gemini), Bria. Add them in Settings → AI keys."
}
{
"success": false,
"code": "subscription_required",
"errorCode": "SUBSCRIPTION_REQUIRED",
"message": "Your team generates with Hooked's keys, which are paid by your plan. Subscribe to keep generating."
}
{
"success": false,
"errorCode": "INSUFFICIENT_CREDITS",
"message": "Not enough credits for TikTok Slideshow creation. Required: 7, Available: 3",
"creditsNeeded": 7,
"creditsAvailable": 3
}
{
"code": "entitlement_required",
"error": "entitlement_required",
"message": "This endpoint requires the \"app\" product.",
"product": "app"
}
Overview
A TikTok Slideshow plays your library images and videos one after another, each with its own text boxes and duration. Add anavatarId and a script and an avatar narrates the slideshow, keyed out of its background in a corner of the frame.
| Mode | Send | Result |
|---|---|---|
| Slides only | slides | The slides with their text and optional music |
| Narrated | slides + avatarId + script | The same, with an avatar speaking the script in the bottom-right corner |
webhook is called with the MP4.Canvas size
Text box positions, sizes andfontSize are in pixels of the output canvas:
aspectRatio | Canvas (width × height) |
|---|---|
ratio_9_16 | 1080 × 1920 |
ratio_16_9 | 1280 × 720 |
ratio_1_1 | 1080 × 1080 |
400 slides.<i>.texts.<j>: The text box must fit the 1080x1920 canvas (x + width <= 1080, y + height <= 1920). Always send x, y, width and height: a box without them gets the editor’s default placement, which is not meant to be relied on.
curl -X POST "https://api.hooked.so/v1/project/create/tiktok-slideshow" \
-H "x-api-key: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"name": "5 morning habits",
"aspectRatio": "ratio_9_16",
"slides": [
{
"media": "cm8w1r7d20001l708x9y8z7w6",
"duration": 3,
"texts": [
{ "text": "5 morning habits that changed my life", "x": 100, "y": 760, "width": 880, "height": 400, "fontSize": 88 }
]
},
{
"media": "cm8w1s0aa0002l708q1w2e3r4",
"duration": 4,
"texts": [
{ "text": "1. No phone for the first hour", "x": 100, "y": 1400, "width": 880, "height": 240, "fontSize": 72 }
]
}
],
"musicId": "cm7m2u5ic0000l708h3k4m5n6"
}'
const response = await fetch("https://api.hooked.so/v1/project/create/tiktok-slideshow", {
method: "POST",
headers: {
"x-api-key": "your_api_key_here",
"Content-Type": "application/json",
},
body: JSON.stringify({
slides: [
{
media: "cm8w1r7d20001l708x9y8z7w6",
texts: [{ text: "5 morning habits", x: 100, y: 760, width: 880, height: 400, fontSize: 88 }],
},
{ media: "cm8w1s0aa0002l708q1w2e3r4", duration: 4 },
],
// Optional narration:
avatarId: "2",
script: "Here are five morning habits that changed my life.",
webhook: "https://example.com/hooks/hooked?token=YOUR_SECRET",
}),
});
const { data } = await response.json();
console.log(data.projectId);
import requests
response = requests.post(
"https://api.hooked.so/v1/project/create/tiktok-slideshow",
headers={"x-api-key": "your_api_key_here"},
json={
"slides": [
{
"media": "cm8w1r7d20001l708x9y8z7w6",
"texts": [{"text": "5 morning habits", "x": 100, "y": 760,
"width": 880, "height": 400, "fontSize": 88}],
},
{"media": "cm8w1s0aa0002l708q1w2e3r4", "duration": 4},
],
},
)
print(response.json()["data"]["projectId"])
{
"success": true,
"projectId": "cm8x4f2qk0007l708a1b2c3d4",
"data": {
"projectId": "cm8x4f2qk0007l708a1b2c3d4",
"status": "processing"
},
"message": "TikTok Slideshow successfully created"
}
{
"success": false,
"message": "slides.0.texts.0: The text box must fit the 1080x1920 canvas (x + width <= 1080, y + height <= 1920)"
}
{
"code": "not_authenticated",
"message": "Not authenticated",
"errorCode": "NOT_AUTHENTICATED",
"details": { "x-api-key": "Header not provided or API Key invalid" }
}
{
"success": false,
"code": "missing_credentials",
"errorCode": "MISSING_CREDENTIALS",
"missingProviders": ["gemini", "bria"],
"message": "Your team uses its own provider keys (BYOK) and these are missing or invalid: Google AI (Gemini), Bria. Add them in Settings → AI keys."
}
{
"success": false,
"code": "subscription_required",
"errorCode": "SUBSCRIPTION_REQUIRED",
"message": "Your team generates with Hooked's keys, which are paid by your plan. Subscribe to keep generating."
}
{
"success": false,
"errorCode": "INSUFFICIENT_CREDITS",
"message": "Not enough credits for TikTok Slideshow creation. Required: 7, Available: 3",
"creditsNeeded": 7,
"creditsAvailable": 3
}
{
"code": "entitlement_required",
"error": "entitlement_required",
"message": "This endpoint requires the \"app\" product.",
"product": "app"
}
projectId is returned both at the top level and inside data; read it from data.
Errors
| Status | Body | When |
|---|---|---|
| 400 | { success: false, message } | Invalid JSON body; slides: At least one slide is required; Media ID is required for slide <i>; Media not found: <id>; Media has no URL: <id>; a text box outside the canvas (slides.<i>.texts.<j>: The text box must fit …), a width or height under 40 px (slides.<i>.texts.<j>.width: Must be at least 40 px (got …)) or a fontSize outside 32-800 px (slides.<i>.texts.<j>.fontSize: Must be between 32 and 800 px (got …)); avatarId: An avatar is required to narrate the script; script: A script is required with an avatar; an unknown avatarId or musicId; webhook: Must be a valid HTTPS URL |
| 400 | Subscription not found | The team has no plan record. Contact support |
| 401 | not_authenticated | Missing or invalid x-api-key |
| 402 | missing_credentials | Your team uses its own keys (BYOK) and a key this request needs is missing. Nothing is created |
| 402 | subscription_required | Your team uses Hooked’s keys and has no active subscription |
| 402 | INSUFFICIENT_CREDITS | The price is higher than your balance |
| 403 | entitlement_required | Your team does not have the product this endpoint belongs to |
| 500 | { success: false, message } | Unexpected error (credits charged are refunded) |
Idempotency-Key header to retry safely: if a request times out or answers 5xx, sending it again with the same key and body returns the first answer instead of creating (and charging) the project twice.Credits and your own keys
- Teams on Hooked’s keys (managed): 7 credits for a slideshow without an avatar. With an avatar: 7 credits plus 100 credits per started 15 seconds of script (estimated at about 2.5 words per second). Charged when the project is created; refunded if it fails.
- Teams on their own keys (BYOK): no credits are charged. The team needs an OpenRouter key in Settings → AI keys, plus Google AI (Gemini) and Bria when the slideshow has an avatar. No ElevenLabs key is needed: no voice is synthesized. Without the keys the request answers
402 missing_credentialsand nothing is created.
What happens next
The slideshow is assembled and rendered automatically: without an avatar right away, with one when its clips are done. You do not need to call Render.- Poll Get Project until
data.videois present anddata.video.statusisCOMPLETED, then downloaddata.video.url; or - pass
webhookand wait for theCOMPLETED(orFAILED) call described in Webhooks.
Related
Get Video
List Avatars
List Music
Get Project
Headers
Makes the request safe to retry. 1-255 printable ASCII characters, one per operation (your job id, or a UUID you store), reused on every retry. Within 24 hours the same key with the same body answers with the first response and the header Idempotent-Replayed: true, without running or charging again. Keys are scoped to your team and the endpoint. 5xx answers and refusals before anything ran (401, 402, 403, 409, 429) are not kept. See Idempotency.
1 - 255^[\x20-\x7E]+$Query Parameters
true: only answer the price of this exact request, as { success: true, data: { dryRun: true, estimatedCredits } } with status 200. The request is validated like a real one (a 400 or 402 says the same), but nothing is created, queued or charged. estimatedCredits is exactly what the call without dryRun charges a managed team; a byok team is charged nothing. Do not send an Idempotency-Key with it.
Body
HTTPS URL on a public host, called when the video is ready or the project fails (max 500 characters). Requests are signed: verify the Hooked-Signature header (HMAC-SHA256 of ".") with the signing secret from Settings → Webhooks; Hooked-Event and Hooked-Delivery headers name the event and the delivery. No redirects are followed; 10 s timeout; 3 immediate attempts. See the Webhooks guide for the payload.
500