Send email with attachments
UsePOST /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.
content.from
decides what recipients see, content.replyTo decides where replies go, and
envelopeSender only changes the bounce address on a verified sending 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.
Add an Idempotency-Key header to the request if you retry. Repeating the same
key with the same message and files returns the original receipt instead of
sending twice; the same key with different content returns 409.
A problem with the message part returns 400 on this endpoint — missing
message, invalid JSON, no recipients, or neither a text nor an HTML body.
Sender authorization failures still return 422 with the field named, as they
do on the JSON endpoint.
Attach a file from a URL
Send public HTTPS URLs directly withPOST /sending/messages:
Upload a file separately
The upload endpoint stores one file, up to 10 MB, when attachment storage is configured:data.file with fileName, contentType and sizeBytes, plus publicUrl only when public hosting is configured. A separate upload does not send an email. To attach a file to a message, use the multipart sending example above.
These clients upload a file with the same multipart endpoint:
Include multiple files
Repeatfiles 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+ providesfetch, FormData and Blob. Run this on your server, with your sending key in the WAZOBIA_API_KEY environment variable.
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.