> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tornadoapi.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Bucket Config (Legacy)

> Configure your own S3-compatible storage bucket (deprecated)

<Warning>
  **Deprecated**: This endpoint only supports S3-compatible storage. Use the dedicated endpoints instead:

  * [`POST /user/s3`](/api-reference/user/configure-s3) for S3-compatible storage
  * [`POST /user/blob`](/api-reference/user/configure-blob) for Azure Blob Storage
  * [`POST /user/gcs`](/api-reference/user/configure-gcs) for Google Cloud Storage
  * [`POST /user/oss`](/api-reference/user/configure-oss) for Alibaba Cloud OSS
</Warning>

## Overview

Configure a custom S3-compatible storage bucket for your downloads. Credentials are verified before saving.

## Header Parameters

<ParamField header="x-api-key" type="string" required>
  Your API key for authentication
</ParamField>

## Request

<ParamField body="endpoint" type="string" required>
  S3 endpoint URL (e.g., `https://s3.us-east-1.amazonaws.com`)
</ParamField>

<ParamField body="bucket" type="string" required>
  Bucket name
</ParamField>

<ParamField body="region" type="string" required>
  AWS region (e.g., `us-east-1`, `auto` for R2)
</ParamField>

<ParamField body="access_key" type="string" required>
  AWS Access Key ID or equivalent
</ParamField>

<ParamField body="secret_key" type="string" required>
  AWS Secret Access Key or equivalent
</ParamField>

## Response

<ResponseField name="message" type="string">
  Success confirmation message
</ResponseField>

## Example

<CodeGroup>
  ```bash AWS S3 theme={null}
  curl -X POST "https://api.tornadoapi.io/user/bucket" \
    -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"
    }'
  ```

  ```bash Cloudflare R2 theme={null}
  curl -X POST "https://api.tornadoapi.io/user/bucket" \
    -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"
    }'
  ```

  ```json Response theme={null}
  {
    "message": "Bucket configuration updated successfully"
  }
  ```
</CodeGroup>

## Success Response

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "message": "Bucket configuration updated successfully"
  }
  ```
</ResponseExample>

## Error Responses

<ResponseExample>
  ```json 400 Bad Request theme={null}
  {
    "error": "Verification failed: Access Denied"
  }
  ```

  ```json 400 Bad Request theme={null}
  {
    "error": "Verification failed: NoSuchBucket"
  }
  ```

  ```json 401 Unauthorized theme={null}
  {
    "error": "Invalid API Key"
  }
  ```
</ResponseExample>

## Verification Process

When you submit bucket configuration, Tornado:

1. Creates an S3 client with your credentials
2. Attempts to list the bucket (verifies read access)
3. If successful, saves the configuration

<Warning>
  Ensure your credentials have both read and write permissions before configuring.
</Warning>

## Required IAM Permissions

```json theme={null}
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "s3:PutObject",
        "s3:GetObject",
        "s3:ListBucket"
      ],
      "Resource": [
        "arn:aws:s3:::your-bucket-name",
        "arn:aws:s3:::your-bucket-name/*"
      ]
    }
  ]
}
```

## Supported Providers

| Provider            | Endpoint Format                                 | Region      |
| ------------------- | ----------------------------------------------- | ----------- |
| AWS S3              | `https://s3.{region}.amazonaws.com`             | Your region |
| Cloudflare R2       | `https://{account_id}.r2.cloudflarestorage.com` | `auto`      |
| OVH Object Storage  | `https://s3.{region}.cloud.ovh.net`             | Your region |
| MinIO               | Your MinIO URL                                  | Your region |
| 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 |
