Skip to main content
Files

列出 File

Forward Files API 接口说明。

描述

获取当前账户可见的 File 列表,支持分页和条件过滤。

路径

GET /api/v1/forward/files

请求头

头部必选说明
Authorization是Bearer <PAT 或 SAT>

查询参数

参数类型必选说明
identity_idstring否仅在操作 Identity 归属资源时使用;PAT 可通过 Query 显式传入,不传时为管理员视角;SAT 由凭证确定归属,任何 SAT 显式携带该参数(包括空值)返回 HTTP 400。详见 Identity 归属。
limitinteger否分页大小,最大 100。
pagestring否分页游标(推荐使用),取值来自上一页响应的 next_page;与 after_id、before_id 互斥。
after_idstring否向后翻页游标;与 page、before_id 互斥。
before_idstring否向前翻页游标;与 page、after_id 互斥。
namestring否按文件名搜索。
scope_idstring否按资源作用域 ID 过滤,常用于 Session 资源文件查询。传入时不要同时使用 before_id 或 after_id;当前游标参数在该过滤模式下不生效。

示例请求

curl -X GET "https://api.qoder.com/api/v1/forward/files" \
  -H "Authorization: Bearer $QODER_ACCESS_TOKEN"

示例响应

{
  "data": [
    {
      "id": "file_xxx",
      "type": "file",
      "filename": "report.pdf",
      "size_bytes": 1024,
      "mime_type": "application/pdf",
      "created_at": "2026-07-23T10:00:00Z",
      "updated_at": "2026-07-23T10:00:00Z",
      "downloadable": true,
      "scope": null,
      "metadata": {
        "source": "console"
      },
      "identity_id": null
    }
  ],
  "first_id": "file_xxx",
  "last_id": "file_xxx",
  "has_more": false,
  "next_page": null
}

空列表响应

{
  "data": [],
  "first_id": null,
  "last_id": null,
  "has_more": false,
  "next_page": null
}

响应字段

响应 data 数组每一项为 File 对象。分页字段详见 列表分页字段。

错误码

HTTPtype触发条件
400invalid_request_error请求体、路径参数或查询参数非法;包括 SAT 显式携带 Query identity_id(含空值)。
401authentication_error缺少或无效的认证令牌。
403permission_error管理员 Scope 发生 Owner mismatch,或下游服务拒绝访问。
404not_found_errorPAT 指定的 Identity 不存在、已禁用、已删除或不属于当前调用方。
500/502/503api_errorForward 或依赖服务失败。
列出 File - Qoder