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

Query parameters

ParameterTypeRequiredDescription
identity_idstringNoFor Identity-owned resources only. PATs may supply this query parameter; omitting it uses the administrator scope. SAT ownership is determined by the credential; any SAT (including Admin SAT) explicitly supplying this parameter, even with an empty value, receives HTTP 400. See Identity ownership.

Form フィールド

フィールド型必須説明
filefileはいアップロードするファイルの内容です。最大サイズは 500 MiB です。対応する形式については、アップロード可能なファイル形式を参照してください。
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, including any SAT explicitly supplying query identity_id (even with an empty value).
400invalid_request_errorファイルの内容が 500 MiB を超えています。
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管理者 Scope で Owner mismatch が発生したか、下流サービスがアクセスを拒否しました。
404not_found_errorPAT で指定した Identity が存在しない、無効化または削除されている、あるいは呼び出し元に属していません。
409conflict_errorリソース状態、参照関係、または冪等性キーが競合しています。
429rate_limit_errorアップロード容量が不足しています。
500/502/503api_errorForward または依存サービスでエラーが発生しました。