SDK
import { createVoyantCloudClient } from "@voyant-travel/cloud-sdk";
const cloud = createVoyantCloudClient({ apiKey: process.env.VOYANT_API_KEY });
const ticket = await cloud.video.videos.createUpload({
"fileSize": 123,
"maxDurationSeconds": 123,
"name": "<string>",
"requireSignedUrls": true,
"allowedOrigins": [
"<string>"
],
"tags": [
"<string>"
],
"watermarkProfileId": "<string>",
"thumbnailTimestampPct": "<string>",
"meta": {}
});curl --request POST \
--url https://api.voyant.travel/video/v1/videos/upload \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"fileSize": 123,
"maxDurationSeconds": 123,
"name": "<string>",
"requireSignedUrls": true,
"allowedOrigins": [
"<string>"
],
"tags": [
"<string>"
],
"watermarkProfileId": "<string>",
"thumbnailTimestampPct": "<string>",
"meta": {}
}'const response = await fetch("https://api.voyant.travel/video/v1/videos/upload", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer <token>"
},
body: JSON.stringify({
"fileSize": 123,
"maxDurationSeconds": 123,
"name": "<string>",
"requireSignedUrls": true,
"allowedOrigins": [
"<string>"
],
"tags": [
"<string>"
],
"watermarkProfileId": "<string>",
"thumbnailTimestampPct": "<string>",
"meta": {}
}),
});
const data = await response.json();import requests
response = requests.post(
"https://api.voyant.travel/video/v1/videos/upload",
headers={
"Authorization": "Bearer <token>"
},
json={
"fileSize": 123,
"maxDurationSeconds": 123,
"name": "<string>",
"requireSignedUrls": True,
"allowedOrigins": [
"<string>"
],
"tags": [
"<string>"
],
"watermarkProfileId": "<string>",
"thumbnailTimestampPct": "<string>",
"meta": {}
}
)
data = response.json()<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.voyant.travel/video/v1/videos/upload",
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([
'fileSize' => 16106127360,
'maxDurationSeconds' => 10800,
'name' => '<string>',
'requireSignedUrls' => true,
'allowedOrigins' => [
'<string>'
],
'tags' => [
'<string>'
],
'watermarkProfileId' => '<string>',
'thumbnailTimestampPct' => 0.5,
'meta' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.voyant.travel/video/v1/videos/upload"
payload := strings.NewReader("{\n \"fileSize\": 16106127360,\n \"maxDurationSeconds\": 10800,\n \"name\": \"<string>\",\n \"requireSignedUrls\": true,\n \"allowedOrigins\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"watermarkProfileId\": \"<string>\",\n \"thumbnailTimestampPct\": 0.5,\n \"meta\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
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.voyant.travel/video/v1/videos/upload")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"fileSize\": 16106127360,\n \"maxDurationSeconds\": 10800,\n \"name\": \"<string>\",\n \"requireSignedUrls\": true,\n \"allowedOrigins\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"watermarkProfileId\": \"<string>\",\n \"thumbnailTimestampPct\": 0.5,\n \"meta\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.voyant.travel/video/v1/videos/upload")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"fileSize\": 16106127360,\n \"maxDurationSeconds\": 10800,\n \"name\": \"<string>\",\n \"requireSignedUrls\": true,\n \"allowedOrigins\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"watermarkProfileId\": \"<string>\",\n \"thumbnailTimestampPct\": 0.5,\n \"meta\": {}\n}"
response = http.request(request)
puts response.read_body{
"data": {
"video": {
"id": "<string>",
"organizationId": "<string>",
"status": "pending_upload",
"readyToStream": true,
"thumbnailTimestampPct": 123,
"requireSignedUrls": true,
"allowedOrigins": [
"<string>"
],
"tags": [
"<string>"
],
"downloadStatus": "disabled",
"meta": {},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"providerVideoUid": "<string>",
"name": "<string>",
"durationSeconds": 123,
"sizeBytes": 123,
"inputWidth": 123,
"inputHeight": 123,
"thumbnailUrl": "<string>",
"playbackHlsUrl": "<string>",
"playbackDashUrl": "<string>",
"maxDurationSeconds": 123,
"maxSizeBytes": 123,
"watermarkProfileId": "<string>",
"downloadReadyAt": "2023-11-07T05:31:56Z",
"errorCode": "<string>",
"errorMessage": "<string>",
"uploadedAt": "2023-11-07T05:31:56Z",
"readyAt": "2023-11-07T05:31:56Z",
"lastEventAt": "2023-11-07T05:31:56Z"
},
"uploadUrl": "<string>",
"uploadExpiresAt": "2023-11-07T05:31:56Z"
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>",
"retryAfterMs": 123
}{
"error": "<string>"
}{
"error": "<string>"
}Video
Create a direct upload
Creates a video record and returns a TUS upload ticket the client uses to upload the file bytes directly. Requires scope: video:upload
POST
/
video
/
v1
/
videos
/
upload
SDK
import { createVoyantCloudClient } from "@voyant-travel/cloud-sdk";
const cloud = createVoyantCloudClient({ apiKey: process.env.VOYANT_API_KEY });
const ticket = await cloud.video.videos.createUpload({
"fileSize": 123,
"maxDurationSeconds": 123,
"name": "<string>",
"requireSignedUrls": true,
"allowedOrigins": [
"<string>"
],
"tags": [
"<string>"
],
"watermarkProfileId": "<string>",
"thumbnailTimestampPct": "<string>",
"meta": {}
});curl --request POST \
--url https://api.voyant.travel/video/v1/videos/upload \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"fileSize": 123,
"maxDurationSeconds": 123,
"name": "<string>",
"requireSignedUrls": true,
"allowedOrigins": [
"<string>"
],
"tags": [
"<string>"
],
"watermarkProfileId": "<string>",
"thumbnailTimestampPct": "<string>",
"meta": {}
}'const response = await fetch("https://api.voyant.travel/video/v1/videos/upload", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer <token>"
},
body: JSON.stringify({
"fileSize": 123,
"maxDurationSeconds": 123,
"name": "<string>",
"requireSignedUrls": true,
"allowedOrigins": [
"<string>"
],
"tags": [
"<string>"
],
"watermarkProfileId": "<string>",
"thumbnailTimestampPct": "<string>",
"meta": {}
}),
});
const data = await response.json();import requests
response = requests.post(
"https://api.voyant.travel/video/v1/videos/upload",
headers={
"Authorization": "Bearer <token>"
},
json={
"fileSize": 123,
"maxDurationSeconds": 123,
"name": "<string>",
"requireSignedUrls": True,
"allowedOrigins": [
"<string>"
],
"tags": [
"<string>"
],
"watermarkProfileId": "<string>",
"thumbnailTimestampPct": "<string>",
"meta": {}
}
)
data = response.json()<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.voyant.travel/video/v1/videos/upload",
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([
'fileSize' => 16106127360,
'maxDurationSeconds' => 10800,
'name' => '<string>',
'requireSignedUrls' => true,
'allowedOrigins' => [
'<string>'
],
'tags' => [
'<string>'
],
'watermarkProfileId' => '<string>',
'thumbnailTimestampPct' => 0.5,
'meta' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.voyant.travel/video/v1/videos/upload"
payload := strings.NewReader("{\n \"fileSize\": 16106127360,\n \"maxDurationSeconds\": 10800,\n \"name\": \"<string>\",\n \"requireSignedUrls\": true,\n \"allowedOrigins\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"watermarkProfileId\": \"<string>\",\n \"thumbnailTimestampPct\": 0.5,\n \"meta\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
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.voyant.travel/video/v1/videos/upload")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"fileSize\": 16106127360,\n \"maxDurationSeconds\": 10800,\n \"name\": \"<string>\",\n \"requireSignedUrls\": true,\n \"allowedOrigins\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"watermarkProfileId\": \"<string>\",\n \"thumbnailTimestampPct\": 0.5,\n \"meta\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.voyant.travel/video/v1/videos/upload")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"fileSize\": 16106127360,\n \"maxDurationSeconds\": 10800,\n \"name\": \"<string>\",\n \"requireSignedUrls\": true,\n \"allowedOrigins\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"watermarkProfileId\": \"<string>\",\n \"thumbnailTimestampPct\": 0.5,\n \"meta\": {}\n}"
response = http.request(request)
puts response.read_body{
"data": {
"video": {
"id": "<string>",
"organizationId": "<string>",
"status": "pending_upload",
"readyToStream": true,
"thumbnailTimestampPct": 123,
"requireSignedUrls": true,
"allowedOrigins": [
"<string>"
],
"tags": [
"<string>"
],
"downloadStatus": "disabled",
"meta": {},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"providerVideoUid": "<string>",
"name": "<string>",
"durationSeconds": 123,
"sizeBytes": 123,
"inputWidth": 123,
"inputHeight": 123,
"thumbnailUrl": "<string>",
"playbackHlsUrl": "<string>",
"playbackDashUrl": "<string>",
"maxDurationSeconds": 123,
"maxSizeBytes": 123,
"watermarkProfileId": "<string>",
"downloadReadyAt": "2023-11-07T05:31:56Z",
"errorCode": "<string>",
"errorMessage": "<string>",
"uploadedAt": "2023-11-07T05:31:56Z",
"readyAt": "2023-11-07T05:31:56Z",
"lastEventAt": "2023-11-07T05:31:56Z"
},
"uploadUrl": "<string>",
"uploadExpiresAt": "2023-11-07T05:31:56Z"
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>",
"retryAfterMs": 123
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
Voyant Cloud API token, passed as Authorization: Bearer <token>. Each token carries a fixed set of scopes; an operation rejects tokens missing its required scope.
Body
application/json
Total file size in bytes. Used as the TUS Upload-Length. Max 30 GB.
Required range:
1 <= x <= 32212254720Cloudflare Stream caps total length at 21,600 seconds (6 hours).
Required range:
1 <= x <= 21600Maximum string length:
200Maximum array length:
20Maximum string length:
253Maximum array length:
50Maximum string length:
64Maximum string length:
120Required range:
0 <= x <= 1Show child attributes
Show child attributes
Response
Upload ticket
Show child attributes
Show child attributes
⌘I