Upload an asset
curl --request POST \
--url https://api.argil.ai/v1/assets \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "my-broll-clip",
"type": "VIDEO",
"url": "https://example.com/clip.mp4"
}
'import requests
url = "https://api.argil.ai/v1/assets"
payload = {
"name": "my-broll-clip",
"type": "VIDEO",
"url": "https://example.com/clip.mp4"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'my-broll-clip', type: 'VIDEO', url: 'https://example.com/clip.mp4'})
};
fetch('https://api.argil.ai/v1/assets', 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.argil.ai/v1/assets",
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([
'name' => 'my-broll-clip',
'type' => 'VIDEO',
'url' => 'https://example.com/clip.mp4'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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.argil.ai/v1/assets"
payload := strings.NewReader("{\n \"name\": \"my-broll-clip\",\n \"type\": \"VIDEO\",\n \"url\": \"https://example.com/clip.mp4\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.argil.ai/v1/assets")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"my-broll-clip\",\n \"type\": \"VIDEO\",\n \"url\": \"https://example.com/clip.mp4\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.argil.ai/v1/assets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"my-broll-clip\",\n \"type\": \"VIDEO\",\n \"url\": \"https://example.com/clip.mp4\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"type": "AUDIO",
"status": "PROCESSING",
"fileUrl": "<string>",
"thumbnailUrl": "<string>",
"createdAt": "2023-11-07T05:31:56Z"
}{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"type": "AUDIO",
"status": "PROCESSING",
"fileUrl": "<string>",
"thumbnailUrl": "<string>",
"createdAt": "2023-11-07T05:31:56Z"
}{
"code": 123,
"message": "<string>"
}{
"code": 123,
"message": "<string>"
}Assets
Upload Asset
Upload an image or video asset via URL for use as B-roll
POST
/
assets
Upload an asset
curl --request POST \
--url https://api.argil.ai/v1/assets \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "my-broll-clip",
"type": "VIDEO",
"url": "https://example.com/clip.mp4"
}
'import requests
url = "https://api.argil.ai/v1/assets"
payload = {
"name": "my-broll-clip",
"type": "VIDEO",
"url": "https://example.com/clip.mp4"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'my-broll-clip', type: 'VIDEO', url: 'https://example.com/clip.mp4'})
};
fetch('https://api.argil.ai/v1/assets', 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.argil.ai/v1/assets",
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([
'name' => 'my-broll-clip',
'type' => 'VIDEO',
'url' => 'https://example.com/clip.mp4'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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.argil.ai/v1/assets"
payload := strings.NewReader("{\n \"name\": \"my-broll-clip\",\n \"type\": \"VIDEO\",\n \"url\": \"https://example.com/clip.mp4\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.argil.ai/v1/assets")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"my-broll-clip\",\n \"type\": \"VIDEO\",\n \"url\": \"https://example.com/clip.mp4\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.argil.ai/v1/assets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"my-broll-clip\",\n \"type\": \"VIDEO\",\n \"url\": \"https://example.com/clip.mp4\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"type": "AUDIO",
"status": "PROCESSING",
"fileUrl": "<string>",
"thumbnailUrl": "<string>",
"createdAt": "2023-11-07T05:31:56Z"
}{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"type": "AUDIO",
"status": "PROCESSING",
"fileUrl": "<string>",
"thumbnailUrl": "<string>",
"createdAt": "2023-11-07T05:31:56Z"
}{
"code": 123,
"message": "<string>"
}{
"code": 123,
"message": "<string>"
}Upload an image or video by providing a publicly accessible URL. The asset is downloaded and processed asynchronously.
Usage Flow
- Call
POST /assetswith the asset URL, name, and type - Receive the asset ID with
status: PROCESSING - Poll
GET /assets/{id}untilstatusisREADY - Use the asset ID in
POST /videoswithbroll.type: UPLOAD
Example
# 1. Upload
curl -X POST https://api.argil.ai/v1/assets \
-H "Authorization: ApiKey YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "product-demo",
"type": "VIDEO",
"url": "https://example.com/demo.mp4"
}'
# 2. Poll until ready
curl https://api.argil.ai/v1/assets/ASSET_ID \
-H "Authorization: ApiKey YOUR_KEY"
# 3. Use as B-roll in a video
curl -X POST https://api.argil.ai/v1/videos \
-H "Authorization: ApiKey YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "my-video",
"type": "moments",
"moments": [{
"transcript": "Check out our product",
"avatarId": "...",
"voiceId": "...",
"broll": {
"type": "UPLOAD",
"assetId": "ASSET_ID"
}
}]
}'
Authorizations
API key to be included in the x-api-key header
Body
application/json
Response
Duplicate asset found — existing asset returned
Available options:
AUDIO, IMAGE, VIDEO Processing status. Poll until READY before using as B-roll.
Available options:
PROCESSING, READY, FAILED URL to access the asset. Null while processing.
URL to a thumbnail image. Null while processing.
Was this page helpful?
