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_id | string | Session ID(sess_ プレフィックス) |
ヘッダー
| 名称 | 必須 | 値 |
|---|
| Authorization | はい | Bearer $QODER_PAT |
| Content-Type | はい | application/json |
リクエストボディ
| フィールド | 型 | 必須 | 説明 |
|---|
resources | array | はい | リソースオブジェクトの配列 |
resources[].type | string | はい | 固定値 "file" |
resources[].file_id | string | はい | ファイル 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 リストを含む)。
エラーレスポンス
| HTTP | type | 説明 |
|---|
| 400 | invalid_request_error | リクエスト形式エラー(type が "file" でない、または file_id が欠落) |
| 401 | authentication_error | PAT が無効または期限切れ |
| 404 | not_found_error | Session またはファイルが存在しない |
エラー例
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"
}