Files, images, and other media bring your Notion workspace to life — from company logos and product photos to contract PDFs and design assets. With the Notion API, you can programmatically upload, attach, and reuse these files wherever they’re needed.
In this guide, you’ll learn how to:
We’ll also walk through the different upload methods and supported file types, so you can choose the best path for your integration.
The Notion API supports three ways to add files to your workspace:
Upload method Description Best for Direct Upload Upload a file (≤ 20MB) via amultipart/form-data
request The simplest method for most files Direct Upload (multi-part) Upload large files (> 20MB) in chunks across multiple requests Larger media assets and uploads over time Indirect Import Import a file from a publicly accessible URL Migration workflows and hosted content
Uploaded files can be attached to:
file
, image
, pdf
, audio
, video
files
properties in databasesicon
and cover
💡 Need support for another block or content type? Let us know here.
Before uploading, make sure your file type is supported. Here’s what the API accepts:
Category Extensions MIME types Audio .aac, .adts, .mid, .midi, .mp3, .mpga, .m4a, .m4b, .mp4, .oga, .ogg, .wav, .wma audio/aac, audio/midi, audio/mpeg, audio/mp4, audio/ogg, audio/wav, audio/x-ms-wma Document .pdf, .txt, .json, .doc, .dot, .docx, .dotx, .xls, .xlt, .xla, .xlsx, .xltx, .ppt, .pot, .pps, .ppa, .pptx, .potx application/pdf, text/plain, application/json, application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document, application/vnd.openxmlformats-officedocument.wordprocessingml.template, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.openxmlformats-officedocument.spreadsheetml.template, application/vnd.ms-powerpoint, application/vnd.openxmlformats-officedocument.presentationml.presentation, application/vnd.openxmlformats-officedocument.presentationml.template Image .gif, .heic, .jpeg, .jpg, .png, .svg, .tif, .tiff, .webp, .ico image/gif, image/heic, image/jpeg, image/png, image/svg+xml, image/tiff, image/webp, image/vnd.microsoft.icon Video .amv, .asf, .wmv, .avi, .f4v, .flv, .gifv, .m4v, .mp4, .mkv, .webm, .mov, .qt, .mpeg video/x-amv, video/x-ms-asf, video/x-msvideo, video/x-f4v, video/x-flv, video/mp4, application/mp4, video/webm, video/quicktime, video/mpeg⚠️Ensure your file type matches the context
For example:
- You can’t use a video in an image block
- Page icons can’t be PDFs
- Text files can’t be embedded in video blocks
These are the same size limits that apply to uploads in the Notion app UI.
Use the Retrieve a user or List all users API to get the file size limit for a bot user. Public integrations that can be added to both free or paid workspaces can retrieve or cache each bot's file size limit. This can help avoid HTTP 400 validation errors for attempting to send files above the size limit.
type APIUserObject = {
object: "user",
type: "bot",
// ... other fields omitted
bot: {
// ... other fields omitted
// Limits and restrictions that apply to the bot's workspace.
workspace_limits: {
// The maximum allowable size of a file upload, in bytes.
max_file_upload_size_in_bytes: number,
},
}
}
For example, in a free workspace where bots are limited to FileUploads of 5 MiB, the response looks like:
{
"object": "user",
"id": "be51669b-1932-4a11-8d35-38fbc2e1e4fd",
"type": "bot",
"bot": {
"owner": {
"type": "workspace"
},
"workspace_name": "Cat's Notion",
"workspace_limits": {
"max_file_upload_size_in_bytes": 5242880
}
}
}
Updated about 1 month ago
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4