Python (SDK)
import latitudesh_python_sdk
from latitudesh_python_sdk import Latitudesh
import os
with Latitudesh(
bearer=os.getenv("LATITUDESH_BEARER", ""),
) as latitudesh:
res = latitudesh.object_storage.post_storage_buckets(data={
"type": latitudesh_python_sdk.PostStorageBucketsType.OBJECTS,
"attributes": {
"project": "proj_6059EqYkOQj8p",
"name": "my-bucket",
"region": "DAL",
},
})
# Handle response
print(res)package main
import(
"context"
"os"
latitudeshgosdk "github.com/latitudesh/latitudesh-go-sdk"
"github.com/latitudesh/latitudesh-go-sdk/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := latitudeshgosdk.New(
latitudeshgosdk.WithSecurity(os.Getenv("LATITUDESH_BEARER")),
)
res, err := s.ObjectStorage.PostStorageBuckets(ctx, operations.PostStorageBucketsRequestBody{
Data: operations.PostStorageBucketsData{
Type: operations.PostStorageBucketsTypeObjects,
Attributes: operations.PostStorageBucketsAttributes{
Project: "proj_6059EqYkOQj8p",
Name: "my-bucket",
Region: "DAL",
},
},
})
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
// handle response
}
}import { Latitudesh } from "latitudesh-typescript-sdk";
const latitudesh = new Latitudesh({
bearer: process.env["LATITUDESH_BEARER"] ?? "",
});
async function run() {
const result = await latitudesh.objectStorage.postStorageBuckets({
data: {
type: "objects",
attributes: {
project: "proj_6059EqYkOQj8p",
name: "my-bucket",
region: "DAL",
},
},
});
console.log(result);
}
run();curl --request POST \
--url https://api.latitude.sh/storage/buckets \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/vnd.api+json' \
--data '
{
"data": {
"type": "objects",
"attributes": {
"project": "proj_6059EqYkOQj8p",
"name": "my-bucket",
"region": "DAL"
}
}
}
'const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/vnd.api+json'},
body: JSON.stringify({
data: {
type: 'objects',
attributes: {project: 'proj_6059EqYkOQj8p', name: 'my-bucket', region: 'DAL'}
}
})
};
fetch('https://api.latitude.sh/storage/buckets', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.latitude.sh/storage/buckets",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
'type' => 'objects',
'attributes' => [
'project' => 'proj_6059EqYkOQj8p',
'name' => 'my-bucket',
'region' => 'DAL'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/vnd.api+json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://api.latitude.sh/storage/buckets")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/vnd.api+json")
.body("{\n \"data\": {\n \"type\": \"objects\",\n \"attributes\": {\n \"project\": \"proj_6059EqYkOQj8p\",\n \"name\": \"my-bucket\",\n \"region\": \"DAL\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.latitude.sh/storage/buckets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/vnd.api+json'
request.body = "{\n \"data\": {\n \"type\": \"objects\",\n \"attributes\": {\n \"project\": \"proj_6059EqYkOQj8p\",\n \"name\": \"my-bucket\",\n \"region\": \"DAL\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "bucket_6VE1Wd37dXnZJ",
"type": "object_storages",
"attributes": {
"name": "my-bucket",
"storage_type": "object",
"storage_class": "standard",
"created_at": "2026-03-19T15:30:00.000Z",
"bucket_name": "my-bucket",
"endpoint": "https://objects.us-east-1.storage.sh",
"access_key": "<your-access-key>",
"secret_key": "<your-secret-key>",
"versioning": false,
"locking": false,
"retention_mode": "NONE",
"retention_period": null,
"region": {
"id": "DAL",
"city": "DAL",
"country": "United States"
},
"project": {
"id": "proj_6059EqYkOQj8p",
"name": "My Project",
"slug": "my-project",
"description": "Project description",
"billing_type": "Normal",
"billing_method": "Normal",
"bandwidth_alert": false,
"environment": null,
"billing": {
"subscription_id": null,
"type": "Normal",
"method": "Normal"
},
"stats": {
"databases": 0,
"ip_addresses": 0,
"prefixes": 0,
"servers": 0,
"storages": 1,
"virtual_machines": 0,
"vlans": 0
}
},
"team": {
"id": "team_lV9Xe2AAK5CbMgGbpPYLskLRXyV",
"name": "My Team",
"slug": "my-team",
"description": "My Team",
"address": "123 Main St",
"status": "verified",
"currency": {
"id": "cur_AW6Q2D9lqKLpr",
"code": "USD",
"name": "US Dollar",
"currency_id": null
}
}
}
}
}
Object Storage
Create bucket
Creates a new object storage bucket for a project.
POST
/
storage
/
buckets
Python (SDK)
import latitudesh_python_sdk
from latitudesh_python_sdk import Latitudesh
import os
with Latitudesh(
bearer=os.getenv("LATITUDESH_BEARER", ""),
) as latitudesh:
res = latitudesh.object_storage.post_storage_buckets(data={
"type": latitudesh_python_sdk.PostStorageBucketsType.OBJECTS,
"attributes": {
"project": "proj_6059EqYkOQj8p",
"name": "my-bucket",
"region": "DAL",
},
})
# Handle response
print(res)package main
import(
"context"
"os"
latitudeshgosdk "github.com/latitudesh/latitudesh-go-sdk"
"github.com/latitudesh/latitudesh-go-sdk/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := latitudeshgosdk.New(
latitudeshgosdk.WithSecurity(os.Getenv("LATITUDESH_BEARER")),
)
res, err := s.ObjectStorage.PostStorageBuckets(ctx, operations.PostStorageBucketsRequestBody{
Data: operations.PostStorageBucketsData{
Type: operations.PostStorageBucketsTypeObjects,
Attributes: operations.PostStorageBucketsAttributes{
Project: "proj_6059EqYkOQj8p",
Name: "my-bucket",
Region: "DAL",
},
},
})
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
// handle response
}
}import { Latitudesh } from "latitudesh-typescript-sdk";
const latitudesh = new Latitudesh({
bearer: process.env["LATITUDESH_BEARER"] ?? "",
});
async function run() {
const result = await latitudesh.objectStorage.postStorageBuckets({
data: {
type: "objects",
attributes: {
project: "proj_6059EqYkOQj8p",
name: "my-bucket",
region: "DAL",
},
},
});
console.log(result);
}
run();curl --request POST \
--url https://api.latitude.sh/storage/buckets \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/vnd.api+json' \
--data '
{
"data": {
"type": "objects",
"attributes": {
"project": "proj_6059EqYkOQj8p",
"name": "my-bucket",
"region": "DAL"
}
}
}
'const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/vnd.api+json'},
body: JSON.stringify({
data: {
type: 'objects',
attributes: {project: 'proj_6059EqYkOQj8p', name: 'my-bucket', region: 'DAL'}
}
})
};
fetch('https://api.latitude.sh/storage/buckets', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.latitude.sh/storage/buckets",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
'type' => 'objects',
'attributes' => [
'project' => 'proj_6059EqYkOQj8p',
'name' => 'my-bucket',
'region' => 'DAL'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/vnd.api+json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://api.latitude.sh/storage/buckets")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/vnd.api+json")
.body("{\n \"data\": {\n \"type\": \"objects\",\n \"attributes\": {\n \"project\": \"proj_6059EqYkOQj8p\",\n \"name\": \"my-bucket\",\n \"region\": \"DAL\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.latitude.sh/storage/buckets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/vnd.api+json'
request.body = "{\n \"data\": {\n \"type\": \"objects\",\n \"attributes\": {\n \"project\": \"proj_6059EqYkOQj8p\",\n \"name\": \"my-bucket\",\n \"region\": \"DAL\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "bucket_6VE1Wd37dXnZJ",
"type": "object_storages",
"attributes": {
"name": "my-bucket",
"storage_type": "object",
"storage_class": "standard",
"created_at": "2026-03-19T15:30:00.000Z",
"bucket_name": "my-bucket",
"endpoint": "https://objects.us-east-1.storage.sh",
"access_key": "<your-access-key>",
"secret_key": "<your-secret-key>",
"versioning": false,
"locking": false,
"retention_mode": "NONE",
"retention_period": null,
"region": {
"id": "DAL",
"city": "DAL",
"country": "United States"
},
"project": {
"id": "proj_6059EqYkOQj8p",
"name": "My Project",
"slug": "my-project",
"description": "Project description",
"billing_type": "Normal",
"billing_method": "Normal",
"bandwidth_alert": false,
"environment": null,
"billing": {
"subscription_id": null,
"type": "Normal",
"method": "Normal"
},
"stats": {
"databases": 0,
"ip_addresses": 0,
"prefixes": 0,
"servers": 0,
"storages": 1,
"virtual_machines": 0,
"vlans": 0
}
},
"team": {
"id": "team_lV9Xe2AAK5CbMgGbpPYLskLRXyV",
"name": "My Team",
"slug": "my-team",
"description": "My Team",
"address": "123 Main St",
"status": "verified",
"currency": {
"id": "cur_AW6Q2D9lqKLpr",
"code": "USD",
"name": "US Dollar",
"currency_id": null
}
}
}
}
}
Was this page helpful?
⌘I