> 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/en/api-integration/endpoint-behaviors/conversation-attachments.md).

# Conversation Attachment Management API

Use the file library API to query and delete conversation attachments, and understand list visibility and expiration fields.

Use the conversation attachment API when you need to query conversation attachments. The list excludes attachments directly linked to file library files. Automatic archiving creates separate file library entries, so the original conversation attachments may still appear in this list. Do not determine whether a file has been archived solely by whether its attachment appears in the list. For how to upload attachments, see [Presigned File Upload Mode](/tech/en/api-integration/api_knowledge.md).

## Access Requirements and Visibility <a href="#access-and-visibility" id="access-and-visibility"></a>

Authenticate with `Authorization: Api-Key <your API key>`. For how to obtain a key, see [Quickstart](/tech/en/api-integration/quickstart.md). The organization must have the file library enabled, and the caller must have the relevant file library permissions. Organization owners can view conversation attachments in their organization that meet the conditions above. Other members can view attachments only from conversations in which they have sent a message. The list is sorted by creation time, newest first.

## Endpoints <a href="#endpoints" id="endpoints"></a>

`GET /api/v1/file-library/conversation-attachments/` lists conversation attachments visible to the caller, and `DELETE /api/v1/file-library/conversation-attachments/{id}/` deletes one attachment. For parameters and response fields, see the API documentation for [List Conversation Attachments](https://docs.maiagent.ai/api/api-reference/fu-jian-he-dang-an#file-library-conversation-attachments-list) and [Delete a Conversation Attachment](https://docs.maiagent.ai/api/api-reference/fu-jian-he-dang-an#file-library-conversation-attachments-destroy).

`{id}` is the attachment ID returned by the list. Deletion also removes the stored file if it is not shared, so confirm the selected attachment first. If another attachment or file still uses the same storage object, that object is retained.

## Pagination and List Fields <a href="#list-fields" id="list-fields"></a>

The default page size is 20 items. Use `pageSize` (or `page_size`) to adjust it, up to 100 items. Attachments are returned in `results`. Keep following the `next` URL to retrieve subsequent pages until `next` is `null`; do not read only the first page.

For the fields of each attachment, see the API documentation for [List Conversation Attachments](https://docs.maiagent.ai/api/api-reference/fu-jian-he-dang-an#file-library-conversation-attachments-list). Integrations can use `conversationId` to identify the source conversation. `expiresAt` is the expiration time calculated from the cleanup settings, represented as an ISO 8601 string (unlike the millisecond timestamp in `createdAt`). It is `null` when no effective cleanup time has been configured. If the conversation has a last-message time, expiration is based on that time; otherwise, it is based on the attachment's creation time.


---

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