Connecting ChatGPT and Notion to Read and Write Notion Pages From ChatGPT

Anyone has idea on how to connect chatGPT and Notion, so I can read and write my Notion pages from my chatGPT account?

3 Likes

That potentially sounds like a bespoke project. There is a Notion API and you could use the OpenAI API to process data from it.

You could also look at ChatGPT plugins, maybe there’s a useful one there?

But I think you may be limited to public data and won’t be able to access your private data.

2 Likes

Thank you.

I’ve tried AskNotion, a GPT I came across, but it doesn’t meet my needs despite granting it access to my Notion workspace

So building a GPT is not the ideal approach to achieving my use case. Right?

I don’t believe you can integrate your own external private data via API with ChatGPT even with plugins (happy to be corrected)

In which case: no

You may need to build this yourself.

That said can you use the existing AI features within Notion?

A prospect actually reached out to me about this use case. He asserted that he doesn’t consider the AI capabilities of Notion sophisticated enough for his needs. So he’d love to read and write his Notion pages from ChatGPT.

2 Likes

So I guess the solution is to build a ChatGPT like interface with the two APIs

Yeah.

But he’s much interested in facilitating his read and write actions right from his chatGPT app. This was why I initially thought building a GPT would suffice.

ChatGPT already has a significant proportion of the consumer audience locked-in. The prospect is not even open to switching platforms.

I bet. It would also cost a lot less.

Feature request then :slight_smile:

1 Like

Found a service, ZenoChat that allows one to integrate Notion pages and read/write its content, right from the chat interface.

But the prospect is not open to switching platforms.

Well that’s tough. Sorry to hear that.

1 Like

This might not be exactly what you are looking (but someone who comes across this might!) for but you could use something called ā€œNautomateā€ (which is a paid app i think) to allow Shortcuts on Apple devices to connect to Notion with actions.

ChatGPT already has integration of actions to Shortcuts so in the same flow, you could share data with ChatGPT and pass it back to Notion.

Only challenge I see is being able to do this with a temporary chat since you dont want every instance of this to be logged as a new chat in your chatGPT application history, and the temporary chat feature is not yet available in Shortcuts. I hope they do it soon, since there is a feature request for the same!

Another way to do this same workflow (without Notion which would be a dealbreaker potentially) is to move to a markdown/text based notes app like Obsidian, since the notes are physically stored into repo/folder you can push them to a supported drive for OpenAI to work with.

1 Like

Your client is in the right track. I’ve written a whole thesis on how connecting chatgpt to be able to read/write Notion databases would be groundbreaking. I won’t go into all that here. But I will say that your client is correct in not wanting to switch to another app powered by Open AI. They are always lesser versions and seem to have more token limitations, can’t switch models etc (such as chatgpt). Theā€howā€ is the question. How do you get a chatgpt instance to write to a Notion database and read to it. The read part is easier. You would need an intermediary service that takes database info and ā€œprintsā€ it to a website in html form that is readable from chatgpt like any website. It would need to be constantly updating this site every time you change any database info. The write part is harder bc how do you get chatgpt to trigger an action without using API. My thought is another intermediary service that reads prompts directly from ChatGPT and then can turn those prompts into action. Long story short in order to do this it will really require someone to build a software that works as a go between. If anyone knows how to do this or wants to exchange some ideas, I’m willing to chat! Really if anyone reads this and says ā€œI could probably code thatā€. Reach out, I know it can work I just don’t have the time to figure out the technical intricacies.

4 Likes

Thank you for the suggestion.

Please can you walk me through how I can achieve this in the Shortcuts app using Nautomate, ChatGPT and Notion?

On Mac, ChatGPT now allows to connect with Notion using accessibility:

Looks like ChatGPT can only read the content of the currently open page in Notion though, so it’s a somewhat limited solution, not a proper integration.

3 Likes

It would be simple if the share link could be embedded into a notion page. Unfortunately that does not seem to be supported. It requires Iframe support and it looks like it’s explicitly disallowed.

I’ve built some automation like this with Make[dot]com, which is a no coding tool that anyone could use with some practice. Example of workflow:

  1. Have a ā€œwatcherā€ that listens to Notion updates (Database entry added, page content add).
  2. Pick out the content you want to send to ChatGPT
  3. Use the ChatGPT connector to get a summary, keyword highlight etc.
  4. Use the Notion connector again to append to the page, add DB item column info etc.

I’m currently using this to:

  1. Watch slack messages
  2. Pick out website links
  3. Scrape websites (ScrapeNinja)
  4. Summarise content etc (OpenAI API)
  5. Create new Notion Database entries

Gotcha is that this is an automation and will occur for every added database item etc. You’ll also need an OpenAI API account and add credits, create a Notion API key and give it access to the Notion pages/DB you are automating. Then add these as connection in Make[dot]com.

Make[dot]com is one tool, Zapier can do similar things and are probably a sea of other products out there.

I’m not sure if this answers OP question or not, but I recently was able to create a custom GPT and add an action that leverages the Notion API.

Currently, I am able to use the custom GPT to:

  • Create new pages - ā€œcreate a new page within ā€˜Home’ page titled ā€˜My New Pageā€™ā€
  • Update existing pages - ā€œAdd a cover photo to My New Page with an image of your choice from Googleā€
  • Create blocks - I had it test out creating a couple basic block types
    |Block Type|Status|Notes|
    |—|—|—|

|Heading 3|:white_check_mark: Created|ā€œ:pushpin: Heading 3 Block (Basic)ā€|
|Quote (Advanced)|:white_check_mark: Created|ā€œ:brain: Complexity is the enemy of execution.ā€|
|Equation|āœ… Created|E = mc² rendered|
|Table of Contents|āœ… Created|Dynamically reflects headings in the page|
|Breadcrumb|āœ… Created|Shows hierarchical context (valid API call)|

The secret sauce here is including the search endpoint so that it first finds the page you are referencing to get the page_id and then using that in the requests for the block endpoints

However, the big wall I’ve hit is trying to create databases. It seems to be a limitation of the internal request engine that is serializing the request before sending it off to the Notion API.

Explained by the ActionsGPT:
:brain: What’s Really Going On

• Custom GPTs wrap your schema inside their own internal request engine , likely based on aiohttp (Python).

• That engine does its own JSON serialization, and the ClientResponseError you’re seeing is not from Notion, it’s from the internal HTTP layer.

• So you’re hitting the wall before the request even leaves OpenAI.

Basically - I’m able to get the custom GPT to formulate a valid request to create a database. When I manually run a curl command of the exact request it generated, the database is successfully created in my Notion account.
However, when I try to have the custom GPT create the database, it runs into an error:
ClientResponseError: <class 'aiohttp.client_exceptions.ClientResponseError’>

I haven’t yet tested out reading/analyzing existing databases, but I’m sure that will work fine because it would be able to search for a database id and then read the content of the requested db.

Any thoughts on the ClientResponseError? Seems like it’s something out of my control and something I can’t solve with a workaround as far as I can tell. Any guidance or support from the OpenAI team would be super helpful, or I can try to provide more details about my current setup

1 Like

Nice.

But if the page is private would that work?

As long as the parent page (under which the custom GPT is creating new elements like pages or databases) has granted permissions to the appropriate app (the custom GPT in this case), then it is allowed to make requests to it.

As I pointed out - the custom gpt can already create a new page under a parent page, or create blocks within in a page it has access to. It’s just having trouble specifically with Notion databases

2 Likes

Thanks.

In Notion, how do you revoke the GPTs access?