API DocsVideosCreate a video

Create a video

POST/api/video/create
videos:write

Create a video record before uploading media.

Examples

curl
curl https://flare.link/api/video/create \
  -H "Authorization: Bearer flr_pat_..." \
  -H "Content-Type: application/json" \
  -d '{
    "fileName": "demo.mp4",
    "s3Key": "vid_demo_123",
    "source": "composite",
    "width": 1920,
    "height": 1080,
    "duration": 120
  }'
node
const res = await fetch("https://flare.link/api/video/create", {
  method: "POST",
  headers: {
    Authorization: "Bearer flr_pat_...",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    fileName: "demo.mp4",
    s3Key: "vid_demo_123",
    source: "composite",
    width: 1920,
    height: 1080,
    duration: 120
  })
});
const data = await res.json();
python
import requests

payload = {
  "fileName": "demo.mp4",
  "s3Key": "vid_demo_123",
  "source": "composite"
}
res = requests.post(
  "https://flare.link/api/video/create",
  headers={"Authorization": "Bearer flr_pat_..."},
  json=payload
)
print(res.json())
ruby
require "net/http"
require "json"

uri = URI("https://flare.link/api/video/create")
req = Net::HTTP::Post.new(uri)
req["Authorization"] = "Bearer flr_pat_..."
req["Content-Type"] = "application/json"
req.body = { fileName: "demo.mp4", s3Key: "vid_demo_123", source: "composite" }.to_json
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
puts res.body
go
package main

import (
  "bytes"
  "fmt"
  "io"
  "net/http"
)

func main() {
  payload := []byte(`{"fileName":"demo.mp4","s3Key":"vid_demo_123","source":"composite"}`)
  req, _ := http.NewRequest("POST", "https://flare.link/api/video/create", bytes.NewBuffer(payload))
  req.Header.Set("Authorization", "Bearer flr_pat_...")
  req.Header.Set("Content-Type", "application/json")
  resp, _ := http.DefaultClient.Do(req)
  body, _ := io.ReadAll(resp.Body)
  fmt.Println(string(body))
}
php
<?php
$payload = json_encode([
  "fileName" => "demo.mp4",
  "s3Key" => "vid_demo_123",
  "source" => "composite"
]);
$ch = curl_init("https://flare.link/api/video/create");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
  "Authorization: Bearer flr_pat_...",
  "Content-Type: application/json"
]);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
csharp
using System.Net.Http.Headers;
using System.Text;
using System.Text.Json;

using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "flr_pat_...");
var payload = JsonSerializer.Serialize(new { fileName = "demo.mp4", s3Key = "vid_demo_123", source = "composite" });
var res = await client.PostAsync("https://flare.link/api/video/create", new StringContent(payload, Encoding.UTF8, "application/json"));
var body = await res.Content.ReadAsStringAsync();

Expected response

{
  "success": true,
  "video": {
    "id": "vid_demo_123",
    "uploadStatus": "uploading"
  }
}