Upload a video
curl --request POST \
--url https://api.memories.ai/serve/datalake/v1/videos \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"collection_id": "col_xxx",
"source_url": "https://cdn.example.com/a.mp4",
"fps": 1
}
'import requests
url = "https://api.memories.ai/serve/datalake/v1/videos"
payload = {
"collection_id": "col_xxx",
"source_url": "https://cdn.example.com/a.mp4",
"fps": 1
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({collection_id: 'col_xxx', source_url: 'https://cdn.example.com/a.mp4', fps: 1})
};
fetch('https://api.memories.ai/serve/datalake/v1/videos', 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.memories.ai/serve/datalake/v1/videos",
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([
'collection_id' => 'col_xxx',
'source_url' => 'https://cdn.example.com/a.mp4',
'fps' => 1
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.memories.ai/serve/datalake/v1/videos"
payload := strings.NewReader("{\n \"collection_id\": \"col_xxx\",\n \"source_url\": \"https://cdn.example.com/a.mp4\",\n \"fps\": 1\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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.memories.ai/serve/datalake/v1/videos")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"collection_id\": \"col_xxx\",\n \"source_url\": \"https://cdn.example.com/a.mp4\",\n \"fps\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.memories.ai/serve/datalake/v1/videos")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"collection_id\": \"col_xxx\",\n \"source_url\": \"https://cdn.example.com/a.mp4\",\n \"fps\": 1\n}"
response = http.request(request)
puts response.read_body{
"video_id": "vid_xxx",
"operation": "op_xxx",
"status": "processing"
}Upload
Upload Video — from URL
Upload a video by URL
POST
/
datalake
/
v1
/
videos
Upload a video
curl --request POST \
--url https://api.memories.ai/serve/datalake/v1/videos \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"collection_id": "col_xxx",
"source_url": "https://cdn.example.com/a.mp4",
"fps": 1
}
'import requests
url = "https://api.memories.ai/serve/datalake/v1/videos"
payload = {
"collection_id": "col_xxx",
"source_url": "https://cdn.example.com/a.mp4",
"fps": 1
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({collection_id: 'col_xxx', source_url: 'https://cdn.example.com/a.mp4', fps: 1})
};
fetch('https://api.memories.ai/serve/datalake/v1/videos', 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.memories.ai/serve/datalake/v1/videos",
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([
'collection_id' => 'col_xxx',
'source_url' => 'https://cdn.example.com/a.mp4',
'fps' => 1
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.memories.ai/serve/datalake/v1/videos"
payload := strings.NewReader("{\n \"collection_id\": \"col_xxx\",\n \"source_url\": \"https://cdn.example.com/a.mp4\",\n \"fps\": 1\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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.memories.ai/serve/datalake/v1/videos")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"collection_id\": \"col_xxx\",\n \"source_url\": \"https://cdn.example.com/a.mp4\",\n \"fps\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.memories.ai/serve/datalake/v1/videos")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"collection_id\": \"col_xxx\",\n \"source_url\": \"https://cdn.example.com/a.mp4\",\n \"fps\": 1\n}"
response = http.request(request)
puts response.read_body{
"video_id": "vid_xxx",
"operation": "op_xxx",
"status": "processing"
}Product: Video Datalake
Host:
https://api.memories.ai/serve/datalake/v1
Auth: Authorization: sk-mai-...202 + a video_id and an operation you poll to done. For local files use Upload — from File; for very large files use Resumable Upload.
Pricing: $0.05 / minute of indexed video · See Pricing for the full model.
Response Fields
string
New video ID (
vid_ prefix).string
Ingest Operation handle; poll Get Operation.
string
Always
processing right after acceptance.Notes
Balance precheck: a balance ≤0 returns 402 quota_exceeded.Authorizations
Send Authorization: sk-mai-...
Query Parameters
Set to resumable to start a chunked upload session for large files.
Available options:
resumable Body
application/jsonmultipart/form-data
Target collection. The video inherits its embedding model / detectors / face config.
URL mode only: a public direct link. Platform links (YouTube/TikTok) fail with source_unresolved.
Sampling frame rate [0.1, 30]. Default 1.0.
ISO-8601 capture time (falls back to video EXIF).
Show child attributes
Show child attributes
{title, tags:[], custom:{}}. Set title to the original filename.
HTTPS webhook, ≤512 chars, fired on completion.
≤128 chars. Same key re-submits the existing video.
Response
200 - application/json
Accepted
