Skip to main content

422 Invalid fields in form error when uploading a PDF using your API from a Deno/Supabase Edge environment

I am encountering a persistent 422 Invalid fields in form error when uploading a PDF using your API from a Deno/Supabase Edge environment, while the exact same file and payload works perfectly with Postman.

I have compared both requests using webhook.site, and both Deno and Postman produce identical uploads:

  • Same file field with the same name, size, and type

  • Same model_id field

  • Same Content-Type header, boundaries, and request headers

Can you advise if there are any subtle differences in multipart encoding, CRLF usage, or runtime detection that could cause your server to reject a Deno-generated multipart form, even when it is indistinguishable from Postman's upload?

Status: Completed2 comments

Log in to comment and vote

Comments2

  • Maxime Churin

    •

    Jul 16, 2025

    Hello,
    From what I can see in our logs, you had successful and failed queries. I believe there is a small typo/discrepancy in your Deno/Supabase Edge environment. On our side, for all your failed queries, we have a validation error on your model_id with the following log:
    Input should be a valid UUID, invalid character: expected an optional prefix of urn:uuid: followed by [0-9a-fA-F-], found s at 1

    Let me know if that helps

  • Ianaré Sévi

    Team•

    Jul 16, 2025

    Hello,

    Are you using the axios library for sending the file?

    We have some code samples here that could be useful:

    https://docs.mindee.com/getting-started/integrating-mindee#tab-node.js

    Let us know if that helps.