Create objects

Mints a presigned PUT URL the caller uploads to DIRECTLY.

POST /v1/s3/buckets/{bucket}/objects

Addresshttps://api.hanzo.ai/v1/s3/buckets/{bucket}/objects
MethodPOST
Operationpost_s3_buckets_by_bucket_objects
AuthAuthorization: Bearer $HANZO_API_KEY

Mints a presigned PUT URL the caller uploads to DIRECTLY.

The bytes never pass through this binary and the admin credential never leaves the server: the URL is signed against the PUBLIC host, scoped to exactly this bucket and key, and expires. A deployment with no public endpoint configured cannot mint one and answers 503 rather than a URL that will not work.

Billed per call — for MINTING the URL, which is the work this operation does; the upload that follows it goes straight to the store and is not seen here. The balance is checked BEFORE anything is touched, so an unfunded org is refused with no URL issued.

Request

3 fields, body application/json (required).

FieldInTypeRequiredDescription
bucketpathstringyesBucket is the bucket to upload into, from the path.
bucketbodystring—Bucket is the bucket to upload into, from the path.
keybodystring—Key is the object key relative to the bucket root.

Response

StatusBodyMeaning
200s3.presignResponseok
defaultproblem-detailsrefused

200 body — 4 fields.

FieldInTypeAlwaysDescription
expiresInbodyinteger (int64)—seconds until the URL expires
keybodystring—Key is the object key the URL was signed for, relative to the bucket root and path-cleaned — so it is what the store will actually read or write, which is not always the string the caller sent.
methodbodystring—"PUT" (upload) or "GET" (download)
urlbodystring—presigned URL the browser follows directly

Failure carries the platform error shape — see Errors.

Examples

hanzo s3 buckets objects create <bucket>
import { Configuration, S3Api } from 'hanzoai';

const api = new S3Api(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postS3BucketsByBucketObjects({ bucket: 'bucket', bucket: "<bucket>", key: "<key>" });
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import S3Api

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = S3Api(client).post_s3_buckets_by_bucket_objects(bucket='bucket', bucket="<bucket>", key="<key>")
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.S3API.PostS3BucketsByBucketObjects(context.Background()).Execute()
if err != nil {
	return err
}
use hanzo_client::apis::{configuration::Configuration, s3_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = s3_api::post_s3_buckets_by_bucket_objects(&cfg, Default::default()).await?;
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.S3Api;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new S3Api(client).postS3BucketsByBucketObjects();
curl -X POST https://api.hanzo.ai/v1/s3/buckets/<bucket>/objects \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "bucket": "<bucket>",
       "key": "<key>"
     }'

MCP reaches s3 through the s3 tool, which names its 6 operations with its own verbs — this one among them, under a name only MCP declares. describe explains any of them:

curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "describe",
         "arguments": {
           "op": "list_s3_buckets"
         }
       }
     }'

S3 API · All Hanzo APIs · Interactive reference

Was this page useful?