Adicionar recurso de sessão
POST/v1/sessions/{session_id}/resources
Adicionar recurso de sessão
Parameters
Returns
Adicionar recurso de sessão
package com.anthropic.example;
import com.anthropic.client.AnthropicClient;
import com.anthropic.client.okhttp.AnthropicOkHttpClient;
import com.anthropic.models.beta.sessions.BetaManagedAgentsFileResourceParams;
import com.anthropic.models.beta.sessions.resources.BetaManagedAgentsFileResource;
import com.anthropic.models.beta.sessions.resources.ResourceAddParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
AnthropicClient client = AnthropicOkHttpClient.fromEnv();
ResourceAddParams params = ResourceAddParams.builder()
.sessionId("sesn_011CZkZAtmR3yMPDzynEDxu7")
.betaManagedAgentsFileResourceParams(BetaManagedAgentsFileResourceParams.builder()
.fileId("file_011CNha8iCJcU1wXNR6q4V8w")
.type(BetaManagedAgentsFileResourceParams.Type.FILE)
.build())
.build();
BetaManagedAgentsFileResource betaManagedAgentsFileResource = client.beta().sessions().resources().add(params);
}
}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"
}