Upload File
api/beta/files/upload
Nearest release: v2.1.245, published an hour after this site recorded the change. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.
api/beta/files/upload Changed · +26 / -17 lines
# Upload File ## Headers ## Body parameters (form-data) ## Returns ## Example ### Response (200) ## Upload File ### Header Parameters ### Returns ### Example #### Response
---- -title: Upload File -url: https://platform.claude.com/docs/en/api/beta/files/upload ---- +# Upload File -## Upload File +**POST** `/v1/files` -**post** `/v1/files` - Upload File -### Header Parameters +## Headers - `"anthropic-beta": optional array of AnthropicBeta`
- `"mid-conversation-tool-changes-2026-07-01"` -### Returns +## Body parameters (form-data) -- `BetaFileMetadata object { id, created_at, filename, 5 more }` +- `file: string` + The file to upload + + format: binary + +## Returns + +- `BetaFileMetadata object` + - `id: string` Unique object identifier.
RFC 3339 datetime string representing when the file was created. + format: date-time + - `filename: string` Original filename of the uploaded file. + maxLength: 500, minLength: 1 + - `mime_type: string` MIME type of the file. + maxLength: 255, minLength: 1 + - `size_bytes: number` Size of the file in bytes. + minimum: 0 + - `type: "file"` Object type.
For files, this is always `"file"`. - - `"file"` - - `downloadable: optional boolean` Whether the file can be downloaded. + default: false + - `scope: optional BetaFileScope or null` The scope of this file, indicating the context in which it was created (e.g., a session).
The type of scope (e.g., `"session"`). - - `"session"` +## Example -### Example - -```http +```bash curl https://api.anthropic.com/v1/files \ -H 'Content-Type: multipart/form-data' \ -H 'anthropic-version: 2023-06-01' \
-F 'file=@/path/to/file' ``` -#### Response +### Response (200) ```json {