获取当前账户下的文件列表,支持分页和按用途过滤。
请求头
头部 | 必选 | 说明 |
| 是 |
|
查询参数
参数 | 类型 | 必选 | 说明 |
| string | 否 | 按文件用途过滤。可选值: |
| integer | 否 | 每页返回的最大文件数量 |
| string | 否 | 游标分页:返回此 |
| string | 否 | 游标分页:返回此 |
完整分页规范详见 分页。
示例请求
# 基本列表
curl -X GET "https://api.qoder.com.cn/api/v1/cloud/files" \
-H "Authorization: Bearer $QODER_PAT"
# 按用途过滤 + 限制数量
curl -X GET "https://api.qoder.com.cn/api/v1/cloud/files?purpose=session_resource&limit=10" \
-H "Authorization: Bearer $QODER_PAT"
# 游标分页
curl -X GET "https://api.qoder.com.cn/api/v1/cloud/files?limit=10&after=file_019e3bb8e6c47d18" \
-H "Authorization: Bearer $QODER_PAT"示例响应
HTTP 200 OK
{
"data": [
{
"created_at": "2026-05-18T15:33:53Z",
"file_id": "file_019e3bb8e6c47d189212a79642136696",
"filename": "report.txt",
"metadata": {
"project": "test"
},
"mime_type": "text/plain",
"purpose": "session_resource",
"size_bytes": 110,
"status": "ready",
"updated_at": "2026-05-18T15:33:54Z"
}
],
"first_id": "file_019e3bb8e6c47d189212a79642136696",
"has_more": false,
"last_id": "file_019e3bb8e6c47d189212a79642136696"
}响应字段
字段 | 类型 | 说明 |
| array | 文件对象数组 |
| string \ | null |
| string \ | null |
| boolean | 是否还有更多数据 |
data 中每个文件对象的字段与上传文件响应一致。
空列表响应:
{
"data": [],
"first_id": null,
"has_more": false,
"last_id": null
}分页说明
列表按创建时间降序排列(最新的在前)。使用游标分页遍历所有文件:
首次请求设置
limit获取第一页如果
has_more为true,使用after=获取下一页使用
before=可向前翻页
错误码
HTTP | type | 触发条件 |
401 |
| 缺少或无效的认证令牌 |
完整错误信封说明详见 错误参考。
该文章对您有帮助吗?