Adicionar recurso de sessão
POST/v1/sessions/{session_id}/resources
Adicionar recurso de sessão
Parameters
Returns
Adicionar recurso de sessão
<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
$client = new Client(apiKey: 'my-anthropic-api-key');
$betaManagedAgentsFileResource = $client->beta->sessions->resources->add(
'sesn_011CZkZAtmR3yMPDzynEDxu7',
fileID: 'file_011CNha8iCJcU1wXNR6q4V8w',
type: 'file',
mountPath: '/uploads/receipt.pdf',
betas: [AnthropicBeta::MESSAGE_BATCHES_2024_09_24],
workspaceID: 'wrkspc_011CZkZaBF1tNoB5wlCeusgy',
);
var_dump($betaManagedAgentsFileResource);Response 200
{
"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
Response 200
{
"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"
}