HTTP error on Notion API after updating N8N

Describe the issue/error/question

I have updated from 0.186.0 to the newest version of n8n, and after that I have been getting an error when passing a PATCH request that makes little sense (given that it was working before)

I am passing body and headers as raw JSON (working example strings on the workflow). I then get a 400 error “This version of the API does not support this type of block type. Please upgrade your API version.” Although this reads like it is a Notion-side or version issue, I am using the exact same node on a previous version o n8n and it was working (in addition this very request is done when passed through the command line). My guess would be that something fishy is going on when parsing this raw string requests, but I am not versed enough to figure it out

Any clarity on this issue would help! Thanks in advance.

What is the error message (if any)?

“message”: “400 - {“object”:“error”,“status”:400,“code”:“validation_error”,“message”:“This version of the API does not support this type of block type. Please upgrade your API version.”}”

Please share the workflow

Information on your n8n setup

  • n8n version: 0.193.5
  • Database you’re using: SQLite
  • Running n8n with the execution process: own
  • Running n8n via: npm

Hey @KenupCF,

You are right there so notion is returning the error and it isn’t happy about the data being sent.

As a test have you tried sending the data from both versions to something like webhook.site to see what is different in the 2 requests?

As a test have you tried sending the data from both versions to something like webhook.site to see what is different in the 2 requests?

Hummm no, good idea. Luckily I have a previous installation of n8n so should be easy. I’ll do it at one point in the next 24 hours and get back to you!

1 Like

Okay, the issue is clear - I just have no idea how to solve it…

Somehow the node is passing the Notion-Version header as a previous version, despite being defined as “2022-06-18”

Not passing the version in the header defaults to that version as well - so the node is basically “dropping” the Notion-Version parameter.

Hey @KenupCF,

Can you try setting the header to an expression and just putting {{ at the start and }} at the end so you have 3 either side.

Hi @Jon
It did not work, the header field still gets overriden.

Incidentally, I found a solution, by making the authentication as generical credential type, instead of the predefined notion credential.

I am not aware on how this works, but is it possible the predefined notion credential (given it is Header Auth) automatically adds the Notion-Version field to the auth header?

I am not sure whether to mark this as solved - I did found a solution, but still feels like this is unexpected behaviour.

Thanks for the help anyway!

Hey @KenupCF,

When using the predefined credential it will use the settings we specify for the credential, In this case it looks like we do set the 2021-05-13 Version header.

It looks like we changed the credential auth for the notion node about 2 months ago when we introduced the credential testing, Before that we left the header to be set in the node itself.

It sounds like what we need is a way to customise or overwrite that.

2 Likes

Would a toggle in the HTTP node allowing for overwriting header fields be an option?

I’m closing it since my issue is resolved, thanks for the attention and hope a nice solution comes out of this!

Cheers,

2 Likes

Having this issue as well, but switching to generic header gives me this error

Hey @Greg_Hadley,

That looks like a different error message, Notion seems to be unhappy with the auth header and has listed 6 possible issues.

Could you open a new thread and include the things you have tried?

1 Like
1 Like