Skip to main content
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>"
}
'
{
  "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

x-api-key
string
required
Your API key for authentication

Request Body

endpoint
string
required
S3 endpoint URL (e.g., https://s3.us-east-1.amazonaws.com or https://ACCOUNT_ID.r2.cloudflarestorage.com)
bucket
string
required
Bucket name
region
string
required
AWS region (e.g., us-east-1, auto for R2)
access_key
string
required
AWS Access Key ID or equivalent
secret_key
string
required
AWS Secret Access Key or equivalent
folder_prefix
string
Optional folder prefix for organizing uploads (e.g., downloads/2024/)
base_folder
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

message
string
Success confirmation message
provider
string
Storage provider type: s3
container_or_bucket
string
The configured bucket name
folder_prefix
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/"
  }'

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"
}

Verification Process

When you submit storage configuration, Tornado:
  1. Validates the request format and required fields
  2. Creates a storage client with your credentials
  3. Attempts to upload a small test file (verify_credentials.txt)
  4. Deletes the test file
  5. 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

ProviderEndpoint FormatRegion
AWS S3https://s3.{region}.amazonaws.comYour region
Cloudflare R2https://{account_id}.r2.cloudflarestorage.comauto
DigitalOcean Spaceshttps://{region}.digitaloceanspaces.comYour region
Backblaze B2https://s3.{region}.backblazeb2.comYour region
Wasabihttps://s3.{region}.wasabisys.comYour region
MinIOYour MinIO URLYour region
OVH Object Storagehttps://s3.{region}.cloud.ovh.netYour region