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

Open in Claude
Open in ChatGPT

Close All Files For Agent

agents.files.close_all(stragent_id) -> FileCloseAllResponse
patch/v1/agents/{agent_id}/files/close-all

Closes all currently open files for a given agent.

This endpoint updates the file state for the agent so that no files are marked as open. Typically used to reset the working memory view for the agent.

ParametersExpand Collapse
agent_id: str

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

minLength42
maxLength42
ReturnsExpand Collapse
FileCloseAllResponse = List[str]
Close All Files For Agent
from letta_client import Letta

client = Letta(
    api_key="My API Key",
)
response = client.agents.files.close_all(
    "agent-123e4567-e89b-42d3-8456-426614174000",
)
print(response)
[
  "string"
]
Returns Examples
[
  "string"
]