Get files
Lists the files in an execution session. Everything the session's sandbox holds — the uploads a run can read and the artifacts it produced — each then…
GET /v1/exec/files/{sid}
| Address | https://api.hanzo.ai/v1/exec/files/{sid} |
| Method | GET |
| Operation | get_exec_files_by_sid |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Lists the files in an execution session.
Everything the session's sandbox holds — the uploads a run can read and the artifacts it produced — each then fetched from GET /v1/exec/download.
The answer is a BARE JSON ARRAY of {name, lastModified}, where name is the
same {session_id}/{fileId} identifier download takes, because that is what the
client matches on. The obvious typed shape, {files: […]}, would have been a
silent wire change: the request still succeeds and response.data.find(...)
finds nothing, which reads as a session holding no files.
The NAME of this handler is what the published summary is cut from, and it used to leak: the comment opened "Files lists …", which is not this function's identifier, so zipdoc's exact-match strip left it and every SDK, tool list and CLI help line opened with a Go symbol no caller can see. An openapi.Describe stated a better summary beside the route and was DISCARDED — Fold replaces a structural operation with the typed one — so the declaration read as landed and rendered nowhere. The comment is the one home for this sentence.
One recursive find, the same traversal the artifact sweep makes. It used to be
ls -1A — top level only — while the sweep collected with find, so a run that
wrote a nested artifact reported it in its reply and then omitted it here, and
the client's prefix match read the file as expired. Two traversals of one
directory is two answers about what a session holds; there is one now.
Request
1 field.
| Field | In | Type | Required | Description |
|---|---|---|---|---|
sid | path | string | yes | SID is the session identifier — the sandbox this listing is of. |
Response
| Status | Body | Meaning |
|---|---|---|
200 | listing[] | ok |
200 body — 2 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
[].lastModified | body | string | — | LastModified is when the BYTES last changed, as RFC 3339 in UTC to the second — 2026-01-02T03:04:05Z, the sandbox's own date -u -r on the file. |
[].name | body | string | — | Name is the file's IDENTIFIER, {session_id}/{fileId} whole — never the bare filename, and never URL-escaped. |
Failure carries the platform error shape — see Errors.
Examples
hanzo exec files get <sid>import { Configuration, ExecApi } from 'hanzoai';
const api = new ExecApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getExecFilesBySid({ sid: 'sid' });from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import ExecApi
client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = ExecApi(client).get_exec_files_by_sid(sid='sid')cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.ExecAPI.GetExecFilesBySid(context.Background()).Execute()
if err != nil {
return err
}use hanzo_cloud::apis::{configuration::Configuration, exec_api};
let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();
let result = exec_api::get_exec_files_by_sid(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.ExecApi;
ApiClient client = new ApiClient();
client.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + System.getenv("HANZO_API_KEY")));
var result = new ExecApi(client).getExecFilesBySid();curl https://api.hanzo.ai/v1/exec/files/<sid> \
-H "Authorization: Bearer $HANZO_API_KEY"MCP reaches exec through the exec tool, which names its 5 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": "get_download"
}
}
}'How is this guide?