Skip to content

feat: add file upload API endpoints to OpenAPI spec#226

Open
deka0106 wants to merge 1 commit intomakenotion:mainfrom
deka0106:feat/local-file-upload
Open

feat: add file upload API endpoints to OpenAPI spec#226
deka0106 wants to merge 1 commit intomakenotion:mainfrom
deka0106:feat/local-file-upload

Conversation

@deka0106
Copy link
Copy Markdown

Description

I understand PRs here are not actively monitored. Submitting this in case it's still useful — feel free to close if not.

Add the 5 Notion File Upload API endpoints to the OpenAPI spec, auto-generating MCP tools.

New tools:

  • create-a-file-upload — create an upload session
  • send-file-upload-content — send local file content (multipart)
  • complete-a-file-upload — finalize the upload
  • retrieve-a-file-upload — get upload status
  • list-file-uploads — list uploads with filtering

The pipeline already supports multipart/form-data with format: binary, so no code changes are needed.

Ref: https://developers.notion.com/reference/file-upload
Closes #191

How was this change tested?

  • Automated test (unit, integration, etc.)
  • Manual test (provide reproducible testing steps below)

Tested the full upload flow using Claude Code as an MCP client with a local build:

  1. Create upload session -> send local file -> complete upload
  2. Embed uploaded image as an image block in a page
  3. Embed uploaded text file as a file block in a page
  4. Set uploaded files on a database file property

Results: https://www.notion.so/deka0106/Notion-MCP-File-Upload-Test-320e72cffcec806fa72befbb8c455ecc

Screenshots

image

Add all 5 Notion File Upload API endpoints to the spec:
- POST /v1/file_uploads (create session)
- GET /v1/file_uploads (list uploads)
- GET /v1/file_uploads/{id} (retrieve upload)
- POST /v1/file_uploads/{id}/send (send file content, multipart/form-data)
- POST /v1/file_uploads/{id}/complete (finalize multi-part upload)

No source code changes needed - the existing auto-generation pipeline
handles multipart/form-data with format:binary out of the box.
@maxbeech
Copy link
Copy Markdown

This is a great addition, brilliant work @deka0106 - please approve soon reviewers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Support local file upload for images and files

2 participants