Create objects
Mints a presigned PUT URL the caller uploads to DIRECTLY.
POST /v1/s3/buckets/{bucket}/objects
| Address | https://api.hanzo.ai/v1/s3/buckets/{bucket}/objects |
| Method | POST |
| Operation | post_s3_buckets_by_bucket_objects |
| Auth | Authorization: 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).
| Field | In | Type | Required | Description |
|---|---|---|---|---|
bucket | path | string | yes | Bucket is the bucket to upload into, from the path. |
bucket | body | string | — | Bucket is the bucket to upload into, from the path. |
key | body | string | — | Key is the object key relative to the bucket root. |
Response
| Status | Body | Meaning |
|---|---|---|
200 | presignResponse | ok |
200 body — 4 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
expiresIn | body | integer | — | seconds until the URL expires |
key | body | string | — | 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… |
method | body | string | — | "PUT" (upload) or "GET" (download) |
url | body | string | — | 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 := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.S3API.PostS3BucketsByBucketObjects(context.Background()).Execute()
if err != nil {
return err
}use hanzo_cloud::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.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + 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 storage tool, which names its 8 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"
}
}
}'How is this guide?