Skip to main content

Send email with attachments

Use POST /sending/messages/with-attachments with your API key as X-API-Key. The message field contains the same JSON message used in Sending email. Add each file using a repeated files field.
Replace the sender with an address on your verified domain. Files must be non-empty, and their combined size must not exceed 5 MB. Your account’s attachment and sending allowances still apply. A successful response means accepted for sending; review delivery activity afterward.

Upload a file separately

The upload endpoint stores one file, up to 10 MB, when attachment storage is configured:
The response returns data.file with key, fileName, contentType, sizeBytes and publicUrl. A separate upload does not send an email. To attach a file to a message, use the multipart sending example above.

Include multiple files

Repeat files for every attachment. Paths refer to files on the machine running your request. The message can contain plain text, HTML or both.

Node.js: send local files

Node.js 22+ provides fetch, FormData and Blob. Run this on your server, with your sending key in the WAZOBIA_API_KEY environment variable.
Let fetch set the multipart Content-Type and boundary. Setting Content-Type: application/json or a boundary manually will break file uploads. The combined 5 MB attachment limit applies to all files together.