---
title: "List Agent Files"
method: GET
path: "/v1/agents/{agent_id}/files"
tags: ["agents"]
---

# List Agent Files

`GET /v1/agents/{agent_id}/files`

Get the files attached to an agent with their open/closed status (paginated).

## Path parameters

- `agent_id` string, required

## Query parameters

- `cursor` string, nullable — Pagination cursor from previous response
- `limit` integer — Number of items to return (1-100)
- `is_open` boolean, nullable — Filter by open status (true for open files, false for closed files)

## Response `200`

Successful Response

- PaginatedAgentFiles — Paginated response for agent files
  - `files` AgentFileAttachment[], required — List of file attachments for the agent
    - `id` string, required — Unique identifier of the file-agent relationship
    - `file_id` string, required — Unique identifier of the file
    - `file_name` string, required — Name of the file
    - `folder_id` string, required — Unique identifier of the folder/source
    - `folder_name` string, required — Name of the folder/source
    - `is_open` boolean, required — Whether the file is currently open in the agent's context
    - `last_accessed_at` string, date-time, nullable — Timestamp of last access by the agent
    - `visible_content` string, nullable — Portion of the file visible to the agent if open
    - `start_line` integer, nullable — Starting line number if file was opened with line range
    - `end_line` integer, nullable — Ending line number if file was opened with line range
  - `next_cursor` string, nullable — Cursor for fetching the next page (file-agent relationship ID)
  - `has_more` boolean, required — Whether more results exist after this page

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/yu-code666/apis/letta-api.md) · [All operations](https://skmtc.dev/yu-code666/apis/letta-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/yu-code666/letta-api/revisions/05c8e12a3c8f/schema)
