Generate Hook
curl --request POST \
--url https://api.usenarrative.ai/api/v1/hooks/generate \
--header 'Content-Type: application/json' \
--data '
{
"continuous_video_url": "https://cdn.usenarrative.ai/prepared/continuous_abc123.mp4",
"transcript_url": "https://cdn.usenarrative.ai/prepared/transcript_abc123.json",
"hook_type": "fine_cut"
}
'import requests
url = "https://api.usenarrative.ai/api/v1/hooks/generate"
payload = {
"continuous_video_url": "https://cdn.usenarrative.ai/prepared/continuous_abc123.mp4",
"transcript_url": "https://cdn.usenarrative.ai/prepared/transcript_abc123.json",
"hook_type": "fine_cut"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
continuous_video_url: 'https://cdn.usenarrative.ai/prepared/continuous_abc123.mp4',
transcript_url: 'https://cdn.usenarrative.ai/prepared/transcript_abc123.json',
hook_type: 'fine_cut'
})
};
fetch('https://api.usenarrative.ai/api/v1/hooks/generate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.usenarrative.ai/api/v1/hooks/generate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'continuous_video_url' => 'https://cdn.usenarrative.ai/prepared/continuous_abc123.mp4',
'transcript_url' => 'https://cdn.usenarrative.ai/prepared/transcript_abc123.json',
'hook_type' => 'fine_cut'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.usenarrative.ai/api/v1/hooks/generate"
payload := strings.NewReader("{\n \"continuous_video_url\": \"https://cdn.usenarrative.ai/prepared/continuous_abc123.mp4\",\n \"transcript_url\": \"https://cdn.usenarrative.ai/prepared/transcript_abc123.json\",\n \"hook_type\": \"fine_cut\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.usenarrative.ai/api/v1/hooks/generate")
.header("Content-Type", "application/json")
.body("{\n \"continuous_video_url\": \"https://cdn.usenarrative.ai/prepared/continuous_abc123.mp4\",\n \"transcript_url\": \"https://cdn.usenarrative.ai/prepared/transcript_abc123.json\",\n \"hook_type\": \"fine_cut\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usenarrative.ai/api/v1/hooks/generate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"continuous_video_url\": \"https://cdn.usenarrative.ai/prepared/continuous_abc123.mp4\",\n \"transcript_url\": \"https://cdn.usenarrative.ai/prepared/transcript_abc123.json\",\n \"hook_type\": \"fine_cut\"\n}"
response = http.request(request)
puts response.read_body{
"video_url": "https://cdn.usenarrative.ai/hooks/hook_abc123.mp4",
"hook_duration_sec": 35.5,
"cliffhanger_timestamp_sec": 756.8,
"hook_type": "fine_cut"
}{
"detail": "Invalid video URL provided"
}{
"detail": "Invalid video URL provided"
}Hooks
Generate Hook
Create engaging social media hooks with cliffhangers
POST
/
api
/
v1
/
hooks
/
generate
Generate Hook
curl --request POST \
--url https://api.usenarrative.ai/api/v1/hooks/generate \
--header 'Content-Type: application/json' \
--data '
{
"continuous_video_url": "https://cdn.usenarrative.ai/prepared/continuous_abc123.mp4",
"transcript_url": "https://cdn.usenarrative.ai/prepared/transcript_abc123.json",
"hook_type": "fine_cut"
}
'import requests
url = "https://api.usenarrative.ai/api/v1/hooks/generate"
payload = {
"continuous_video_url": "https://cdn.usenarrative.ai/prepared/continuous_abc123.mp4",
"transcript_url": "https://cdn.usenarrative.ai/prepared/transcript_abc123.json",
"hook_type": "fine_cut"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
continuous_video_url: 'https://cdn.usenarrative.ai/prepared/continuous_abc123.mp4',
transcript_url: 'https://cdn.usenarrative.ai/prepared/transcript_abc123.json',
hook_type: 'fine_cut'
})
};
fetch('https://api.usenarrative.ai/api/v1/hooks/generate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.usenarrative.ai/api/v1/hooks/generate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'continuous_video_url' => 'https://cdn.usenarrative.ai/prepared/continuous_abc123.mp4',
'transcript_url' => 'https://cdn.usenarrative.ai/prepared/transcript_abc123.json',
'hook_type' => 'fine_cut'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.usenarrative.ai/api/v1/hooks/generate"
payload := strings.NewReader("{\n \"continuous_video_url\": \"https://cdn.usenarrative.ai/prepared/continuous_abc123.mp4\",\n \"transcript_url\": \"https://cdn.usenarrative.ai/prepared/transcript_abc123.json\",\n \"hook_type\": \"fine_cut\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.usenarrative.ai/api/v1/hooks/generate")
.header("Content-Type", "application/json")
.body("{\n \"continuous_video_url\": \"https://cdn.usenarrative.ai/prepared/continuous_abc123.mp4\",\n \"transcript_url\": \"https://cdn.usenarrative.ai/prepared/transcript_abc123.json\",\n \"hook_type\": \"fine_cut\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usenarrative.ai/api/v1/hooks/generate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"continuous_video_url\": \"https://cdn.usenarrative.ai/prepared/continuous_abc123.mp4\",\n \"transcript_url\": \"https://cdn.usenarrative.ai/prepared/transcript_abc123.json\",\n \"hook_type\": \"fine_cut\"\n}"
response = http.request(request)
puts response.read_body{
"video_url": "https://cdn.usenarrative.ai/hooks/hook_abc123.mp4",
"hook_duration_sec": 35.5,
"cliffhanger_timestamp_sec": 756.8,
"hook_type": "fine_cut"
}{
"detail": "Invalid video URL provided"
}{
"detail": "Invalid video URL provided"
}POST /api/v1/hooks/generate
Generate an engaging hook from prepared video content. Supports multiple hook types optimized for social media engagement, each with automatic cliffhanger detection.Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| continuous_video_url | URL | Yes | URL to the prepared continuous video |
| transcript_url | URL | Yes | URL to the transcript JSON file |
| hook_type | enum | Yes | Type of hook: fine_cut, compilation, or narration |
Hook Types
| Type | Description |
|---|---|
fine_cut | Single complete scene (20-40s) with high drama, no edits |
compilation | Flashback structure: Setup → Flashback → Continuation |
narration | TikTok-style edit with AI voiceover (3-4 segments) |
Response
| Field | Description |
|---|---|
| video_url | URL to the generated hook video |
| hook_duration_sec | Duration of the hook in seconds |
| cliffhanger_timestamp_sec | Timestamp where the video cuts to cliffhanger |
| hook_type | Type of hook that was generated |
Example Request
curl -X POST https://api.usenarrative.ai/api/v1/hooks/generate \
-H "Content-Type: application/json" \
-d '{
"continuous_video_url": "https://cdn.usenarrative.ai/prepared/continuous_abc123.mp4",
"transcript_url": "https://cdn.usenarrative.ai/prepared/transcript_abc123.json",
"hook_type": "fine_cut"
}'
Example Response
{
"video_url": "https://cdn.usenarrative.ai/hooks/hook_abc123.mp4",
"hook_duration_sec": 35.5,
"cliffhanger_timestamp_sec": 756.8,
"hook_type": "fine_cut"
}
Hook Type Details
Fine Cut
- Finds one complete, engaging scene from the video
- 20-40 seconds of continuous playback with no edits
- Identifies scenes with dramatic arc (beginning, middle, end)
Compilation
- Creates a three-part narrative structure
- Setup (8-10s): Characters discussing a past event
- Flashback (10-15s): The actual scene from earlier
- Continuation (8-10s): Return to present with reaction
Narration
- TikTok-style edit with AI-generated voiceover
- 3-4 video segments from any timestamp, in any order
- Each segment has 12-18 word narration overlay
- Builds suspense and intrigue
Notes
- Requires output from the Prepare Video endpoint
- Cliffhanger is detected 12-18 minutes after the hook ends
- Hook is designed to maximize viewer engagement and watch-through
Body
application/json
URL to the prepared continuous video
Example:
"https://cdn.usenarrative.ai/prepared/continuous_abc123.mp4"
URL to the transcript JSON file
Example:
"https://cdn.usenarrative.ai/prepared/transcript_abc123.json"
Type of hook to generate
Available options:
fine_cut, compilation, narration Example:
"fine_cut"
Response
Hook generated successfully
URL to the generated hook video
Example:
"https://cdn.usenarrative.ai/hooks/hook_abc123.mp4"
Duration of the hook in seconds
Example:
35.5
Timestamp where the video cuts to cliffhanger
Example:
756.8
Type of hook that was generated
Available options:
fine_cut, compilation, narration Example:
"fine_cut"

