> ## 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.

# ファイルメタデータの取得

> ファイル ID で単一ファイルの詳細メタデータを取得します。

`GET /api/v1/cloud/files/{file_id}`

単一の[ファイルオブジェクト](/ja/cloud-agents/api/files/schemas#file-object)を取得します。`deleted` ステータスのファイルはこのエンドポイントでは返されません。

## パスパラメータ

| パラメータ     | 型      | 必須 | 説明                       |
| --------- | ------ | -- | ------------------------ |
| `file_id` | string | はい | ファイル ID（`file_` プレフィックス） |

## ヘッダー

| ヘッダー          | 必須 | 説明                  |
| ------------- | -- | ------------------- |
| Authorization | はい | `Bearer $QODER_PAT` |

## リクエスト例

```bash theme={null}
curl -X GET "https://api.qoder.com/api/v1/cloud/files/file_019e3bb8c1387743bf4ef115aae5acb1" \
  -H "Authorization: Bearer $QODER_PAT"
```

## レスポンス例

**HTTP 200 OK**

```json theme={null}
{
  "id": "file_019e3bb8c1387743bf4ef115aae5acb1",
  "type": "file",
  "filename": "qoder-test-upload.txt",
  "mime_type": "text/plain",
  "size_bytes": 110,
  "downloadable": true,
  "scope": {
    "id": "sess_019e3bb8e6c47d18",
    "type": "session"
  },
  "metadata": {
    "project": "demo"
  },
  "created_at": "2026-05-18T15:33:44Z"
}
```

## レスポンスフィールド

| フィールド          | 型              | 説明                                                                              |
| -------------- | -------------- | ------------------------------------------------------------------------------- |
| `id`           | string         | ファイル ID（`file_` プレフィックス）                                                        |
| `type`         | string         | 常に `"file"`                                                                     |
| `filename`     | string         | 保存されたファイル名                                                                      |
| `size_bytes`   | integer        | ファイルサイズ（バイト）                                                                    |
| `mime_type`    | string         | アップロード時に指定された MIME タイプ、またはファイル名から検出された MIME タイプ                                 |
| `downloadable` | boolean        | このファイルを `/content` エンドポイント経由でダウンロードできるかどうか                                      |
| `scope`        | object \| null | ファイルが他のリソースに関連付けられている場合のスコープオブジェクト。例: `{ "id": "sess_...", "type": "session" }` |
| `metadata`     | object         | アップロード時に指定するカスタムメタデータオブジェクト。デフォルトは `{}`                                         |
| `created_at`   | string         | 作成時刻（RFC 3339 形式の UTC）                                                          |

## エラーレスポンス

| HTTP | type                   | 説明                                 |
| ---- | ---------------------- | ---------------------------------- |
| 401  | `authentication_error` | 認証トークンが欠落または無効                     |
| 404  | `not_found_error`      | 指定 ID のファイルが存在しないか `deleted` ステータス |

[エラー](/ja/cloud-agents/api/conventions/errors)で完全なエラーエンベロープを参照してください。

## 関連項目

<CardGroup cols={2}>
  <Card title="ファイルの添付とダウンロード" icon="paperclip" href="/ja/cloud-agents/files">
    Agent にコンテキストを提供するファイルをアップロードし、Agent が生成したファイルをダウンロードします。
  </Card>
</CardGroup>
