Next JS revalidation webhook is returning 405 on domain hosted in Cloudflare

I am getting a 405 error on my revalidation webhook in prismic but it works fine when I use the same test trigger in postman.

The webhook worked fine and still works when I used the url but when I added my domain that's hosted in Cloudflare the webhook in prismic is not working but it still works fine in postman.

Must be something in Cloudflare blocking the requests from Prismic but not from my network?

Hey @thorbergur,

Did you follow the steps for setting up revalidation as described in this blog post?


Yes I did, that's how I got it working with the domain.

Hey @thorbergur,

Let me check in with my engineering team and get back to you on that.


1 Like

Hi @thorbergur,

It looks like Cloudflare requires extra configuration for the Next.js Edge Runtime. Have you tried adding this line to your API endpoint file?

export const runtime = 'edge';

You can find more info here: