curl -X GET "https://api.hooked.so/v1/project/cm4x9k2p10001ab12cd34ef56/scenes" \
-H "x-api-key: your_api_key_here"
const projectId = "cm4x9k2p10001ab12cd34ef56";
const response = await fetch(`https://api.hooked.so/v1/project/${projectId}/scenes`, {
headers: { "x-api-key": process.env.HOOKED_API_KEY },
});
const { data } = await response.json();
for (const scene of data.scenes) {
console.log(scene.index, scene.kind, `${scene.startMs}ms`, scene.text);
}
import os
import requests
project_id = "cm4x9k2p10001ab12cd34ef56"
response = requests.get(
f"https://api.hooked.so/v1/project/{project_id}/scenes",
headers={"x-api-key": os.environ["HOOKED_API_KEY"]},
)
for scene in response.json()["data"]["scenes"]:
print(scene["index"], scene["kind"], scene["startMs"], scene["text"])
{
"success": true,
"message": "Scenes fetched successfully",
"data": {
"projectId": "cm4x9k2p10001ab12cd34ef56",
"aspectRatio": "ratio_9_16",
"scenes": [
{
"index": 0,
"kind": "image",
"startMs": 0,
"endMs": 2400,
"text": "Three habits that changed my mornings",
"mediaId": "cm4x9p3r40005ab12gh56ij11",
"url": "https://assets.example.com/scene-0.png",
"prompt": "A sunrise over a quiet kitchen, warm light, steam rising from a coffee cup",
"replaceable": true
},
{
"index": 1,
"kind": "video",
"startMs": 2400,
"endMs": 6000,
"text": "Try them",
"mediaId": null,
"url": "https://assets.example.com/scene-1.mp4",
"prompt": null,
"replaceable": true
}
]
}
}
{
"success": false,
"message": "Project not found"
}
Projects
Get Project Scenes
Read a project’s pictures and clips, to swap one with Edit Project
GET
/
v1
/
project
/
{projectId}
/
scenes
curl -X GET "https://api.hooked.so/v1/project/cm4x9k2p10001ab12cd34ef56/scenes" \
-H "x-api-key: your_api_key_here"
const projectId = "cm4x9k2p10001ab12cd34ef56";
const response = await fetch(`https://api.hooked.so/v1/project/${projectId}/scenes`, {
headers: { "x-api-key": process.env.HOOKED_API_KEY },
});
const { data } = await response.json();
for (const scene of data.scenes) {
console.log(scene.index, scene.kind, `${scene.startMs}ms`, scene.text);
}
import os
import requests
project_id = "cm4x9k2p10001ab12cd34ef56"
response = requests.get(
f"https://api.hooked.so/v1/project/{project_id}/scenes",
headers={"x-api-key": os.environ["HOOKED_API_KEY"]},
)
for scene in response.json()["data"]["scenes"]:
print(scene["index"], scene["kind"], scene["startMs"], scene["text"])
{
"success": true,
"message": "Scenes fetched successfully",
"data": {
"projectId": "cm4x9k2p10001ab12cd34ef56",
"aspectRatio": "ratio_9_16",
"scenes": [
{
"index": 0,
"kind": "image",
"startMs": 0,
"endMs": 2400,
"text": "Three habits that changed my mornings",
"mediaId": "cm4x9p3r40005ab12gh56ij11",
"url": "https://assets.example.com/scene-0.png",
"prompt": "A sunrise over a quiet kitchen, warm light, steam rising from a coffee cup",
"replaceable": true
},
{
"index": 1,
"kind": "video",
"startMs": 2400,
"endMs": 6000,
"text": "Try them",
"mediaId": null,
"url": "https://assets.example.com/scene-1.mp4",
"prompt": null,
"replaceable": true
}
]
}
}
{
"success": false,
"message": "Project not found"
}
Overview
Answers the pictures and clips of a project in the order they play, as they are on its timeline now. Use it to change one moment of a video without making it again: find the scene, make a new image or clip for it, and swap it in with Edit Project inscenes, by index.
indexcounts from0in play order. Layers that overlap (a picture over a background clip) are listed one after the other.startMsandendMsare milliseconds from the start of the video.textis what the captions say while the scene is on screen, to tell which moment it is.promptis what the scene was generated from. Rework it and generate an image or a clip with the project’saspectRatio; once it isCOMPLETED, swap it in.replaceableisfalsefor a clip that plays its own sound (an avatar speaking, a character’s lines). Swapping it would drop that sound, so it is edited in the dashboard.
Changing one scene
GET /v1/project/{projectId}/scenesand pick the scene by itstextor time.- Make the new media: Generate Image for an image scene, Generate Video for a clip scene (at least as long as the scene), or use one already in your library. Wait until it is
COMPLETED. PATCH /v1/project/{projectId}/editwith{ "scenes": [{ "index": 2, "mediaId": "..." }] }.- Render Project for the new video. Only the new media costs credits; editing and rendering are free.
curl -X GET "https://api.hooked.so/v1/project/cm4x9k2p10001ab12cd34ef56/scenes" \
-H "x-api-key: your_api_key_here"
const projectId = "cm4x9k2p10001ab12cd34ef56";
const response = await fetch(`https://api.hooked.so/v1/project/${projectId}/scenes`, {
headers: { "x-api-key": process.env.HOOKED_API_KEY },
});
const { data } = await response.json();
for (const scene of data.scenes) {
console.log(scene.index, scene.kind, `${scene.startMs}ms`, scene.text);
}
import os
import requests
project_id = "cm4x9k2p10001ab12cd34ef56"
response = requests.get(
f"https://api.hooked.so/v1/project/{project_id}/scenes",
headers={"x-api-key": os.environ["HOOKED_API_KEY"]},
)
for scene in response.json()["data"]["scenes"]:
print(scene["index"], scene["kind"], scene["startMs"], scene["text"])
{
"success": true,
"message": "Scenes fetched successfully",
"data": {
"projectId": "cm4x9k2p10001ab12cd34ef56",
"aspectRatio": "ratio_9_16",
"scenes": [
{
"index": 0,
"kind": "image",
"startMs": 0,
"endMs": 2400,
"text": "Three habits that changed my mornings",
"mediaId": "cm4x9p3r40005ab12gh56ij11",
"url": "https://assets.example.com/scene-0.png",
"prompt": "A sunrise over a quiet kitchen, warm light, steam rising from a coffee cup",
"replaceable": true
},
{
"index": 1,
"kind": "video",
"startMs": 2400,
"endMs": 6000,
"text": "Try them",
"mediaId": null,
"url": "https://assets.example.com/scene-1.mp4",
"prompt": null,
"replaceable": true
}
]
}
}
{
"success": false,
"message": "Project not found"
}
Errors
| Status | When |
|---|---|
| 401 | Missing or invalid API key (code: "not_authenticated") |
| 403 | The team does not have the Hooked app product (code: "entitlement_required") |
| 404 | No such project. Another team’s project, or an id that is not one, answers the same Project not found |
| 500 | Internal server error. Retry |