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 escaped string or Base64 encoded)
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. Attempts to upload a small test file (verify_credentials.txt)
  4. Deletes the test file
  5. If successful, saves the configuration encrypted

Required GCS Permissions

The service account needs the Storage Object Admin role, which includes:
  • storage.objects.create
  • storage.objects.delete
  • storage.objects.get
  • storage.objects.list
For the service_account_json field, you can either:
  • Pass the JSON as an escaped string
  • Base64 encode the JSON file: base64 -w0 service-account.json
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: