Skip to content
Discord

Files

Close All Files For Agent
client.agents.files.closeAll(stringagentID, RequestOptionsoptions?): FileCloseAllResponse
PATCH/v1/agents/{agent_id}/files/close-all
Open File For Agent
client.agents.files.open(stringfileID, FileOpenParams { agent_id } params, RequestOptionsoptions?): FileOpenResponse
PATCH/v1/agents/{agent_id}/files/{file_id}/open
Close File For Agent
client.agents.files.close(stringfileID, FileCloseParams { agent_id } params, RequestOptionsoptions?): FileCloseResponse
PATCH/v1/agents/{agent_id}/files/{file_id}/close
List Files For Agent
client.agents.files.list(stringagentID, FileListParams { after, before, cursor, 4 more } query?, RequestOptionsoptions?): NextFilesPage<FileListResponse { id, file_id, file_name, 7 more } >
GET/v1/agents/{agent_id}/files
ModelsExpand Collapse
FileCloseAllResponse = Array<string>
FileOpenResponse = Array<string>
FileCloseResponse = unknown
FileListResponse { id, file_id, file_name, 7 more }

Response model for agent file attachments showing file status in agent context

id: string

Unique identifier of the file-agent relationship

file_id: string

Unique identifier of the file

file_name: string

Name of the file

folder_id: string

Unique identifier of the folder/source

folder_name: string

Name of the folder/source

is_open: boolean

Whether the file is currently open in the agent’s context

end_line?: number | null

Ending line number if file was opened with line range

last_accessed_at?: string | null

Timestamp of last access by the agent

formatdate-time
start_line?: number | null

Starting line number if file was opened with line range

visible_content?: string | null

Portion of the file visible to the agent if open