Skip to content
  • Auto
  • Light
  • Dark
DiscordForumGitHubSign up
View as Markdown
Copy Markdown

Open in Claude
Open in ChatGPT

Close File For Agent

agents.files.close(strfile_id, FileCloseParams**kwargs) -> object
patch/v1/agents/{agent_id}/files/{file_id}/close

Closes a specific file for a given agent.

This endpoint marks a specific file as closed in the agent's file state. The file will be removed from the agent's working memory view.

ParametersExpand Collapse
agent_id: str

The ID of the agent in the format 'agent-'

minLength42
maxLength42
file_id: str

The ID of the file in the format 'file-'

minLength41
maxLength41
ReturnsExpand Collapse
object
Close File For Agent
from letta_client import Letta

client = Letta(
    api_key="My API Key",
)
response = client.agents.files.close(
    file_id="file-123e4567-e89b-42d3-8456-426614174000",
    agent_id="agent-123e4567-e89b-42d3-8456-426614174000",
)
print(response)
{}
Returns Examples
{}