Netlify form submissions returning 400 'Bad request, missing form'

We are using Ajax / fetch, as documented here. Netlify is returning HTTP 400, with body ‘Bad request, missing form’ on every POST. And yet I can find the form submissions in Netlify Forms UI.

Here’s an example submission.

URL: https://www.oceg.org/
Method: POST
Headers:

User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36
Content-Type: application/x-www-form-urlencoded

Body:

form-name=Onboarding&redirectUrl=%2Fuser%2F%3Fsuccess%3DYour%2520answers%2520were%2520successfully%2520saved.&formId=75c28225-4cc7-4fe6-9e7a-ed644103295d&Persona=IT+Professional&Job+Title=CTO&Company=OCEG&Country=United+States+of+America&%5BI+got+an+OCEG+membership+to%E2%80%A6%5D=Maintain+existing+credentials%2Fcertifications&%5BI+got+an+OCEG+membership+to%E2%80%A6%5D=Qualify+for+a+promotion&%5BI+prefer+to+learn+by%E2%80%A6%5D=Reading+eBooks+and+standards&%5BWhat+disciplines+are+you+interested+in+learning+more+about%3F+%5D=Decision+management&%5BWhat+topics+are+you+interested+in+learning+more+about%3F+%5D=Data+privacy&%5BTo+achieve+my+career+goals%2C+I+plan+on+spending%E2%80%A6%5D=%3Cb%3E15+minutes%3C%2Fb%3E+a+week+to+learn+%28Committed%29&Other+Comments=&email=slegay%40oceg.org

As of 3 hours ago, that form seems to have received a submission. Has something changed here?

That’s what I meant by ‘and yet I can find the form submissions in Netlify UI’. The form registers submissions, but Netlify returns error 400.

You can easily reproduce this by submitting a POST request with the details I provided.

Where is the form on your website? I tried checking the pages in navigation and could not find it.

That specific form is only accessible by authenticated users. You’d need to sign up for free, log in and then go to https://www.oceg.org/user/onboarding/.

But I was able to reproduce this in other forms as well. What I would like to understand is why that POST request with the body and headers I included in my original post is returning error 400. Have you tried reproducing this?

Looks like the 400 is coming from your Edge Function(s). You have multiple Edge Functions running on that path and one of them is sending the 400.

Interesting! That’s very helpful, thanks. I’ll try and track this down.