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/files
Qoder Cloud Agents プラットフォームにファイルをアップロードし、Session やツールから利用できるようにします。Content-Type: multipart/form-data を使用します。
ヘッダー
| ヘッダー | 必須 | 説明 |
|---|
| Authorization | はい | Bearer $QODER_PAT |
| フィールド | 型 | 必須 | 説明 |
|---|
file | file | はい | アップロードするファイルのバイナリ内容 |
purpose | string | いいえ | ファイル用途。値:user_upload、tool_output、skill_output、session_resource、agent_output。指定しない場合のデフォルトは user_upload |
metadata | JSON string | いいえ | カスタムメタデータ、JSON オブジェクト形式 |
リクエスト例
curl -X POST "https://openapi.qoder.sh/api/v1/cloud/files" \
-H "Authorization: Bearer $QODER_PAT" \
-F "file=@./my-document.txt" \
-F "purpose=session_resource" \
-F 'metadata={"project":"demo"}'
レスポンス例
HTTP 201 Created
{
"created_at": "2026-05-18T15:33:44Z",
"file_id": "file_019e3bb8c1387743bf4ef115aae5acb1",
"filename": "my-document.txt",
"metadata": {
"project": "demo"
},
"mime_type": "text/plain",
"purpose": "session_resource",
"size_bytes": 110,
"status": "ready",
"updated_at": "2026-05-18T15:33:44Z"
}
レスポンスフィールド
| フィールド | 型 | 説明 |
|---|
file_id | string | ファイル一意識別子、file_ プレフィックス |
filename | string | 元のファイル名 |
size_bytes | integer | ファイルサイズ(バイト) |
mime_type | string | MIME タイプ、サーバー側で自動検出 |
purpose | string | ファイル用途 |
status | string | ファイル状態、アップロード成功時は ready |
metadata | object | カスタムメタデータ |
created_at | string | 作成時刻(ISO 8601) |
updated_at | string | 更新時刻(ISO 8601) |
エラーレスポンス
| HTTP | type | 説明 |
|---|
| 400 | invalid_request_error | file フィールド欠落または purpose 値が無効 |
| 401 | — | 認証トークンが欠落または無効 |
エラー例
{
"error": {
"message": "Field 'file' is required.",
"type": "invalid_request_error"
},
"type": "error"
}
{
"error": {
"message": "Field 'purpose' must be one of: user_upload, tool_output, skill_output, session_resource, agent_output.",
"type": "invalid_request_error"
},
"type": "error"
}