Skip to main content
The Notion SDK provides a complete file upload system through the 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:
  1. Create - Initialize a file upload and get upload metadata
  2. Send - Upload the file content (single or multi-part)
  3. Complete - Finalize multi-part uploads
  4. Use - Reference the file in pages, blocks, or properties
  5. 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

Use fileUploads.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

Use fileUploads.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

You must send exactly the number of parts specified in number_of_parts before calling complete().

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 a FileUploadObjectResponse:

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

  • Use single_part for files under 20MB
  • Use multi_part for files over 20MB
  • Use external_url for publicly hosted files
For multi-part uploads, track progress using the number_of_parts field:
File uploads expire after 24 hours. Regularly check for expired or failed uploads and handle them appropriately.
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_type matches file extension

Complete Upload Example

Here’s a complete example with error handling: