client.fileUploads namespace. You can upload files to use as page icons, covers, or inline file blocks.
File Upload Lifecycle
The file upload process follows these steps:- Create - Initialize a file upload and get upload metadata
- Send - Upload the file content (single or multi-part)
- Complete - Finalize multi-part uploads
- Use - Reference the file in pages, blocks, or properties
- List - View all file uploads and their status
Upload Modes
The API supports three upload modes:single_part
For files under 20MB. Upload in one request.
multi_part
For files over 20MB. Upload in multiple chunks.
external_url
Import a publicly accessible file from a URL.
Creating a File Upload
UsefileUploads.create() to initialize an upload:
create() Method Signature
Parameters
Single-Part Upload Example
For files under 20MB:Multi-Part Upload Example
For files over 20MB, upload in chunks:External URL Import
Import a publicly accessible file:The file must be publicly accessible without authentication. Notion will download and import the file asynchronously.
Sending File Data
UsefileUploads.send() to upload the actual file content:
send() Method Signature
Parameters
Browser Example with File Input
Completing Multi-Part Uploads
After sending all parts, finalize the upload:complete() Method Signature
Example
Using Uploaded Files
Once uploaded, reference the file by its ID:As Page Icon
As Page Cover
As Inline File Block
Retrieving File Uploads
Get details about a specific file upload:retrieve() Method Signature
Example
Listing File Uploads
Retrieve all file uploads with optional filtering:list() Method Signature
Parameters
Example
File Upload Response
All file upload methods return aFileUploadObjectResponse:
Status Values
pending
Upload created but file not yet sent
uploaded
File successfully uploaded and ready to use
expired
Upload expired before completion (typically 24 hours)
failed
Upload failed due to an error
Best Practices
Choose the right upload mode
Choose the right upload mode
- Use
single_partfor files under 20MB - Use
multi_partfor files over 20MB - Use
external_urlfor publicly hosted files
Handle upload errors
Handle upload errors
Monitor upload progress for large files
Monitor upload progress for large files
For multi-part uploads, track progress using the
number_of_parts field:Clean up failed uploads
Clean up failed uploads
File uploads expire after 24 hours. Regularly check for expired or failed uploads and handle them appropriately.
Validate file types and sizes
Validate file types and sizes
Before uploading, validate that the file meets Notion’s requirements:
- Maximum file size varies by plan
- Supported file types depend on usage (images, videos, documents)
- Check
content_typematches file extension