Examples
End-to-end examples for common workflows.
Managed Clip From A YouTube URL
CLIP=$(curl -s -X POST https://www.blitzreels.com/api/v1/clips \
-H "Authorization: Bearer $BLITZREELS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"project_name": "Demo short",
"source": {
"source_type": "youtube",
"youtube_url": "https://www.youtube.com/watch?v=VIDEO_ID"
},
"selection": {
"selection_mode": "auto_best"
},
"target": {
"aspect_ratio": "9:16",
"min_duration_seconds": 8,
"max_duration_seconds": 45
},
"layout": {
"layout_mode": "auto",
"content_type_hint": "auto"
},
"captions": {
"enabled": true
},
"qa": {
"qa_mode": "permissive"
},
"export": {
"auto_export": false
}
}')
CLIP_ID=$(echo "$CLIP" | jq -r '.clip.clip_id')
curl https://www.blitzreels.com/api/v1/clips/$CLIP_ID \
-H "Authorization: Bearer $BLITZREELS_API_KEY"Low-Level Suggestion Apply
Use this when you already have a workspace media asset and need manual control instead of the managed /clips workflow:
- ingest into a project
- wait for clipping readiness
- get short suggestions
- apply one suggestion
- verify captions and duration
- export
# 1) Create project
PROJECT=$(curl -s -X POST https://www.blitzreels.com/api/v1/projects \
-H "Authorization: Bearer $BLITZREELS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"Backend clip","aspect_ratio":"9:16"}')
PROJECT_ID=$(echo "$PROJECT" | jq -r .id)
# 2) Force transcript if the automatic pipeline is not ready yet
JOB=$(curl -s -X POST https://www.blitzreels.com/api/v1/projects/$PROJECT_ID/transcribe \
-H "Authorization: Bearer $BLITZREELS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"media_id":"MEDIA_ID","force":true,"auto_suggest_shorts":true}')
JOB_ID=$(echo "$JOB" | jq -r .job_id)
# 3) Poll clipping readiness and suggestions
curl "https://www.blitzreels.com/api/v1/workspace/media/assets/MEDIA_ID/clipping-status?project_id=$PROJECT_ID" \
-H "Authorization: Bearer $BLITZREELS_API_KEY"
curl "https://www.blitzreels.com/api/v1/projects/$PROJECT_ID/transcript?media_id=MEDIA_ID" \
-H "Authorization: Bearer $BLITZREELS_API_KEY"
curl https://www.blitzreels.com/api/v1/workspace/media/assets/MEDIA_ID/short-suggestions \
-H "Authorization: Bearer $BLITZREELS_API_KEY"
# 4) Apply one suggestion directly to the project
APPLY=$(curl -s -X POST https://www.blitzreels.com/api/v1/workspace/media/assets/MEDIA_ID/short-suggestions/SUGGESTION_ID/apply \
-H "Authorization: Bearer $BLITZREELS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"project_id":"'"$PROJECT_ID"'",
"caption_style_id":"viral-center",
"mark_saved":true
}')
ITEM_ID=$(echo "$APPLY" | jq -r '.timeline_item_id')
# 5) Verify resulting timeline
curl "https://www.blitzreels.com/api/v1/projects/$PROJECT_ID/context?mode=timeline" \
-H "Authorization: Bearer $BLITZREELS_API_KEY"
# 6) Export
curl -X POST https://www.blitzreels.com/api/v1/projects/$PROJECT_ID/export \
-H "Authorization: Bearer $BLITZREELS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"resolution":"1080p","format":"mp4"}'Export When Ready
EXPORT=$(curl -s -X POST https://www.blitzreels.com/api/v1/projects/$PROJECT_ID/export \
-H "Authorization: Bearer $BLITZREELS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"resolution":"1080p"}')
EXPORT_ID=$(echo "$EXPORT" | jq -r .export_id)
curl https://www.blitzreels.com/api/v1/exports/$EXPORT_ID \
-H "Authorization: Bearer $BLITZREELS_API_KEY"Webhook Receiver (Node)
import crypto from "crypto";
export async function POST(req: Request) {
const signature = req.headers.get("x-blitzreels-signature") ?? "";
const timestamp = req.headers.get("x-blitzreels-timestamp") ?? "";
const body = await req.text();
const expected = crypto
.createHmac("sha256", process.env.WEBHOOK_SECRET ?? "")
.update(`${timestamp}.${body}`)
.digest("hex");
if (signature !== expected) {
return new Response("Invalid signature", { status: 401 });
}
return new Response("ok", { status: 200 });
}Trim a Clip
curl -X POST https://www.blitzreels.com/api/v1/projects/$PROJECT_ID/timeline/trim \
-H "Authorization: Bearer $BLITZREELS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"timeline_item_id": "timeline-item-uuid",
"trim_start_delta_seconds": 1.0,
"trim_end_delta_seconds": 0.5
}'Emphasize Caption Words
curl -X POST https://www.blitzreels.com/api/v1/projects/$PROJECT_ID/captions/words/emphasis \
-H "Authorization: Bearer $BLITZREELS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"emphasis": true,
"match_pattern": "numbers"
}'Bulk Transcript Corrections
curl -X POST https://www.blitzreels.com/api/v1/projects/$PROJECT_ID/transcript/corrections \
-H "Authorization: Bearer $BLITZREELS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"media_asset_id": "media-asset-uuid",
"replacements": [
{ "from": "Virgil", "to": "Virgile", "match_case": false, "match_whole_word": true }
]
}'