Using the API from your application
The API is defined using an OpenAPI specification, available here.
The recommended method to submit an email is to create a JSON document containing an object with the following properties:
payload: The complete payload of the message as it will be sent, including the headers and the body.from: The email address that will be used in the MAIL FROM:; the return-path or bounce address.to: The email address the mail will be used in the RCPT TO:; the recipient.ip: The ip address that the email will be sent from, as an IPv4 address in dotted-quad notation, or an IPv6 address in hex.finishedUrl: A URL that will receive a callback once processing is complete.
It will return a JSON document with an object containing just one property, id, the identifier for the result.
The callback to finishedUrl will be a JSON document containing an object including the following properties:
id: The identifier for this result.url: The URL where the results are published.
There are other features, documented in the OpenAPI specification, such as including an opaque token that will be returned with the results, callbacks for status updates during processing and a polling interface (much less efficient than using callbacks and intended for desktop applications).