> For the complete documentation index, see [llms.txt](https://docs.maiagent.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.maiagent.ai/tech/ja/api-integration/endpoint-behaviors/conversation-attachments.md).

# 対話添付ファイル管理 API

ファイルライブラリ API で会話の添付ファイルを照会・削除し、一覧の可視範囲と有効期限のフィールドを確認します。

会話の添付ファイルを照会するには、会話の添付ファイル API を使用できます。一覧には、ファイルライブラリのファイルに直接リンクされた添付ファイルは含まれません。自動アーカイブでは別途ファイルライブラリの項目が作成されるため、元の会話の添付ファイルが引き続きこの一覧に表示される場合があります。一覧に添付ファイルがあるかどうかだけで、ファイルがアーカイブ済みかを判断しないでください。添付ファイルのアップロード方法は、[Presigned ファイルアップロードモード](/tech/ja/api-integration/api_knowledge.md) を参照してください。

## アクセス条件と可視範囲 <a href="#access-and-visibility" id="access-and-visibility"></a>

`Authorization: Api-Key <ご自身の API キー>` で認証してください。キーの取得方法は、[クイックスタート](/tech/ja/api-integration/quickstart.md) を参照してください。組織でファイルライブラリが有効になっており、呼び出し元がファイルライブラリに関連する権限を持っている必要があります。組織の所有者は、組織内で上記の条件を満たす会話の添付ファイルを閲覧できます。その他のメンバーは、自分がメッセージを送信したことのある会話の添付ファイルのみ閲覧できます。一覧は作成日時の新しい順に並びます。

## エンドポイント <a href="#endpoints" id="endpoints"></a>

`GET /api/v1/file-library/conversation-attachments/` は呼び出し元が閲覧できる会話の添付ファイルを一覧表示し、`DELETE /api/v1/file-library/conversation-attachments/{id}/` は添付ファイルを1件削除します。パラメータとレスポンスのフィールドは、API ドキュメントの [会話の添付ファイル一覧](https://docs.maiagent.ai/api/api-reference/fu-jian-he-dang-an#file-library-conversation-attachments-list) と [会話の添付ファイルの削除](https://docs.maiagent.ai/api/api-reference/fu-jian-he-dang-an#file-library-conversation-attachments-destroy) を参照してください。

`{id}` は一覧で返される添付ファイル ID です。削除時には、共有されていない保存ファイルも削除されるため、選択した添付ファイルを事前に確認してください。他の添付ファイルやファイルが同じストレージオブジェクトを使用している場合、そのオブジェクトは保持されます。

## ページネーションと一覧のフィールド <a href="#list-fields" id="list-fields"></a>

一覧はデフォルトで1ページあたり20件です。`pageSize`（`page_size` も使用できます）で調整でき、上限は100件です。添付ファイルはレスポンスの `results` に含まれます。`next` が `null` になるまで、`next` の URL に従って次のページを取得してください。最初のページだけで取得を終えないでください。

各添付ファイルのフィールドは、API ドキュメントの [会話の添付ファイル一覧](https://docs.maiagent.ai/api/api-reference/fu-jian-he-dang-an#file-library-conversation-attachments-list) を参照してください。連携側では `conversationId` を使用して元の会話を特定できます。`expiresAt` はクリーンアップ設定に基づいて計算される有効期限で、ISO 8601 形式の文字列です（`createdAt` のミリ秒単位のタイムスタンプとは異なります）。クリーンアップの適用時刻が設定されていない場合は `null` です。会話に最終メッセージの時刻がある場合は、その時刻を基準に有効期限が計算されます。ない場合は、添付ファイルの作成時刻が基準になります。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.maiagent.ai/tech/ja/api-integration/endpoint-behaviors/conversation-attachments.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
