Files
Start a file upload
POST
/
v1
/
files
Start a file upload
curl --request POST \
--url https://api.vturb.com/v1/files \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "My thumbnail",
"filename": "mythumbnail.jpg",
"content_type": "image/jpeg",
"size": 184856,
"checksum": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"folder_id": "6890000000000000000000a1"
}
'import requests
url = "https://api.vturb.com/v1/files"
payload = {
"name": "My thumbnail",
"filename": "mythumbnail.jpg",
"content_type": "image/jpeg",
"size": 184856,
"checksum": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"folder_id": "6890000000000000000000a1"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'My thumbnail',
filename: 'mythumbnail.jpg',
content_type: 'image/jpeg',
size: 184856,
checksum: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
folder_id: '6890000000000000000000a1'
})
};
fetch('https://api.vturb.com/v1/files', 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.vturb.com/v1/files",
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 thumbnail',
'filename' => 'mythumbnail.jpg',
'content_type' => 'image/jpeg',
'size' => 184856,
'checksum' => 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
'folder_id' => '6890000000000000000000a1'
]),
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.vturb.com/v1/files"
payload := strings.NewReader("{\n \"name\": \"My thumbnail\",\n \"filename\": \"mythumbnail.jpg\",\n \"content_type\": \"image/jpeg\",\n \"size\": 184856,\n \"checksum\": \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\n \"folder_id\": \"6890000000000000000000a1\"\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.vturb.com/v1/files")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"My thumbnail\",\n \"filename\": \"mythumbnail.jpg\",\n \"content_type\": \"image/jpeg\",\n \"size\": 184856,\n \"checksum\": \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\n \"folder_id\": \"6890000000000000000000a1\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vturb.com/v1/files")
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 \"name\": \"My thumbnail\",\n \"filename\": \"mythumbnail.jpg\",\n \"content_type\": \"image/jpeg\",\n \"size\": 184856,\n \"checksum\": \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\n \"folder_id\": \"6890000000000000000000a1\"\n}"
response = http.request(request)
puts response.read_body{
"id": "0190a0b0-0000-7000-8000-000000000001",
"status": "awaiting_upload",
"upload": {
"url": "https://s3.amazonaws.com/vturb-uploads/org_123/x/original.jpg?x-amz-checksum-sha256=qqq%3D&X-Amz-Signature=abc",
"expires_at": "2026-08-13T12:15:00Z"
},
"complete_url": "/v1/files/0190a0b0-0000-7000-8000-000000000001/upload/completion"
}{
"type": "https://docs.vturb.com/errors/unauthorized",
"code": "unauthorized",
"message": "Missing or invalid API credential. Send a vt_ token in the Authorization header.",
"request_id": "00000000-0000-0000-0000-000000000000"
}{
"type": "https://docs.vturb.com/errors/forbidden",
"code": "forbidden",
"message": "The credential is missing the scope this action requires.",
"request_id": "00000000-0000-0000-0000-000000000000"
}{
"type": "https://docs.vturb.com/errors/unprocessable_content",
"code": "unprocessable_content",
"message": "The request is invalid. See errors for the fields that failed.",
"request_id": "00000000-0000-0000-0000-000000000000",
"errors": [
{
"field": "checksum",
"message": "must be a 64-char hex SHA-256"
},
{
"field": "size",
"message": "is not a number"
}
]
}Authorizations
Paste your VTurb API token (vt_...). Sent as Authorization: Bearer <token>.
Body
application/json
Display name for the file.
Maximum string length:
255Example:
"My thumbnail"
Original filename of the upload.
Maximum string length:
255Example:
"mythumbnail.jpg"
MIME type of the file.
Available options:
image/png, image/jpeg, image/gif, image/webp, text/vtt Example:
"image/jpeg"
Size of the file in bytes (max 20MB).
Required range:
1 <= x <= 20971520Example:
184856
Optional SHA-256 checksum of the file (64 hex characters). When given, the presign locks it so S3 rejects any upload whose bytes don't match.
Example:
"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
Optional folder to place the file in.
Example:
"6890000000000000000000a1"
Was this page helpful?
⌘I
Start a file upload
curl --request POST \
--url https://api.vturb.com/v1/files \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "My thumbnail",
"filename": "mythumbnail.jpg",
"content_type": "image/jpeg",
"size": 184856,
"checksum": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"folder_id": "6890000000000000000000a1"
}
'import requests
url = "https://api.vturb.com/v1/files"
payload = {
"name": "My thumbnail",
"filename": "mythumbnail.jpg",
"content_type": "image/jpeg",
"size": 184856,
"checksum": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"folder_id": "6890000000000000000000a1"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'My thumbnail',
filename: 'mythumbnail.jpg',
content_type: 'image/jpeg',
size: 184856,
checksum: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
folder_id: '6890000000000000000000a1'
})
};
fetch('https://api.vturb.com/v1/files', 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.vturb.com/v1/files",
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 thumbnail',
'filename' => 'mythumbnail.jpg',
'content_type' => 'image/jpeg',
'size' => 184856,
'checksum' => 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
'folder_id' => '6890000000000000000000a1'
]),
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.vturb.com/v1/files"
payload := strings.NewReader("{\n \"name\": \"My thumbnail\",\n \"filename\": \"mythumbnail.jpg\",\n \"content_type\": \"image/jpeg\",\n \"size\": 184856,\n \"checksum\": \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\n \"folder_id\": \"6890000000000000000000a1\"\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.vturb.com/v1/files")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"My thumbnail\",\n \"filename\": \"mythumbnail.jpg\",\n \"content_type\": \"image/jpeg\",\n \"size\": 184856,\n \"checksum\": \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\n \"folder_id\": \"6890000000000000000000a1\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vturb.com/v1/files")
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 \"name\": \"My thumbnail\",\n \"filename\": \"mythumbnail.jpg\",\n \"content_type\": \"image/jpeg\",\n \"size\": 184856,\n \"checksum\": \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\n \"folder_id\": \"6890000000000000000000a1\"\n}"
response = http.request(request)
puts response.read_body{
"id": "0190a0b0-0000-7000-8000-000000000001",
"status": "awaiting_upload",
"upload": {
"url": "https://s3.amazonaws.com/vturb-uploads/org_123/x/original.jpg?x-amz-checksum-sha256=qqq%3D&X-Amz-Signature=abc",
"expires_at": "2026-08-13T12:15:00Z"
},
"complete_url": "/v1/files/0190a0b0-0000-7000-8000-000000000001/upload/completion"
}{
"type": "https://docs.vturb.com/errors/unauthorized",
"code": "unauthorized",
"message": "Missing or invalid API credential. Send a vt_ token in the Authorization header.",
"request_id": "00000000-0000-0000-0000-000000000000"
}{
"type": "https://docs.vturb.com/errors/forbidden",
"code": "forbidden",
"message": "The credential is missing the scope this action requires.",
"request_id": "00000000-0000-0000-0000-000000000000"
}{
"type": "https://docs.vturb.com/errors/unprocessable_content",
"code": "unprocessable_content",
"message": "The request is invalid. See errors for the fields that failed.",
"request_id": "00000000-0000-0000-0000-000000000000",
"errors": [
{
"field": "checksum",
"message": "must be a 64-char hex SHA-256"
},
{
"field": "size",
"message": "is not a number"
}
]
}