Skip to main content
POST
Configure Google Cloud Storage

Overview

Set up Google Cloud Storage for uploaded videos. Authenticate with a service account JSON key. Credentials are verified before saving.

Header Parameters

string
required
Your API key for authentication

Request Body

string
required
Google Cloud project ID
string
required
GCS bucket name
string
required
Service account JSON credentials as a JSON string. Base64 is not decoded by this endpoint
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: gcs
string
The configured bucket name
string
The configured folder prefix (if provided)

Examples

Success Response

Error Responses

Verification Process

When you submit storage configuration, Tornado:
  1. Validates the request format and the service account JSON structure
  2. Creates a storage client with your credentials
  3. Uploads a small uniquely named credential-probe object
  4. Attempts best-effort deletion of the probe
  5. Saves credentials in Key Vault and a configuration reference on the API key

Required GCS Permissions

The Storage Object Admin role is one broad option. A custom role can instead grant the operations needed for the chosen upload/delivery path, including:
  • storage.objects.create
  • storage.objects.delete
  • storage.objects.get
  • storage.objects.list
Pass the complete service-account JSON as a string, preferably using json.dumps() as above. Do not Base64-encode this field.
Python users: Do not manually construct the service_account_json as a raw string with escaped quotes. The \n characters in the private key will be interpreted as literal newlines by Python, which produces invalid JSON and causes a "Invalid JSON in service account credentials" error.Always use json.dumps() on a dict or a loaded JSON file to ensure proper escaping: