Add Session Resource
beta.sessions.resources.add(strsession_id, ResourceAddParams**kwargs) -> BetaManagedAgentsFileResourcePOST/v1/sessions/{session_id}/resources
Add Session Resource
import os
from anthropic import Anthropic
client = Anthropic(
api_key=os.environ.get(
"ANTHROPIC_API_KEY"
), # This is the default and can be omitted
)
beta_managed_agents_file_resource = client.beta.sessions.resources.add(
session_id="sesn_011CZkZAtmR3yMPDzynEDxu7",
file_id="file_011CNha8iCJcU1wXNR6q4V8w",
type="file",
)
print(beta_managed_agents_file_resource.id){
"id": "sesrsc_011CZkZBJq5dWxk9fVLNcPht",
"created_at": "2026-03-15T10:00:00Z",
"file_id": "file_011CNha8iCJcU1wXNR6q4V8w",
"mount_path": "/uploads/receipt.pdf",
"type": "file",
"updated_at": "2026-03-15T10:00:00Z"
}Returns Examples
{
"id": "sesrsc_011CZkZBJq5dWxk9fVLNcPht",
"created_at": "2026-03-15T10:00:00Z",
"file_id": "file_011CNha8iCJcU1wXNR6q4V8w",
"mount_path": "/uploads/receipt.pdf",
"type": "file",
"updated_at": "2026-03-15T10:00:00Z"
}