upload_id that is accepted wherever an item id or ref is.
A file you hold
POST /api/v1/uploadswithfile_name,content_typeandfile_sizereturnsupload_url, valid for one hour, andr2_key. One upload carries up to 5 GB; a larger file goes throughimport_mediainlinkmode.PUTthe bytes toupload_urlwith the same content type.POST /api/v1/uploads/confirmwithr2_key,file_name,file_sizeandcontent_typeturns the file into a library item and returnsupload_idand its type.descriptionsets the item’s description.enrich: truedescribes and tags an image, using cloud processing.made_fromrecords what the file was made from.
A file at a URL
POST /api/v1/uploads/import fetches a public URL into the library in one call, keeping the original bytes. Send url for one file, or items for up to 20, each with its own file_name, description and made_from. A batch returns results in input order, each with a status of imported, duplicate or failed, and a summary. A failed item is a status in the list, not an error. folder_id accepts an id or a path.
A duplicate, meaning a file the library already holds byte for byte, returns 200 with the existing item and duplicate: true.
The same over the tools
import_media does the same through any interface, in url, file, presign and confirm modes, and through the desktop app in local mode for a path on that computer. See Library.
