I think JMAP (the IMAP successor) is the best choice here. It was designed to be an open alternative to the proprietary APIs offered by Gmail and the like. It offers a JSON API that clients can talk to using HTTP. The JMAP website has some examples: https://jmap.io/crash-course.html
So it seems that a simple server that implements JMAP would be what the OP is looking for, perhaps https://github.com/stalwartlabs/mail-server (which also supports SMTP/IMAP for compatibility with other clients)?
Baserow and n8n both have form builders built-in, so if you’re using one of these tools already it might be worth checking out.