メインコンテンツへスキップ
GET /api/v1/cloud/files 現在のアカウント配下のファイルを取得します。

ヘッダー

ヘッダー必須説明
AuthorizationはいBearer $QODER_PAT

クエリパラメータ

パラメータ必須説明
limitintegerいいえ1 ページあたりの最大件数。デフォルト 20、範囲は 1〜100。100 を超える値は 400 invalid_request_error を返します。
pagestringいいえClaude スタイルの前方カーソル。after_id と同等。before_id および after_id と排他
after_idstringいいえカーソルページネーション:この ID 以降のファイルを返す。page および before_id と排他
before_idstringいいえカーソルページネーション:この ID 以前のファイルを返す。page および after_id と排他
namestringいいえファイル名の前方一致検索(大文字小文字を区別しない)
scope_idstringいいえリソーススコープ(現在は Session ID)に関連付けられたファイルでフィルタ

リクエスト例

# 基本一覧
curl -X GET "https://api.qoder.com/api/v1/cloud/files" \
  -H "Authorization: Bearer $QODER_PAT"

# Session スコープでフィルタ + 件数制限
curl -X GET "https://api.qoder.com/api/v1/cloud/files?scope_id=sess_019e3bb8e6c47d18&limit=10" \
  -H "Authorization: Bearer $QODER_PAT"

# カーソルページネーション
curl -X GET "https://api.qoder.com/api/v1/cloud/files?limit=10&page=file_019e3bb8e6c47d18" \
  -H "Authorization: Bearer $QODER_PAT"

レスポンス例

HTTP 200 OK
{
  "data": [
    {
      "id": "file_019e3bb8e6c47d189212a79642136696",
      "type": "file",
      "filename": "report.txt",
      "mime_type": "text/plain",
      "size_bytes": 110,
      "downloadable": true,
      "scope": {
        "id": "sess_019e3bb8e6c47d18",
        "type": "session"
      },
      "metadata": {
        "project": "demo"
      },
      "created_at": "2026-05-18T15:33:53Z"
    }
  ],
  "next_page": null,
  "first_id": "file_019e3bb8e6c47d189212a79642136696",
  "has_more": false,
  "last_id": "file_019e3bb8e6c47d189212a79642136696"
}

レスポンスフィールド

フィールド説明
dataarrayファイルオブジェクトの配列
next_pagestring | null次ページの前方カーソル。has_moretrue の場合に page として使用
first_idstring | null現在ページ先頭ファイルの ID。data が空の場合は null
last_idstring | null現在ページ末尾ファイルの ID。data が空の場合は null
has_morebooleanさらにファイルがあるかどうか

ページネーション

結果は created_atid でソートされます。ファイルをページングするには:
  1. 初回リクエストで limit を設定し、最初のページを取得します。
  2. has_moretrue の場合、page=<next_page> で次のページを取得します。
  3. before_id=<first_id> で前方ページネーションが可能です。

エラーレスポンス

HTTPtype説明
400invalid_request_errorlimit が無効、または pagebefore_idafter_id のうち複数が指定されている
401authentication_error認証トークンが欠落または無効
エラーで完全なエラーエンベロープを参照してください。

関連項目

ファイルの添付とダウンロード

Agent にコンテキストを提供するファイルをアップロードし、Agent が生成したファイルをダウンロードします。