分页列出工作空间下的文件,按 created_at 倒序返回。可通过 scope_id 仅列出某会话沙箱内的文件。
前提
已完成 Endpoint 与鉴权配置,详见API 总览与认证。
接口
GET /files
Query 参数limit 每页数量,最大 100 page 首次不传,后续传上一次响应的 scope_id 传入会话 ID,仅返回该会话沙箱内的文件 | 请求示例 |
响应示例
{
"data": [
{
"id": "file_xxx",
"type": "file",
"filename": "sales_2025.csv",
"downloadable": false,
"mime_type": "text/csv",
"size_bytes": 524288,
"status": "available",
"created_at": "2026-06-16T14:51:39+08:00"
},
{
"id": "file_xxx",
"type": "file",
"filename": "demo.png",
"downloadable": false,
"mime_type": "image/png",
"size_bytes": 102400,
"status": "checking",
"created_at": "2026-06-16T14:48:02+08:00"
}
],
"next_page": "xxx",
"requestId": "xxx"
}
响应包含 data(File 对象数组)与 next_page。File 对象字段如下:
File 对象字段
id string
文件 ID,格式 file_<24位字母数字>
type string
固定为 file
filename string
文件名
mime_type string
服务端检测的 MIME 类型
size_bytes int
文件大小,单位字节
downloadable bool
是否支持下载,当前接口直传与会话沙箱拷贝均为 false
status string
安全审核状态:available / checking / rejected / type_rejected
created_at string
上传时间,ISO 8601
该文章对您有帮助吗?