Overview
Retrieve all templates in your account. Templates are pre-configured video setups with {{variables}} that you can reuse to generate personalized videos at scale.
Endpoint
GET https://api.hooked.ai/v1/template/list
Query Parameters
Filter by video type: class, ugc_ads, ugc_video, script_to_video, hook_demo, product_ads, scenes, tiktok_slideshow
Number of results (max: 100)
curl -X GET "https://api.hooked.ai/v1/template/list" \
-H "x-api-key: your_api_key_here"
{
"success": true,
"data": {
"templates": [
{
"id": "tmpl_abc123",
"name": "Sales Outreach",
"type": "class",
"script": "Hi {{name}}! I noticed {{company}} is growing fast...",
"variables": ["name", "company"],
"avatarId": "avatar_sarah_01",
"voiceId": "tzX5paJ07p5hyWFcU3uG",
"scenes": [
{
"script": "Hi {{name}}! Welcome to {{company}}.",
"variables": [
{ "key": "name", "value": "" },
{ "key": "company", "value": "" }
]
}
],
"createdAt": "2024-01-15T10:00:00Z"
}
],
"total": 1,
"limit": 50,
"offset": 0
}
}
Using Templates
Once you have a template, create personalized videos by replacing variables:
const template = templates[0];
const response = await fetch('https://api.hooked.ai/v1/project/create', {
method: 'POST',
headers: {
'x-api-key': 'your_api_key_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({
type: template.type,
templateId: template.id,
scenes: template.scenes.map(scene => ({
...scene,
variables: scene.variables.map(v => ({
key: v.key,
value: myData[v.key]
}))
})),
webhook: 'https://your-domain.com/webhook'
})
});