### Headers ### Headers ### Headers ### Headers ### Headers
The whole hunk
from line 1, old and new numbered
/
lines
from line 1
1---
2title: Files
3url: https://platform.claude.com/docs/en/api/files
4---
5
16# Files
27
38## Upload File
from line 11
611
712Upload File
813
14### Headers
15
16- `"anthropic-workspace-id": optional string`
17
918### Body parameters (form-data)
1019
1120- `file: string`
1221
13 The file to upload
22 The file to upload. Only the final path component of the part's `filename` is kept; an absent or empty `filename` is replaced with `unnamed` plus the extension for the file's stored `mime_type`, when known.
1423
1524 format: binary
1625
from line 33
2433
2534- `FileMetadata object`
2635
36 - `type: "file"`
37
38 Object type.
39
40 For files, this is always `"file"`.
41
2742 - `id: string`
2843
2944 Unique object identifier.
from line 69
5469
5570 minimum: 0
5671
57 - `type: "file"`
58
59 Object type.
60
61 For files, this is always `"file"`.
62
6372 - `downloadable: optional boolean`
6473
6574 Whether the file can be downloaded.
from line 130
121130
122131 Opaque page cursor returned in a prior list response's `next_page`. Prefixed `page_`.
123132
133### Headers
134
135- `"anthropic-workspace-id": optional string`
136
124137### Returns
125138
126139- `data: array of FileMetadata`
from line 140
127140
128141 List of file metadata objects.
129142
143 - `type: "file"`
144
145 Object type.
146
147 For files, this is always `"file"`.
148
130149 - `id: string`
131150
132151 Unique object identifier.
from line 176
157176
158177 minimum: 0
159178
160 - `type: "file"`
161
162 Object type.
163
164 For files, this is always `"file"`.
165
166179 - `downloadable: optional boolean`
167180
168181 Whether the file can be downloaded.
from line 232
219232
220233 ID of the File.
221234
235### Headers
236
237- `"anthropic-workspace-id": optional string`
238
222239### Example
223240
224241```bash
from line 256
239256
240257 ID of the File.
241258
259### Headers
260
261- `"anthropic-workspace-id": optional string`
262
242263### Returns
243264
244265- `FileMetadata object`
245266
267 - `type: "file"`
268
269 Object type.
270
271 For files, this is always `"file"`.
272
246273 - `id: string`
247274
248275 Unique object identifier.
from line 300
273300
274301 minimum: 0
275302
276 - `type: "file"`
277
278 Object type.
279
280 For files, this is always `"file"`.
281
282303 - `downloadable: optional boolean`
283304
284305 Whether the file can be downloaded.
from line 347
326347
327348 ID of the File.
328349
350### Headers
351
352- `"anthropic-workspace-id": optional string`
353
329354### Returns
330355
331356- `DeletedFile object`
332357
333 - `id: string`
334
335 ID of the deleted file.
336
337358 - `type: optional "file_deleted"`
338359
339360 Deleted object type.
from line 363
342363
343364 default: file_deleted
344365
366 - `id: string`
367
368 ID of the deleted file.
369
345370### Example
346371
347372```bash
from line 391
366391
367392- `DeletedFile object`
368393
369 - `id: string`
370
371 ID of the deleted file.
372
373394 - `type: optional "file_deleted"`
374395
375396 Deleted object type.
from line 399
378399
379400 default: file_deleted
380401
402 - `id: string`
403
404 ID of the deleted file.
405
381406### File Metadata
382407
383408- `FileMetadata object`
384409
410 - `type: "file"`
411
412 Object type.
413
414 For files, this is always `"file"`.
415
385416 - `id: string`
386417
387418 Unique object identifier.
from line 442
411442 Size of the file in bytes.
412443
413444 minimum: 0
414
415 - `type: "file"`
416
417 Object type.
418
419 For files, this is always `"file"`.
420445
421446 - `downloadable: optional boolean`
422447