SPB Git

Repository Public

add.md 3.5 KB 187 lines markdown

1---2title: Add Session Resource3url: https://platform.claude.com/docs/en/api/beta/sessions/resources/add4---56# Add Session Resource78**POST** `/v1/sessions/{session_id}/resources`910Add Session Resource1112## Path parameters1314- `session_id: string`1516## Headers1718- `"anthropic-beta": optional array of AnthropicBeta`1920  Optional header to specify the beta version(s) you want to use.2122  - `string`2324  - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 43 more`2526    - `"message-batches-2024-09-24"`2728    - `"prompt-caching-2024-07-31"`2930    - `"computer-use-2024-10-22"`3132    - `"computer-use-2025-01-24"`3334    - `"pdfs-2024-09-25"`3536    - `"token-counting-2024-11-01"`3738    - `"token-efficient-tools-2025-02-19"`3940    - `"output-128k-2025-02-19"`4142    - `"files-api-2025-04-14"`4344    - `"mcp-client-2025-04-04"`4546    - `"mcp-client-2025-11-20"`4748    - `"dev-full-thinking-2025-05-14"`4950    - `"interleaved-thinking-2025-05-14"`5152    - `"code-execution-2025-05-22"`5354    - `"extended-cache-ttl-2025-04-11"`5556    - `"context-1m-2025-08-07"`5758    - `"context-management-2025-06-27"`5960    - `"model-context-window-exceeded-2025-08-26"`6162    - `"skills-2025-10-02"`6364    - `"fast-mode-2026-02-01"`6566    - `"output-300k-2026-03-24"`6768    - `"user-profiles-2026-03-24"`6970    - `"user-profiles-2026-08-18"`7172    - `"user-profiles-2026-09-04"`7374    - `"advisor-tool-2026-03-01"`7576    - `"managed-agents-2026-04-01"`7778    - `"cache-diagnosis-2026-04-07"`7980    - `"dreaming-2026-04-21"`8182    - `"thinking-token-count-2026-05-13"`8384    - `"server-side-fallback-2026-06-01"`8586    - `"server-side-fallback-2026-07-01"`8788    - `"fallback-credit-2026-06-01"`8990    - `"fallback-credit-2026-07-01"`9192    - `"agent-memory-2026-07-22"`9394    - `"mid-conversation-tool-changes-2026-07-01"`9596    - `"compact-2026-01-12"`9798    - `"computer-use-2025-11-24"`99100    - `"mcp-tunnels-2026-06-22"`101102    - `"structured-outputs-2025-11-13"`103104    - `"task-budgets-2026-03-13"`105106    - `"thinking-display-updates-2026-08-18"`107108    - `"ce-user-management-2026-07-13"`109110    - `"mid-conversation-output-config-2026-07-01"`111112    - `"thinking-binding-controls-2026-08-01"`113114    - `"mid-conversation-system-clear-at-2026-08-21"`115116    - `"compact-2026-09-04"`117118- `"anthropic-workspace-id": optional string`119120## Body parameters121122- `file_id: string`123124  ID of a previously uploaded file.125126  minLength: 1, maxLength: 128127128- `type: "file"`129130- `mount_path: optional string or null`131132  Mount path in the container. Defaults to `/mnt/session/uploads/<file_id>`.133134  minLength: 1, maxLength: 4096135136## Returns137138- `BetaManagedAgentsFileResource object`139140  - `type: "file"`141142  - `id: string`143144  - `created_at: string`145146    A timestamp in RFC 3339 format147148    format: date-time149150  - `file_id: string`151152  - `mount_path: string`153154  - `updated_at: string`155156    A timestamp in RFC 3339 format157158    format: date-time159160## Example161162```bash163curl https://api.anthropic.com/v1/sessions/$SESSION_ID/resources \164    -H 'Content-Type: application/json' \165    -H 'anthropic-version: 2023-06-01' \166    -H 'anthropic-beta: managed-agents-2026-04-01' \167    -H "X-Api-Key: $ANTHROPIC_API_KEY" \168    -d '{169          "file_id": "file_011CNha8iCJcU1wXNR6q4V8w",170          "type": "file",171          "mount_path": "/uploads/receipt.pdf"172        }'173```174175### Response (200)176177```json178{179  "id": "sesrsc_011CZkZBJq5dWxk9fVLNcPht",180  "created_at": "2026-03-15T10:00:00Z",181  "file_id": "file_011CNha8iCJcU1wXNR6q4V8w",182  "mount_path": "/uploads/receipt.pdf",183  "type": "file",184  "updated_at": "2026-03-15T10:00:00Z"185}186```187
Files main
Menu

Theme