upload_file_to_notion
Upload files to Notion via API, supporting custom filenames and authentication. Returns file upload ID for further integration with Notion pages.
Instructions
Upload a file to Notion using the Notion API.
Args:
file_path: Path to the file to upload
notion_token: Notion API token for authentication (optional if NOTION_API_TOKEN env var is set)
file_name: Optional custom filename (defaults to original filename)
Returns:
The file upload ID from Notion (use upload_and_attach_file_to_page for URL)
Raises:
Exception: If file doesn't exist, exceeds size limit, or API call fails
Input Schema
Name | Required | Description | Default |
---|---|---|---|
file_name | No | ||
file_path | Yes | ||
notion_token | No |
Input Schema (JSON Schema)
{
"properties": {
"file_name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "File Name"
},
"file_path": {
"title": "File Path",
"type": "string"
},
"notion_token": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Notion Token"
}
},
"required": [
"file_path"
],
"type": "object"
}