Upload a file into a workspace
Stores one file in a workspace's blob store and answers the blob id it is addressable by, as plain text — the front discards that body, it is there for a…
POST /v1/team/files/{workspace}
| Address | https://api.hanzo.ai/v1/team/files/{workspace} |
| Method | POST |
| Operation | post_team_files_by_workspace |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Stores one file in a workspace's blob store and answers the blob id it is addressable by, as plain text — the front discards that body, it is there for a caller driving this by hand.
The body is a multipart form with a file part, and THAT PART'S FILENAME IS THE BLOB ID: the client mints it (a uuid v4) and the server stores under it, so a part whose filename is not a uuid is refused rather than assigned one. A file over 100 MiB is 413 and an empty one is 400.
The caller must hold a verified session or workspace token AND be a member of the workspace; an unknown workspace, another tenant's workspace and a workspace the caller is not in all answer the same 404, so a probe learns nothing about what exists. The stored key embeds the verified org and the workspace, so an upload cannot land in another tenant's box whatever id it names. A storage backend that is unavailable fails closed with 502 rather than reporting a write it never made.
Request
1 field.
| Field | In | Type | Required | Description |
|---|---|---|---|---|
workspace | path | string | yes |
Response
The document declares no response body for this operation. It answers 200 on success and the platform error shape on failure — see Errors.
Examples
hanzo team files add <workspace>import { Configuration, TeamApi } from 'hanzoai';
const api = new TeamApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postTeamFilesByWorkspace({ workspace: 'workspace' });from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import TeamApi
client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = TeamApi(client).post_team_files_by_workspace(workspace='workspace')cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.TeamAPI.PostTeamFilesByWorkspace(context.Background()).Execute()
if err != nil {
return err
}use hanzo_cloud::apis::{configuration::Configuration, team_api};
let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();
let result = team_api::post_team_files_by_workspace(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.TeamApi;
ApiClient client = new ApiClient();
client.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + System.getenv("HANZO_API_KEY")));
var result = new TeamApi(client).postTeamFilesByWorkspace();curl -X POST https://api.hanzo.ai/v1/team/files/<workspace> \
-H "Authorization: Bearer $HANZO_API_KEY"The door reaches team through the team tool, which names its 18 operations with its own verbs — this one among them, under a name only the door 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": "get_collaborator"
}
}
}'How is this guide?