> ## Documentation Index
> Fetch the complete documentation index at: https://docs.alforse.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ファイル

> 契約原本、請求書、領収証跡、その他証拠をアップロード/ダウンロードします。

アップロードは presign、オブジェクトストレージ直送、confirm の 3 段階です。API は生ファイル本文を直接受け取りません。

| エンドポイント                   | 本文/パラメータ                                                                   | 権限                   |
| ------------------------- | -------------------------------------------------------------------------- | -------------------- |
| `POST /files/presign`     | `fileName, contentType, sizeBytes, kind, subjectId, contractId, paymentId` | `contract_view view` |
| `PUT signed upload URL`   | `file bytes to object storage`                                             | `signed URL`         |
| `POST /files/confirm`     | `objectKey, fileName, contentType, sizeBytes, kind, uploadToken`           | `contract_view view` |
| `GET /files/:id/download` | `contractId, paymentId`                                                    | `contract_view view` |
