Request Upload Url
大容量ファイル用に GCS への PUT 署名URLを発行する(Section 4・非同期1段目)。
クライアントは返却された upload_url へ直接 PUT でアップロードし、その後 POST /sources/file-ingest に source_id を渡して取り込みを起動する。editor 以上。
署名URL発行自体もレートリミット対象だが、action=“upload_url” で file-ingest (action=“ingest”)とは別バケットの日次上限を持つ(#142)。free tier (ingest_per_day=1)で共有すると署名URL発行だけでクォータを使い切り、後続の 必須 file-ingest が 429 になり非同期アップロードが完走できなかったため分離した。 認証済みユーザによる大量発行で孤児 Source 行が無制限に生成されるのを防ぐという DoS 防御の趣旨(旧 MED M-3)は維持する。
POST
/sources/upload-urlHeader parameters
authorizationstring | anyX-Api-Keystring | anyRequest body
requiredapplication/jsonfilenamestringrequiredmin length 1 · max length 255
content_typestringdefault: "application/octet-stream"
Responses
200Successful Response
any422Validation Error
detailValidationError[]Show propertiesHide properties
Array of
ValidationErrorlocstring | integer[]requiredShow propertiesHide properties
Array of
string | integerAny of:
string
stringinteger
integermsgstringrequiredtypestringrequiredRequest
curl -X POST "/sources/upload-url" \
-H "Content-Type: application/json" \
-d '{
"filename": "string",
"content_type": "application/octet-stream"
}'const response = await fetch("/sources/upload-url", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
"filename": "string",
"content_type": "application/octet-stream"
})
});import requests
response = requests.post(
"/sources/upload-url",
headers={
"Content-Type": "application/json"
},
json={
"filename": "string",
"content_type": "application/octet-stream"
},
)Response
"string"{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string"
}
]
}