Configure S3 Storage
curl --request POST \
--url https://api.tornadoapi.io/user/s3 \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '
{
"endpoint": "<string>",
"bucket": "<string>",
"region": "<string>",
"access_key": "<string>",
"secret_key": "<string>",
"folder_prefix": "<string>",
"base_folder": "<string>"
}
'import requests
url = "https://api.tornadoapi.io/user/s3"
payload = {
"endpoint": "<string>",
"bucket": "<string>",
"region": "<string>",
"access_key": "<string>",
"secret_key": "<string>",
"folder_prefix": "<string>",
"base_folder": "<string>"
}
headers = {
"x-api-key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
endpoint: '<string>',
bucket: '<string>',
region: '<string>',
access_key: '<string>',
secret_key: '<string>',
folder_prefix: '<string>',
base_folder: '<string>'
})
};
fetch('https://api.tornadoapi.io/user/s3', 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.tornadoapi.io/user/s3",
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([
'endpoint' => '<string>',
'bucket' => '<string>',
'region' => '<string>',
'access_key' => '<string>',
'secret_key' => '<string>',
'folder_prefix' => '<string>',
'base_folder' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <x-api-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.tornadoapi.io/user/s3"
payload := strings.NewReader("{\n \"endpoint\": \"<string>\",\n \"bucket\": \"<string>\",\n \"region\": \"<string>\",\n \"access_key\": \"<string>\",\n \"secret_key\": \"<string>\",\n \"folder_prefix\": \"<string>\",\n \"base_folder\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<x-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.tornadoapi.io/user/s3")
.header("x-api-key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"endpoint\": \"<string>\",\n \"bucket\": \"<string>\",\n \"region\": \"<string>\",\n \"access_key\": \"<string>\",\n \"secret_key\": \"<string>\",\n \"folder_prefix\": \"<string>\",\n \"base_folder\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tornadoapi.io/user/s3")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"endpoint\": \"<string>\",\n \"bucket\": \"<string>\",\n \"region\": \"<string>\",\n \"access_key\": \"<string>\",\n \"secret_key\": \"<string>\",\n \"folder_prefix\": \"<string>\",\n \"base_folder\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"message": "S3 storage configured successfully",
"provider": "s3",
"container_or_bucket": "my-tornado-downloads",
"folder_prefix": "videos/"
}
User
Configure S3 Storage
Configure S3-compatible storage (AWS S3, Cloudflare R2, MinIO, etc.)
POST
/
user
/
s3
Configure S3 Storage
curl --request POST \
--url https://api.tornadoapi.io/user/s3 \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '
{
"endpoint": "<string>",
"bucket": "<string>",
"region": "<string>",
"access_key": "<string>",
"secret_key": "<string>",
"folder_prefix": "<string>",
"base_folder": "<string>"
}
'import requests
url = "https://api.tornadoapi.io/user/s3"
payload = {
"endpoint": "<string>",
"bucket": "<string>",
"region": "<string>",
"access_key": "<string>",
"secret_key": "<string>",
"folder_prefix": "<string>",
"base_folder": "<string>"
}
headers = {
"x-api-key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
endpoint: '<string>',
bucket: '<string>',
region: '<string>',
access_key: '<string>',
secret_key: '<string>',
folder_prefix: '<string>',
base_folder: '<string>'
})
};
fetch('https://api.tornadoapi.io/user/s3', 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.tornadoapi.io/user/s3",
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([
'endpoint' => '<string>',
'bucket' => '<string>',
'region' => '<string>',
'access_key' => '<string>',
'secret_key' => '<string>',
'folder_prefix' => '<string>',
'base_folder' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <x-api-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.tornadoapi.io/user/s3"
payload := strings.NewReader("{\n \"endpoint\": \"<string>\",\n \"bucket\": \"<string>\",\n \"region\": \"<string>\",\n \"access_key\": \"<string>\",\n \"secret_key\": \"<string>\",\n \"folder_prefix\": \"<string>\",\n \"base_folder\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<x-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.tornadoapi.io/user/s3")
.header("x-api-key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"endpoint\": \"<string>\",\n \"bucket\": \"<string>\",\n \"region\": \"<string>\",\n \"access_key\": \"<string>\",\n \"secret_key\": \"<string>\",\n \"folder_prefix\": \"<string>\",\n \"base_folder\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tornadoapi.io/user/s3")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"endpoint\": \"<string>\",\n \"bucket\": \"<string>\",\n \"region\": \"<string>\",\n \"access_key\": \"<string>\",\n \"secret_key\": \"<string>\",\n \"folder_prefix\": \"<string>\",\n \"base_folder\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"message": "S3 storage configured successfully",
"provider": "s3",
"container_or_bucket": "my-tornado-downloads",
"folder_prefix": "videos/"
}
Overview
Set up your own S3-compatible storage for uploaded videos. Credentials are verified before saving.Header Parameters
string
required
Your API key for authentication
Request Body
string
required
S3 endpoint URL (e.g.,
https://s3.us-east-1.amazonaws.com or https://ACCOUNT_ID.r2.cloudflarestorage.com)string
required
Bucket name
string
required
AWS region (e.g.,
us-east-1, auto for R2)string
required
AWS Access Key ID or equivalent
string
required
AWS Secret Access Key or equivalent
string
Optional folder prefix for organizing uploads (e.g.,
downloads/2024/)string
default:"videos"
Base folder name for uploaded files. Defaults to
videos if not specified. Set to a custom value to change the top-level folder where files are stored (e.g., downloads, media).Response
string
Success confirmation message
string
Storage provider type:
s3string
The configured bucket name
string
The configured folder prefix (if provided)
Examples
curl -X POST "https://api.tornadoapi.io/user/s3" \
-H "x-api-key: sk_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"endpoint": "https://s3.us-east-1.amazonaws.com",
"bucket": "my-tornado-downloads",
"region": "us-east-1",
"access_key": "AKIAIOSFODNN7EXAMPLE",
"secret_key": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
"folder_prefix": "videos/"
}'
curl -X POST "https://api.tornadoapi.io/user/s3" \
-H "x-api-key: sk_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"endpoint": "https://ACCOUNT_ID.r2.cloudflarestorage.com",
"bucket": "my-downloads",
"region": "auto",
"access_key": "R2_ACCESS_KEY_ID",
"secret_key": "R2_SECRET_ACCESS_KEY"
}'
import requests
response = requests.post(
"https://api.tornadoapi.io/user/s3",
headers={"x-api-key": "sk_your_api_key"},
json={
"endpoint": "https://s3.us-east-1.amazonaws.com",
"bucket": "my-tornado-downloads",
"region": "us-east-1",
"access_key": "AKIAIOSFODNN7EXAMPLE",
"secret_key": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
}
)
print(response.json())
{
"message": "S3 storage configured successfully",
"provider": "s3",
"container_or_bucket": "my-tornado-downloads",
"folder_prefix": "videos/"
}
Success Response
{
"message": "S3 storage configured successfully",
"provider": "s3",
"container_or_bucket": "my-tornado-downloads",
"folder_prefix": "videos/"
}
Error Responses
{
"error": "Credential validation failed: Access Denied"
}
{
"error": "Credential validation failed: NoSuchBucket"
}
{
"error": "Invalid API Key"
}
Verification Process
When you submit storage configuration, Tornado:- Validates the request format and required fields
- Creates a storage client with your credentials
- Attempts to upload a small test file (
verify_credentials.txt) - Deletes the test file
- If successful, saves the configuration encrypted
Ensure your credentials have both read and write permissions before configuring.
Required IAM Permissions
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:PutObject",
"s3:GetObject",
"s3:DeleteObject",
"s3:ListBucket"
],
"Resource": [
"arn:aws:s3:::your-bucket-name",
"arn:aws:s3:::your-bucket-name/*"
]
}
]
}
Supported S3-Compatible Providers
| Provider | Endpoint Format | Region |
|---|---|---|
| AWS S3 | https://s3.{region}.amazonaws.com | Your region |
| Cloudflare R2 | https://{account_id}.r2.cloudflarestorage.com | auto |
| DigitalOcean Spaces | https://{region}.digitaloceanspaces.com | Your region |
| Backblaze B2 | https://s3.{region}.backblazeb2.com | Your region |
| Wasabi | https://s3.{region}.wasabisys.com | Your region |
| MinIO | Your MinIO URL | Your region |
| OVH Object Storage | https://s3.{region}.cloud.ovh.net | Your region |
Was this page helpful?
⌘I
