Send a file upload
Use this API to transmit file contents to Notion for afile upload.
For this endpoint, use aContent-Type ofmultipart/form-data, and provide your file contents under thefile key.
📘
The use of multipart form data is unique to this endpoint. Other Notion APIs, includingCreate a file upload andComplete a file upload, use JSON parameters.
Include a
boundarywith theContent-Typeheader of your request as perRFC 2388. Most request libraries (e.g.fetch,ky) automatically handle this as long as you provide a form data object but don't overwrite theContent-Typeexplicitly.For more tips and examples, view thefile upload guide.
Whenmode=multi_part, each part must include a form fieldpart_number to indicate which part is being sent. Parts may be sent concurrently up to standard Notion APIrate limits, and may be sent out of order as long as all parts (1, ...,part_number) are successfully sent before calling thecomplete file upload API.
The maximum allowed length of a file name is 900 bytes, including any file extension included in the file name or inferred based on thecontent_type. However, we recommend using shorter names for performance and easier file management and lookup using theList file uploads API.