There are a few different options for Email REST APIs, but none of them, as far as I can tell, are a replacement for the traditional email protocols, SMTP, POP, and IMAP. What would such a system look like?
First, instead of our usual email addresses, we’d have routes, so my email, , would look more like:
To GET all of my mail:
If I wanted mark message 123 as spam:
To get a message’s labels:
To get all spam messages:
URL query strings on GETs could be used to filter results by the email metadata:
To send an email, we could POST to someone else’s inbox, with the message content in the request body:
For security, we can incorporate public keys into the system. Before I can POST to
gmail.com/michaeljburling, I would have to get Michael’s public key, and then use it and my private key to sign my message:
GET gmail.com/michaeljburling/public_key POST gmail.com/michaeljburling
Any messages with an invalid signature would go directly to spam, so email spoofing would not be possible.
See also: Internet Mail 2000.