post__bucket
POST /bucket
Create Bucket
Create a new storage bucket for cloud storage management.
This endpoint allows you to configure storage buckets from various cloud providers. The system supports:
AWS S3: Amazon Web Services Simple Storage Service
GCS: Google Cloud Storage
Azure: Microsoft Azure Blob Storage
S3-Compatible: Services like StorJ, Akave, and other S3-compatible providers
Supported Providers:
S3: AWS S3 and S3-compatible servicesGCS: Google Cloud StorageAZURE: Azure Blob Storage
Validation:
Bucket name must be unique within your organization
Storage credentials are validated before creation
Quota limits are checked (organization bucket limit)
Security:
Access keys and secrets are encrypted before storage
Credentials are never returned in API responses
Quota Limits:
Maximum buckets per organization based on subscription
Free trial typically includes 10 buckets
Quota exceeded returns 429 status code
TypeScript Client Library
public createStorageBucket = async (data: CreateBucketRequest): Promise<CreateBucketResponse> => {
return this.makeRequest<CreateBucketResponse>('bucket', 'POST', data);
};Code Samples
# You can also use wget
curl -X POST https://backend.flashback.tech/bucket \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'POST https://backend.flashback.tech/bucket HTTP/1.1
Host: localhost:3000
Content-Type: application/json
Accept: application/jsonconst inputBody = '{
"name": "My Backup Bucket",
"bucket": "my-backup-bucket-2024",
"storageType": "S3",
"key": "AKIAIOSFODNN7EXAMPLE",
"secret": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
"region": "us-east-1",
"endpoint": "https://gateway.storjshare.io"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://backend.flashback.tech/bucket',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.post 'https://backend.flashback.tech/bucket',
params: {
}, headers: headers
p JSON.parse(result)import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('https://backend.flashback.tech/bucket', headers = headers)
print(r.json())<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://backend.flashback.tech/bucket', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...URL obj = new URL("https://backend.flashback.tech/bucket");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://backend.flashback.tech/bucket", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}Body parameter
{
"name": "My Backup Bucket",
"bucket": "my-backup-bucket-2024",
"storageType": "S3",
"key": "AKIAIOSFODNN7EXAMPLE",
"secret": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
"region": "us-east-1",
"endpoint": "https://gateway.storjshare.io",
"workspaceId": "workspace-123"
}Parameters
body
body
object
true
none
» name
body
string
true
Human-readable name for the bucket
» bucket
body
string
true
Actual bucket name in cloud storage
» storageType
body
string
true
Cloud storage provider type
» key
body
string
true
Access key for the storage provider
» secret
body
string
true
Secret key for the storage provider
» region
body
string
true
Storage region (e.g., us-east-1, eu-west-1)
» endpoint
body
string
false
Custom endpoint URL for S3-compatible services
» workspaceId
body
string
true
Workspace ID the bucket belongs to
Enumerated Values
» storageType
S3
» storageType
GCS
» storageType
AZURE
Example responses
200 Response
{
"success": true,
"bucketId": "550e8400-e29b-41d4-a716-446655440000"
}Responses
Response Schema
Status Code 200
» success
boolean
false
none
none
» bucketId
string
false
none
Unique identifier for the created bucket
Status Code 400
» success
boolean
false
none
none
» message
string
false
none
none
Status Code 429
» success
boolean
false
none
none
» bucketId
string
false
none
none
Last updated
Was this helpful?