curl --request POST \
--url https://app.trackplay.io/api/v1/videos/{video}/upload \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file=@example-file \
--form orientation=landscapeimport requests
url = "https://app.trackplay.io/api/v1/videos/{video}/upload"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = { "orientation": "landscape" }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
form.append('orientation', 'landscape');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://app.trackplay.io/api/v1/videos/{video}/upload', 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://app.trackplay.io/api/v1/videos/{video}/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 => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"orientation\"\r\n\r\nlandscape\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data"
],
]);
$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://app.trackplay.io/api/v1/videos/{video}/upload"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"orientation\"\r\n\r\nlandscape\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.trackplay.io/api/v1/videos/{video}/upload")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"orientation\"\r\n\r\nlandscape\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.trackplay.io/api/v1/videos/{video}/upload")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"orientation\"\r\n\r\nlandscape\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"video": {
"id": 123,
"code": "<string>",
"title": "<string>",
"folder_id": 123,
"status": "waiting_for_upload",
"orientations": {
"landscape": {
"status": "waiting_for_upload",
"progress": 123,
"error": "<string>"
},
"portrait": {
"status": "waiting_for_upload",
"progress": 123,
"error": "<string>"
}
},
"plain_mode": true,
"status_url": "<string>",
"embed": {
"script_url": "<string>",
"html": "<string>",
"plain_html": "<string>"
}
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"message": "The given data was invalid.",
"errors": {}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Upload a video in one request
Uploads a video file in one multipart/form-data request, with the file in a file field. Same types as the resumable protocol. One request carries at most 3,000 MB (a larger body gets a 413 from the server before it reaches TrackPlay), and a request that fails partway has to restart from zero, so use it for clips under 100 MB.
The file goes down the same encode and auto-publish pipeline as a dashboard upload, and the video.uploaded webhook fires. Answers 202 with the status to poll.
Requires a token with the videos:write scope.
curl --request POST \
--url https://app.trackplay.io/api/v1/videos/{video}/upload \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file=@example-file \
--form orientation=landscapeimport requests
url = "https://app.trackplay.io/api/v1/videos/{video}/upload"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = { "orientation": "landscape" }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
form.append('orientation', 'landscape');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://app.trackplay.io/api/v1/videos/{video}/upload', 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://app.trackplay.io/api/v1/videos/{video}/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 => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"orientation\"\r\n\r\nlandscape\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data"
],
]);
$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://app.trackplay.io/api/v1/videos/{video}/upload"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"orientation\"\r\n\r\nlandscape\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.trackplay.io/api/v1/videos/{video}/upload")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"orientation\"\r\n\r\nlandscape\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.trackplay.io/api/v1/videos/{video}/upload")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"orientation\"\r\n\r\nlandscape\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"video": {
"id": 123,
"code": "<string>",
"title": "<string>",
"folder_id": 123,
"status": "waiting_for_upload",
"orientations": {
"landscape": {
"status": "waiting_for_upload",
"progress": 123,
"error": "<string>"
},
"portrait": {
"status": "waiting_for_upload",
"progress": 123,
"error": "<string>"
}
},
"plain_mode": true,
"status_url": "<string>",
"embed": {
"script_url": "<string>",
"html": "<string>",
"plain_html": "<string>"
}
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"message": "The given data was invalid.",
"errors": {}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Authorizations
A scoped token minted in Settings → API tokens. Send it as Authorization: Bearer tplt_… or X-API-Key: tplt_….
Headers
Retry-safe key. The first response for a given key is cached for 24 hours and replayed on a repeat, with Idempotency-Replayed: true set.
Path Parameters
The video's numeric ID.
Body
Response
Accepted. The file is stored and on its way to the encoder. Poll GET /videos/{video}/status until status is ready.
The processing status of a video. Returned by every upload call and by GET /videos/{video}/status.
Show child attributes
Show child attributes