curl --request POST \
--url https://api.zebratruth.ai/v1/compliance/media/upload-url \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"contentType": "video/mp4"
}
'import requests
url = "https://api.zebratruth.ai/v1/compliance/media/upload-url"
payload = { "contentType": "video/mp4" }
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({contentType: 'video/mp4'})
};
fetch('https://api.zebratruth.ai/v1/compliance/media/upload-url', 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.zebratruth.ai/v1/compliance/media/upload-url",
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([
'contentType' => 'video/mp4'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-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.zebratruth.ai/v1/compliance/media/upload-url"
payload := strings.NewReader("{\n \"contentType\": \"video/mp4\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
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.zebratruth.ai/v1/compliance/media/upload-url")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"contentType\": \"video/mp4\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zebratruth.ai/v1/compliance/media/upload-url")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"contentType\": \"video/mp4\"\n}"
response = http.request(request)
puts response.read_body{
"uploadUrl": "https://zebratruthstorage.blob.core.windows.net/videos/.../source.mp4?...sig=...",
"blobPath": "videos/kp_abc123.../82b68316-.../source.mp4",
"requestId": "82b68316-ed85-489c-991e-2ff0f2b95f29",
"requiredTags": {
"tenantId": "<string>",
"requestId": "<string>",
"kind": "video"
},
"uploadInstructions": {
"method": "PUT",
"headers": {}
}
}{
"statusCode": 401,
"message": "Invalid API key",
"error": true,
"url": "https://api.zebratruth.ai/v1/whoami",
"statusMessage": "Invalid API key"
}{
"statusCode": 402,
"message": "Insufficient credits",
"error": true,
"url": "<string>",
"statusMessage": "Insufficient credits",
"data": {
"creditsRemaining": 3,
"creditsNeeded": 123,
"upgradeUrl": "https://developers.zebratruth.ai/dashboard/billing"
}
}{
"statusCode": 403,
"message": "Requested jurisdictions [india, china] are not in your subscription. Allowed: [us, eu].",
"error": true,
"url": "https://api.zebratruth.ai/v1/compliance/check",
"statusMessage": "Requested jurisdictions [india, china] are not in your subscription. Allowed: [us, eu]."
}{
"statusCode": 429,
"message": "Rate limit exceeded",
"error": true,
"url": "<string>",
"statusMessage": "Rate limit exceeded",
"data": {
"retryAfter": 5,
"limit": 60,
"remaining": 0
}
}Mint a video upload URL
Returns a tenant-scoped, short-lived (15 min) SAS URL the client uses
to PUT video bytes directly to blob storage — bypassing the API
for the upload itself. The returned requestId is the handle for the
subsequent POST /compliance/check-video call.
Why direct upload? Videos can be up to 200 MB. Streaming them through the API endpoint would add latency, double bandwidth costs, and hit serverless function timeout limits. Direct-to-blob upload is the same pattern major cloud object stores use for large files.
Allowed content types: video/mp4, video/webm, video/quicktime.
The duration limits (3–180s) and file-size cap (200 MB) are enforced
by the subsequent check-video call’s probe step — not at upload time.
The PUT must include the returned uploadInstructions.headers
verbatim (they carry ownership tags + the storage x-ms-blob-type header).
curl --request POST \
--url https://api.zebratruth.ai/v1/compliance/media/upload-url \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"contentType": "video/mp4"
}
'import requests
url = "https://api.zebratruth.ai/v1/compliance/media/upload-url"
payload = { "contentType": "video/mp4" }
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({contentType: 'video/mp4'})
};
fetch('https://api.zebratruth.ai/v1/compliance/media/upload-url', 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.zebratruth.ai/v1/compliance/media/upload-url",
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([
'contentType' => 'video/mp4'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-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.zebratruth.ai/v1/compliance/media/upload-url"
payload := strings.NewReader("{\n \"contentType\": \"video/mp4\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
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.zebratruth.ai/v1/compliance/media/upload-url")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"contentType\": \"video/mp4\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zebratruth.ai/v1/compliance/media/upload-url")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"contentType\": \"video/mp4\"\n}"
response = http.request(request)
puts response.read_body{
"uploadUrl": "https://zebratruthstorage.blob.core.windows.net/videos/.../source.mp4?...sig=...",
"blobPath": "videos/kp_abc123.../82b68316-.../source.mp4",
"requestId": "82b68316-ed85-489c-991e-2ff0f2b95f29",
"requiredTags": {
"tenantId": "<string>",
"requestId": "<string>",
"kind": "video"
},
"uploadInstructions": {
"method": "PUT",
"headers": {}
}
}{
"statusCode": 401,
"message": "Invalid API key",
"error": true,
"url": "https://api.zebratruth.ai/v1/whoami",
"statusMessage": "Invalid API key"
}{
"statusCode": 402,
"message": "Insufficient credits",
"error": true,
"url": "<string>",
"statusMessage": "Insufficient credits",
"data": {
"creditsRemaining": 3,
"creditsNeeded": 123,
"upgradeUrl": "https://developers.zebratruth.ai/dashboard/billing"
}
}{
"statusCode": 403,
"message": "Requested jurisdictions [india, china] are not in your subscription. Allowed: [us, eu].",
"error": true,
"url": "https://api.zebratruth.ai/v1/compliance/check",
"statusMessage": "Requested jurisdictions [india, china] are not in your subscription. Allowed: [us, eu]."
}{
"statusCode": 429,
"message": "Rate limit exceeded",
"error": true,
"url": "<string>",
"statusMessage": "Rate limit exceeded",
"data": {
"retryAfter": 5,
"limit": 60,
"remaining": 0
}
}Authorizations
API key starting with zt_live_ (production) or zt_test_ (sandbox).
Get your key at https://developers.zebratruth.ai
Headers
Body
Response
Upload URL minted