メインコンテンツへスキップ

Documentation Index

Fetch the complete documentation index at: https://docs.qoder.com/llms.txt

Use this file to discover all available pages before exploring further.

POST /v1/sessions/{session_id}/resources Session にファイルリソースを追加します。追加後、Agent はメッセージ処理時にこれらのファイルにアクセスできるようになります。 注意: この機能は M3 ゲート機能です。Files API でファイルをアップロードして file_id を取得する必要があります。

パスパラメータ

パラメータ説明
session_idstringSession ID(sess_ プレフィックス)

ヘッダー

名称必須
AuthorizationはいBearer $QODER_PAT
Content-Typeはいapplication/json

リクエストボディ

フィールド必須説明
resourcesarrayはいリソースオブジェクトの配列
resources[].typestringはい固定値 "file"
resources[].file_idstringはいファイル ID(Files API でアップロード後に取得)

リクエスト例

curl -X POST https://openapi.qoder.sh/api/v1/cloud/sessions/sess_019e392c0d1e74e095d21ea4c6b41def/resources \
  -H "Authorization: Bearer $QODER_PAT" \
  -H "Content-Type: application/json" \
  -d '{
    "resources": [
      {"type": "file", "file_id": "file_abc123def456"}
    ]
  }'

レスポンス例

HTTP 200 OK 更新後の Session オブジェクトを返します(新しい resources リストを含む)。

エラーレスポンス

HTTPtype説明
400invalid_request_errorリクエスト形式エラー(type"file" でない、または file_id が欠落)
401authentication_errorPAT が無効または期限切れ
404not_found_errorSession またはファイルが存在しない

エラー例

type が不正:
{
  "error": {
    "message": "resources[0]: field 'type' must be 'file'.",
    "type": "invalid_request_error"
  },
  "type": "error"
}
file_id が欠落:
{
  "error": {
    "message": "resources[0]: field 'file_id' must be a non-empty string.",
    "type": "invalid_request_error"
  },
  "type": "error"
}
ファイルが存在しない:
{
  "error": {
    "message": "File 'file_fake_test_id' was not found.",
    "type": "not_found_error"
  },
  "type": "error"
}