Skip to main content
Files

File のアップロード

Forward API リファレンス。

Description

Uploads file content and creates a File.

パス

POST /api/v1/forward/files

リクエストヘッダー

ヘッダー必須説明
AuthorizationはいBearer <PAT または SAT>
Idempotency-Keyいいえ作成リクエスト用の任意の冪等性キーです。同じキーは同一リクエストにのみ再利用できます。省略した場合、ローカルの冪等リプレイ保護は提供されません。
Content-Typeはいmultipart/form-data

Form フィールド

フィールド必須説明
filefileYesFile content to upload. See Supported upload file types.
namestringいいえ表示ファイル名。既定値は multipart のファイル名です。正規化後の長さは 1〜255 バイトである必要があります。
metadataJSON stringNoMetadata object. created_by is reserved and must not be supplied (supplying it returns 400).

リクエスト例

curl -X POST "https://api.qoder.com/api/v1/forward/files" \
  -H "Authorization: Bearer $QODER_ACCESS_TOKEN" \
  -H "Idempotency-Key: create-file-001" \
  -F "file=@report.pdf;type=application/pdf" \
  -F "name=report.pdf" \
  -F 'metadata={"source":"console"}'

レスポンス例

HTTP 201 Created
{
  "id": "file_xxx",
  "type": "file",
  "filename": "report.pdf",
  "size_bytes": 1024,
  "mime_type": "application/pdf",
  "created_at": "2026-07-23T10:00:00Z",
  "updated_at": "2026-07-23T10:00:00Z",
  "downloadable": false,
  "scope": null,
  "metadata": {
    "source": "console"
  },
  "identity_id": null
}

レスポンスフィールド

フィールド説明
idstringFile ID。
typestring固定値 file
filenamestringファイル名。
size_bytesintegerバイト単位のファイルサイズ。
mime_typestringMIME タイプ。
created_atstringRFC 3339 形式の作成日時。
updated_atstringRFC 3339 形式の最終更新日時。
downloadablebooleanFile をダウンロードできるかどうか。
scopeobject/nullResource scope associated with the File, such as a Session.
metadataobjectFile メタデータ。
identity_idstring/nullForward の所有 Identity。

エラー

HTTPType発生条件
400invalid_request_errorThe request body, path parameters, query parameters, or multipart fields are invalid.
400invalid_request_errorThe file type is unsupported. See Supported upload file types.
400invalid_request_errorIf the reserved key created_by is supplied, message is metadata key "created_by" is reserved, identifying the invalid field.
401authentication_error認証トークンがないか、無効です。
403permission_error呼び出し元にはこのリソースへのアクセス権限がありません。
409conflict_errorリソース状態、参照関係、または冪等性キーが競合しています。
429rate_limit_errorアップロード容量が不足しています。
500/502/503api_errorForward または依存サービスでエラーが発生しました。
File のアップロード - Qoder