> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hooked.so/llms.txt
> Use this file to discover all available pages before exploring further.

# List Templates

> Get all your video templates

## 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.so/v1/template/list
```

## Query Parameters

<ParamField query="type" type="string">
  Filter by video type: `class`, `ugc_ads`, `ugc_video`, `script_to_video`, `hook_demo`, `product_ads`, `scenes`, `tiktok_slideshow`
</ParamField>

<ParamField query="limit" type="number" default="50">
  Number of results (max: 100)
</ParamField>

<ParamField query="offset" type="number" default="0">
  Pagination offset
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET "https://api.hooked.so/v1/template/list" \
    -H "x-api-key: your_api_key_here"
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://api.hooked.so/v1/template/list', {
    headers: { 'x-api-key': 'your_api_key_here' }
  });

  const { templates } = (await response.json()).data;
  console.log(`Found ${templates.length} templates`);
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      'https://api.hooked.so/v1/template/list',
      headers={'x-api-key': 'your_api_key_here'}
  )
  templates = response.json()['data']['templates']
  print(f'Found {len(templates)} templates')
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "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
    }
  }
  ```
</ResponseExample>

## Using Templates

Once you have a template, create personalized videos by replacing variables:

```javascript theme={null}
const template = templates[0];

const response = await fetch('https://api.hooked.so/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'
  })
});
```

## Related

<CardGroup cols={2}>
  <Card title="Template Personalization" icon="sparkles" href="/examples/template-personalization">
    Complete personalization example
  </Card>

  <Card title="Scenes & Variables" icon="brackets-curly" href="/guides/scenes-and-variables">
    Learn about the template system
  </Card>

  <Card title="Bulk Generation" icon="layer-group" href="/guides/bulk-generation">
    Generate videos at scale
  </Card>

  <Card title="List Videos" icon="list" href="/api-reference/video/list">
    View generated videos
  </Card>
</CardGroup>
